Skip to main content

Switch

Build non-linear decision models

The Switch node introduces a dynamic branching mechanism to decision models, enabling the graph to diverge based on conditions.

Switch / Branching node

Conditions are written in a Zen Expression Language. By incorporating the Switch node, decision models become more flexible and context-aware. This capability is particularly valuable in scenarios where diverse decision logic is required based on varying inputs. The Switch node efficiently manages branching within the graph, enhancing the overall complexity and realism of decision models in GoRules JDM, making it a pivotal component for crafting intelligent and adaptive systems.

info

The Switch node preserves the incoming data without modification; it forwards the entire context to the output branch(es).

HitPolicy

There are two HitPolicy options for the switch node, first and collect.

In the context of a first hit policy, the graph branches to the initial matching condition, analogous to the behavior observed in a table. Conversely, under a collect hit policy, the graph extends to all branches where conditions hold true, allowing branching to multiple paths.

info

You can change Hit Policy in the middle right corner of the switch node.

caution

If there are multiple edges from the same condition, there is no guaranteed order of execution.

Modify Switch

Adding a branch

In the Edit Graph mode you can add a new branch by pressing (+) Button on the Switch node.

info

You will need to press Apply changes on the Graph for changes to take effect.

Deleting a branch

In the Edit Graph deleting a branch is done by pressing trash can icon next to the desired condition.

info

You will need to press Apply changes on the Graph for changes to take effect.

Modifying condition

To edit branch condition select a branch on the Switch node and type expression.