Value sharing
Note
Only available with arta>=0.10.0
.
It is possible to share some informations between condition and action implementations.
It can be usefull when an action needs some data that was computed in a condition (e.g., sanity check use cases).
In the following example, a condition is computing the median of some input values and checking it. Then, the action retrieves this median value and uses it.
Two things have to be done for that:
- Add the
**kwargs
parameter in your functions' definition (validation and action functions) if not already there. - Set some new subkeys in the
input_data
key.
Set the value (in a condition for example):
Get the value (in an action for example):