6Business Rules

This chapter contains the following:

Overview

Overview of Using Business Rules With Order Management

Set up a business rule in Order Management Cloud to implement a dynamic decision at run time that automates a company policy, does a calculation, or does some processing.

A business rule is a statement that describes how to implement a business policy or make a business decision. It can implement logic.

  • Enforce a spending policy.

  • Constrain a process so it meets a regulatory requirement.

  • Compute a discount or premium.

  • Provide an offer according to customer value.

Here are some business requirements you can meet with a business rule.

  • Set a default value for shipment priority

  • If quantity is more than 10, then add free items to the sales order.

  • If customer is Computer Service and Rentals, then use orchestration process y to fulfill the sales order.

  • If destination is Japan, then route shipment through Pacific Northwest Warehouse.

A business rule keeps rule logic separate from the underlying application code, which allows a business analyst to modify rule logic without using programming code and without interrupting your business process.

Here's an example of a business rule.

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

Here are the types of business rules you can use and where you can use them.

flow that illustrates the types of business rules
you can use and where you can use them

Note.

Type of Business Rule Description

Transform a sales order.

  • Pretransformation

  • Product Transformation

  • Posttransformation

Order Management transforms each source order that you create in Order Management or that it receives from a source system so it can optimize order fulfillment. You can write a rule to. . .

  • Populate order attributes before transformation.

  • Transform a source order.

  • Populate order attributes after transformation.

For example.

  • Populate an attribute on a fulfillment line. If the item is a widget, then populate the Request Date attribute on the fulfillment line.

  • Convert a measurement. If the item is a widget, then convert the value in the Size attribute from centimeters to inches in the fulfillment line.

  • Create fulfillment lines from one item. For example, if the item is a laptop that includes a docking station, then transform the item into one fulfillment line for the laptop and another fulfillment line for the docking station.

For details, see the Transform Source Orders to Sales Orders topic.

Process Assignment

Assign the orchestration process that Order Management runs to process fulfillment lines.

For example.

  • If the ordered quantity is large, then assign the sales order to an orchestration process that optimizes scheduling and delivery for large orders.

  • If the customer is Important, then assign the sales order to an orchestration process that expedites delivery.

  • If the ship-to address in the order header resides outside of your country, then assign the sales order to an orchestration process that handles international fulfillment, such as checking for trade compliance.

For details, see the Assign Orchestration Processes topic.

Process a sales order.

  • Start After Condition

  • Branching Condition

  • Lead Time Expression

  • Line Selection Criteria

Process a change order.

  • Compensation Pattern

  • Cost of Change

Set up a rule that affects processing, such as branch in an orchestration process, do a complex calculation that determines planning lead time, or manage a change that occurs to the sales order.

For example.

  • If an invoice exceeds $100,000, then make sure a representative phones the customer.

  • If the status of the Create Shipment orchestration process step is Shipped, then send a notification to your customer that the sales order is on its way.

  • If the sales order includes a shippable item, such as a laptop, and an item that isn't shippable, such as a warranty for the laptop, then make sure the orchestration process doesn't attempt to ship the warranty.

Routing Rule

Set up a rule that routes a fulfillment request to a fulfillment system according to an attribute on the sales order, fulfillment line, or orchestration process.

For example.

  • If product type is Goods, and if task type is Invoice, then route the request to fulfillment system ABCInvoicingSystem.

  • If item is 2TX Server, then route the service request to fulfillment system Big Server.

For details, see the Overview of Connecting Order Management to Your Fulfillment System topic.

For background details about creating Oracle Business Rules, see Designing Business Rules with Oracle Business Process Management on Oracle Help Center.

Use Visual Information Builder to Create Rules

Prior to Release 12, you use Oracle Business Rules to create rules in Order Management Cloud. Starting with release 12, you can use Visual Information Builder to create some types of rules, which is a rule editor that supports a simplified drag-and-drop interface. It helps you visualize data, visualize your business processes, implement your business logic, and implement your business rule sets.

Starting with release 13B, its strongly recommended that you use only Visual Information Builder for routing, pretransformation, and assignment rules.

Here are pages you use to access the editors.

Editor for Oracle Business Rules Editor for Visual Information Builder

Manage External Interface Routing Rules

Manage External Integration Routing Rules for Sales Orders

Manage Pretransformation Defaulting Rules

Manage Pretransformation Rules for Sales Orders

Manage Orchestration Process Assignment Rules

Manage Process Assignment Rules for Sales Orders

Examples of Creating Business Rules

Visual Information Builder

See these topics.

  • Manage Routing Rules

  • Manage Pretransformation Rules

  • Manage Process Assignment Rules

  • Route Requests from Order Management to Fulfillment Systems

  • Route Requests to Fulfillment Systems Without Cross-References

  • Create Cross-References in Order Management

  • Integrate Order Management Without Cross-Referencing Customer Attributes

Oracle Business Rules

See these topics.

Page Topic

Manage Orchestration Process Definitions

See these topics for rules that you set up on an orchestration process.

  • Set Up Lead-Times for Orchestration Process Steps

  • Select Fulfillment Lines for Orchestration Process Steps

  • Measure the Cost of Change

  • Compensate Sales Orders That Change

  • Add Branches to Orchestration Processes

See these topics for rules that pause an orchestration process.

  • Pause Orchestration Processes Until an Event Occurs

  • Pause Orchestration Processes Until Time Elapses

  • Pause Orchestration Processes Until Items Are Ready to Ship

See these topics for rules that control status.

  • Add Status Conditions to Orchestration Processes

  • Add Status Conditions to Fulfillment Lines

Transformation Rules

  • Set Up Transformation Rules

  • Set Up Advanced Transformation Rules

For details about using business rules with extensible flexfields, see the Overview of Setting Up Extensible Flexfields in Order Management topic.

Examples That Include Orchestration Process Attributes

Orchestration Process Attribute Topic

Cost of Change

Measure the Cost of Change

Compensation Pattern

Manage Change That Occurs During Order Fulfillment

Compensate Sales Orders That Change

Lead-Time Expression

Set Up Lead-Times for Orchestration Process Steps

Line Selection Criteria

Select Fulfillment Lines for Orchestration Process Steps

Branching Condition

Add Branches to Orchestration Processes

Start-After Condition

Pause Orchestration Processes Until an Event Occurs

Pause Orchestration Processes Until Time Elapses

Pause Orchestration Processes Until Items Are Ready to Ship

You use the Manage Orchestration Process Definitions page to set these attributes. For details, see the Guidelines for Setting Up Orchestration Process Steps topic.

How Business Rules Work

Write a business rule that uses conditional logic to process a business event.

A business rule uses the sales order as input, uses functions to get details or to do an action on a fact, then provides a result that Order Management uses to update sales order details.

how A business rule uses the sales order as input

Assume you must implement a rule.

  • If the item is a Green Server, then use priority shipping.

Here's the flow.

flow of an example rule

Note.

  1. An event occurs that causes Order Management to run the rule. The event depends on the context where you write the rule. For example, if you set up a rule.

    • On a step in an orchestration process. The rule runs when the process reaches the step.

    • On the external interface. The rule runs when a task in the external interface references the rule.

  2. If the If statement is true according to the facts, then Order Management activates the rule.

    For example.

    • If the item is a Green Server

      where

      • Item is a fact.

      • Green Server is a fact.

  3. The rule references the dictionary to get the objects it needs at run time.

    For example, you create variables and declare objects when you set up the rule. You store these objects in the dictionary.

  4. The rule does the action.

    The action is a Then statement. For example.

    • Use priority shipping.

      where

      • priority shipping is a fact

For background details about business rules, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

Use guidelines to help you create a business rule.

Use Tools and Environments

  • Use Visual Information Builder to create all your rules, or use Oracle Business Rules to create all your rules. Don't use Visual Information Builder to create some rules, and then use Oracle Business Rules to create other rules.

    Use Visual Information Builder to create all your
rules, or use Oracle Business Rules to create all your rules
  • Create all your rules in the same instance of Order Management. Don't create some rules in one instance, and then some other rules in another instance or environment.

  • Some rule dictionaries are available in jDeveloper. However, don't use jDeveloper because problems might occur during patching, instantiating objects, and migrating. Instead, use the Setup and Maintenance work area to set up your rules.

    Use the work area to migrate setup data from one environment to another environment. You can create rules for orchestration processes only through the Manage Orchestration Process Definitions page in the Setup and Maintenance work area. Migration migrates rules that you create when you set up an orchestration process.

Use Auto fill in Visual Information Builder or Oracle Business Rules

Use automatic fill to display a list of values that are available according to the rule structure that you define. Automatic fill helps to simplify creating the rule because you don't need to research what attributes and facts are available, and you don't need to research whether you can use an attribute or fact in the logic you define. Automatic fill continues to filter the results each time you enter another character.

