The JsonActor
(JSON transformation actor) is a Coral Actor that can transform an input JSON according to a supplied template.
The creation JSON of the JsonActor (see Coral Actor) has "type": "json"
.
The params
value is a JSON with the following field:
field | type | required | description |
---|---|---|---|
template |
JSON | yes | the template for the output |
{
"data": {
"type": "actors",
"attributes": {
"type": "json",
"params": {
"template": {
"a": "some constant text",
"b": "${referenceField}",
"c": "${ref.sub.sub[2]}",
"d": {
"e": "${ref2}",
"f": "${ref3}"
}
}
}
}
}
}
If fields are expressions the create a string field starting with a the expression (according to the coral JSON expression parser) surrounded by ${
… }
.
The JsonActor
only does useful work if the trigger is connected.
The trigger can be any JSON. The supplied JSON will be used to fill the template.
The JsonActor
emits the transformed JSON.
That is the template JSON with expressions replaced with their evaluation from the trigger input.
The JsonActor
keeps no state.
The JsonActor
does not collect state from other actors.
The JsonActor
does not provide timer actions.