ThresholdActor

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.

Creating a ThresholdActor

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.

Example

{
  "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.

Trigger

The ThresholdActor only does useful work if the trigger is connected.

Emit

The ThresholdActor emits the received JSON when the value is at least the threshold. Otherwise, nothing is emitted.

State

The ThresholdActor does not keep state.

Collect

The ThresholdActor does not collect state from other actors.

Timer

The ThresholdActor does not provide timer actions.