Last updated

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 and 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.

  1. In the left navigation bar, click Automations .
  2. In the Rules engine section, click Rules engine.
  3. Click Core events or Billing events, then select an event.
    For a complete list of events and related actions, see Events.
  4. Click Rule set.
  5. Select from the following:
    • To create an automation that can stop all subsequent rules in the event list from being processed:
      1. In the top left of the page, click Rules.
      2. Click Create rule.
      3. In the Rule name field, enter a name for your rule.
      4. In the Labels field, enter a value and press enter.
        Use labels to categorize and filter your rules and binds.
      5. 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:
      1. In the top left of the page, click Binds.
      2. Click Create bind.
      3. In the Bind name field, enter a name for your bind.
  6. To specify conditions:
    1. In the Conditions section, clear the No conditions checkbox.
    2. In the Filter dropdown, select a filter.
    3. In the Operation dropdown, select a 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.
    4. In the Value field, enter or select values.
    5. Click Add filter.
  7. 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.
  8. 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.

  1. In the left navigation bar, click Automations .
  2. In the Rules engine section, click Rules engine.
  3. 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.
  4. Click an event with associated rules or binds, then click Rule set.
  5. Click Rules or Binds.
  6. 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 Clone .
    • Edit a rule or bind: On the right of the rule or bind, click Edit . Edit, then click Save.
    • Delete a rule or bind: On the right of the rule or bind, click Delete .
    • Adjust the order of rules or binds in the ruleset: on the left on a rule or bind click
    • Add a rule or bind to the ruleset: In the top right of the page, click Create rule or Create 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.

  1. In the left navigation bar, click Automations .
  2. In the Rules engine section, Rules engine.
  3. Depending on the automation you want to create, click Core events or Billing events, then click an event.
  4. Click Draft rulesets, then click Create draft ruleset.
  5. Enter a name and description for the draft ruleset.
  6. Optionally, if you have existing rules on the event, and want to replace or edit them, select the Copy current ruleset checkbox.
  7. Click Save ruleset.
  8. Select from the following:
    • To create an automation that can stop all subsequent rules in the event list from being processed:
      1. In the top left of the page, click Rules.
      2. In the top right of the page, click , then click Create rule.
      3. In the Rule name or field, enter a name for your rule.
      4. In the Labels field, enter a value and press enter.
        Use labels to categorize and filter your rules and binds.
      5. 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:
      1. In the top left of the page, click Binds.
      2. In the top right of the page, click , then click Create rule.
      3. In the Bind name or field, enter a name for your bind.
  9. To specify conditions:
    1. In the Conditions section, clear the No conditions checkbox.
    2. In the Filter dropdown, select a filter.
    3. In the Operation dropdown, select a 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.
    4. In the Value field, enter or select values.
    5. Click Add filter.
  10. In the Actions section, click Add action, then select an action.
    For a complete list of actions and how to configure them, see Actions.
  11. When you have configured the rule or bind, at the bottom of the page, click Save rule or Save bind.
  12. 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.
  13. To activate the daft ruleset, in the rules engine live, click Publish.

Edit draft rulesets

Use this process to edit draft rulesets.

  1. In the left navigation bar, click Automations .

  2. In the Rules engine section, click Rules engine.

  3. 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.

  4. Click an event with associated rule or bind, then click Draft rulesets.

  5. Select one of the following:

    • Publish a draft ruleset: On the right of the item, click Download .

    • Copy a draft ruleset: On the right of the item, click Clone .

    • Delete a draft ruleset: On the right of the item, click Delete .

    • Edit a draft ruleset:

      1. On the right of the ruleset, click Edit .
      2. Click Rules or Binds.
      3. 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
        • Edit a rule or bind in a draft ruleset: On the right of the rule or bind, click Edit . Edit, then click Save.
        • Delete a rule or bind: On the right of the rule or bind, click Delete .
        • Add a rule or bind to a daft ruleset: In the right of the page, click , then click Create rule or Create 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 top right of the page, click , then click Publish.