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.

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

    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.

    In this example, Right Value contains:

    line.extendedAmount more than 50000

    It 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. Assign means to add assign a 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.

    DooSeededOrchestrationRules.Result.Result

    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.

    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.