View Source Glific.Flows.Action (Glific v5.1.6)

The Action object which encapsulates one action in a given node.

Link to this section Summary

Functions

Execute a action, given a message stream. Consume the message stream as processing occurs

Process a json structure from flow editor to the Glific data types

Validate a action and all its children

Link to this section Types

@type t() :: %Glific.Flows.Action{
  attachment_type: String.t() | nil,
  attachment_url: String.t() | nil,
  attachments: list() | nil,
  body: String.t() | nil,
  category: String.t() | nil,
  contacts: list() | nil,
  delay: integer() | 0,
  enter_flow: Glific.Flows.Flow.t() | nil,
  enter_flow_expression: String.t() | nil,
  enter_flow_name: String.t() | nil,
  enter_flow_uuid: Ecto.UUID.t() | nil,
  field: map() | nil,
  groups: list() | nil,
  headers: map() | nil,
  id: term(),
  input: String.t() | nil,
  interactive_template_expression: String.t() | nil,
  interactive_template_id: integer() | nil,
  labels: list() | nil,
  language: term(),
  method: String.t() | nil,
  name: String.t() | nil,
  node: Glific.Flows.Node.t() | nil,
  node_uuid: Ecto.UUID.t() | nil,
  params: list() | nil,
  params_count: String.t() | nil,
  profile_type: String.t() | nil,
  quick_replies: [String.t()],
  result_name: String.t() | nil,
  templating: Glific.Flows.Templating.t() | nil,
  text: String.t() | nil,
  type: String.t() | nil,
  url: String.t() | nil,
  uuid: Ecto.UUID.t() | nil,
  value: String.t() | nil,
  wait_time: integer() | nil
}

Link to this section Functions

Link to this function

execute(action, context, messages)

View Source
@spec execute(t(), Glific.Flows.FlowContext.t(), [Glific.Messages.Message.t()]) ::
  {:ok | :wait, Glific.Flows.FlowContext.t(), [Glific.Messages.Message.t()]}
  | {:error, String.t()}

Execute a action, given a message stream. Consume the message stream as processing occurs

Link to this function

process(json, uuid_map, node)

View Source
@spec process(map(), map(), Glific.Flows.Node.t()) :: {t(), map()}

Process a json structure from flow editor to the Glific data types

Link to this function

validate(action, errors, flow)

View Source
@spec validate(t(), Keyword.t(), map()) :: Keyword.t()

Validate a action and all its children