Task 4: Setting a condition on a transition

You learn how to control the ruleflow from task to task using conditions, and create the Else transition.

About this task

In this task, you define different paths within the ruleflow by setting a condition on the transition between the eligibility and pricing rule tasks, and creating an Else transition to cover cases when the condition is not met. You can define several transitions from a single task, and give each transition different conditions. When you set a transition condition, you must always define an alternate transition or an Else transition with no condition.

The condition is based on the ruleset parameter rental, which is defined in the rule project properties for this tutorial, and verbalized as the current rental agreement.

Procedure

  1. In the ruleflow diagram, click the line for the transition between eligibility and pricing.
  2. In the Properties view for the transition, click Condition, and then set the label to rental agreement accepted.
  3. Make sure that Use BAL for transition condition is selected.
    In the editing area, type:
    'the current rental agreement' is accepted
    

    This condition specifies that if the ruleset parameter rental is returned as accepted, the path follows the transition to the pricing rule task.

  4. Whenever you set a transition condition, you must create an Else transition to follow when the condition is not met.

    Create a transition from the eligibility task to the end node.

    The else label is added automatically.

  5. In the Ruleflow Editor toolbar, click Layout All Nodes button Layout All Nodes, and then save your work (Ctrl+S).

Results

The ruleflow diagram displays the condition labels.

Final version of the ruleflow.

What to do next

In the next task, you run the ruleflow.