Add Branches to Orchestration Processes

Create a branching condition that determines whether to run a branch on an orchestration process.

An orchestration process branch is a path in an orchestration process that the process runs when the flow meets a condition.

Assume you sell commercial computer systems, and you need a business rule.

  • If the sales order is valued at $50,000.00 or more, then make sure a representative calls the customer before sending the invoice for the order.

Here's the flow that you will create for this example.

orchestration process flow you create for this example.

Note

  • Each step in the flow includes the step number, task name, task type, and service name.

  • The Conditional Node indicates that an orchestration process is about to branch. The first step of the branch contains the condition.

  • If the flow.

    • Meets the condition. The orchestration process runs the steps on the branch that notifies the representative.

    • Doesn't meet the condition. The orchestration process runs the steps on the branch that don't notify the representative.

  • Order Management adds an empty default branch when it runs the orchestration process. If the orchestration process includes only one branch, then it isn't necessary to set an Otherwise condition.

This example uses a rule that processes only one fulfillment line. You use an advanced rule to write a rule for an orchestration process that processes more than one fulfillment line. For details, see Overview of Using Business Rules With Order Management.

Summary of the Set Up

  1. Route the notification to the representative.

  2. Create the orchestration process.

  3. Add the orchestration process steps.

  4. Create the If statement.

  5. Create the Then statement.

  6. Test your set up.

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

Route the Notification to the Representative

This example sends a notification to a representative to call the customer if the invoice is valued at $50,000.00 or more. You create the routing that enables the notification. This setup is specific to this example. Other branching usages might not require this setup, or they might require some other setup.

  1. Create the routing rules that enable the send. For details, see Manage Routing Rules.

  2. Create the connector that you referenced in the routing rules in step 1.

  3. Use the Manage Web Service Details page to create the connector.

Create the Orchestration Process

Use these values in the header of the orchestration process when you create the process.

Attribute

Value

Process Name

CallCustomerWhenLargeInvoice

Process Display Name

Call the Customer

Process Class

Ship Order Class

Set

Common Set

For details, see Guidelines for Setting Up Orchestration Processes.

Add the Orchestration Process Steps

You will add these steps.

You will create these steps.
  1. Add a step.

    Attribute

    Value

    Step Name

    Schedule Item

    Step Type

    Service

    Task

    Schedule

    Service

    Create Scheduling

  2. Add another step.

    Tip: To maintain the correct sequence when you add each step, click the step you most recently added, then click Add Row.

    Attribute

    Value

    Step Name

    Reserve Item

    Step Type

    Service

    Task

    Reserve

    Service

    Create Inventory Reservation

  3. Add another step.

    Attribute

    Value

    Step Name

    Ship Item

    Step Type

    Service

    Task

    Ship

    Service

    Create Shipping

  4. Add another step.

    Attribute

    Value

    Step Name

    Wait for Item to Ship

    Step Type

    Service

    Task

    Ship

    Service

    Wait for Shipment

    Exit Criteria

    Shipped

    Fulfillment Completion Step

    Contains a check mark.

  5. Add another step.

    Attribute

    Value

    Step Name

    Conditional Node

    Step Type

    Conditional

  6. Add another step.

    Attribute

    Value

    Step Name

    Phone Customer

    Step Type

    Service

    Task

    Activity

    Service

    Create Activity

    Evaluation Sequence

    1

  7. Add another step.

    Attribute

    Value

    Step Name

    Wait for Phone Customer

    Step Type

    Service

    Task

    Activity

    Service

    Wait for Activity

    Exit Criteria

    Completed

  8. Add another step.

    Attribute

    Value

    Step Name

    Create Invoice

    Step Type

    Service

    Task

    Invoice

    Service

    Create Billing Lines

  9. Add another step.

    Attribute

    Value

    Step Name

    Wait for Invoice

    Step Type

    Service

    Task

    Invoice

    Service

    Wait for Billing

    Exit Criteria

    Billed

  10. In the Step Definition list, click the Conditional Node step, then add another step. This step creates the Otherwise branch.

    Attribute

    Value

    Step Name

    Otherwise Create Invoice

    Task Type

    Invoice

    Task

    Otherwise Create Invoice

    Each task name that you use with a task type must be unique. You used the Invoice task with the Invoice task type earlier in this procedure, so you must create a new task name.

    To do this, In the Task attribute, click the Search down arrow, then click Create. In the Create Task Name dialog, enter values.

    • Code: 1

    • Name: Otherwise_Create_Invoice

    • Display Name: Otherwise Create Invoice

    • Task Type: Invoice

    Click Save and Close.

    Service

    Create Billing Lines

    Evaluation Sequence

    2

    Otherwise

    Contains a check mark.

    Planning Default Branch

    Contains a check mark.

  11. In the Step Definition list, click the Otherwise Step, Create Invoice step, then add another step. This step creates the Wait for Invoice Step on the Otherwise branch.

    Attribute

    Value

    Step Name

    Otherwise Wait for Invoice

    Step Type

    Service

    Task

    Otherwise Create Invoice

    Service

    Wait for Billing

    Exit Criteria

    Billed

  12. In the Step Definition list, click the Wait for Invoice step, then add another step. This step merges the branch back to the main flow.

    Attribute

    Value

    Step Name

    Merge

    Step Type

    Merge

