Events¶
The Events
element can be used to add PMP Events, which can be subscribed to via the API, or trigger autonomous responses.
At most 14 events can be defined per processing block.
An event can have 1 context message.
At most 4 arguments are allowed per message.
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | Events:
- Name: "MyEventWithoutContext"
Description: "Event active."
- Name: "MyEventWithoutArguments"
Description: "Event active."
Messages:
- Text: "My event text."
- Name: "MyEventWith1Argument"
Description: "Event active."
Messages:
- Text: "Values: {0}."
Arguments:
- Name: "Context0"
DataType: "Double"
- Name: "MyEventWith2Arguments"
Description: "Event active."
Messages:
- Text: "Values: {0}, {1}."
Arguments:
- Name: "Context0"
DataType: "Double"
- Name: "Context1"
DataType: "Float"
- Name: "MyEventWIth3Arguments"
Description: "Event active."
Messages:
- Text: "Values: {0}, {1}, {2}."
Arguments:
- Name: "Context0"
DataType: "Double"
- Name: "Context1"
DataType: "Float"
- Name: "Context2"
DataType: "Uint32"
- Name: "MyEventWith4Arguments"
Description: "Event active."
Messages:
- Text: "Values: {0}, {1}, {2}, {3}."
Arguments:
- Name: "Context0"
DataType: "Double"
- Name: "Context1"
DataType: "Float"
- Name: "Context2"
DataType: "Uint32"
- Name: "Context3"
DataType: "Bool"
|
YAML schema¶
1 | Events: list(include('Event'), required=False)
|
1 2 3 4 5 6 7 8 9 10 11 12 | Event:
Name: name()
Description: str(required=False)
Messages: list(include('Message'), required=False, max=1)
Message:
Text: str(required=True)
Arguments: list(include('Argument'), required=False)
Argument:
Name: name()
DataType: Enum("Uint8", "Uint16", "Uint32", "Uint64", "Int8", "Int16", "Int32", "Int64", "Float", "Double", "Bool", required=True)
|
Attribute |
Required |
Description |
---|---|---|
|
Yes |
The name of the event. Should comply with the Naming conventions. |
|
No |
The |
|
No |
The Context information of the event. Maximum of 1 message is supported. |
Attribute |
Required |
Description |
---|---|---|
|
Yes |
The text displayed when the event is triggered. 4 arguments can be added by using {0}, {1}, {2}, {3}. |
|
No |
A list of the argument names. Maximum of 4 arguments are supported. |
Attribute |
Required |
Description |
---|---|---|
|
Yes |
The name of the argument. Should comply with the Naming conventions. |
|
Yes |
The data type, supported types: “Uint8”, “Uint16”, “Uint32”, “Uint64”, “Int8”, “Int16”, “Int32”, “Int64”, “Float”, “Double”, “Bool”. |