3.3. Available Node Types


A rule-flow process is a flow chart that depicts different types of nodes which are linked by connections. The process itself exposes the following properties:
  • ID: this is the process' unique ID.
  • Name: this is the process' unique display name.
  • Version: this is the process' version number.
  • Package: this is the package (or name-space) in which the process is stored.
  • Variables: you can define variables to store data during the execution of your process.
  • Exception Handlers: use these specify what is expected to happen when a fault occurs in the process.
  • Connection Layouts: use these to specify what your connections are to look like on the canvas:
    • Manual always draws your connections as lines going straight from their start points to their end points (with the option to use intermediate break points).
    • Shortest path is similar, but it tries to go around any obstacles it might encounter between the start and end point, to avoid lines crossing nodes.
    • The Manhattan option draws connections using horizontal and vertical lines only.
The following types of nodes are available when creating a rule flow:

3.3.1. Start Event

This is the start of the rule flow. (A rule flow must have only one start node. It cannot have incoming connections and must have one outgoing connection.) Whenever a rule flow process is started, execution will commence at this node and automatically continue to the first node linked from it, and so on.
The Start Event node possesses the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Triggers: you can specify triggers that, when activated, will automatically start the process. Examples are a constraint trigger that automatically launches the process if a given rule or constraint is satisfied, and an event trigger that automatically starts the process if a specific event is signalled.

    Note

    You cannot yet specify these triggers in the Graphical Editor. Edit the XML file instead to add them.
  • MetaData: this is meta-data related to this node.

3.3.2. End Event

This is the end of the rule flow. A rule flow must have at least one end node. The End node must have one incoming connection and cannot have any outgoing connections.
This node possesses the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Terminate: an End node can be terminate the entire process (this is the default) or just one path. If the process is terminated, every active node (even those on parallel paths) in this rule flow is cancelled.
    Non-terminating End nodes end terminate the current path, while other parallel paths remain.
  • MetaData: this is meta-data related to this node.

3.3.3. Rule Task (or RuleFlowGroup)

Use this node to represent a set of rules you wish to have evaluated. A RuleFlowGroup node should have one incoming connection and one outgoing connection.
To make rules part of a specific rule flow group, use the ruleflow-group header attribute. When a RuleFlowGroup node is reached, the engine will start executing any rules that are part of the corresponding ruleflow-group. Execution will automatically continue to the next node once there are no more active rules in that group.
This means that you can add new activations (belonging to the currently active rule flow group) to the Agenda even if the facts have been modified by other rules.

Note

The rule flow will immediately process the next node if it encounters a rule flow group containing no active rules. If the rule flow group was already active, it will remain so and execution will only continue if every active rule has been run.
This contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • RuleFlowGroup: this is the name of the rule flow group that represents the set of rules for this node.
  • Timers: these are any timers that are linked to this node.
  • MetaData: this is meta-data related to this node.

3.3.4. Diverging Gateway (or Split)

Use this to create branches in your rule flow. A Split node must have one incoming connection and two or more outgoing connections.
There are three types of Split node:
  • AND means that the control flow will continue in all outgoing connections simultaneously.
  • XOR means that no more or less than one of the outgoing connections will be chosen. The decision is made by evaluating the constraints that are linked to each of the outgoing connections. Constraints are specified using the same syntax as the left-hand side of a rule. The constraint with the lowest priority number that evaluates to true is selected.

    Warning

    Make sure that at least one of the outgoing connections will evaluate to true at run time (the rule flow will throw an exception if there are none). For example, you could use a connection which is always true (default) with a high priority number to specify what should happen if none of the other connections can be taken.
  • OR means that all outgoing connections whose condition evaluates to true are selected. Conditions are similar to the XOR split, except that no priorities are taken into account.

    Warning

    Make sure that at least one of the outgoing connections will evaluate to true at run time (the rule flow will throw an exception if there are none). For example, you could use a connection which is always true (default) with a high priority number to specify what should happen if none of the other connections can be taken.
