Sample Rules
Intended Audience:
Technical User
Author:
Fluent Commerce
Changed on:
5 Sept 2025
Overview
The Rules SDK Maven archetype will generate 2 sample Rules into the Plugin Project.- DemoSendArbitraryEvent
- DemoAddAttributeToOrder
Key points
- DemoSendArbitraryEvent
- DemoAddAttributeToOrder
DemoSendArbitraryEvent
This simple Rule demonstrates one of the most fundamental actions for building orchestrated business logic. This rule simply sends an event, based on the`eventName` supplied as a parameter to the Rule.Sending Events from inside a Rule is how the execution of logic can move from one Ruleset to another, and provides the capability to build in complex branching and flow logic into your workflows.DemoAddAttributeToOrder
This Rule demonstrates another fundamental aspect of the Fluent Orchestration Platform. As the workflow executes on the entity, it may require additional information or data to be attached, or stored alongside it.All Fluent Entities are extendable by means of the Attributes field. Attributes are a simple structure that defines a Name (or key), a Type, and a Value.This Rule demonstrates adding a new attribute to the Order entity for which it applies.This Rule also demonstrates the use of the`accepts` parameter in the `@RuleInfo` annotation. Since the logic within the Rule can only apply to an Order, the `accepts` parameter ensures this Rule is only available to Order Workflows.