View Source Fountainedge (Fountainedge Workflow Engine v1.0.8)

Workflow engine.

A basic understanding of graph theory would elucidate an intuitive grasp of this package.

Link to this section Summary

Functions

Returns a list of out edge nodes that are valid transitions.

Returns a list of out edges that are valid transitions.

Transition between nodes along an edge.

Link to this section Functions

Link to this function

out_edge_nodes(workflow)

View Source

Returns a list of out edge nodes that are valid transitions.

Same as out_edges/1, but with the nodes resolved also for convenience.

@spec out_edges(Fountainedge.Workflow.t()) :: [Fountainedge.Edge.t()] | []

Returns a list of out edges that are valid transitions.

An out edge is an edge leading out of any of the current nodes.

Then pass the chosen edge into transition/2.

Link to this function

transition(workflow, edge)

View Source

Transition between nodes along an edge.

The current nodes are tracked as a state, and parallel processess are tracked using tokens.

A valid out edge must be given.

The following example will transition along the edge from node 1 to node 2, provided that it is a valid out edge given the current status of the workflow:

workflow = Fountainedge.transition(workflow, %Edge{id: 1, next: 2})