Rules and binds
This topic describes rules, binds, and rulesets and how to use them.
In the Rebilly rules engine, an action is an operation that executes when an event occurs. Action and event conditions are defined in rules and binds. Rulesets are collections of rules and binds that are associated with an event. The order in which the rules or binds are placed within a ruleset specifies the execution order.
Rules are binds are defined as follows:
- Rules: When an event occurs, this configuration can be set to stop subsequent rules in the event list from being executed.
- Binds: When an event occurs, this configuration can be set to always execute, regardless of rule based events.
Create a rule or bind
Use this process to create a rule or bind. Once created, the rule or bind is added to a ruleset that is associated with the related event.
-
In the left navigation bar, click
Automations , then click Rules engine .
-
Click
Core events
or
Billing events
, then select an event.
For a complete list of events and related actions, see Events . - Click Rule set .
-
Select from the following:
-
To create an automation that can stop all subsequent rules in the event list from being processed:
- In the top left of the page, click Rules .
- In the Rule name field, enter a name for your rule.
-
In the
Labels
field, enter a value and press enter.
Use labels to categorize and filter your rules and binds. - Optionally, to specify that when this rule occurs, the rules engine stops subsequent rules in the event list from being processing, clear the Stop further processing checkbox.
-
To create an automation that always executes regardless of rule based events:
- In the top left of the page, click Binds .
- In the Bind name field, enter a name for your bind.
-
To create an automation that can stop all subsequent rules in the event list from being processed:
-
To specify conditions:
- In the Conditions section, clear the Match all cases checkbox.
-
In the
Select filter
dropdown, select a filter, and configure the condition.
- To use data that is shared by other rules, or to compare against a list of data: select is in list or any other list filter type, then in the next field select the related list. For more information, see Create a value list .
- To ensure that a specific field is empty, or not empty: select is empty or any other empty filter type. For more information, see Empty criteria .
- Click Add filter .
-
In the
Actions
section, click
Add action
, then select an action.
Events have specific actions associated. For a complete list of actions and how to configure them, see Actions . - When you have configured the rule or bind, at the bottom of the page, click Save rule or Save bind .
View and edit rules, binds, and rulesets
Use this process to view and edit rulesets that are associated with an event.
-
In the left navigation bar, click
Automations , then click Rules engine .
-
Click
Core events
or
Billing events
.
Events with binds or rules display the word "Binds" or "Rules" followed by the number of rules or binds associated with the event. - Click an event with associated rules or binds, then click Rule set .
- Click Rules or Binds .
-
Select from the following:
- Activate or deactivate a rule or bind in the ruleset: Turn the Status toggle on or off.
- Specify that a rule, once executed, stops all subsequent rules in the event list from being processed: Click Stops further rule processing .
-
Copy a rule or bind: On the right of the rule or binds, click
.
-
Edit a rule or bind: On the right of the rule or bind, click
. Edit, then click Save .
-
Delete a rule or bind: On the right of the rule or bind, click
.
-
Adjust the order of rules or binds in the ruleset: on the left on a rule or bind click
and drag the rule, or click
or
- Add a rule or bind to the ruleset: In the top right of the page, click Add rule or Add bind . Complete the form, then click Save .
Create a draft ruleset
Use draft rulesets to create rulesets, in draft form and compare your changes before publishing them.
-
In the left navigation bar, click
Automations .
- Click Rules engine .
- Depending on the automation you want to create, click Core events or Billing events , then click an event.
- Click Draft rulesets , then click Add draft ruleset .
- Enter a name and description for the draft ruleset.
- Optionally, if you have existing rules on the event, and want to replace or edit them, select the Copy current ruleset checkbox.
- Click Add ruleset .
-
Select from the following:
-
To create an automation that can stop all subsequent rules in the event list from being processed:
- In the top left of the page, click Rules .
- In the Rule name or field, enter a name for your rule.
-
In the
Labels
field, enter a value and press enter.
Use labels to categorize and filter your rules and binds. - Optionally, to specify that when this rule or bind occurs, the rules engine stops further processing of rules that follow this one in the event list.
-
To create an automation that always executes regardless of rule based events:
- In the top left of the page, click Rules .
- In the Bind name or field, enter a name for your bind.
-
To create an automation that can stop all subsequent rules in the event list from being processed:
-
To specify conditions:
- In the Conditions section, clear the Match all cases checkbox.
-
In the
Select filter
dropdown, select a filter, and configure the condition.
- To use data that is shared by other rules, or to compare against a list of data: select is in list or any other list filter type, then in the next field select the related list. For more information, see Create a value list .
- To ensure that a specific field is empty, or not empty: select is empty or any other empty filter type. For more information, see Empty criteria .
- Click Add filter .
-
In the
Actions
section, click
Add action
, then select an action.
For a complete list of actions and how to configure them, see Actions . - When you have configured the rule or bind, at the bottom of the page, click Save rule or Save bind .
-
When you have finished creating or editing, in the right of the page, click
, and select Publish .
If you have existing rules or binds on the event, the differences are displayed. - To activate the daft ruleset, in the rules engine live, click Publish .
Edit draft rulesets
Use this process to edit draft rulesets.
-
In the left navigation bar, click
Automations , then click Rules engine .
- Click Core events or Billing events . Events with binds or rules display the word "Binds" or "Rules" followed by the number of rules or binds associated with the event.
- Click an event with associated rule or bind, then click Draft rulesets .
-
Select one of the following:
-
Publish a draft ruleset: On the right of the item, click
.
-
Copy a draft ruleset: On the right of the item, click
.
-
Delete a draft ruleset: On the right of the item, click
.
-
Edit a draft ruleset:
-
On the right of the ruleset, click
.
- Click Rules or Binds .
-
Select from the following:
- Activate or deactivate a rule or bind in the ruleset: Turn the Status toggle on or off.
- Specify that a rule, once executed, stops all subsequent rules in the event list from being processed: Click Stops further rule processing .
-
Adjust the order of rules in the ruleset: on the left on a rule or bind click
and drag the rule, or click
or
-
Edit a rule or bind in a draft ruleset: On the right of the rule or bind, click
. Edit, then click Save .
-
Delete a rule or bind: On the right of the rule or bind, click
.
-
Add a rule or bind to a daft ruleset: In the right of the page, click
, then click Add rule or Add bind . Complete the form, then click Save .
-
Edit draft ruleset information: In the right of the page, click
, then click Edit information . Edit, then click Save .
-
Publish a draft ruleset: In the right of the page, click
.
-
On the right of the ruleset, click
-
Publish a draft ruleset: On the right of the item, click