This node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Type: this is the node type (AND, XOR or OR.)
  • Constraints: these are the constraints linked to each of the outgoing connections (in case of an (X)OR split).
  • MetaData: this is meta-data related to this node.

3.3.5. Converging Gateway (or Join)

Use this to synchronize multiple branches. A join node must have two or more incoming connections and one outgoing connection. Four types of split are available to you:
  • AND means that it will wait until all incoming branches are completed before continuing.
  • XOR means that it continues as soon as one of its incoming branches has been completed. (If it is triggered from more than one incoming connection, it will activate the next node for each of those triggers.)
  • Discriminator means that it will continue if one of its incoming branches has been completed. Other incoming branches are registered as they complete until all connections have finished At that point, the node will be reset, so that it can be triggered again when one of its incoming branches has been completed once more.
  • n-of-m means that it continues if n of its m incoming branches have been completed. The variable n could either be hard-coded to a fixed value, or refer to a process variable that will contain the number of incoming branches for which it must wait.
This node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Type: this is the node type (AND, XOR or OR.)
  • n: this is the number of incoming connections for which it must wait (in case of a n-of-m join).
  • MetaData: this is meta-data related to this node.

3.3.6. State

this node represents a wait state. A state must have one incoming connection and one or more outgoing connections.
For each of the outgoing connections, you can specify a rule constraint to define how long the process should wait before continuing. For example, a constraint in an order entry application might specify that the process should wait until no more errors are found in the given order.
To specify a constraint, use the same syntax as you would for the left-hand side of a rule.
When it reaches this node, the engine will check the associated constraints. If one of the constraint evaluates to true directly, the flow will continue immediately. Otherwise, the flow will continue if one of the constraints is satisfied later on, for example when a fact is inserted, updated or removed from the working memory.

Note

You can also signal a state manually to make it progress to the next state, using ksession.signalEvent("signal", "name") where name should either be the name of the constraint for the connection that should be selected, or the name of the node to which you wish to move.
A state contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Constraints: use these to define when the process can leave this state and continue for each of the outgoing connections.
  • Timers: these are any timers that are linked to this node.
  • On-entry and on-exit actions: these are actions that are executed upon entry or exit of this node, respectively.
  • MetaData: this is meta-data related to this node.

3.3.7. Reusable Sub-Process (or SubFlow)

This represents the invocation of another process from within the parent process. A sub-process node must have one incoming connection and one outgoing connection.
When a SubFlow node is reached, the engine will start the process with the given ID.
This node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • ProcessId: this is the ID. of the process that is to be executed.
  • Wait for completion: if you set this property to true, the SubFlow node will only continue if it has terminated its execution (by other completing or aborting it); otherwise it will continue immediately after having started the sub-process.
  • Independent: if you set this property to true, the sub-process will start as an independent process. This means that the SubFlow process will not terminate if this it reaches an end node; otherwise the active sub-process will be cancelled on termination (or abortion) of the process.
  • On-entry and on-exit actions: these are actions that are executed upon entry or exit of this node, respectively.
  • Parameter in/out mapping: you can also define sub-flow nodes by using in- and out-mappings for variables. The value of variables in this process will be used as parameters when starting the process. The value of the variables in the sub-process will be copied to the variables of this process when the sub-process has been completed.

    Note

    You can only use out mappings when Wait for completion is set to true.
  • Timers: these are any timers that are linked to this node.
  • MetaData: this is meta-data related to this node.

3.3.8. Action (or Script Task)

This node represents an action that should be executed in this rule flow. An action node should have one incoming connection and one outgoing connection. The associated action specifies what should be executed, the dialect used for coding the action (such as Java or MVEL), and the actual action code.
This code can access any global, the predefined variable called drools referring to a KnowledgeHelper object (which can, for example, be used to retrieve the Working Memory by calling drools.getWorkingMemory()), and the variable kcontext that references the ProcessContext object. (This latter object can, for example, be used to access the current ProcessInstance or NodeInstance, and to obtain and set variables).
When the rule flow reaches an Action node, it will execute the action and then continue to the next node.
The Action node possesses the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Action: this is the action associated with the node.
  • MetaData: this is meta-data related to this node.

