Use Case to Pause for Time

Read this topic to examine a detailed example that describes when to pause for time.

Assume your supply chain analysis determines it typically requires two days to ship goods from warehouse to customer when your customer orders through your legacy system. Your supply chain uses just-in-time fulfillment. You don't want to send the order to shipping too early to avoid the cost of reserving inventory any time longer than necessary to meet the requested delivery date. So you set up a pause task that pauses the orchestration process until two days before the scheduled ship date happens.

You create a business rule.

  • If source system is Legacy, then release pause on ShipDate minus two.

Summary of the Set Up

  1. Set up orchestration process.

  2. Create If statement.

  3. Create Then statement.

  4. 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 background details about.

Set Up 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_Time

    Process Display Name

    Pause_for_Time

    Process Class

    Ship Order Class

    Set

    Common Set

  4. Set up orchestration process steps.

    Do the stuff that's described in the Define the Orchestration Process Steps subtopic. For details, see Pause Orchestration Processes for Events.

Create If Statement

Create the If statement that determines whether the source system is Legacy.

If statement that determines whether the source system is Legacy

Create the If statement.

  1. Create the rule.

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

    • In the Start After Condition dialog, click Properties, then set the values.

      Attribute

      Value

      Name

      Rule That Pauses Until Ready to Ship

      Description

      If source system is Legacy, then release pause on ShipDate minus two.

      Advanced Mode

      Contains a check mark.

      Tree Mode

      Doesn't contain a check mark.

  2. Specify the header.

    • In the IF area, in the Left Value attribute, enter Header.

    • Set the field that's located to the right of Is A to DooSeededOrchestrationRules.DOOHeader.

    • In the IF area, click the down arrow next to the magnifying glass, then click Delete Test.

  3. Specify the line.

    • Click Add Pattern.

    • In the left field, under Add Test, enter Line.

    • Set the field that's located to the right of Is A to DooSeededOrchestrationRules.DOOFLine.

  4. Add the test.

    • Immediately under the left field that contains the value Line, click down arrow > Simple Test.

    • Click Left Value.

    • In the Condition Browser, expand Header.

      Notice that the list displays order header attributes that you can use to specify which attribute to examine. For this example, this If statement creates a filter that causes the rule to only consider source orders where the Source Order System attribute contains a value of LEG, where LEG is an abbreviation for the term legacy.

    • Click sourceOrderSystem > OK.

    • In the Right Value attribute, enter "LEG".

Create the Then Statement

This statement adds the pause and specifies to release it two days before the scheduled ship date happens.

statement that adds the pause and specifies to release it two days before the scheduled ship date happens

Create the Then statement.

  1. Assign the result.

    Code Description

    Assign new DooSeededOrchestrationRules.SacResult SAC = new DooSeededOrchestrationRules.SacResult()

    Create a new variable named SAC and set it to the SacResult type in the DooSeededOrchestrationRules method.

    Assign Header.sacResult = SAC

    Set the value of the sacResult object on the order header to the value that SAC contains.

    For brevity, the 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.

  2. Use Assign New to create a variable named DateTime. You will use this variable to calculate the amount of time to delay shipment.

    • In the Then area, click Add Action > Assign New.

    • Click Select a Target > DooSeededOrchestrationRules.Timestamp.

    • In the empty attribute immediately to the right of Select a Target, enter DateTime.

      Don't include quotation marks. Adding DateTime in this attribute creates the variable that this example uses for the date calculation.

  3. Select the fulfillment line attribute that you will use to calculate the date.

    • Click Expression Value.

    • In the Condition Browser, expand Line.

      The dialog displays a list of fulfillment line attributes. You can set up you rule so it considers the value of one of these attributes.

    • Click scheduleShipDate > OK.

    • Make sure the attribute where you added DateTime still contains DateTime.

    • Click Add Action > Modify.

    • Click Select a Target > DateTime.

  4. Calculate the amount of time to delay shipment.

    • Click Edit Properties.

    • In the Properties dialog, in the Time row, click Value.

    • In the Condition Browser, expand DateTime, then click Time.

      Note that the Condition Browser adds a value of DateTime.time to attribute Expression.

    • In the Expression attribute, append -(2*24*60*60*1000) to the end of DateTime.time.

      where

      • 2 is the number of days.

      • 24 is the number of hours in one day.

      • 60 is the number of minutes in one hour.

      • 60 is the number of seconds in one hour.

      • 1000 is the number of milliseconds in one second.

      This value calculates the number of milliseconds so the pause task ends two days before the orchestration process schedules the order lines for shipping.

      You can use the getAdjustedDate instead function of DateTime.time.

    • Make sure the Expression attribute includes DateTime.time-(2*24*60*60*1000), then click OK.

      For example:

      condition browser with DateTime.time-(2*24*60*60*1000)
    • Make sure the Properties dialog includes the value in the time property.

      values in Properties dialog
    • Click OK.

  5. Pause the orchestration process.

    You will set these properties.

    ( reevaluateFlag:"N", sacType:DooSeededOrchestrationRules.SacResult.SAC_TYPE_TIMER, waitDateTime:DateTime )
    • Click Add Action > Assert New.

    • Click Select a Target > DooSeededOrchestrationRules.SacResult.

    • Click Edit Properties.

    • In the Properties dialog, in the reevaluateFlag row, in the Value attribute, enter "N". You must include the double quotation marks.

    • In the sacType row, click Value.

    • In the Condition Browser dialog, expand DooSeededOrchestrationRules > SacResult, click SAC_TYPE_TIMER, then click .

      A pause type of TIMER causes the orchestration process to pause until time elapses.

    • In the Properties dialog, in the waitDateTime row, click Value.

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

    • Make sure the Properties dialog contains these values.

      dialog with the required values
  6. Click OK, then, in the Pause Rule dialog, click Save.

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