automatically filling values to display a list
of values that are available according to the rule structure that
you define

Using Automatic Fill in Oracle Business Rules

Its strongly recommended that you use automatic fill or the drop down list and dialog in Oracle Business Rules when you set values. Don't enter a value directly in a field unless you're entering a literal string. Oracle Business Rules dynamically modifies the values that are available in fields depending on values you set while you're creating the rule. If you enter a value directly in an field, its possible that the rule will fail validation even if the value you enter is exactly the same value that the rules editor populates when you use automatic fill or the dialog.

If you declare a variable in one field, but don't see it available in another field, then click Save in the rule builder dialog.

If you enter a literal string in a field and get a validation error when you click Validate, then remove all content from the field, click Expression Value, enter you value in the Condition Browser, then click OK.

Use the Tree in Visual Information Builder

Use the tree in Visual Information Builder to find attributes you can use in your rule, then add them.

Use the tree in Visual Information Builder to find
attributes you can use in your rule, then add them.

The tree displays the hierarchy of the objects you can add to the rule. For example, the Manage External Interface Routing Rules page displays the hierarchy of attributes you can add. sales order .

  • A sales order is an object in Order Management.

  • A sales order includes entities, such as.

    • Order Header

    • Order Fulfill Line

  • Each entity includes attributes. For example, here are some attributes in the Order Fulfill Line entity.

    • Business Unit

    • Item

    • Ordered Quantity

    • And many others

  • To add an attribute to your rule, click the attribute, drag, then drop it onto the rule.

    For example, drag the Item attribute onto the If statement of your rule.

You can use the tree to set up a wide range of conditional logic that meets your business requirements. If you prefer not to use the tree, you can search directly in the If statement or Then statement for the entity, attribute, values, and so on.

Use Advanced Mode and Tree Mode in Oracle Business Rules

Use Advanced Mode and Tree Mode to help simplify creating and managing your rule. These modes help structure your rule to make sure it contains the correct logic structure, and to filter choices available to you to help make sure the rule references objects correctly according to structure.

Using Advanced Mode and Tree Mode

Migrate Between Environments

Specify types of rules to migrate.

types of rules to migrate

Note.

  • In the Setup and Maintenance work area, click Actions > Export > Create New Export.

  • Export the business objects you need to run business rules. For example.

    • Orchestration Transformation Rules

    • Order Approval Rules.

    • External integration Routing Rules

    • Orchestration Process Assignment Rules

    • Orchestration Process Rule Dictionary

For details, see these topics.

  • Export Offering Setup

  • Migrate Business Rules in Order Management

Set Up Rule Logic

  • Make sure your rules won't cause a conflict at run time.

    For example, assume you write rule x that assigns a fulfillment line with item type of server to one process, and you write rule y that assigns server item ABC to another process. A conflict might occur. You must revise rule x so it doesn't specify server item ABC. Oracle Business Rules provide details about potential conflicts after you save the rule.

  • If your rule compares one data object to another data object of the same type, then use advanced mode and create two variables, one variable to represent each data object.

    You must specify that variable one is not the same as variable two. Set up this test.

    variable1 is not variable2

    If you don't set up this test, then Oracle Business Rules will use variable1 and variable 2 to represent the same object instance when it determines the rule to apply.

  • Make sure each rule evaluates to a single result. For example, if you write two rules for the interface layer, then make sure only one rule evaluates to true. Assume you write two rules.

    If Task Type = Shipment return Fusion Shipment 
    If Task Type = Shipment and Customer = GOLD return Third Party Shipment
    

    These rules look different but they each evaluate to true when Task Type equals Shipment and Customer equals GOLD. To avoid this problem, write If, Then, Else rules in Visual Information Builder to make sure your rules are mutually exclusive.

Set Up Rule Logic When You Use Visual Information Builder

Defining Rule Logic When You Use Visual Information
Builder

Note.

  1. Notice the entity. You enter the attribute, such as Order Type, and then the entity that contains the attribute, such as Order Header, displays immediately under the attribute.

    Most attributes on the order header are different from attributes on the order line. For example, the order header includes the Order Type attribute but the order line doesn't. However, the order header and the order line contain similar or identical attributes. For example, the order header and the order line each include attribute Shipping Instruction. If your rule must reference Shipping Instruction on the order header, then make sure you use the order header entity.

  2. Is in the List. Use Is in the List to examine the list of values that the attribute references instead of writing an OR condition. For example, the list of values for Order Type includes Mixed Orders and Standard Orders. If you don't use Is in the List, then it might be necessary to write a series of OR conditions. For example.

    If Order Type equals Mixed Orders, or If Order Type equals Standard Orders
  3. Add the description. Description for the IF statement is optional. However, you can use it to quickly scan your rule logic without having to drill down into the rule to determine the purpose of the statement. You can also add a description for the Then clause.

  4. Make sure the object isn't empty.

    Note: If your rule depends on a value, and if the rule references an attribute that doesn't contain a value, then it might fail with unpredictable results, such as a null pointer error. For example.
    Manage Process Assignment Rules for Sales OrdersView row with key oracle.jbo.Key[null ] is not found in __DimensionVO__For__Reference__For_DCL__

    or

    Attempted to invoke method "longValue" in class "java.lang.Long" on a null object reference. at line 29 column 13 in /Ruleset(PreTransformationRS)/Rule(HQVMISubinvDefault)/Pattern(v0_HeaderVO)/Test[8]

    Avoid this problem. Make sure the value of any attribute that your rule references isn't empty.

    Here's an example of how to do it in Oracle Business Rules.

    example of how to do it in Oracle Business Rules.

Use rule logic in Visual Information Builder to simplify creating and managing your rule.

Using rule logic in Visual Information Builder
to simplify creating and managing your rule

Note.

  1. Structure your rule.

    • Put all your logic in one rule instead of spreading it across more than one rule.

    • Write one rule that includes more than one IF_THEN_ELSE statement instead of writing more than one rule.

    • Add an IF THEN ELSE structure.

    • Nest your rules, such as adding another IF after an ELSE.

  2. To look for values that aren't in the list, write a rule that looks for values in the list, then add a False condition. Use False directly in the IF statement to implement a NOT condition rather than adding another rule.

Write More Than One Rule

If you set up more than one rule to meet the same business requirement, then set priority. For details, see the Guidelines for Pausing Orchestration Processes topic.

Writing More Than One Rule

Make sure the rules in a single rule set are mutually exclusive.

Make sure the rules in a single rule set are mutually
exclusive.

A rule set is a group of rules that run together to achieve a business objective. For example, assume you create a pause rule and a release rule on a pause task. The pause rule and release rule together constitute one rule set. Oracle Business Rules runs all the rules in a rule set. To avoid logic problems, make sure no two rules can be true at the same time, or false at the same time.

Create If Statements

  • Use an If Then format that uses natural language when you first begin writing your rule. For example.

    If the item type is server, then add extra packing to the shipping instructions.
  • Remove dependencies where the result of one rule changes the If statement of another rule in a way that causes infinite looping.

  • Consider the outcome under a variety of data inputs. The If Then statement is the most common statement. You can also use If Then Else in advanced mode.

  • Add the equivalent of an Else clause so your rule can handle the situation where no condition is met. To avoid an interruption in processing, this is particularly important when your rule assigns an orchestration process or routes processing to the interface layer.

  • Use a bucket set to simplify If logic in the decision table. Use parameters on actions to provide different values for the same attribute in each rule.

  • Use a decision table when you require more than one rule that uses the same set of If statements and Then statements.

Create If Statements in Oracle Business Rules

Use different conditions in Oracle Business Rules depending on the release you're using.

Old Releases Current Release Description

For Each Case

Each

Repeat for each of the row that satisfies the conditions of the If statement.

There is a case where

At least one

At least one of the rows satisfies the conditions of the If statement.

There is no case where

None

None of the rows satisfies the conditions of the If statement.

Aggregate

Aggregate

Aggregate fulfillment lines before you send them to your fulfillment system.

Reference Attributes

  • Identify the attributes you will reference in the rule. For example, Item Type and Shipping Instructions are each an attribute on the fulfillment line. For details about Order Management tables that these attributes reference, see book Tables and Views for Oracle Supply Chain Management Cloud at https://docs.oracle.com/en/cloud/saas/supply-chain-management/r13-update18a/oedsc/index.html.

  • Add a default, catch all rule that can handle the situation where you must set an attribute value.

  • Make sure your rule can handle an attribute that doesn't contain a value, even for attributes that normally do contain a value.

    Note: If the attribute doesn't contain a value, and if your rule does a calculation that requires a value, then it might create an error or result in a null pointer exception at runtime.

    For example, an Order Entry Specialist might or might not set the value for an extensible flexfield because adding a value is optional. If your rule references an extensible flexfield, and if this flexfield doesn't contain a value at run time, then write your rule so it populates the flexfield with a default value that your rule can use during calculations.

    For details about using rules with extensible flexfields, see the Overview of Using Extensible Flexfields in Order Management topic.

