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
@spec bump_count(t(), Glific.Flows.FlowContext.t()) :: any()
Wrapper function to bump the count of the node using our metrics subsystem
@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
@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
@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
@spec process(map(), map(), Glific.Flows.Flow.t()) :: {t(), map()}
Process a json structure from flow editor to the Glific data types
Validate a node and all its children