73
ATG C om merce P ro gra mm in g G ui d e
90 4
Appen d ix G: C o mm erce Pi pel in e C h ain s
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
Nucleus component:
/atg/commerce/approval/processor/SendApprovalRequiredMessage
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcSendApprovalRequiredMessage
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.
checkRequiresApproval Pipeline Chain
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 section describes the processor in the pipeline chain.
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
68
ATG C om mer ce P ro g ramm in g Gui d e
90 5
Appen di x G: C o mm erce P i pel in e C h ain s
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.
orderApproved Pipeline Chain
The
orderApproved
pipeline chain processes an approval of a given order. When an approver submits
her approval of an order via a form using the
ApprovalFormHandler
, the form handler’s
handleApproveOrder()
method executes the
orderApproved
pipeline chain. The pipeline chain’s
transaction mode is TX_REQUIRED.
The following sections describe each processor in the pipeline chain.
addApproverIdToOrderForApproval
This processor adds the profile ID for the approver who approved the order to the order’s
approverIds
property. The
approverIds
property contains a list of approvers who have approved or rejected the
order.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddApproverIdToOrder
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddApproverIdToOrder
Transitions: Return value of 1 executes
addApproverMessagesToOrderForApproval
next.
addApproverMessagesToOrderForApproval
This processor adds the message that the approver attaches to the order to the list of messages in the
order’s
approverMessages
property. The message typically indicates the reason for approval. It is passed
to the
orderApproved
chain by the
ApprovalFormHandler
form handler, which is used to process the
approval.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddApproverMessagesToOrder
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddApproverMessagesToOrder
Transitions: Return value of 1 executes
sendApprovalUpdateMessageForApproval
next.
sendApprovalUpdateMessageForApproval
This processor sends an
ApprovalUpdate
message that includes the order requiring approval and the
profile repository item for the customer associated with the order to both the
/Approval/ApprovalUpdate
JMS message queue and the
/Approval/Scenarios
JMS message topic.
The
approvalStatus
property of the message is set to “approved”. The
ApprovalCompleteService
64
ATG C om merce P ro gra mm in g G ui d e
90 6
Appen d ix G: C o mm erce Pi pel in e C h ain s
listens for the message sent to the
/Approval/ApprovalUpdate JMS message queue
. The message
sent to
/Approval/Scenarios
can be used to execute scenarios.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/SendApprovalUpdateMessage
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcSendApprovalMessage
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.
orderRejected Pipeline Chain
The
orderRejected
pipeline chain processes a rejection of a given order. When an approver submits her
rejection of an order via a form using the
ApprovalFormHandler
, the form handler’s
handleRejectOrder()
method executes the
orderRejected
pipeline chain. The pipeline chain’s
transaction mode is TX_REQUIRED.
The following sections describe each processor in the pipeline chain.
addApproverIdToOderForRejection
This processor adds the profile ID for the approver who rejected the order to the order’s
approverIds
property. The
approverIds
property contains a list of approvers who have approved or rejected the
order.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddApproverIdToOrder
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddApproverIdToOrder
Transitions: Return value of 1 executes
addApproverMessagesToOrderForRejection
next.
addApproverMessagesToOrderForRejection
This processor adds the message that the approver attaches to the order to the list of messages in the
order’s
approverMessages
property. The message typically indicates the reason for rejection. It is passed
to the
orderRejected
chain by the
ApprovalFormHandler
form handler, which is used to process the
rejection.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddApproverMessagesToOrder
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddApproverMessagesToOrder
Transitions: Return value of 1 executes
sendApprovalUpdateMessageForRejection
next.
78
ATG C om mer ce P ro g ramm in g Gui d e
90 7
Appen di x G: C o mm erce P i pel in e C h ain s
sendApprovalUpdateMessageForRejection
This processor sends an
ApprovalUpdate
message that includes the order requiring approval and the
profile repository item for the customer associated with the order to both the
/Approval/ApprovalUpdate
JMS message queue and the
/Approval/Scenarios
JMS message topic.
The
approvalStatus
property of the message is set to “rejected”. The
ApprovalCompleteService
listens for the message sent to the
/Approval/ApprovalUpdate JMS message queue
. The message
sent to
/Approval/Scenarios
can be used to execute scenarios.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/SendApprovalUpdateMessage
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcSendApprovalMessage
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.
checkApprovalComplete Pipeline Chain
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.b2bcommerce.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.
65
ATG C om merce P ro gra mm in g G ui d e
90 8
Appen d ix G: C o mm erce Pi pel in e C h ain s
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 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
67
ATG C om mer ce P ro g ramm in g Gui d e
90 9
Appen di x G: C o mm erce P i pel in e C h ain s
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.b2bcommerce.approval.processor.ProcSendApprovalCompleteMessage
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.
checkApprovalCompleteError Pipeline Chain
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 sections describe each processor in the pipeline chain.
addMessageMapperErrorToOrder
This processor adds the error message to the order’s
approvalSystemMessages
property.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/AddMessageMapperErrorToOrder
PipelineProcessor object:
atg.b2bcommerce.approval.processor.ProcAddMessageMapperErrorToOrder
Transitions: Return value of 1 executes
changeOrderToFailed
next.
13
ATG C om merce P ro gra mm in g G ui d e
91 0
Appen d ix G: C o mm erce Pi pel in e C h ain s
changeOrderToFailed
This processor sets the order’s state to FAILED.
Transactional mode: TX_MANDATORY
Nucleus component:
/atg/commerce/approval/processor/ChangeOrderToFailed
PipelineProcessor object:
atg.commerce.order.processor.ProcChangeOrderState
Transitions: None. This is the last processor in the pipeline, which causes the
ApprovalPipelineManager
to return to the caller.
3
ATG C om mer ce P ro g ramm in g Gui d e
91 1
Appen di x G: C o mm erce P i pel in e C h ain s
29
ATG C om merce P ro gra mm in g G ui d e
91 2
In d ex
Index
A
Abandoned Order is Converted event, 525
Abandoned Order is Lost event, 525
Abandoned Order is Modified event, 524
abandoned order services
AbandonedOrderLogRepository, 513
AbandonedOrderService, 514, 516
AbandonedOrderTools, 518
abandonment states, 511
customizations and extensions, 530
defining abandoned orders, 514
defining lost orders, 514
detecting abandoned orders, 514
detecting lost orders, 514
developer overview, 509
messages, 775
order repository extensions, 511
orders, abandoned, 511
orders, converted, 511
orders, lost, 511
orders, reanimated, 511
profile repository extensions, 512
scenario actions, 526
scenario events, 523
transient users, 529
Documents you may be interested
Documents you may be interested