Reference Extensible Flexfields

Referencing Extensible Flexfields

Apply guidelines when you reference an extensible flexfield in Visual Information Builder.

  • Its not necessary to examine the context for an empty value.

  • Your rule must examine the segment for an empty value.

  • Run the Publish Extensible Flexfield Attributes scheduled process whether you use Visual Information Builder or Oracle Business Rules. This scheduled process updates the rule definitions. You must run it each time you set up a new or modify an existing extensible flexfield so you can view and use them in the rule editors.

Apply guidelines when you reference an extensible flexfield in Oracle Business Rules.

guidelines when you reference an extensible flexfield
in Oracle Business Rules

Note.

  • Use isn't null to make sure the value of any attribute or object, such as the segment or context, that your rule references isn't empty. If your rule references an empty attribute, but depends on a value, then it might fail with unpredictable results.

  • Reference the context code, such as HeaderEFF.context.

  • Reference the segment name, such as HeaderEFF.getFlexAttributeDateValue("_CompleteCompliancedate").

  • If you reference a value set, then Oracle Business Rules uses the VALUE column, by default. If the value set.

    • Contains a value for ID. The editor uses the ID, and you must write the rule so it uses the ID.

    • Doesn't contain a value for ID. The editor uses the value.

    For example, if you write a rule that references a payment term, then you must make sure the value set includes a value for ID, and your rule must reference the ID.

  • For details about how to identify the context code and segment name, see the Identify Flexfield Contexts and Category Codes for Your Business Rules topic.

More Guidelines for Referencing Attributes

If you use Order Promising, then apply these guidelines.

f you use Order Promising, then apply these guidelines.

Note.

  • Order Promising uses the Scheduled Ship Date attribute on the sales order only if you set the Override Schedule attribute to Yes. If you create a rule that references Scheduled Ship Date, then make sure you override the schedule.

  • Specify the warehouse, or specify the supplier and supplier site. It isn't necessary to specify scheduled arrival date.

  • If you don't make these settings, then Order Promising ignores the scheduled ship date that the rule sets.

You can reference an item attribute in an entity in Visual Information Builder.

referencing an item attribute in an entity in Visual
Information Builder

Note.

  • You can reference an item attribute from these entities.

    • Item Definition

    • Item Category

    • Related Item

  • These entities are children of the Order Fulfill Line entity, grandchildren of Order Line, and great grandchildren of Order Header.

  • You can reference an item attribute in Visual Information Builder or Oracle Business Rules.

  • Don't reference an item attribute that ends with suffix _OBSOLETE in the attribute name.

Set Up Types of Rules

Transformation Rule

defining a Transformation Rule

Note.

  • Use the Then to set values.

  • Use a product transformation rule to add new order line or to delete an existing order line.

    Here's some code that adds a new fulfillment line for item 12345678.

    OrderTransformationRules.AddNewOrderLine (newItemId:12345678, viewRowImpl:fline.viewRowImpl)

    This code deletes the fulfillment line that references item 12345678.

    OrderTransformationRules.DeleteOrderLine (fulfillmentLineId:12345678, viewRowImpl:fline.viewRowImpl)
  • Use a posttransformation rule to modify an attribute on a new order line.

  • Use the ModifyEntity function to set a value.

    This example code modifies the ShippingInstructions attribute. It sets the contents of the attribute to the text Sales credits are 17.

    PostTransformationRules.ModifyEntity(attrName:ShippingInstructions, attrValue: "Sales credits are 17.")
  • Make sure you use each rule only to do work for its intended design. For example, use a product transformation rule only to transform the product. Don't use it to implement some other functionality.

Interface Routing Rule

defining an Interface Routing Rule

Note.

  • Use parameters, such as Maximum Lines to Aggregate, to aggregate the lines you send to your fulfillment system.

  • For details about how to set attributes, see the Actions You Can Set in Routing Rules topic.

  • Run several tests and measure the results. Optimize values for each parameter after each test.

Compensation Pattern

defining a Compensation Pattern

Note.

  • Use Advanced Mode.

  • Use the Assign action.

  • Assign a value for the compensation pattern. For example.

    Assign header.mRuleDecision.compensationPattern = "CANCEL_CREATE"
  • Don't use this rule to set the default value for any other attribute.

Cost of Change Rule

defining a Cost of Change Rule

Note.

  • Use Advanced Mode.

  • Use the Assign action.

  • Assign a numeric value, such as 10 to costOfChange. For example.

    assign Header.mRuleDecision.costOfChange = 10
  • Don't use this rule to set the default value for any other attribute.

Guidelines for Rules in Orchestration Processes

For details about setting these rules, see the Guidelines for Setting Up Orchestration Process Steps topic.

Lead-Time Expression Rule

defining a Lead-Time Expression Rule

Note.

  • Use Advanced Mode.

  • Use the Assign action.

  • Assign a datetime value. For example.

    assign Header.mRuleDecision.leadTime = (Fline.scheduleShipDate.time - CurrentDate.date.timeInMillis)/(1000*60*60*24)
  • Don't use this rule to set the default value for any other attribute.

Line-Selection Rule

defining a Line-Selection Rule

Note.

  • Use Advanced Mode.

  • Use the Assert action.

  • Assert value for fulfillLineId. For example.

    assert DooSeededOrchestrationRules.Result (resultObjKey.Fline.fulfillLineId)
  • Don't use this rule to set the default value for any other attribute.

Branching Condition Rule

defining a Branching Condition Rule

Note.

  • Use Advanced Mode.

  • Use the Assign action.

  • Assign the Boolean to True. For example.

    assign Header.mRuleDecision.isOrchStepExecutable = DooSeededOrchestrationRules.Boolean.TRUE
  • Don't use this rule to set the default value for any other attribute.

Guidelines for Pause Tasks

Set up a pause task on an orchestration process. For details, see the Guidelines for Pausing Orchestration Processes topic.

Parts of a Business Rule

A business rule contains an If statement and a Then statement.

For example.

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

Here's a rule in Oracle Business Rules editor.

example of the main parts of business rule

Note.

  1. Left Value of the If statement. Specifies the object the rule compares in the If statement.

    In this example, Left Value contains a string.

    DooSeededOrchestrationRules.DOOFLine.extendedAmount

    where

    • DooSeededOrchestrationRules is the name of a dictionary. A dictionary is an XML file that contains rules organized in rule sets, facts, functions, variables, bucket sets, links, the data model, and so on.

    • DOOFLine is an object in the dictionary.

      • DOO is an abbreviation for distributed order orchestration, which is a name Order Management used in earlier releases. It means the same as order orchestration.

      • extendedAmount is a fulfillment line attribute. It contains the total value of the sales order.

      • FLine is an alias for fulfillment line.

      • DOOFLine contains the data model for the fulfillment line in order orchestration. For example, DOOFLine contains the fulfillment line attributes, such as orderedQty, customerPONumber, creationDate, and so on. You can reference these attributes and use their values in your rule.

  2. Right Value of the If statement. Specifies the value the rule uses to determine whether the If statement is true. The example contains a literal value of 50000. You can also reference an object from the dictionary. If you reference an object, then the rule uses the value that the object contains at run time to make the comparison.

  3. Action. Specifies how to add your target to the dictionary. You can specify a variety of actions. Assert New means to add a new fact to the dictionary.

    A fact is transactional data that the rule uses, such as the items on a sales order.

    • An object stores this data. You reference the object when you create a rule.

    • Order Management provides a hierarchy of facts according to the transactional data for the sales order in each dictionary.

    • Each object instance corresponds to a single fact.

    • You must assert each fact before you can use it in a rule. Assert makes the fact available so you can reference it elsewhere in the rule, such as in the properties of the Target.

  4. Target. Specifies the object that the rule modifies when the If statement evaluates to true. In this example, if extendedAmount is more than 50000, then the rule will assert the Result object as a fact into the DooSeededOrchestrationRules dictionary.

  5. Edit Properties. Specifies the properties of the target. If the rule evaluates the If statement to true, then the rule modifies the values of the properties of the target according to how set up these values. Here's the code that this example uses for the properties.

    ( resultObj:DooSeededOrchestrationRules.Boolean.TRUE )

    where

    • resultObj is a property of the Result fact that the target specifies.

    • Boolean is a variable in the DooSeededOrchestrationRules dictionary.

    • TRUE specifies to set the Boolean variable to TRUE.

    The Then statement sets the resultObj property of the Result fact to TRUE. This example is a branching condition, so the orchestration process examines the value of resultObj at run time. If it contains TRUE, then the process runs the branch that makes sure a representative phones the customer.

