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 list describes each processor in the pipeline chain:
PipelineLink name:
getApprovalCompleteParams
This processor takes properties from the
ApprovalUpdate
message and adds them to the Map object that is passed to theApprovalPipelineManager
for execution of thecheckApprovalComplete
chain. You define the properties to take from theApprovalUpdate
message in the.properties
file of this processor.Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/GetApprovalCompleteParams
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcPopulatePipelineParams
Transitions: Return value of 1 executes
approvalCompleteAnalyzer
next.PipelineLink name:
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.b2bcommerce.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 executeschangeOrderToFailedApproval
next.PipelineLink name:
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.PipelineLink name:
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.PipelineLink name:
completeProcessingOrder
This processor executes the
processOrder
chain, passing the given order toprocessOrder
as one of its parameters. The properties file for the/atg/commerce/approval/processor/CompleteProcessingOrder
component specifiesprocessOrder
in thechainToRun
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.PipelineLink name:
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. TheapprovalStatus
property of the message is set to eitherapproval_passed
orapproval_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.b2bcommerce.approval.processor.ProcSendApprovalCompleteMessage
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.