Create the If Statement

business rule in the remaining part of this procedure

Start by creating the If statement.

  • If the extendedAmount attribute on the fulfillment line is more than 50000

Do it.

  1. In the Step Definition list, in the Phone Customer step, in the Branching Condition column, click Click for Rule.

  2. In the Branching Condition Rules dialog, click Add Rule, then click Expand.

  3. Delete the value Rule 1 , and then enter Condition for invoices valued at more than 50000 dollars.

  4. Click Left Value.

  5. In the Condition Browser dialog, expand DooSeededOrchestrationRules > DOOFLine, click extendedAmount, then click OK.

    where

    Code

    Description

    DooSeededOrchestrationRules

    A dictionary that includes predefined rule sets, facts, functions, variables, bucket sets, links, and functions that you can use to orchestrate fulfillment.

    DOO

    Means distributed order orchestration, which is an earlier name for order orchestration.

    FLine

    Fulfillment line.

    extendedAmount

    A fulfillment line attribute that stores the total value of the sales order.

  6. Click Is, and then click More Than.

  7. Click Right Value.

  8. In the Condition Browser dialog, enter 50000, then click OK. Don't include commas in your value.

Create the Then Statement

You will create the Then statement.

  • ( resultObj:DooSeededOrchestrationRules.Boolean.TRUE )

where

Code

Description

resultObj

A variable in the DooSeededOrchestrationRules dictionary. You use it to store the result of the business rule.

Boolean

Sets the value of resultObj to TRUE.

Do it.

  1. In the Then area, click Add Action > Assert New.

  2. Click Select a Target, then click DooSeededOrchestrationRules.Result.

  3. Click Edit Properties.

  4. In the Properties dialog, in the ResultObj row, click Value.

  5. In the Condition Browser dialog, expand DooSeededOrchestrationRules > Boolean, click True, then click OK.

  6. Make sure the Properties dialog contains these values.

    Name

    Type

    Value

    resultObj

    Object

    DooSeededOrchestrationRules.Boolean.TRUE

    resultObjKey

    Object

    Leave this cell empty.

    viewRowImpl

    oracle.jbo.server.viewRowImpl

    Leave this cell empty.

    For example:

    values in Properties dialog
  7. Click OK.

  8. In the Branching Condition Rules dialog, click Save.

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

Test Your Set Up

  1. Verify that you correctly defined the orchestration process steps and flow.

    • In the header of the Edit Orchestration Process Definition page, click Actions, then click Generate Process Diagram.

    • Make sure the diagram includes the same steps and logic that the diagram at the beginning of this topic displays.

  2. Test the nonbranching flow.

    • In the Order Management work area, create a sales order that's valued at less than $50,000.00.

    • Verify that Order Management ships the item without requesting that you call the customer.

  3. Test the branching flow.

    • Create a sales order that's valued at more than $50,000.00.

    • Verify that Order Management doesn't ship the item until the activity that the Wait for Phone Customer step references reaches a Completed state.