Glific v0.3.1 Glific.Flows.Flow View Source
The flow object which encapsulates the complete flow as emitted by
by https://github.com/nyaruka/floweditor
Link to this section Summary
Functions
Standard changeset pattern we use for all data types
Build the context so we can execute the flow
Return a flow for a specific uuid. Cache is not present in cache
load the latest revision, specifically json definition from the flow_revision table. We return the clean definition back
Helper function to load a active flow from the database and build an object
Process a json structure from floweditor to the Glific data types
Create a subflow of an existing flow
Changeset helper for keywords
Link to this section Types
Specs
t() :: %Glific.Flows.Flow{
__meta__: Ecto.Schema.Metadata.t(),
definition: map() | nil,
flow_type: String.t() | nil,
id: non_neg_integer() | nil,
ignore_keywords: boolean() | nil,
inserted_at: :utc_datetime | nil,
keywords: [String.t()] | nil,
localization: Glific.Flows.Localization.t() | nil,
name: String.t() | nil,
nodes: [Glific.Flows.Node.t()] | nil,
organization:
Glific.Partners.Organization.t() | Ecto.Association.NotLoaded.t() | nil,
organization_id: non_neg_integer() | nil,
revisions:
[Glific.Flows.FlowRevision.t()] | Ecto.Association.NotLoaded.t() | nil,
shortcode: String.t() | nil,
updated_at: :utc_datetime | nil,
uuid: Ecto.UUID.t() | nil,
uuid_map: map() | nil,
version_number: String.t() | nil
}
Link to this section Functions
Specs
changeset(t(), map()) :: Ecto.Changeset.t()
Standard changeset pattern we use for all data types
Specs
context(t(), Glific.Contacts.Contact.t()) :: {:ok, Glific.Flows.FlowContext.t()} | {:error, String.t()}
Build the context so we can execute the flow
Specs
get_flow(Ecto.UUID.t()) :: map()
Return a flow for a specific uuid. Cache is not present in cache
Specs
load the latest revision, specifically json definition from the flow_revision table. We return the clean definition back
Specs
Helper function to load a active flow from the database and build an object
Specs
Process a json structure from floweditor to the Glific data types
Specs
start_sub_flow(Glific.Flows.FlowContext.t(), Ecto.UUID.t()) :: {:ok, Glific.Flows.FlowContext.t(), [String.t()]} | {:error, String.t()}
Create a subflow of an existing flow
Specs
validate_keywords(Ecto.Changeset.t(), []) :: Ecto.Changeset.t()
Changeset helper for keywords