Migrate Business Rules in Order Management

Migrate your business rules across different instances of Order Management Cloud. For example, migrate business rules from your test environment to your production environment.

Here are the types of rules you can migrate.

  • Approval

  • External interface routing

  • Pretransformation

  • Posttransformation

  • Transformation

  • Product transformation

  • Process assignment

Note.

  • Business rules that you add to an orchestration process are part of the orchestration process definition. You use the Functional Setup Manager to export these definitions from one environment and to import them into another environment.

  • In most situations, an upgrade or patch won't affect your rules, with these exceptions.

    • The upgrade or patch might overwrite modifications you make to a predefined rule or decision table.

    • The upgrade or patch might change rule behavior, and this change might affect the behavior of your business rules.

Migrate business rules in Order Management.

  1. Make sure the source environment and the target environment are on the same release.

    You can't migrate rules across different releases. To get your rules into a new release, upgrade the source environment so its on the same release as the target environment, then migrate your rules.

  2. Make sure each of your rule specifies attribute values that exist.

    Example Rule Description

    Assume you create rule in Oracle Business Rules.

    If Business Unit equals "203", then set FulfillOrdID to "207"

    If Business Unit 203 or FulfillOrdID 207 doesn't exist in your target environment, then the migration will fail. To avoid this error, make sure these entities exist in your target environment.

    Assume you create a rule in Visual Information Builder.

    If Business Unit equals "Vision Operations" then set Warehouse to "Singapore Distribution"

    If Business Unit Vision Operations or Warehouse Singapore Distribution doesn't exist in your target environment, then the migration will fail. To avoid this error, make sure these entities exist in your target environment.

  3. Make sure each rule operation that uses Starts with or Contains includes the full attribute value or ID value.

  4. For each attribute that your rule references in the source environment, make sure you also set up each of these attributes in the target environment.

    For example, if a rule in your source environment references the Primary Salesperson attribute, then make sure the target environment also includes Primary Salesperson.

  5. Make sure none of the rules you're about to migrate contain errors.

    • Test each rule in the source instance.

    • Make sure your rules specify values that use the same data type, and that the attribute can contain the data type.

    • The migration examines each rule in the source that you specify to migrate. If any of these rules contain an error, then the migration will fail.

  6. Make sure the rules you migrate replace the functionality that rules in your target environment requires.

    Migration deletes all rules in the target environment before it does the migration, including rules you don't set up in the source. For example, if the target includes rules x, y, and z, and if the source includes rules x and y, then the migration deletes rules x, y, and z from the target, then copies rules x and y from the source to the target. If the target depends on rule z, then copy rule z to the source before you do the migration.

  7. Make sure you release each rule you must migrate.

    If you create a business rule in the source environment but don't release it, then the migration won't migrate the rule. Migration only migrates rules you save and release.

  8. If your rule references an extensible flexfield, then make sure you set up each of flexfield in the same way in the source environment and in the target environment.

    The Manage Configuration Packages page doesn't examine your extensible flexfield setup. You must manually examine your setup.

  9. Migrate your rules.

    • In the Navigator, click Setup and Maintenance.

    • On the Setup page, click Tasks > Manage Configuration Packages.

    • On the Manage Configuration Packages page, search for your configuration package.

    • In the search results, click the row that includes your configuration package, then click Export Setup Data.

    • On the Export Setup Data page, click Next > Submit.

      The Setup and Maintenance work area exports business rules from your source environment and imports them into your target environment.

Oracle Business Rules

Use the Business Rules Editor

Use an editor to edit Oracle Business Rules.

For a generic demonstration of how to create a rule, see the Demo for Creating Business Rules topic.

Summary of the Steps

  1. Access the rule editor.

  2. Add the If statement.

  3. Add the Then statement.

Access the Rule Editor

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

    • Offering: Order Management

    • Functional Area: Orders

  2. Open one of these pages.

    • Manage Orchestration Process Definitions

    • Manage Product Transformation Rules

    The page you access depends on the set up you must do. For this example, you modify an orchestration process definition, so open Manage Orchestration Process Definitions.

  3. Access the rule editor.

    You access the rule editor in different ways, depending on the page you use. For this example, you click Add to Rule in the Pause Rule column on the step of an orchestration process. For an example, see the Pause Orchestration Processes Until Events Occur topic.

Add the If Statement

You will create this statement.

part of a business rule

Do it.

  1. Click the magnifying glass (Left Value) to access the Condition Browser.

    The Condition Browser displays objects that come predefined in the dictionary. It also displays objects that you assert into the dictionary while you create your rule.

    The browser filters the items it displays according to where you access it. This behavior helps make sure you only choose objects that make sense in the context where you access the browser. For example, here's the dictionaries that the browser displays when you create a start-after condition.

    part of a business rule
  2. Expand the DooSeededOrchestrationRules dictionary.

    The browser displays the objects that this dictionary contains, including facts, variables, and so on.

    part of a business rule

    You usually use only some of the objects that are available in the dictionary. For example, here are the objects you typically use in the DooSeededOrchestrationRules dictionary.

    • Result

    • Date

    • Timestamp

    • DOOHeader

    • SacResult

    • DOOFLine

    Get assistance from Oracle to use other objects or other dictionaries.

  3. In DooSeededOrchestrationRules, expand DOOFLine, then notice the attributes. These attributes display on the order fulfillment line in the Order Management work area.

    part of a business rule

    where

    Browser Text Description

    DOOFLine

    Fact in the DooSeededOrchestrationRules dictionary

    DOO

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

    FLine

    Abbreviation for fulfillment line.

    billToCustomerId

    Fulfillment line attribute. This attribute stores an identification number for the customer. Its the same number that displays in the Order Management work area.

    toString

    Includes conversions you can make on the attribute.

    A sales order uses the demandClassCode attribute to allow you to classify the customer. Assume your rule must examine the value of demandClassCode, so scroll down, click demandClassCode, then click OK.

    part of a business rule

    The rule editor adds the attribute to the statement.

    part of a business rule
  4. Click Right Value (the magnifying glass) to access the Condition Browser.

    part of a business rule

    The Right Value window specifies the value that the If statement uses to determine whether its True. Similar to Left Value, you can expand DooSeededOrchestrationRules to access objects in the dictionary. You can also specify a string.

    For this example, enter "GOLD" in the window, then click OK. You must enclose the string with double quotation marks.

    part of a business rule

Add the Then Statement

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

    part of a business rule

    Choose an action. For this example, you will assert the Then statement as a new fact into the dictionary.

    Action Description

    Assert

    Add a fact into the dictionary.

    You can also reassert an object. A reassert updates the dictionary so it reflects the new state of the object whether or not you changed the object.

    Reassert doesn't create a fact. If your rule requires more than one fact for a fact type, then you must assert each of these facts as a separate object.

    Assert New

    Add a new fact into the dictionary.

    Assign

    Assign a value to a variable in the dictionary.

    Call

    Call a function from the dictionary.

    Modify

    Modify a data value that's associated with a matched fact in the dictionary.

    Retract

    Remove a fact from the dictionary.

    Other Actions

    Advanced mode displays more actions, but you don't use most of them. For details, see How to Use Advanced Mode Action Forms in Oracle Fusion Middleware User's Guide for Oracle Business Rules.

  2. Click Select a Target.

    part of a business rule

    The target specifies the object this rule will modify if it evaluates to true.

    For this example, select object SacResult, where sac means start after condition. The rule will modify this value.

    part of a business rule
  3. Click Edit Properties.

    part of a business rule

    If you click Edit Properties, the rules editor gets the properties of the object that you selected as the target, then displays them in the Properties dialog. In this example, it displays the properties of SacResult.

    part of a business rule
  4. In the reevaluateFlag row, in the Value column, enter "N". You must include the double quotation marks.

    Each target contains a different set of properties, so you must set them differently depending on your business requirements. In this example, reevaluateFlag specifies to evaluate the result of the start after condition again after the rule runs. You don't want this reevaluation, so set reevaluateFlag to N.

  5. In the Value column, click Value (the magnifying glass).

    Use the sacType property to specify the action to take when the If statement evaluates to true. In this example, you must pause the orchestration process while it waits for an event to occur. The EVENT pause type causes the orchestration process to pause, so you set sacType. For details about setting properties for the start after condition, see the Use Holds to Pause Orchestration Processes topic.

    part of a business rule
  6. In the Condition Browser, expand DooSeededOrchestrationRules > SacResult, click SAC_TYPE_EVENT, then click OK.

    part of a business rule
  7. Verify that the Properties dialog displays your settings, then click OK.

    part of a business rule

    Notice that the Then area displays a string representation of the properties you set. Use this string to quickly assess the action the rule will do. Here's the complete business rule.

    part of a business rule

