mirror of
https://github.com/jwetzell/showbridge-docs.git
synced 2026-05-13 21:14:17 +00:00
add docs for filter.expr and wrapped payload stuff
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: Payload
|
||||
sidebar:
|
||||
order: 5
|
||||
---
|
||||
|
||||
[Processors](/concepts/Processors) operator on a "wrapped" version of the message produces by the module. This wrapped version is available to all processors and is defined as follows:
|
||||
- **Payload**: the actual message produced by the module (or the result of the previous [processor](/concepts/processors) in the [route](/concepts/routes)).
|
||||
- **Sender**: the network address of the module that produced the message (if applicable not all modules will have a sender address).
|
||||
- **Modules**: a map of all [modules](/concepts/modules) in the router with the module id as the key and the module instance as the value.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: Expr Filter
|
||||
sidebar:
|
||||
order: 2
|
||||
---
|
||||
The `filter.expr` processor evaluates an [Expr expression](https://expr-lang.org/playground). If the expression evaluates to true then the payload is sent through. This processor will return an error if the expression fails to evaluate.
|
||||
|
||||
- **type**: `filter.expr`
|
||||
- **params**:
|
||||
- **expression**: [Expr expression](https://expr-lang.org/playground) to evaluate. The expression has access to the [wrapped payload](/concepts/payload).
|
||||
|
||||
### Example
|
||||
Match a payload great than or equal to 0
|
||||
```
|
||||
- type: filter.expr
|
||||
params:
|
||||
pattern: "Payload >= 0"
|
||||
```
|
||||
Reference in New Issue
Block a user