-
Feature Request
-
Resolution: Obsolete
-
Major
-
None
The 'order' attribute on Lifecycle callback annotations (e.g. @Compensate, @Prepare) can be used to ensure that certain lifecycle callbacks precede others during lifecycle processing. Normally, callbacks are made in the reverse order to that in which their corresponding service request was made. FIRST indicates that the callback should be executed before other NORMAL callbacks registered for the same lifecycle event. LAST indicates that the callback should be executed after other NORMAL callbacks registered for the same lifecycle event. Multiple FIRST or LAST callbacks are sorted in reverse order of registration.
Example:
@ServiceRequest() public void submitOrder(...) { ... } @Compensate public void cancelOrder() { //Cancel the order } @Compensate(order=ExecutionOrder.LAST) public void notifyAdmin() { //Notify an admin that an order was cancelled. }