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

The Node object which encapsulates one node in a given flow

Link to this section Summary

Functions

Wrapper function to bump the count of the node using our metrics subsystem

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

If the node has a router component, and the flow has enabled us to fix other/no response pathways, do the needful for that node

Wrapper function to abort and clean things up when we detect an infinite loop

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

Validate a node and all its children

Link to this section Types

@type t() :: %Glific.Flows.Node{
  actions: [Glific.Flows.Action.t()] | [],
  exits: [Glific.Flows.Exit.t()] | [],
  flow: Glific.Flows.Flow.t() | nil,
  flow_id: non_neg_integer() | nil,
  flow_uuid: Ecto.UUID.t() | nil,
  id: term(),
  is_terminal: boolean() | false,
  router: Glific.Flows.Router.t() | nil,
  uuid: Ecto.UUID.t() | nil
}

Link to this section Functions

Link to this function

bump_count(node, context)

View Source
@spec bump_count(t(), Glific.Flows.FlowContext.t()) :: any()

Wrapper function to bump the count of the node using our metrics subsystem

Link to this function

execute(node, context, messages)

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

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

Link to this function

fix_node(node, flow, uuid_map)

View Source
@spec fix_node(t(), Glific.Flows.Flow.t(), map()) :: {t(), map()}

If the node has a router component, and the flow has enabled us to fix other/no response pathways, do the needful for that node

Link to this function

infinite_loop(context, body)

View Source
@spec infinite_loop(Glific.Flows.FlowContext.t(), String.t()) :: {:ok, map(), any()}

Wrapper function to abort and clean things up when we detect an infinite loop

Link to this function

process(json, uuid_map, flow)

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

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

Link to this function

validate(node, errors, flow)

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

Validate a node and all its children