Conditional Process Runs

Set conditions when to run a digital process and its steps.

For every step of your digital process, you can add a condition that would be used by the process context to decide whether the particular step should be processed or not. You can set up a filter or a rule that serves as conditional logic for the step. All of the conditions are evaluated by the Decision Engine to affect the process.

It's possible to add conditional logic to every process step and to triggers that serve as mid-process triggers in your digital process. However, it's not possible to add logic to a start trigger, which is the first step of the whole process. Whenever you have conditional logic applied to a step, you can check the condition in the debugger and evaluate the outcome of its execution or non-execution.

Filters

Filters allow a step to only act on a selected event type. It is possible to add more than one filter for the same step. If you set filters for specific event types within a step, it means that the digital process step will run only if the conditions of the filter are met. If they are not met, the process step is skipped. Filters use the event types that are configured for your OE tenant.

To open the filter settings window:

  1. Choose Add Logic in a chosen process step, it opens a window with a visible Filter tab.

  2. Choose an Event Type from the drop-down list. The list shows event types that are configured for the tenant and available for the scenario context. It's possible to select multiple event types at one time.

  3. Choose the IN or AND event matching.

  • IN - means the condition passes if the event type matches at least one of the selected events from the list. The bahavior is based on matching any of these events.

  • AND - means the condition passes only if the event type matches all the events selected in the list, the events accumulate across steps. The behavior is based on matching every event in this list.

For example:

If you select IN with welcome_pack_completion_event and registration_event selected, the filter passes if either one happens. If you select AND with the same list, the filter only passes once both events happen.

Decisions

Decisions work on the level of evaluating whether an action should be taken or not. It means, they allow setting up a condition for the step that is evaluated on a true / false logic.

To open the decision window choose Add Logic in a chosen process step and go to the Decision tab.

JSON Logic

For the decisions, we use the JSON logic expression language and extend it with custom operators. The JSON logic expression can be either a direct expression placed in the field, or it can refer to a rule created in the Rulestore.

Custom operators:

  • businessRule - References a rule defined in the rulestore.

    The first expected value is the ID for the rule that you want to use, and the others are the variables that should be available for the referenced business rule. These variables are indicated as value pairs.

    • Rulestore

    // ID: "01ARZ3NDEKTSV4RRFFQ69G5FAV"
    {"==": [{"var": "a"}, {"var": "b"}]}
    • Logic

    {"businessRule": ["01ARZ3NDEKTSV4RRFFQ69G5FAV", ["a", 1], ["b", {"var": "n"}]]}
    • Data

    {"n": 1}
    • Result

    true
  • context - This is used to access a dynamic value inside the process context in a way similar to the var operator. If access to a dotted key is needed, the dotted key should be quoted with backquotes (`).

    • Logic

    {"context":  "`key.with.dots`.boolean"}
    • Process Context

    {"key.with.dots": {"boolean": true}}
    • Result

    true

Extended behavior:

  • var - Inside a digital process the data means the context with the parent key.

    For example if the process context is:

    {"event": {"key": "value"}}

    Then, the data for the JSON logic expression would be:

    {"context":  {"event": {"key": "value"}}}

    Dotted keys must be backquoted to work.

    • Logic

    {"var":  "context.`key.with.dots`.boolean"}
    • Process Context

    {"key.with.dots": {"boolean": true}}
    • Result

    true
  • To learn about the rules creation in OE, see the Rulestore documentation.

  • For the full list of JsonLogic operators, see the JsonLogic guide.

Last updated

Was this helpful?