Executable BPMN 2 definition. Pass moddle context and execute.
Definition constructor.
moddleContext
: Moddle context from bpmn-moddleoptions
: Optional execute options
options
: Optional execute options, defaults to constructor optionscallback
: Optional callbackerr
: Occasional errormainProcess
: Executing processprocesses
: All processes including executable process
Get process activity by id. Loops processes to return first child activity that match id.
Get activities that are in an entered state.
state
: State of definitionchildren
: List of children that are in an entered stateid
: child identered
: Boolean indicating that the child is currently executingwaiting
: Boolean indicating if the task is in a waiting state
Returns list of definiton processes with options. If the definition is running the running processes are returned.
The function is synchronous but can be passed a callback to get the first executable process.
options
: Optional execute options, defaults to constructor options if processes arn't startedvariables
services
listener
callback
: Optional callbackerr
: Occasional errormainProcess
: First executable processprocesses
: All processes including executable process
Get definition state.
state
: State of definition,pending
,running
, orcompleted
stopped
: Boolean indicating that the definition was stopped before state was accuiredmoddleContext
: Definition moddle contextprocesses
: Object with processes with id as keyvariables
: Execution variablesservices
: Execution serviceschildren
: List of child activity statesentered
: Boolean indicating if the child is currently executing
Signal an activity that is waiting.
activityId
: Activity Idmessage
: Activity input message
Returns boolean, true
if signal was approved and false
otherwise.
Stop execution.
Resume execution. Resumed with data from getState()
.
Returns resumed definition.
definitionState
: Required definition state fromgetState()
options
: Optional execute optionslistener
: Execution listener
callback
: Optional callbackerr
: Occasional errormainProcess
: Executing processprocesses
: All processes including executing process
Emitted events.
Definition started execution but not yet any processes.
All processes have completed.
A non-recoverable error has ocurred.
Arguments:
err
: The erroreventSource
: The source instance that emitted error, e.g. a task or other activitiy