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 list describes each processor in the pipeline chain:
PipelineLink name:
addMessageMapperErrorToOrderThis processor adds the error message to the order’s
approvalSystemMessagesproperty.Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddMessageMapperErrorToOrderPipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddMessageMapperErrorToOrderTransitions: Return value of 1 executes
changeOrderToFailednext.PipelineLink name:
changeOrderToFailedThis processor sets the order’s state to FAILED.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/ChangeOrderToFailedPipelineProcessor object:
atg.commerce.order.processor.ProcChangeOrderStateTransitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManagerto return to the caller.

