Authors:
Dominik Malzacher, Esma Tuzovic, Cille Schliebitz, Anita Gu
Changed on:
2 Feb 2025
In this section you will learn all about rules, including:
In this module, we return to the concept of Rules as the building blocks for the Rulesets. We’ll also cover some guidelines for designing Rules.
You are shown two different Lego configurations below, an Angel (Left) and Poseidon (Right).
Take a minute to inspect both configurations. When you're ready....scroll down to reveal how this relates to designing rules.
In the left image, the little Lego wing piece has been composed together with other pieces to form an Angel. In the right image, the same Lego piece is composed together with many other Lego pieces to form a Poseidon.
The visual analogy demonstrates how rules should be:
It also demonstrates how rulesets:
In the case of the Angel the piece portrays an angel wing, while in the case of the Poseidon the piece is composed with other instances and forms a mustache, beard, and eyebrows. This is what rules are in the workflow framework — they can be composed together with other rules in a ruleset to form a completely unique outcome.
Example: One ruleset may perform a certain task, while another ruleset composed of the same rule along with other rules performs a completely different task.
Below is an example of a Ruleset (Ruleset A) showing 4 Rules (rules 1 to 4) configured within it. It illustrates the key concepts of rules execution, specifically:
Multiple instances of a Rule are a design intention.
Each Ruleset executes in sequence for the given context or event.
Recommended practice regarding the naming convention for Rulesets
Each Ruleset should only have a single purpose, and a Ruleset that changes the state of an entity should be clearly named to reflect that purpose.
This is done so that a Workflow is easy to read and thus becomes easier to support.
The diagram on the right shows an example, as well as a non-example of this recommendation.
Key Takeaways and Best Practices
A Rule consists of two components:
Rules are meant to be:
Note: Rules do not have to always produce an Action.
When naming and defining Rulesets:
Rulesets should be of a single purpose, such as to: