The ThresholdActor (threshold actor) is a Coral Actor that emits the received JSON when for the specified field the associated value is at least the specified threshold.
The ThresholdActor has type: "threshold". The params value is a JSON with two fields:
| field | type | required | description |
|---|---|---|---|
key |
string | yes | the name of the threshold field in the trigger-JSON |
threshold |
number | yes | The value in the key field should be at least this before it is emitted. |
{
"type": "threshold",
"params": {
"key": "amount",
"threshold": 100
}
}This will create a threshold actor for the field amount which will only emit its trigger JSON if the “amount” field is equal to or larger than 100.
The ThresholdActor only does useful work if the trigger is connected.
The ThresholdActor emits the received JSON when the value is at least the threshold. Otherwise, nothing is emitted.
The ThresholdActor does not keep state.
The ThresholdActor does not collect state from other actors.
The ThresholdActor does not provide timer actions.