Use Case to Pause for an Event

Assume you work for a publisher who will release a new book at some point in the future, and you must provide your Gold customers an opportunity to order the book before your company releases it to the public.

You will create these rules:

  • If the customer is Gold, then pause the orchestration process.

  • If the customer isn't Gold, then skip the pause task.

Summary of the Set Up

  1. Create the orchestration process.

  2. Add orchestration process steps.

  3. Create If statement for first rule.

  4. Create Then statement for first rule.

  5. Create second rule.

  6. Deploy the orchestration process. For details, see Deploy Orchestration Processes.

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

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.

Get more details.

Create the Orchestration Process

  1. Go to the Setup and Maintenance work area, then go to the task.

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Orchestration Process Definitions

  2. On the Manage Orchestration Process Definitions page, click Actions > Create.

  3. On the Create Orchestration Process Definition page, set the values, then click Save.

    Attribute

    Value

    Process Name

    Pause_for_Gold

    Process Display Name

    Pause_for_Gold

    Process Class

    Ship Order Class

    Set

    Common Set

Add Orchestration Process Steps

You will add these steps.

Orchestration Process Steps

Try it.

  1. On the Step Definition tab, click Actions > Add Row.

  2. Set the values, then click Save.

    Attribute

    Value

    Step Name

    Schedule Goods

    Step Type

    Service

    Task

    Schedule

    Service

    Create Scheduling

  3. Add more steps. Repeat steps 1 and 2. Use these values.

    • Create Reservation

    • Create Shipment

    • Wait for Shipment Advice

    • Create Invoice

    • Wait for Invoice

    Note

    • Set the Step Type attribute for all steps to Service.

    • Set other attributes so they reflect step behavior.

      For example, for the Create Reservation step, set these values.

      Attribute

      Value

      Step Type

      Service

      Task

      Reserve

      Service

      Create Inventory Reservation

    • Make sure you set the Exit Criteria attribute for each wait step. For example, set Exit Criteria for the Wait for Shipment Advice step to Shipped.

  4. Add the pause step. Click the Create Reservation step, click Add Row, set the values in the new row, then click Save.

    Attribute

    Value

    Step Name

    Pause

    Step Type

    Service

    Task

    Pause

    Service

    Pause Process

Create If Statement for First Rule

You will create the start-after condition. This condition determines whether the customer is Gold.

You will create this If statement.

If Statement for First Rule

where

  • DOOFLine is a function in the DooSeededOrchestrationRules dictionary.

  • DOO is an abbreviation for distributed order orchestration, which is an earlier name for order orchestration.

  • FLine is an abbreviation for fulfillment line.

  • demandClassCode is a fulfillment line attribute. This attribute stores the customer class, such as Gold, Silver, or Bronze.

  • isn't determines whether demandClassCode contains Gold.

  • For details, see Guidelines for Pausing Orchestration Processes.

Create the If statement for the first rule.

  1. Create the rule.

    • On the Pause step, in the Pause Rule column, click Click for Rule.

    • In the Start After Condition dialog, click Add Rule, then replace Rule 1 with Pause for Gold Customers.

    • Click Properties, then add check mark to Advanced Mode.

  2. Specify the dictionary and facts to examine.

    • In the IF area, in the window to the left of Is A, enter header.

    • Set the window to the right of Is A to DooSeededOrchestrationRules.DOOHeader.

    • Click Add Pattern.

    • In the window to the left of Is A, enter FLine.

    • Set the window to the right of Is A to DooSeededOrchestrationRules.DOOFLine.

  3. Make sure to evaluate only fulfillment lines.

    • Under FLine, click Add Test.

    • Click Left Value.

    • In the Condition Browser, expand Header, click ChildFLines, then click OK.

    • Change Is to Contains.

    • Click Right Value.

    • In the Condition Browser, click FLine, then click OK.

  4. Make sure the attribute you're about to test isn't empty.

    • On the test you just added, to the far right, click the down arrow, then click Simple Test.

    • On the new line that displays, click Left Value.

    • In the Condition Browser, expand FLine.

      Notice that each value under FLine references a fulfillment line attribute.

    • Click demandClassCode, then click OK

    • Change Is to Isn't.

    • Click Right Value.

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

  5. Determine whether the customer is Gold.

    • On the test you just added, to the far right, click the down arrow, then click Simple Test.

    • On the new line that displays, click Left Value.

    • In the Condition Browser, expand FLine.

    • Click demandClassCode, then click OK.

    • In the Right Value window, enter "Gold".

      You must include the double quotation marks ( " " ).

Create Then Statement for First Rule

You will create this Then statement.

Then Statement for First Rule

For brevity, this screen print doesn't include the entire value for the event.

Create the Then statement for the first rule.

  1. In the Then area, click Add Action > Assign.

  2. Click Select a Target, then click header.SacResult.

  3. In the window to the right of the equal sign ( = ), enter this value.

    ( eventName:"Gold Preorders", reevaluateFlag:"N",sacType:DooSeededOrchestrationRules.SacResult.SAC_TYPE_EVENT )

    where

    • eventName is a variable that you can use to help track the status of the pause task. The Order Management work area uses the text you enter wherever it displays status details, such as in the Gantt chart on tab Orchestration Plan of page Orchestration Process that the user can access from page Manage Orchestration Process. This example specifies to use event Gold Preorders.

    • reevaluateFlag:"N" specifies not to evaluate this rule again.

    • sac is an abbreviation for start after condition.

    • sacType specifies the dictionary, rule set, and event to use for the start after condition.

    • DooSeededOrchestrationRules is a dictionary that contains predefined rules you can use in your business rule.

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

    • EVENT is an event in SacResult. It specifies to use a business event.

    • A pause type of EVENT causes the orchestration process to pause until an event happens.

    • An attribute on an orchestration process references this event, but you can also use it with a web service. You can also use other parameters to release a pause task. This event isn't related to the events that the event framework in Oracle Middleware uses.

    • You must include double quotation marks ( " " ).

  4. Click Save.

Create the Second Rule

You will create this rule.

the Second Rule

Try it.

  1. On the Pause step, in the Pause Rule column, click Click for Rule.

  2. In the Pause Rule Set dialog, in the check box to the left of Pause for Gold Customers, add a check mark.

  3. Click Cut > Paste.

  4. Scroll down to the bottom of the dialog and notice the rule that the paste added.

  5. Make these changes to this new rule.

    Replace This Value

    With This Value

    Pause for Gold Customers

    Skip Customers Who Are Not Gold

    FLine.demandClassCode is "Gold"

    FLine.demandClassCode isn't "Gold"

    header.sacResult = ( eventName:"Gold Preorders", reevaluateFlag:"N",sacType:DooSeededOrchestrationRules.SacResult.SAC_TYPE_EVENT )

    header.sacResult = ( eventName:"Gold Preorders", ( reevaluateFlag:"N", sacType:DooSeededOrchestrationRules.SacResult.SAC_TYPE_IMMEDIATE )

    Start after condition IMMEDIATE ends the pause task and allows the orchestration process to continue to the next step.

  6. Click Save.

  7. On the Edit Orchestration Process Definition page, click Save.