Use Advanced Mode and Tree Mode in Business Rules

Use advanced mode in a business rule to set priority, set variables, define collections, and so on.

  • Set the rule priority when you must process more than one rule.

  • Set the variable name for an object so the rule can compare two instances of an object or so you can create a hierarchical relationship.

  • Set up collections of objects in one business rule.

  • Use complex rule logic, such as If Then Else, or more than one If statement.

  • Use Tree Mode to maintain the object hierarchy.

Use Advanced Mode

Here's the top part of a rule that uses Advanced Mode.

 top part of a business rule uses Advanced Mode

Here are the attributes that are available in the rule header when you use Advanced Mode.

Attribute Description

Effective Date

Determines when the business rule is available to use.

Priority

Determines when to run each rule when you create a set of rules.

  • You use Priority only rarely.

  • Priority isn't an absolute value because Order Management might run a rule more than one time in a single session. Also, input values to the rule might change, and the sequence that Order Management uses to activate them might also affect priority.

  • You can't use Priority across more than one set of rules.

Active

Makes the business rule available for use.

If Active doesn't contain a check mark, then Order Management doesn't include it during validation, even if Order Management previously released it as an active rule.

For examples that use Advanced Mode, see the Get Data from Product Information Management topic.

Use Tree Mode

A business rule uses facts to evaluate rules at run time.

  • The business rule uses the data model from Order Management to identify each fact it must use.

  • A fact doesn't include data that resides outside of Order Management.

  • Use facts for transformation, process assignment, and external interface routing according to business components in Oracle Application Development Framework (ADF), specifically view objects (VO) that expose the data model.

  • View objects provide a hierarchical view of transactional data, such as a sales order. However, each business rule converts them into rule language (RL) facts. Facts in rule language don't include a hierarchy. You don't need to manage rule language facts, but this conversion might affect how you create your rule.

  • If the fact is a business component in Application Development Framework, and if your rule uses more than one object type, then you must make sure your rule reestablishes the view object (VO) hierarchy. Reestablishing the hierarchy makes sure each rule performs at an optimal level.

Properties of Business Component Facts in the Application Development Framework

Property Description

ViewRowImpl

References a row in a view object. You use ViewRowImpl to access a row in a database table.

You typically specify this property in the result. Its required in a transformation rule. Its optional for other business rules.

The Business Components for Java framework instantiates an object of ViewRowImpl for each record that the view object query returns for the row.

key_values

References the oracle.rules.sdk2.decisionpoint.KeyChain object. You can use this property to get the set of key values for this row and the parent rows of this row. This property is optional.

You can use Advanced Mode with an explicit join to reestablish the hierarchy. You can also use Tree Mode to more clearly represent the hierarchy in the rule editor.

Maintain the Object Hierarchy

You must maintain the object hierarchy when you use advanced mode or tree mode.

Advanced Mode Advanced Mode and Tree Mode

If you use only Advanced Mode, and if the If statements and Then statements in your rule will process a public view object on the sales order, then your rule must make sure it joins each public view object so it accurately represents the sales order hierarchy. For example.

  • Join the header public view object with the line public view object.

  • Join the line public view object with the fulfillment line in the public view object.

  • And so on.

If you use Advanced Mode and Tree Mode, then you can select objects in the existing hierarchy, such as Header, Line, and FulfillLine.

If you use an extensible flexfield, then you might need to create more joins.

Note.

  • If you use Tree Mode, then also use Advanced Mode because Advanced Mode helps you to maintain the hierarchy.

  • If you use only Advanced Mode to maintain the object hierarchy, then you must explicitly specify the hierarchy. For an example, see the Get Data from Product Information Management topic.

  • If you use Tree Mode to set the root of an object hierarchy, then the rules editor displays objects only at the root level or below the root level while you create the rule. This filtering helps to make sure you correctly maintain the object hierarchy.

  • Tree Mode uses the forward slash (/) to indicate hierarchy.

For an example that uses Tree Mode to maintain the object hierarchy and that uses the forward slash, see the Use Extensible Flexfields in Line-Selection Rules topic.

Use Decision Tables and Bucket Sets in Business Rules

Use a decision table to create a set of IF statements displayed as a table. If your set up must analyze more than one combination of attribute values, then the decision table is more compact and intuitive to use than a number of individual IF statements.

The decision table doesn't require you to use all If statements and Then statements in every rule.

See these topics for examples that use a decision table and bucket set.

  • Create Transformation Rules

  • Assign Orchestration Processes

For background details about decision tables, see Working with Decision Tables in Oracle Fusion Middleware User's Guide for Oracle Business Rules.

Here's an example that uses a decision table. It labels each If statement as a Condition and each Then statement as an Action.

example of a decision table

Use Bucket Sets

A bucket is a container that sets up a list of values or a range of values that the If statement uses to determine whether its true.

A bucket set is a container you can use to hold the overall range of values that a group of buckets defines. Use it to constrain the values that the If statement and the facts in a decision table will consider.

Assume you create a Colors bucket set that includes string values of red and purple. You can write a rule for each color. You can also write one rule for blue and another rule for purple.

how a business rule uses a bucket set

In another example, assume you create a Numbers bucket set that uses integers instead of strings. You can then create buckets in the Numbers bucket set. Here's the buckets.

  • Less than 1

  • 1 to 10

  • Greater than 10

You can't add a bucket set to a fact.

You can create a bucket set that specifies aliases for data that might be difficult to recognize, such as identification numbers. You can use the toString() function in the If statement to convert the value from the Long data type to a String alias, such as a product code. In this set up, the bucket set maps each identification number to the product code.

Here's an example bucket set that chunks ranges of values into a large, a medium, and a small bucket.

example that specifies ranges of values into a large,
a medium, and a small bucket

Ways to Define a Bucket Set

Way Description

Create a local list of values or a list of ranges.

Create the bucket set in the decision table.

Manually create a global bucket set.

Create the bucket set in a product transformation rule, then select bucket set values from a list of values for each decision table that the rule page displays.

The list of values only includes values that match the data type you're setting up. For example, assume you set up one bucket set that includes numeric values, another bucket set that includes text values, then add an If statement that examines numeric data. The list of values in the If statement will display values only from the bucket set that contains numeric data.

Automatically create a global bucket set.

Use the Generate Bucket Sets scheduled process to create a bucket set from transactional data.

Use Predefined Bucket Sets

Predefined Bucket Sets Predefined Bucket Sets

ORAAccountingRules

ORAInvoicingRules

ORACurrencies

ORAShipmentPriority

ORADemandClasses

ORAFreightTerms

ORAFOB

ORAReceiptMethods

ORAModeOfTransport

ORAConversionType

ORAPaymentTerms

ORACarrier

ORASalesCreditTypes

ORASupplier

ORAServiceLevel

ORASupplierSite

ORATaxClassificationCodes

ORAReturnReason

ORATaxExemptionReason

ORACancelReason

ORAUOM

ORAReturnReason

ORAWarehouses

Not applicable

Refresh Data in Bucket Sets

To keep each bucket set up to date with data in the entities that the bucket set references, set the Refresh Collected Data option to Yes on the Generate Bucket Sets scheduled process.

setting option Refresh Collected Data to Yes on scheduled
process Generate Bucket Sets

Calculate Dates in Business Rules

You can calculate a date in a business rule.

  • A business rule doesn't come predefined with functions that do date arithmetic, such as Scheduled Ship Date minus 1.

  • To avoid data type and object hierarchy problems, you can't use a business rule to do date arithmetic with a fact. However, you can create a rule that does date arithmetic in an orchestration process.

  • A date attribute use the time stamp data type.

Here's an example that uses an If statement to set up fline as the alias for the fulfillment line. It compares the time of the scheduled ship date to the current date, and uses milliseconds in the comparison conversion.

If fline.scheduleShipDate.time>=CurrentDate.date.timeInMillis

In another example, here's some code that calculates the scheduled arrival date to occur three days after the current date.

If fline.scheduleArivalDate.time>= CurrentDate.date.timeInMillis+3*24*60*60*1000

where

  • 3 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.

Here's a dialog that sets up a business rule for the line selection criteria in an orchestration process.

business rule for the line selection criteria in an
orchestration process

Note.

Rule Part Code

If the requested arrival date occurs earlier than three days after the current date, then skip this step.

DooSeededOrchestrationRules.DOOFLine.requestArrivalDate.time more than CurrentDate.date.timeInMillis+3*24*60*60*1000

Action

Assert New

DooSeededOrchestrationRules.Result(DooSeededOrchestrationRules.DOOFLine.fulfillLineId)

If you use this kind of calculation in the THEN clause, then make sure your rule doesn't modify or overwrite the original value. You might need to assign a temporary variable to hold the calculation before your rule populates the result object.