3.3.9. Timer Event

This node represents a timer that can trigger one or multiple times after a given period. A Timer node must have one incoming connection and one outgoing connection.
The timer delay specifies how long (in milliseconds) the timer should wait before triggering the first time. The timer period specifies the time between two subsequent triggers. A period of 0 means that the timer should only be triggered once. When the rule flow reaches a Timer node, it starts the associated timer.
The timer is cancelled if the timer node is cancelled (by, for instance, completing or aborting the process).
The Timer node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • Timer delay: this is the delay (in milliseconds) that the node should wait before triggering the first time.
  • Timer period: this is the period (in milliseconds) between two subsequent triggers. If the period is 0, the timer should only be triggered once.
  • MetaData: this is meta-data related to this node.

3.3.10. Error Event (or Fault)

Use a Fault node to signal an exceptional condition in the process. It must have one incoming connection and no outgoing connections.
When the rule flow reaches a fault node, it will throw a fault with the given name. The process will search for an appropriate exception handler that is capable of handling this kind of fault. If no fault handler is found, the process instance is aborted.
A Fault node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • FaultName: this is the name of the fault. This name is used to search for appropriate exception handlers that are capable of handling this kind of fault.
  • FaultVariable: this is the name of the variable that contains the data associated with this fault. This data is also passed on to the exception handler (if one is found).
  • MetaData: this is meta-data related to this node.

3.3.11. (Message) Event

Use this Event node to respond to internal or external events during the execution of the process. An Event node must have no incoming connections and one outgoing connection. It specifies the type of event that is expected. Whenever that type of event is detected, the node connected to this Event node is triggered.
It contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • EventType: this is the type of event that is expected.
  • VariableName: this is the name of the variable that will contain the data (if any) associated with this event.
  • Scope: you can use this node to listen to internal events only (that is, events that are signalled to this process instance directly, by using processInstance.signalEvent(String type, Object data).)
    You can define it as external, by using workingMemory.signalEvent(String type, Object event). In this case, it will also be listening to external events that are signalled to the process engine directly .
  • MetaData: this is meta-data related to this node.

3.3.12. Sub-Process (or Composite)

A Composite node is a node that can contain other nodes so that it acts as a node container. This allows not only the embedding of a part of the flow within such a Composite node, but also the definition of additional variables and exception handlers that are accessible for all nodes inside this container. A Composite node should have one incoming connection and one outgoing connection. It contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • StartNodeId: this is the ID. of the node container node that should be triggered.
  • EndNodeId: this is the ID. of the node container node that that represents the end of the flow. When this node is completed, the composite node will also complete and move to the outgoing connection. Every other node executing within this composite node will be cancelled.
  • Variables: you can add additional data storage variables.
  • Exception Handlers: use these to specify the behavior to occur when a fault is encountered.

3.3.13. Multiple Instance (or ForEach)

A ForEach node is a special composite that allows you to execute the flow contained therein multiple times, once for each element in a collection. A ForEach node must have one incoming connection and one outgoing connection.
A ForEach node awaits the completion of the embedded flow for each of the collection''s elements before continuing.
This node contains the following properties:
  • ID: this is the ID. of the node (and is unique within one node container).
  • Name: this is the node's display name.
  • StartNodeId: this is the ID. of the node container node that should be triggered.
  • EndNodeId: this is the ID. of the node container node that that represents the end of the flow. When this node is completed, the composite node will also complete and move to the outgoing connection. Every other node executing within this composite node will be cancelled.
  • CollectionExpression: this is the name of a variable that represents the collection of elements over which you will iterate. Set the collection variable to java.util.Collection.
  • VariableName: this is the name of the variable which contains the current element from the collection. This gives sub-nodes contained in the composite node access to the selected element.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat