Author:
Fluent Commerce
Changed on:
29 Aug 2025
Secondly, avoid duplicating logic within a workflow.Don't duplicate logic unnecessarily within the workflow—this makes it harder to maintain and may result in unexpected differences in behavior between the different tasks. The workflow should be readable and simple.Example: Avoid having more than one Change of State action for each state.
Finally, you must always use the SetState rule (from the Core Reference Module plugin) to change the state of an entity. Use the SetState rule to change status, as this will ensure that the workflow engine can track the state change and update the context appropriately. If any status changes are made via direct mutation, the workflow engine would not know about this change, which may result in incorrect ruleset matching logic during event execution.Lastly, even if you are able to change the state of an entity via a mutation from another rule, it is recommended that you never do this, as it would mean that the state change logic would be hidden inside the Java code, where no one knows it exists.