Create new thought process with optional validate and action functions. Presence of branches in options determines how middleware will execute. Without middleware option, will the middleware of same name as the thought. Create new thought process with optional validate and action functions. Presence of branches in options determines how middleware will execute. Without middleware option, will the middleware of same name as the thought.
Call validate, execute middleware, possibly branches, then action.
Will not enter process with empty branches or if state done
is true.
Without branches, execute middleware, resolve on completion.
With branches, process each branch or until state done
is true.
Action will be called with the boolean success of the process.
Process succeeds if middleware completed or branches were matched.
If process succeeds, timestamp is added to state.
Generated using TypeDoc
Defines a process to wrap execution of middleware of the same name. Validators can prevent a process from running. Actions can effect the state before the next process validates.