Reference > Rule Languages > ILOG Rule Language > IRL Keywords > select

Summary

The keyword used to select a rule in a rule task.

Syntax

ruletask ruleTaskName 
{
    body = select(?rule) {action1 ... actionq}
};  

Description

A rule task is composed of a list of rules that compose its body. The rule list can be specified either by extension: the rule names are explicitly given, or by comprehension: the rule list is computed from the code that is given (using select or dynamicselect keywords). The given code must return a boolean value.

The difference between dynamicselect and select is in the number of times the code is evaluated. In both cases the code is evaluated when the task is first invoked.

Example

flowtask main
{
body {
  selectTask;selectTask;dynamicselectTask;dynamicselectTask;
     }
}

where selectTask and dynamicselectTask are rule tasks with a body respectively defined with a select and a dynamicselect clause. With this ruleflow, the selectTask body will be evaluated only once, and the dynamicselectTask body will be evaluated twice. If the ruleflow is executed again (after a resetRuleflow()), the selectTask body will be evaluated again.

See Also

body (in Rule Task), ruletask