A collection of states to chain onto.
A Chain has a start and zero or more chainable ends. If there are zero ends, calling next() on the Chain will fail.
|end||The chainable end state(s) of this chain.|
|id||Identify this Chain.|
|start||The start state of this chain.|
The chainable end state(s) of this chain.
Identify this Chain.
The start state of this chain.
|next(next)||Continue normal execution with the given state.|
|to||Return a single state that encompasses all states in the chain.|
|static custom(startState, endStates, lastAdded)||Make a Chain with specific start and end states, and a last-added Chainable.|
|static sequence(start, next)||Make a Chain with the start from one chain and the ends from another.|
|static start(state)||Begin a new Chain from one chainable.|
public next(next: IChainable): Chain
Continue normal execution with the given state.
Single State(id, props?)
public toSingleState(id: string, props?: ParallelProps): Parallel
Return a single state that encompasses all states in the chain.
This can be used to add error handling to a sequence of states.
Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$'.
static custom(startState, endStates, lastAdded)
public static custom(startState: State, endStates: Array<INextable>, lastAdded: IChainable): Chain
Make a Chain with specific start and end states, and a last-added Chainable.
static sequence(start, next)
public static sequence(start: IChainable, next: IChainable): Chain
Make a Chain with the start from one chain and the ends from another.
public static start(state: IChainable): Chain
Begin a new Chain from one chainable.