| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > functiontask |
functiontask |
PREVIOUS NEXT |
The keyword used to declare a function task. This keyword is used at the top level of the ruleset.
functiontask functionTaskName
{
[property propertyName = value;]
[initialaction {action1 ... actionm}]
[finalaction {action1 ... actionn}]
[completionflag = value;]
body {ruleflow}
};
A function task is one of the three kinds of tasks available in a ruleflow. A function task defines a ruleflow function.
| Notes |
|
true, then the task is completed; its final actions, if any, are executed, and the ruleflow execution continues. If the Boolean value returns false, the task is suspended: its final actions are not executed, the ruleflow execution is suspended, and the program returns to the caller of the ruleflow execution. When the ruleflow is executed again, it starts from this suspended task.
functiontask UpdateDistance
{
body =
{
int x = move.x;
int y = move.y;
for (var i = y + 1; i < 10; i++)
{
int p = grid.position(x,i);
if (p == null) break;
p.distance--;
update(p);
}
}
};
This example defines a function task whose body is the code given between the braced brackets. This code is executed when the task is called to be executed in a ruleflow.
If initial actions are provided, they are executed before the task body. If final actions are defined, they are executed after the task body.
body (in Function Task), flowtask, ruletask
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |