Building a ruleflow
A task model must contain at least one ruleflow in order to be executed. A default
ruleflow is created automatically when you create a task model. You can create other ruleflows as
well. To create a ruleflow, click the Add ruleflow
button in the
task model toolbar.
When you click a ruleflow in the Artifacts tab, it opens in preview mode. The preview mode allows you to see the details of each node of ruleflow and easily access the artifacts it contains. You must click Open ruleflow to be able to edit a ruleflow.
The following diagram shows the main parts of a ruleflow:
- Start node

- Task nodes

- Transition

- End node


Start and end nodes
A start node and an end node are graphical markers for the start and end of a ruleflow. Every ruleflow has one start node and at least one end node.
You can specify actions to be executed at the start and end nodes. For example, you can define an action on the start node to reset the data used in the ruleflow. Actions defined for an end node also apply to any other end nodes in the ruleflow.
Task nodes
Between the start node and the end node, a ruleflow is made of task nodes that are linked by transitions. The task nodes contain the instructions for what to execute and in what order.
The following types of task node are available:
Rule task node-
A rule task node contains a set of rules to be executed at that point in the ruleflow.
Depending on how the execution properties of a rule task are set, the rules might execute in order, or following a more complex logic.
Action task node
-
An action task node contains action statement to be executed. You define the actions of an action task in the same way that you define actions in business rules.
Function task node- A function task node references another model to be executed. The referenced model can be any task model, decision model, or predictive model contained in the decision service.
Subflow task node-
A subflow task node references another ruleflow to be executed. The referenced ruleflow can be any other ruleflow in the task model.
Transitions
Transitions connect task nodes in a ruleflow and define the sequence of the ruleflow from one task node to another. Transitions are unidirectional and can have associated conditions.
These conditions determine whether a transition is part of the execution flow. For example, with the following condition on the transition between the validation and eligibility model tasks, the eligibility task can be performed only when the data is validated, otherwise the ruleflow ends.

Two types of elements can be added to a ruleflow to organize transitions: branches and forks. Branches allow you to organize conditional transitions, in the same way that you could start several conditional transitions from a task node. Forks allow you to create multiple, parallel paths in your ruleflow, if you need to execute rules simultaneously.
Initial and final actions
You can define initial actions and final actions on tasks. Initial actions apply before a task is processed and final actions apply after a task is processed. The execution sequence of a task node consists of execute its initial actions, then its body, and then its final actions.
You define initial and final actions in the same way as you define actions for an action task.
Initial and final actions are not mandatory and you can use them independently of each other.