Create Temporary Variables

Use a Timestamp object to create a temporary variable, such as to provide an offset to a data attribute. For example, three days before the scheduled ship date. The Assign New action instantiates the variable, provides an alias, and sets the initial value.

Here's an example of a lead time expression in a business rule on an orchestration process. fline represents the fulfillment line object and DateTime represents the temporary variable.

Action Code

Assign New

DooSeededOrchestrationRules.Timestamp DateTime = fline.scheduleShipDate

Modify

DateTime(time:DateTime.time-(2*24*60*60*1000))

Assert New

DooSeededOrchestrationRules.Result(resultObj:DateTime)

Use Date Functions in Advanced Mode

Function Example

before(Timestamp|java.util.Date)

If fline.RequestArrivalDate.before(fline.ScheduleArrivalDate) is true

after(Timestamp|java.util.Date)

If fline.RequestArrivalDate.after(fline.ScheduleArrivalDate) is true

compareTo(Object|Timestamp|java.util.Date)

If fline.RequestArrivalDate.compareTo(fline.ScheduleArrivalDate) is -1

equals(Object|Timestamp)

If fline.RequestArrivalDate.equals(fline.ScheduleArrivalDate) is true

Note.

  • Use these functions for each attribute that's a Timestamp data type, including a temporary variable that you declare with the Timestamp object.

  • You can manually enter the function after you select the attribute. You can also open the Expression Builder, click the Functions tab, then open the folder next to the date attribute.

  • The format for each function, except compareTo, is true or false, and this format doesn't require quotation marks.

  • Here's the format that compareTo uses.

    • -1. The object to the left of compareTo occurs before the object to the right of compareTo.

    • 0. The object to the left of compareTo occurs at the same time as the object to the right of compareTo.

    • 1. The object to the left of compareTo occurs after the object to the right of compareTo.

Manage Errors and Conflicts in Business Rules

Manage errors and conflicts that might occur with your business rule.

Manage Errors

Each business rule validates your syntax when you save your rule. It displays errors in the error pane at the bottom of the page or dialog.

  • Click Validate to validate your rule before you save it.

  • Click the arrow on the bottom right corner of the page or dialog to examine the error.

  • Double-click an error message to open the rule that contains the error and to automatically highlight the object that the error affects.

For example.

rule that Manages Errors and Conflicts

Manage Conflicts

Each business rule provides conflict management for your decision tables.

  • The business rule displays conflicts between the If statement and the Then statement.

  • You can use the exclamation point (!) on the tool bar to toggle visibility of the conflict.

  • The business rule identifies each rule that the conflict affects, including rules that depend on a conflicted rule. For example, if rule A is conflicted, and if Rule B depends on Rule A, then Rule B also displays as conflicted.

  • An icon on the decision table toolbar identifies a missing set up in your business rule. For example, if you add bucket set elements but don't use them in your rule, then the page displays an icon.

  • The page might display the rules you must add to correct the set up. You can select a rule to add it to your set up, but you aren't required to select them. Instead, you can create a different rule to correct the set up.

    This feature is useful when you create a bucket set that includes a large number of values. Each bucket set allows you to choose Otherwise when it isn't necessary to individually specify each selection.

Here's an example where a new rule is in conflict with three other rules.

new rule that's in conflict with three other rules

Demo for Creating Business Rules

Watch video

Watch: This video tutorial illustrates how to create a business rule in Order Management Cloud. It creates a pause task rule that coordinates the fulfillment lines of a sales order that Order Management runs in different orchestration processes.

Functions You Can Use in Business Rules

Use a function in your business rule to get details or to do a calculation.

Here are the functions you can use in a product transformation, orchestration process assignment, or external interface routing rule. You can't use them on an orchestration process.

Attribute Description

ModifyEntity

Modify an entity.

Use this function with a pretransformation rule, transformation rule, or posttransformation rule.

Use these arguments.

  • attrName(String)

  • attrValue(Object)

  • viewRowImpl(oracle.jbo.server.ViewRowImpl)

Note.

  • If you don't use the list of values to set attrName(), then you must enclose the attribute that you provide with quotation marks.

  • The name of the attribute is the required data type, not the value of the attribute at run time.

  • Make sure your rule populates the ModifyEntity arguments when your rule uses them to do an action.

  • ModifyEntity behavior is different from the Modify action you use on menus on the Manage Product Transformation Rules page.

AddNewOrderLine

Add an order line to a sales order.

Use this function only with a transformation rule.

Use these arguments.

  • newItemId(Long)

  • viewRowImpl(oracle.jbo.server.ViewRowImpl)

DeleteOrderLine

Delete an order line from a sales order.

Use this function only with a transformation rule.

Arguments.

  • fulfillmentLineId(Long)

  • viewRowImpl(oracle.jbo.server.ViewRowImpl)

For example.

  • Delete fulfillment line 1 and fulfillment line 2

Note that viewRowImpl(oracle.jbo.server.ViewRowImpl) represents the current object instance. For example, a fulfillment line record.

Functions You Can Use with Rules On an Orchestration Process

Use these functions in a rule that you create on an orchestration process. You can't use them with product transformation, orchestration process assignment, or external interface routing.

These functions work at the attribute level. You can find them on the Functions tab of the Expression Builder dialog as the first entries under each object.

You can also use predefined date functions on each date attribute.

Date Functions You Can Use On an Orchestration Process

Function Description

getAdjustedDate(Timestamp, Double)

Add or subtract the value of argument Double (in days) from the Timestamp argument, depending on the sign, and then return the result in the Timestamp argument.

subtractFromDate(Timestamp, Timestamp)

Subtract the value of the second Timestamp argument from the first Timestamp argument.

If the second Timestamp argument is empty, then subtractFromDate subtracts the current date from the first Timestamp argument.

subtractFromDate returns the number of days as a BigDecimal() value.

getConvertedDate(Object)

Convert a type of date object in the datetime data type.

current_date

Get the system date as a datetime data type.

Change Management Functions You Can Use On an Orchestration Process

Function Description

hasChanges()

Determine whether extensible flexfield values in the change order are different from values that the previous version of the sales order contains.

getAttribute(String)

Get the name of an attribute.

Use getAttribute on the order header, fulfillment line, orchestration process, or task.

getTransactionalAttribute(String)

Get the name of a transactional attribute.

You can use getTransactionalAttribute only on a fulfillment line.

getFlexContext(String)

Gets the name of the extensible flexfield context.

Use getFlexContext only on a fulfillment line.

You can also use these functions. You must prefix the attribute name with an underscore (_), and you must enclose the attribute name in quotation marks.

Function Description

attributeChanged(String)

Determine whether the value of an attribute in the change order is different from the value that the previous version of the sales order contains.

Use it on the order header, fulfillment line, or extensible flexfield context.

getFlexAttributeValue(String)

Get the value of an extensible flexfield attribute of data type String.

Use it only on an extensible flexfield context.

getFlexAttributeDateValue(String)

Gets the value of an extensible flexfield attribute of data type Date in time stamp format.

Use it only on an extensible flexfield context.

getFlexAttributeNumValue(String)

Get the value of an extensible flexfield attribute of data type Number.

Use it only on an extensible flexfield context.

For details about using a business rule with an extensible flexfield, see the Use Extensible Flexfields with Order Management topic.

Example of Choosing a Function

Use the Functions tab in the Expression Builder dialog to get a list of arguments you can use. For example, with method getFlexAttributeDateValue.

tab Functions in dialog Expression Builder

Visual Information Builder

Use Visual Information Builder

Use a drag-and-drop interface to create a business rule. Visualize data, visualize your business processes, and implement business logic.

Examine the Behavior of a Predefined Rule

Observe how the rule editor establishes a condition.

  • If task type is shipment, then set the connector to Connect to Oracle Fusion Shipping System

Do it.

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

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage External Integration Routing Rules for Sales Orders

  2. On the Manage External Interface Routing Rules page, notice the predefined routing rules.

    Use this page to.

    • Activate or inactivate a rule.

    • Create a new rule.

    • Change the rule priority.

    • View, modify, duplicate, or delete a rule.

    • Publish active rules.

  3. Right-click Shipping Task Routing, then click Actions > Edit.

  4. Click IF, then notice the phrase Task Type is Equal to Shipment.

  5. Click DO, then notice the phrase Set Connector Name, Connector Name: Connect to Oracle Fusion Shipping System.

  6. Click Close.

Limitations

  • You can't use a decision table. If you created a rule in an earlier version of Order Management that uses a decision table, and if you prefer to use Visual Information Builder to replace this rule, then use the IF-THEN-ELSE structure in Visual Information Builder to replace the decision table. For an example, see the Manage Process Assignment Rules topic.

  • Don't use Visual Information Builder and Oracle Business Rules at the same time in the same implementation. Use Visual Information Builder or Oracle Business Rules for all your rules.

  • You can't create a global variable for use in a rule.

  • You can't create collections of objects in conditions.

  • Don't reference an object that includes the text _Obsolete when you create your rule. _Obsolete indicates that business rules might no longer support the object in the current or future release.

