You learn the steps for defining a rule task.
About this task
To define a rule task, you do the following steps:
You define which rules you want to run as part of the eligibility rule task, and which execution mode the rule engine uses for this rule task.
You also specify a final action to do after the rule task runs.
Procedure
- Select the
eligibility rule
task in the ruleflow diagram, and in the Properties view, click Rule
Selection, and then click Edit.
- In the Select Rules dialog, select the eligibility rule
package. Use the arrow to move the package to the panel on the side,
and then click OK.
All the rules in the eligibility rule package
are now in the rule task.
- In the Properties view, click Rule Task,
and then select Fastpath for Algorithm if it
is not already selected.
The Fastpath mode is well suited
for eligibility rules because they are defined with decision tables,
and the tests in rule conditions for rules generated in decision tables
share the same pattern and order.
- In the Properties view, click Final Action,
and then select IRL and enter the following
code:
session.displayMessage(rental.toString());
Defining this final action means that after all the rules in the rule task are run, the Console
output displays a message that describes the details of the rental agreement.
-
Save your work.
Note: At the end of task 3, you fix the errors that are shown in task 2.
What to do next
In the next task of this tutorial, you define the pricing rule task, which computes rental prices for eligible customers.