Use Business Rules When You Can't Use Extensions

Create a business rule when an Order Management extension doesn't meet your requirements.

For example, you can't use an Order Management extension to update the ScheduleShipDate attribute when you revise a sales order.

Assume you must set the value of the ScheduleShipDate attribute to the value that the RequestShipDate attribute contains when you create an order revision.

Summary of the Setup

  1. Create a posttransformation rule.

  2. Test your setup.

Create a Posttransformation Rule

Create a Posttransformation Rule

Here's how the rule works at run time.

how the rule works at run time

Try it.

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

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Posttransformation Defaulting Rules

  2. On the Manage Posttransformation Defaulting Rules page, create a new rule.

  3. Add a check mark to the Advanced Mode option.

  4. In the If area, set the conditions.

    Code

    Description

    header is a PosttransformationRules.HeaderVO

    Declare the Header variable into the PosttransformationRules dictionary.

    Get values for attributes of the order header that the orchestration process is currently processing from the header virtual object (VO), then store them in the Header variable.

    line is a PosttransformationRules.LineVO

    Declare the line variable into the PosttransformationRules dictionary.

    Get values for attributes of the order line that the orchestration process is currently processing from the line virtual object (VO), then store them in the line variable.

    header.OrderLine isn't null

    Make sure the order line contains a value.

    header.OrderLine RL.contains line

    Declare the OrderLine variable into the rules language (RL) dictionary, then set the value of OrderLine to the value that the line variable contains.

    This condition makes sure the OrderLine variable references the fulfillment line that the orchestration process is currently processing. It also makes sure you correctly declare the variable into the dictionary.

    You use it to examine all lines in the sales order, not only the line that the current orchestration process instance is processing.

    fline is a PosttransformationRules.FulfillLineVO

    Declare the fline variable into the PosttransformationRules dictionary.

    Get values for attributes of the fulfillment line that the orchestration process is currently processing from the virtual object (VO) for the fulfillment line, then store them in the fline variable.

    line.OrderFulfillLine isn't null

    Make sure the line.OrderFulfillLine fact contains a value.

    line.OrderFulfillLine RL.contains fline

    Make sure the line.OrderFulfillLine fact contains data from the fline variable.

    header.ChangeVersionNumber isn't 1

    Proceed to the Then statement only if you're revising the sales order.

    If the ChangeVersionNumber attribute on the order header equals 1, then the sales order isn't a revision.

  5. In the Then area, add an Assign action.

    Code

    Description

    fline.ScheduleShipDate = fline.RequestShipDate

    Set the value of the ScheduleShipDate attribute in the fline variable to the value that the RequestShipDate attribute contains in the fline variable.

  6. Click Save > Release.

    For details about how to create a business rule, see Overview of Using Business Rules With Order Management.

Test Your Setup

  1. Go to the Order Management work area, create, then submit a sales order.

    Attribute

    Value

    Business Unit

    Vision Operations

    Assume the order number is 521702.

  2. Revise sales order 521702, then submit your revision.

  3. On the Order page, click Fulfillment Lines.

  4. On the order line, examine the value of the Scheduled Ship Date attribute.

  5. In the Attributes area, click Supply Details.

  6. Examine the value of the Requested Ship Date attribute, and verify that it matches the Scheduled Ship Date.

    For example:

    Examine the value of the Requested Ship Date attribute

Use REST API

If you don't want to use a business rule or an extension to set the scheduled ship date, you can use a patch action on the salesOrdersForOrderHub REST API. For example:

{
 "lines":[
  {
  "SourceTransactionLineId": "1",
  "SourceTransactionScheduleId": "1",
  "OverrideScheduleDateFlag": true,
  "ScheduleShipDate": "2019-10-25T05:59:59+00:00",
  "ShippingInstructions":"REST NEW TEST",
  "RequestedFulfillmentOrganizationCode": "M1"
  }
 ]
}

For details and examples, go to REST API for Oracle Supply Chain Management Cloud, expand Order Management, then click Sales Orders for Order Hub > Update One Sales Order.