Use Case to Pause for a Dependency

This use case coordinates orchestration processes to make sure Order Management invoices all the fulfillment lines that a sales order contains at the same time, even if the shipment dates vary.

The orchestration process uses the same sequence of steps to process each fulfillment line, but these lines might not be synchronized.

Assume a school district places a sales order for 600 new history books and requires that they receive the invoice for the sales order only after Order Management ships all books.

Assume that the orchestration process must get the books from different warehouses.

  • Fulfillment line 1 gets 80 books from the Seattle warehouse

  • Fulfillment line 2 gets 400 books from the Denver warehouse

  • Fulfillment line 3 gets 120 books from the Chicago warehouse

You set up an orchestration process that processes the fulfillment lines, pauses until fulfillment shipped all lines, resumes processing, then sends the lines to billing.

Summary of the Steps

  1. Set up the orchestration process.

  2. Create the first rule.

  3. Create the If statement for the second rule.

  4. Create the Then statement for the second rule.

For brevity, the screen prints in this topic don'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.

This topic uses example values. You might need different values, depending on your business requirements.

For background details about:

Set Up the Orchestration Process

View an example that describes how to do this set up. For details, see Pause Orchestration Processes for Events.

  1. Create a new orchestration process and set up the header.

  2. Add orchestration process steps.

    • Schedule

    • Reserve

    • Ship

    • Wait for Shipment

    • Pause

    • Invoice

    • Wait for Billing

Create the First Rule

You will create a business rule.

the First Rule

Note

Code

Description

DooSeededOrchestrationRules

A dictionary that contains predefined rules you can use in your business rule.

DOOHeader

An object in the DooSeededOrchestrationRules dictionary that stores details about the sales order header.

Assign New

Assign DOOHeader as a new object in the DooSeededOrchestrationRules dictionary. This assignment makes the object available throughout your rule.

SacResult

A rule set in the DooSeededOrchestrationRules dictionary. It contains events and variables you can use to specify how to handle the result of a start after condition.

SAC

A value you can set for SacResult. The term sac is an abbreviation for start after condition.

Assign Header.sacResult = SAC

Set the value of SacResult to SAC.

sacType

A property of SacResult. sacType stores the value that the rule uses to determine whether to pause the orchestration process or release it.

SAC_TYPE_IMMEDIATE

A value of sacType. If sacType contains IMMEDIATE, then the rule will immediately release the pause task.

Header.SacResult.sacType = DooSeededOrchestrationRules.SacResult.SAC_TYPE_IMMEDIATE

Set sacType to SAC_TYPE_IMMEDIATE.

Create the first rule.

  1. On the Pause step, in the Pause Rule column, click Add Rule.

    In the Start After Condition dialog, click Add Rule > Properties, then set the values.

    Attribute

    Value

    Name

    Default Rule for Dependent Pause

    Description

    Default rule that pauses orchestration process until a dependency resolves.

    Priority

    Highest

    Advanced Mode

    Contains a check mark.

  2. In the field below If, enter an alias, such as Header.

  3. In the field to the right of Is A, select DooSeededOrchestrationRules.DOOHeader.

  4. Click the down arrow next to Right Value, then click Delete Test.

    If you remove the test, then the rule always applies the actions that the Then area contains.

  5. In the Then area, click Add Action, then click Assign New.

  6. Click Select a Target, then click DooSeededOrchestrationRules.SacResult.

  7. In the field to the left of the equal sign (=), enter SAC.

  8. In the field to the right of the equal sign (=), click Expression Value.

  9. In the Condition Browser dialog, expand DooSeededOrchestrationRules, expand SacResult, click New, then click OK.

  10. Click Add Action > Assign.

  11. Click Select a Target, then click Header.sacResult.

  12. In the field to the right of the equal sign (=), enter SAC.

  13. Click Add Action > Assign.

  14. Click Select a Target, then click Header.sacResult.sacType.

  15. In the field to the right of the equal sign (=), click Expression Value.

  16. In the Condition Browser dialog, expand DooSeededOrchestrationRules, expand SacResult, click SAC_TYPE_IMMEDIATE, and then click OK.

  17. Click Validate, then click Save.

Create the If Statement for the Second Rule

You will create this rule.

rule that states if the actual ship date isn't null on all fulfillment lines, then release

It states that if the actual ship date isn't null on all fulfillment lines, then release the pause task.

First, you create the If statement.

if statement in second rule

where

Code

Description

At least one

Pause all shipped lines even if the fulfillment system shipped all lines except one line.

FLine is a OrderHeader/allFLinesIntheOrder

Coordinate across more than one orchestration process when more than one orchestration process processes the fulfillment lines for the sales order.

FLine.actualShipDate is null

Determine whether any of the fulfillment lines haven't shipped.

actualShipDate is null when orchestration starts. Orchestration sets actualShipDate to a value when it ships the item.

Create the If statement for the second rule.

  1. On the Pause step, in the Pause Rule column, click Add Rule.

    In the Start After Condition dialog, collapse the rule you just created.

  2. Click Add Rule > Properties, then set the values.

    Attribute

    Value

    Name

    Rule for Pause Dependency

    Description

    Rule that pauses orchestration process until a dependency resolves.

    Priority

    Medium

    Advanced Mode

    Contains a check mark.

    Tree Mode

    Contains a check mark.

  3. Set Root to DooSeededOrchestrationRules.DOOHeader.

  4. In the If area, in the field to the left of Is A, replace the default value with an alias, such as OrderHeader.

  5. Click the down arrow to the right of Right Value, and then click Delete Test.

  6. Click Add Pattern to the right of the If statement.

  7. To the right of the empty fields, click Surround Pattern with Parenthesis, then click Surround.

  8. In the list of values under And, click At least one.

  9. In the field on the left, under At least one, enter FLine.

  10. In the field to the right of Is A, select OrderHeader/allFLinesIntheOrder.

  11. Click the down arrow next to Add Test, then click Simple Test.

  12. Click Left Value.

  13. In the Condition Browser, expand FLine, click actualShipDate, then click OK.

  14. Click Right Value.

  15. In the Condition Browser, click null, then click OK.

Create the Then Statement for the Second Rule

You will create a Then statement.

Then Statement for the Second Rule

For details about these properties, see Overview of Pausing Orchestration Processes.

Create the Then Statement for the second rule.

  1. In the Then area, click the down arrow next to Add Action, then click Assign.

  2. Click Select a Target, then click OrderHeader.sacResult.eventName.

  3. Click Expression Value.

  4. In the Condition Browser, expand DooSeededOrchestrationRules, expand SacResult, select SAC_SYSTEM_EVENT_IPC_PAUSE, then click OK.

    This step sets up the rule to evaluate fulfillment lines until the flow ships all of them, and then to release them. Interprocess communication (IPC) implements a pause according to an event.

  5. Click the down arrow next to Add Action, then click Assign.

  6. Click Select a Target, then click OrderHeader.sacResult.reevaluateFlag.

  7. In the field to the right of the equal sign (=), enter "Y".

    You must include the double quotation marks.

  8. Click the down arrow next to Add Action, then click Assign.

  9. Click Select a Target, then click OrderHeader.sacResult.sacType.

  10. Click Expression Value on the same line.

  11. In the Condition Browser, expand DooSeededOrchestrationRules, expand SacResult, click SAC_TYPE_EVENT, then click OK.

  12. Click Validate, then click Save.