The checkRequiresApproval
pipeline chain is the chain that actually checks whether an approval is required for a customer’s order. The default implementation of this chain checks the approvalRequired
property in the customer’s profile. If the approvalRequired
property is true, then approval is required for the customer. An error is then added to the PipelineResult
object, which tells the system that an approval is required, and the reason that approval is required is stored in the errorMessages
property of the Order. This reason for approval is later added to the order’s approvalSystemMessages
property by the approveOrder
chain’s addApprovalSystemMessagesToOrder
processor. If the approvalRequired
property is false, then approval isn’t required for the customer.
The checkRequiresApproval
pipeline chain is executed by the runCheckRequiresApprovalChain
processor in the approveOrder
pipeline chain. The checkRequiresApproval()
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.
Note:You can edit this chain to create specific requirements for whether an approval is required for a given customer. For example, you might want to include a processor that checks the total amount of the customer’s order against an order limit in the customer’s profile. If the order amount exceeds the specified limit, then approval for the customer’s order would be required. Similarly, you might want to include a processor that checks the manufacturers of the items in the customer’s order against a list of preferred suppliers in the customer’s profile. If a manufacturer isn’t in the list of preferred suppliers, then approval for the customer’s order would be required.
The following describes the single processor in the default implementation of this pipeline chain:
PipelineLink name:
checkProfileApprovalRequirements
This processor checks the
approvalRequired
property in the customer’s profile. If the property is true, then approval is required for the customer. If the property is false, then approval isn’t required for the customer.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/CheckProfileApprovalRequirements
PipelineProcessor object:
atg.commerce.order.processor.ProcPropertyRestriction
Transitions: None. This is the only processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.