If an error occurs while ApprovalCompleteService
is processing an ApprovalComplete
message, the checkApprovalCompleteError
chain is executed. This chain is a recovery chain that executes logic when an error occurs.
Note: The default implementation of this chain adds the error message to the order’s approvalSystemMessages
property and sets the order’s state to FAILED. You can edit the chain to perform different logic to meet your application’s needs.
The checkApprovalCompleteError
pipeline chain is executed by the checkApprovalCompleteError()
method in the ApprovalPipelineManager
. The checkApprovalCompleteError()
method adds the parameters that were passed to the chain in which the error occurred to the ApprovalPipelineManager
’s parameter list, which is supplied to the executing chain. The pipeline chain’s transaction mode is TX_REQUIRES_NEW.
The following sections describe each processor in the pipeline chain.
addMessageMapperErrorToOrder
This processor adds the error message to the order’s approvalSystemMessages
property.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/approval/processor/AddMessageMapperErrorToOrder
PipelineProcessor object: atg.commerce.approval.processor.ProcAddMessageMapperErrorToOrder
Transitions: Return value of 1 executes changeOrderToFailed
next.
changeOrderToFailed
This processor sets the order’s state to FAILED.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/approval/processor/ChangeOrderToFailed
PipelineProcessor object: atg.commerce.order.processor.ProcChangeOrderState
Transitions: None. This is the last processor in the pipeline, which causes the ApprovalPipelineManager
to return to the caller.