Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Nov 7, 2023
1 parent 7dade95 commit cff92e7
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/user_guide/event_processors/event_combine.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ processors:
debug: false
```
### Conditional Execution of Subprocessors
The workflow for processing event messages can include multiple subprocessors, each potentially governed by its own condition. These conditions are defined using the jq query language, enabling dynamic and precise control over when each subprocessor should be executed.
### Defining Conditions for Subprocessors
When configuring your subprocessors, you have the option to attach a jq-based condition to each one. The specified condition acts as a gatekeeper, determining whether the corresponding subprocessor should be activated for a particular event message.
### Condition Evaluation Process
For a subprocessor to run, the following criteria must be met:
Condition Presence: If a condition is specified for the subprocessor, it must be evaluated.
Condition Outcome: The result of the jq condition evaluation must be true.
Combined Conditions: In scenarios where both the main processor and the subprocessor have associated conditions, both conditions must independently evaluate to true for the subprocessor to be triggered.
Only when all relevant conditions are met will the subprocessor execute its designated operations on the event message.
It is important to note that the absence of a condition is equivalent to a condition that always evaluates to true. Thus, if no condition is provided for a subprocessor, it will execute as long as the main processor's condition (if any) is met.
By using conditional execution, you can build sophisticated and efficient event message processing workflows that react dynamically to the content of the messages.
### Examples
In the below example, we define 3 regular processors and 2 `event-combine` processors.
Expand Down Expand Up @@ -68,7 +92,7 @@ processors:
pipeline2:
event-combine:
processors:
- condition: '.tags[\"subscription-name\"] == \"sub2\"'
- condition: '.tags["subscription-name"] == "sub2"'
name: proc2
- name: proc3
```

0 comments on commit cff92e7

Please sign in to comment.