Use Visual Information Builder to create routing rules.

Assume you must create a routing rule.

  • If the task type is Compliance Check, and if the compliance value is less than 100, then set the connector to ComplianceCheckConnector, and set the interface type to SDO.

Here's the rule you will create.

the rule you will create.

Summary of the Steps

  1. Create the If statement.

  2. Create the Then statement.

  3. Activate and publish your rule.

This topic includes example values. You might use different values, depending on your business requirements.

Create the If Statement

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

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage External Integration Routing Rules for Sales Orders

  2. On the Manage External Interface Routing Rules page, click Create New Rule.

  3. Set values.

    Attribute Value

    Name

    Routing Rule for Compliance Check

    Description

    Route sales orders according to results of the compliance check.

  4. Name the If statement so it describes the meaning of the condition.

    • In the If area, click Enter Description.

    • In the Enter Description dialog, enter Task Type = Compliance Check and Compliance Value Is Less Than 100, then click OK.

  5. Click New Condition (the dashed circle in the IF area).

  6. In the Create Condition dialog, enter Task, wait a moment, then click Task Type (Order Header).

    Notice that the dialog displays suggestions when you wait after you finish typing.

  7. In the Create Condition dialog, click Search.

  8. In the Search dialog, enter Compliance, then click Search.

  9. Choose Compliance Check, click OK > OK.

    Notice that area IF displays the condition.

    • Task Type is Equal to Compliance Check

  10. Click AND.

  11. In the Create Condition dialog, enter Compli, then wait a moment.

    Notice that the dialog displays a number of attributes, such as Compliance Date (Header Compliance Details). Extensible flexfields that you set up on the order header provide values for these attributes. The order header displays them as attributes in the Order Management work area.

  12. Click Compliance Value (Header Compliance Details).

  13. Change the operator from = (equal), to < (less than).

  14. Change the value from 0.0, to 100, then click OK.

    Notice that the IF area displays the condition.

    • Task Type is equal to Compliance Check AND Compliance Value < 100

Create the THEN Statement

  1. Click THEN > DO.

  2. Name the DO so it reflects the meaning of the action.

    • In the DO area, click Enter Description.

    • In the Enter Description dialog, enter Set connector to ComplianceCheckConnector and interface type to SDO, then click OK.

  3. Click New Action (the dashed circle in the DO area), then click Perform an Action.

  4. In the Create Action dialog, set the action to Set Connector Name, then click Search.

  5. In the Search dialog, enter %Compli%, then click Search.

    The percentage symbols (%) are wildcards that search for all values before and after the text Compli. This search returns services that the Manage Connector Details page contains, and that contain the text Compli.

  6. In the Description area, click Compliance check system conn. . ., then click OK.

  7. In the Create Action dialog, click OK.

  8. In the DO area, click AND > Perform an Action.

  9. In the Create Action dialog, set the action to Set Interaction Interface Type.

  10. Set Interaction Interface Type to SDO.

    If you are a new customer, then you must set Interaction Interface Type to SDO for any interaction interface that you set up. Use EBM only for backward compatibility to a prior release.

  11. Click Save and Close.

Activate and Publish Your Rule

  1. On the Manage External Interface Routing Rules page, notice that the Active indicator for the Routing Rule for Compliance Check rule is grey.

  2. Right-click Routing Rule for Compliance Check, then click Actions > Edit.

  3. In the Routing Rule for Compliance Check dialog, add a check mark to the Activate Rule option, then click Save and Close.

    Notice that the Active indicator for Routing Rule for Compliance Check is green.

  4. Click Publish.

    Order Management publishes each of the rules that are active on the Manage External Interface Routing Rules page.

Use Visual Information Builder to manage a pretransformation rule that sets the default value of an attribute according to the value of another attribute.

You will create a pretransformation rule.

  • If order type is Government, then set warehouse to Denver Manufacturing.

For example.

If order type is Government, then set warehouse
to Denver Manufacturing

Summary of the Steps

  1. Create the If statement.

  2. Create the Then statement.

  3. Activate and publish your rule.

This topic includes example values. You might use different values, depending on your business requirements.

Create the If Statement

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

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Pretransformation Rules for Sales Orders

  2. On the Manage Pretransformation Defaulting Rules page, click Create New Rule.

  3. Set values.

    Attribute Value

    Name

    Pretransformation Default Rule for Warehouse

    Description

    Use warehouse Denver Manufacturing for government sales orders.

  4. Name the If statement so it describes the meaning of the condition.

    • Click Enter Description.

    • In the Enter Description dialog, enter Order Type = Government, then click OK.

  5. Click New Condition (the dashed circle in the IF area).

  6. In the Create Condition dialog, enter order type, wait a moment, then click Order Type (Order Header).

    Notice that the dialog displays suggestions when you wait after you finish typing.

  7. Accept the is equal to condition, set order type to Government, then click OK.

    The IF area displays the condition.

    • Order Type is equal to Government

  8. Click And.

  9. In the Create Condition dialog, enter ware, wait a moment, then click Warehouse (Order Fulfill Line).

  10. Change = to Is Blank, then click OK.

    The IF area displays the condition.

    • Warehouse is blank

      Make sure the attribute you set in a pretransformation rule is empty before you set the value. This test helps to make sure the rule doesn't evaluate or change a value that the rule or the Order Entry Specialist already set.

Create the THEN Statement

  1. Click THEN > DO.

  2. Name the DO so it describes the meaning of the action.

    • Click Enter Description.

    • In the Enter Description dialog, enter Set warehouse to Denver, then click OK.

  3. Click New Action (the dashed circle in the DO area).

  4. In the Create Action dialog, enter ware, wait a moment, then choose Warehouse (Order Fulfill Line).

  5. In the Create Action dialog, click Search.

  6. In the Search dialog, enter Denver, then click Search.

  7. Under Warehouse Name, click Denver Manufacturing, then click OK.

  8. In the Create Action dialog, click OK.

    The DO area displays the condition.

    • Warehouse is set to Denver Manufacturing

  9. Click Save and Close.

Activate and Publish Your Rule

  1. On the Manage External Interface Routing Rules page, notice that the Active indicator for the Pretransformation Default Rule for Warehouse rule is grey.

  2. Right-click Pretransformation Default Rule for Warehouse, then click Actions > Edit.

  3. In the Pretransformation Default Rule for Warehouse dialog, add a check mark to the Activate Rule option, then click Save and Close.

    Notice that the Active indicator for the Pretransformation Default Rule for Warehouse rule is green.

  4. Click Publish.

    Order Management publishes each of the rules that are active on the Manage Pretransformation Defaulting Rules page.

A More Complex Example

Add more complexity to your rule. For example, allow your fulfillment system to use one carrier for large source orders you create in your legacy system, and another carrier for all other sales orders.

  • If the source system is a legacy system, and if the quantity is more than 1,000, and then use carrier Fedex, else use carrier UPS.

In your shipping environment, assume you typically use Fedex (Federal Express) to deliver small to medium size packages, and you use UPS (United Parcel Service) to deliver large packages.

You can add the OR, ELSE, THEN, and AND conditions to meet your business requirements.

adding the OR, ELSE, THEN, and AND conditions

Assign an orchestration process according to different conditions.

For example, assign different orchestration processes to handle source orders that Order Management receives from different source systems, assign them differently depending on whether the order is a new sales order or a return, or assign them depending on the value of an attribute, such as the line type is a credit.

You will create a rule.

diagram of business rules

Summary of the Steps

  1. Create the routing rule and the first If condition.

  2. Create the Then for the first If.

  3. Create the second If.

  4. Create the Then for the Second If.

  5. Create the third If.

  6. Create the Then for the Third If.

  7. Create the Do that assigns the orchestration process when receiving returns for credit.

  8. Create the Do that assigns the orchestration process for all other returns.

  9. Create the Do that assigns the orchestration process for all other sales orders.

  10. Activate and publish your rule.

This topic includes example values that demonstrate how you can use Visual Information Builder to create a complex process assignment rule. You might use different values, depending on your business requirements.

Part One

