Runbox.Scenario.OutputAction (runbox v7.0.1)

Output action represents a side effect produced by a run.

creating-output-actions

Creating output actions

Creating output action typically happens from scenario. It is done by creating one of the appropriate struct:

For example:

iex> %OutputAction.UpsertAssetAttributes{
...>   type: "/asset/camera",
...>   id: "one",
...>   attributes: %{"foo" => "bar"}
...> }

asset-and-edge-output-actions

Asset and edge output actions

Changes done by output actions to assets and edges are scoped for each scenario run. The global result is computed from the changes done by individual runs.

A single run is forbidden to do multiple changes to the same object (asset attribute or edge) at the same time. However distinct runs can perform such changes, because they are scoped to each run.

The rules to compute the global state apply in the following order:

  1. Change with the higher timestamp has precedence.

  2. Updating an asset attribute or an edge has precedence to deleting it.

  3. Change with the higher value has precedence (applies only for asset attributes).

Link to this section Summary

Link to this section Types