Runbox.Scenario.UIAction (runbox v7.0.1)

Definition of action to be fired from UI.

In scenario list of Runbox.Scenario.UIActions is defined and stored in asset map entity. When action is fired from UI, scenario receives Toolbox.Scenario.UserAction.

Link to this section Summary

Types

t()

UI action definition.

Functions

Converts list of UI actions to actions property.

Link to this section Types

@type t() :: %Runbox.Scenario.UIAction{
  description: String.t(),
  details: map(),
  name: String.t(),
  topic: String.t(),
  type: String.t()
}

UI action definition.

Properties topic, type and details are serialized to JWT token and used for routing of fired action. Property topic is name of raw topic where fired actions are pushed, property type is type to be used in Toolbox.Message as type and property details is stored in resulting message body as details property. Properties name and description are only metadata for UI.

Link to this section Functions

Link to this function

actions(ui_actions)

@spec actions([t()]) :: {:ok, [map()]} | {:error, Joken.error_reason()}

Converts list of UI actions to actions property.

Map in resulting list contains two properties:

  • action - action (topic, type, details) encoded to JWT.
  • meta - metadata (name, description) to be used in UI.

Resulting list of maps should be stored to some entity in asset map.