Creating a ruleflow

In the Business console, you can create, and add elements to a ruleflow. You use these elements to determine a sequence in which the rules are selected, and define which methods the rule engine uses to evaluate those rules.

About this task

You can add a ruleflow to a project, or any of its packages. After adding a ruleflow to a rule project or package, you define the structure by adding the elements that you need in the ruleflow editor.

Procedure

  1. In the Decision Artifacts tab, click Create an artifact > New Ruleflow to add a ruleflow in the project of your choice.

    In the ruleflow editor, a start node and an end node are added by default.

  2. Add elements to your ruleflow with the + button along the transitions to add a node between the elements, or under an element to create a node connected to this element. If you drag the new node to an existing node, a transition is created between them.
    Note: You are notified of errors, or elements that are incorrectly positioned, by an icon displayed inside the node.
  3. Create rule tasks, and add rules to be run at this point in the ruleflow.
    1. Add a rule task element in the editor, and click the rule task to open a window where you set its properties.
    2. Next to Uses, click Edit to add rules and packages to a rule task. You can use the arrow icons to order the rules and packages. Depending on the rule execution properties of the task, this order might impact the output of ruleflow execution.
    3. Optional: For advanced users, configure the execution of rule tasks at run time:
      • Select the rule engine algorithm, ordering, and exit criteria. For more information, see Execution properties for rule tasks.
      • Use the option Selects rules where to select rules to be run at run time, and Rule selection to define whether the runtime rule selection is static or dynamic. For more information, see Runtime rule selection.

    If you need to delete an element, select the node or transition that you want to delete, and press Delete or Backspace on your keyboard.

  4. Optional: If you need to run rule action statements, add action tasks in your ruleflow. Then, set the action statement, initial action, and final action.
  5. Configure the properties of transitions between the tasks.
    1. Select the transition, and provide a name for the condition in the Label field.
    2. Next to Conditions, click Edit.
    3. Select BAL, or IRL, and type a condition statement. For example, in BAL:
      'the current rental agreement' is accepted

      If you write the condition by using IRL, make sure the text fields contain a valid Boolean expression.

    In transition conditions, the variable scope is restricted to ruleset parameters and variables. It does not include access to the working memory.

  6. Optional: You can create multiple, parallel paths in your ruleflow, if you need to run rules simultaneously. For example, if you are checking the eligibility of a customer for a loan, you might want to check whether the customer meets the criteria for the loan, and also if the amount requested is valid. To do so, you use forks and joins in your ruleflow.
    1. Add a fork node where you want your ruleflow to run several rules in parallel. You can then add your rule tasks in the ruleflow.
    2. Add a join where you want to combine the transitions created from the fork.

    The transitions from a fork node to a join node must not have conditions, because the ruleflow follows all paths in parallel between the fork and the join.

  7. Optional: You can add branches to the ruleflow to organize conditional transitions, in the same way that you could start several conditional transitions from a task.
    Important:

    When multiple transitions originating from a branch or a task define overlapping conditions, the path taken to run the ruleflow is unpredictable. Make sure the conditions you define for multiple transitions do not overlap.

    1. Add a branch node where you want your ruleflow to organize the different conditions.
    2. To name the branch, click the branch node, and enter the name in the Label field.
    3. Add transition conditions for each transition from the branch. One of the transitions must be an Else transition.
  8. Optional: If you need to run another ruleflow at some point in your main ruleflow, add a subflow task, and click it to open the properties window. Select the ruleflow you want to run in the Subflow drop-down list.
  9. To align the ruleflow automatically, click Arrange all in the toolbar.
  10. Save the ruleflow.