The approveOrder
pipeline determines whether the given order already is approved. If the order is not already approved, it determines whether an approval for the order is required.
The approveOrder
pipeline chain is executed by the executeApproveOrderChain
processor in the processOrder
pipeline chain. The approveOrder
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.
verifyApproval
This processor checks whether the given order has already been approved.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Returns a value of 0 (STOP_CHAIN_EXECUTION_AND_COMMIT) if the order has already been approved; this stops execution of the |
runCheckRequiresApprovalChain
This processor executes the checkRequiresApproval
pipeline chain. The properties file for the /atg/commerce/approval/processor/RunCheckRequiresApproval
component specifies checkRequiresApproval
in the chainToRun
property.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Returns a value of 0 (STOP_CHAIN_EXECUTION_AND_COMMIT) if the order does not require approval; this stops execution of |
addApproverIdsToOrder
This processor adds to the order the list of profile IDs for the users who can approve the customer’s order. This list is obtained from the customer’s approvers
profile property and is added to the order’s authorizedApproverIds
property.
If the customer’s approvers
profile property is unset and the AddApproverIdsToOrder.allowCheckoutIfApproversNotDefined
property is set to false (which it is by default), then an ApprovalException
is thrown.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Return value of 1 executes |
changeOrderToPendingApproval
This processor sets the order’s state to PENDING_APPROVAL.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Return value of 1 executes |
addApprovalSystemMessagesToOrder
This processor adds to the order the list of system messages that correspond to the conditions that triggered an approval being required. An example might be “order limit exceeded.” This list is added to the order’s approvalSystemMessages
property. The system messages are defined by the processors in the checkRequiresApproval
pipeline chain.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Return value of 1 executes |
addOrderToRepository
This processor saves the order in its present state to the Order Repository.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | Return value of 1 executes |
sendApprovalRequiredMessage
This processor sends a message to the /Approval/Scenarios
JMS message topic; the message includes the order requiring approval and the profile repository item for the customer associated with the order. The message can then be used to execute scenarios.
Transactional Mode | TX_MANDATORY |
Component |
|
Object |
|
Transitions | None. This is the last processor in the pipeline, which causes the |