Adding a Ruleset to your Workflow
Author:
Fluent Commerce
Changed on:
13 Dec 2023
Key Points
- Adding a Ruleset via the UI
- Adding a Ruleset via JSON
Steps
Adding a Ruleset to your Workflow
The defines the Rules that are executed when a matching is produced.
Adding a Ruleset via the UI
You can add new Rulesets via either an existing list or via the Swimlane.
The green icons represent one or more Rulesets.

Rulesets inside of the Status rectangles are triggered on that State, while those outside of a status transition the to the state in which it's line and arrow indicate.


Clicking on the green icon reveals a list of Rulesets configured within that state or transition.

Each displays a Name, the Statuses for which the applies, and a Description. In the above example, the name is Create, and the current status is Created.
The Name is required as part of the that would the to run.
Clicking on a Name brings up the details on a slide-out panel from the right-hand side of the screen.

The Edit screen has three sections:
- Triggers
- User Actions
- Rules
Each of these sections can expand or collapse by clicking on the section header.
Adding a Ruleset via JSON
To add a to a JSON, you must add a new to the `Rulesets`
Array of the Json that matches the schema outlined below.
Ruleset schema
JSON Key | Value Type | Mandatory | Description |
name | String | YES | Name of the . The name cannot contain spaces. This name is used as matching criteria for Events. |
description | String | NO | Cannot be more than 250 characters. |
type | String | NO | The being processed. |
subtype | String | NO | The |
eventType | String | NO | There are three valid types; NORMAL, EXCEPTION and GENERATED. Most eventTypes will be normal, however you can ues the EXCEPTION type for Rulesets that handle exceptions. |
rules | String | YES | The array of Rules that will be run when this is triggered |
triggers | Array | YES | A list of statuses that will this . |
userActions | Array | NO | A list of userActions in this |
Ruleset sample
1{
2 "rulesets": [
3 {
4 "name": "{{rulesetName}}",
5 "description": "",
6 "type": "{{entity}}",
7 "eventType": "{{eventType}}",
8 "subtype": "{{subtype}}",
9 "rules": [],
10 "triggers": [
11 {
12 "status": "{{statusName}}"
13 }
14 ],
15 "userActions": []
16 }
17 ]
18}