The checkApprovalComplete pipeline determines whether the approval process for the given order is complete. The checkApprovalComplete pipeline chain is executed by ApprovalCompleteService when the service receives an ApprovalUpdate message from the /Approval/ApprovalUpdate JMS message queue. The checkApprovalComplete() method adds the given Order and the ApprovalPipelineManager to its parameter list, which is supplied to the executing chain. The pipeline chain’s transaction mode is TX_REQUIRED.

The following sections describe each processor in the pipeline chain.

getApprovalCompleteParams

This processor takes properties from the ApprovalUpdate message and adds them to the Map object that is passed to the ApprovalPipelineManager for execution of the checkApprovalComplete chain. You define the properties to take from the ApprovalUpdate message in the .properties file of this processor.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/GetApprovalCompleteParams

PipelineProcessor object: atg.commerce.approval.processor.ProcPopulatePipelineParams

Transitions: Return value of 1 executes approvalCompleteAnalyzer next.

approvalCompleteAnalyzer

This processor determines whether the approval process for the given order is complete. By default, approvalCompleteAnalyzer checks whether at least one person has approved or rejected the order. If so, then the approval process for the order is considered to be complete.

Note: You can change the implementation of approvalCompleteAnalyzer in order to change the requirements for completion of the approval process.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/ApprovalCompleteAnalyzer

PipelineProcessor object: atg.commerce.approval.processor.ProcApprovalCompleteAnalyzer

Transitions: Returns a value of 0 if the approval process for the order isn’t complete (that is, the order requires further approvals); this stops execution of the chain, and the transaction commits. Returns a value of 1 if the order has been approved; this executes changeOrderToApproved next. Returns a value of 2 if the order has been rejected; this executes changeOrderToFailedApproval next.

changeOrderToFailedApproval

This processor sets the order’s state to FAILED_APPROVAL, as specified in the newOrderState property of the /atg/commerce/approval/processor/ChangeOrderToFailedApproval component.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/ChangeOrderToFailedApproval

PipelineProcessor object: atg.commerce.order.processor.ProcChangeOrderState

Transitions: Return value of 1 executes sendApprovalCompleteMessage next.

changeOrderToApproved

This processor sets the order’s state to APPROVED, as specified in the newOrderState property of the /atg/commerce/approval/processor/ChangeOrderToApproved component.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/ChangeOrderToApproved

PipelineProcessor object: atg.commerce.order.processor.ProcChangeOrderState

Transitions: Return value of 1 executes completeProcessingOrder next.

completeProcessingOrder

This processor executes the processOrder chain, passing the given order to processOrder as one of its parameters. The properties file for the /atg/commerce/approval/processor/CompleteProcessingOrder component specifies processOrder in the chainToRun property.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/CompleteProcessingOrder

PipelineProcessor object: atg.commerce.order.processor.ProcExecuteChain

Transitions: Return value of 1 executes sendApprovalCompleteMessage next.

sendApprovalCompleteMessage

This processor sends a message to the /Approval/Scenarios JMS message topic that includes the order requiring approval and the profile repository item for the customer associated with the order. The approvalStatus property of the message is set to either approval_passed or approval_failed, depending on the state of the order. The message can then be used to execute scenarios.

Transactional mode: TX_MANDATORY

Nucleus component: /atg/commerce/approval/processor/SendApprovalCompleteMessage

PipelineProcessor object: atg.commerce.approval.processor.ProcSendApprovalCompleteMessage

Transitions: None. This is the last processor in the pipeline, which causes the ApprovalPipelineManager to return to the caller.