...
Code Block | ||||
---|---|---|---|---|
| ||||
with <var> = <expr> [[and] <var> = <expr>]* |
Any variable in a modifier clause is used (with its associated value) as an event parameter.
...
Code Block | ||||
---|---|---|---|---|
| ||||
raise explicit event "foo" with a = "hello" and b = 4 + x; | ||||
Info | ||||
| ||||
In the node pico engine, the modifier clause has this form (note, no "and"): with <var> = <expr> [ <var> = <expr> ]* making the example
|
Attributes Clause
The attributes
clause also allows the developer to add event attributes to the event. The expression that follows the attributes
key word must evaluate to a map. The keys and values in the map will be used as event attributes. This is particularly useful when you want to pass through all, or most, of the attributes that the current rule received:
...
Code Block | ||||
---|---|---|---|---|
| ||||
raise explicit event "foo" with a = "hello" and b = 4 + x and _api = "sky"; |
Like any other postlude statement, explicit events can be guarded:
Code Block | ||||
---|---|---|---|---|
| ||||
raise explicit event "foo" with a = "hello" and b = 4 + x if (flipper == "two"); |
...