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.

Examine examples that use Advanced Mode. For details, see Get Data from Product Information Management.

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 routing rules 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. View an example. For details, see Get Data from Product Information Management.

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

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