Create the Routing Rule and First IF Condition

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

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Process Assignment Rules for Sales Orders

  2. On the Manage Orchestration Process Assignment Rules page, click Create New Rule.

  3. Change the rule name.

    Current Name New Name

    New Rule

    Default Process Assignment Rule

  4. Name the If statement so it reflects the meaning of the condition.

    • Click Enter Description.

    • In the Enter Description dialog, enter source system = BM-CPQ, then click OK.

      This IF statement looks for source orders that are coming in from one channel in an integration, named BM-CPQ (Big Machines - Configure, Price, and Quote).

  5. In the Attributes tab, in the Search field, enter Source order, then wait a moment.

    Notice that the dialog displays suggestions when you wait after you finish typing.

  6. Click Source Order System (Order Header).

    Notice that the object hierarchy in the Attributes tab highlights the attribute that the search results returned, such as Source Order System.

  7. Drag the Source Order System attribute from the Attributes tab, then drop it onto the area IF.

  8. In the Create Condition dialog that displays after you release the mouse button, accept is equal to as the condition, then, in the list that displays immediately below is equal to, click the down arrow.

    Notice that the list displays the source systems that are set up for this deployment.

  9. Set the source system to BM_CPQ, then click OK.

    Notice that the IF area now displays a condition.

    • Source Order System is equal to BM_CPQ

Create the THEN for the First IF

  1. Click THEN > DO.

  2. Name the DO so it reflects the meaning of the action.

    • Click Enter Description.

    • In the Enter Description dialog, enter Set process name to DOO_Billonly, then click OK.

  3. Click New Action (the dashed circle in the DO area), then click Perform an Action.

  4. In the Create Action dialog, enter process name, wait a moment, click Process Name (Order Fulfill Line), then click Search.

  5. In the Search dialog, enter DOO_Bill, then click Search.

  6. In the ProcessName area, click DOO_BillonlyGenericProcess, then click OK.

  7. In the Create Action dialog, click OK.

    Notice that the DO area now displays text.

    • Process Name is set to DOO_BillonlyGenericProcess

  8. Click Save.

Create the Second IF

  1. Below the IF area, click ELSE > IF.

  2. Name the If statement so it describes the meaning of the condition.

    • In the IF area, click Enter Description.

    • In the Enter Description dialog, enter category = ORDER, then click OK.

  3. In the Attributes tab, notice that the object hierarchy displays as a navigation tree, then browse through the tree.

    • Click Attributes > Order Header.

    • In the Order Header branch, click Order Line.

    • In the Order Line branch, click Order Fulfill Line.

    • In the Order Fulfill Line branch, click Category.

    • Drag attribute Category from the Attributes tab, then drop it onto the IF area.

  4. In the Attributes tab, browse through the object hierarchy.

  5. In the Create Condition dialog that displays, notice that the condition defaults to Category is equal to Order, then click OK.

Create the THEN for the Second IF

  1. In the area to the right of condition IF category = ORDER, click THEN > DO.

  2. Name the DO so it describes the meaning of the action.

    • Click Enter Description.

    • In the Enter Description dialog, enter Set process name to DOO_GenericFulfillmentProcess, then click OK.

  3. Click New Action (the dashed circle in the DO area), then click Perform an Action.

  4. In the Create Action dialog, enter process name, wait a moment, click Process Name (Order Fulfill Line), then click Search.

  5. In the Search dialog, enter DOO_, then click Search.

  6. In the ProcessName area, click DOO_OrderFulfillmentGenericProcess, then click OK.

  7. In the Create Action dialog, click OK.

    Notice that the DO area displays text.

    • Process Name is set to DOO_OrderFulfillmentGenericProcess

  8. Click Save.

Create the Third IF

Assign the orchestration process to use when handling a return.

  1. Below the IF category = ORDER area, click ELSE > IF.

  2. Name the If statement so it describes the meaning of the condition.

    • Click Enter Description.

    • In the Enter Description dialog, enter category = RETURN, then click OK.

  3. Click New Condition (the dashed circle in the IF area).

  4. In the Create Condition dialog, enter category, wait a moment, then click Category (Order Fulfill Line).

  5. Set the condition to is equal to Return goods, then click OK.

    Notice that the IF area now displays text.

    Category is equal to Return goods

Create the THEN for the Third IF

Returns for different types of fulfillment lines might require Order Management to use different fulfillment processing. In this example, you set up the rule to consider only returns for credit.

  • If Line Type isn't empty, and if Line type is equal to Return for credit

Do it.

  1. In the area to the right of condition IF category = RETURN, click THEN > IF.

  2. Name the IF so it describes the meaning of the action.

    • Click Enter Description.

    • In the Enter Description dialog, enter line type = credit only, then click OK.

  3. Click New Condition (the dashed circle in the IF area).

  4. In the Create Condition dialog, enter line type, wait a moment, then click Line Type (Order Fulfill Line).

  5. Set up the rule to handle an empty line type value.

    • Set the operator to is blank, then click OK.

      Its important to include a condition that can handle a situation where the value of the line type is empty. If you don't create this condition, then the rule might fail and cause an error.

      Notice that the IF area displays text.

      Line Type is blank

    • In the upper right corner of the Line Type is Blank area, click Select (the circle with the solid line), then wait for it to display a blue check mark.

    • In the upper left corner of the page, next to the trash can, click Group.

      Notice that the IF Line Type = Credit Only area now displays the This Condition is True area around the Line Type is Blank area. This grouping is equivalent to adding parenthesis inside your statement.

      In this example, you group Line Type is Blank to test whether this statement is true or false. To group a set of statements, you select each statement, then click Group.

    • Click true.

      Notice that true changes to false. In this example, when you run the rule, you must make sure the line type is blank condition is false because you want Order Management to assign the orchestration process only if the line type contains a value.

  6. In the IF line type = credit only area, click the AND that resides outside of the this condition is false area.

    rule for this condition is false
  7. In the Create Condition dialog, enter line type, wait a moment, then click Line Type (Order Fulfill Line).

  8. Set the condition to is equal to Return for credit, then click OK.

    Notice that the IF area now displays text.

    • Line type is equal to Return for credit

  9. Click Save.

Part Two

Create the DO That Assigns the Orchestration Process When Receiving Returns for Credit

  1. In the area to the right of condition IF line type = credit only, click THEN > DO.

  2. Name the DO so it describes the meaning of the action.

    • In the DO area, click Enter Description.

    • In the Enter Description dialog, enter Set process to BillOnly, then click OK.

  3. Click New Action (the dashed circle in the DO area).

  4. In the Create Action dialog, enter process name, wait a moment, click Process Name (Order Fulfill Line), then click Search.

  5. In the Search dialog, enter %Bill%, then click Search.

    The percentage symbols (%) are wildcards that search for all values before and after the text Bill. This search returns orchestration process names that contain the text Bill.

  6. In the ProcessName area, click DOO_BillOnlyGenericProcess, then click OK.

  7. In the Create Action dialog, click OK.

    Notice that area DO displays text.

    • Process Name is set to DOO_BillOnlyGenericProcess

Create the DO That Assigns the Orchestration Process for All Other Returns

  1. Immediately below the IF line type = credit only condition , click ELSE > DO

  2. Name the DO so it describes the meaning of the action.

    • In the DO area, click Enter Description.

    • In the Enter Description dialog, enter Set process to Return Process, then click OK.

  3. Click New Action (the dashed circle in the DO area).

  4. In the Create Action dialog, enter process name, wait a moment, click Process Name (Order Fulfill Line), then click Search.

  5. In the Search dialog, enter %Return%, then click Search.

  6. In the ProcessName area, click ReturnOrderGenericProcess, then click OK.

  7. In the Create Action dialog, click OK.

    Notice that the DO area displays text.

    • Process Name is set to ReturnOrderGenericProcess

  8. Click Save.

Create the DO That Assigns the Orchestration Process for All Other Sales Orders

Assign the orchestration process to use for the sales orders that don't meet the other IF conditions.

  1. Immediately below the IF category = RETURN condition, click ELSE > DO.

  2. Name the DO so it describes the meaning of the action.

    • In the DO area, click Enter Description.

    • In the Enter Description dialog, enter Set process to ShipOrder Generic, then click OK.

  3. Click New Action (the dashed circle in the DO area).

  4. In the Create Action dialog, enter process name, wait a moment, click Process Name (Order Fulfill Line), then click Search.

  5. In the Search dialog, enter Ship, then click Search.

  6. In the ProcessName area, click ShipOrderGenericProcess, then click OK.

  7. In the Create Action dialog, click OK.

    Notice that the DO area displays text.

    • Process Name is set to ShipOrderGenericProcess

  8. Click Save.

Activate and Publish Your Rule

  1. On the Manage Orchestration Process Assignment Rules page, notice that the Active indicator for the Default Process Assignment Rule rule is grey.

  2. Right-click Default Process Assignment Rule, then click Actions > Edit.

  3. In the Default Process Assignment Rule dialog, add a check mark to option Activate Rule, then click Save and Close.

    Notice that the Active indicator for the Default Process Assignment Rule rule is green.

  4. Click Publish.

    Order Management publishes each of the rules that are active on the Manage Orchestration Process Assignment Rules page.