Pause Orchestration Processes for Dependencies

Set up a pause task to temporarily stop an orchestration process from running until a dependency resolves.

Wait to Ship All Lines Before Invoicing

The dependency in this example is to wait for all lines to ship before continuing to the invoicing step.

he dependency in this example is to wait for all lines to ship before continuing to the invoicing step.

Note

  • The Pause step references the pause task. The Pause step resides between the Shipping step and the Invoicing step in the orchestration process.

  • If no fulfillment line meets any condition in the IF statement, then all fulfillment lines have shipped, the rule releases the pause, and the flow continues to the next orchestration process step.

  • For brevity, this screen print doesn't assign the result from the rules dictionary and to the header, but you must assign that result. For details, see the Assign the Result subtopic in Guidelines for Pausing Orchestration Processes.

Here's your code.

Code

Description

Header is a DooSeededOrchestrationRules.DOOHeader

Declare the Header variable, then load values into Header from object DOOHeader of method DooSeededOrchestrationRules.

DOOHeader contains order header attributes and their values.

At least one

Ask a question. Does the sales order include at least one fulfillment line that order fulfillment hasn't shipped, and that order fulfillment can ship?

Fline is a DooSeededOrchestrationRules.DOOFline and

Declare variable Fline (fulfillment line), then load values into Fline from object DOOFline of method DooSeededOrchestrationRules.

DOOFline (Distributed Order Orchestration Fulfillment Line) contains fulfillment line attributes and their values.

Header.allFLinesinTheOrder

Examine all fulfillment lines in the sales order, including lines that the orchestration process isn't currently processing.

A dependency might exist between the fulfillment line that the orchestration process is currently processing, and other fulfillment lines in the sales order, so you must inspect all of them.

Fline.shippableFlag is "Y"

If the shippableFlag attribute on the fulfillment line is Y, then proceed.

Make sure each fulfillment line is shippable. Some items can't ship, such as a subscription. If a fulfillment line contains a subscription, then shippableFlag is N for the line, the rule ignores the line, and moves to the next line.

Fline.actualShipDate is null

If the actualShipDate attribute on the fulfillment line doesn't contain a value, then it indicates the fulfillment line hasn't shipped, and the rule must pause the orchestration process.

Fline.orderedQty more than 0

If the orderedQty attribute on the fulfillment line is 0, then it indicates the fulfillment line is a canceled line, the rule ignores the line, and moves to the next line.

SAC_SYSTEM_EVENT_IPC_PAUSE

Use SAC_SYSTEM_EVENT_IPC_PAUSE, where IPC means Interprocess Communication.

The rule evaluates this type of pause each time a task finishes for each fulfillment line.

reevaluateFlag = Y

Evaluate the condition each time an orchestration process step finishes.

In this example, the Shipping step ships the fulfillment lines, so the rule must evaluate after the Shipping step finishes for each fulfillment line to determine whether order fulfillment shipped all fulfillment lines.