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
@spec out_edge_nodes(Fountainedge.Workflow.t()) :: [{Fountainedge.Edge.t(), Fountainedge.Node.t(), Fountainedge.Node.t()}] | []
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
.
@spec transition(Fountainedge.Workflow.t(), Fountainedge.Edge.t()) :: Fountainedge.Workflow.t()
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})