Constructor
new Engine()
Creates a new Engine instance.
Members
_bpmn
The description of the process that is deployed to this engine instance
callActivityExecutors :Object
The engines in which we intend to execute the call activities, maps from the id of the call activity to the corresponding engine
Type:
- Object
definitionId :string
The name of the file the process description is taken from before being executed in this module
Type:
- string
importDefinitionId
The definitionId for the process description of the imported process executed in this module
instanceIDs :Array.<string>
The globally known IDs for the instances created within this BPMN process
Type:
- Array.<string>
machineInformation :object
id, ip and name of this machine
Type:
- object
processID :string
The ID of the process for this Engine instance
Type:
- string
userTasks :Array.<object>
The user tasks when encountered in a process instance and awaiting handling.
Type:
- Array.<object>
Methods
abortUserTask(instanceID, userTaskID)
Signals the user task as aborted to the corresponding process instance, which is responsible.
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | The id of the process instance to be notified |
userTaskID |
string | The id of the user task |
completeUserTask(instanceID, userTaskID, variables)
Signals the user task as completed to the corresponding process instance, which is responsible.
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | The id of the process instance to be notified |
userTaskID |
string | The id of the user task |
variables |
object | The updated process variables |
deleteInstance(instanceID)
Deletes the instance with the given id
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | id of the instance to be deleted |
(async) deployProcess(definitionId, importDefinitionId)
Deploys the process to the NeoBPMN Engine making it ready to start instances
Parameters:
Name | Type | Description |
---|---|---|
definitionId |
string | The name of the file of the (main) process (as stored in the |
importDefinitionId |
string | -optional-- the definitionId under which we can find the imported process definition we want to start here module) |
getInstance(instanceID) → {object}
Returns the instance with the given id
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | id of the instance we want to get |
Returns:
- the requested process instance
- Type
- object
insertToken(instance)
Continues an token coming from another machine by inserting the token in the running instance on this engine
Parameters:
Name | Type | Description |
---|---|---|
instance |
Object | the instance object coming from another machine we want to continue |
(async) pauseInstance(instanceID)
Pauses an instance
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | id of the instance we want to pause |
setFlowNodeProgress(instanceID, tokenId, progress)
Sets the current progress of a flowNode running at given token (mainly used for usertasks)
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | The id of the process instance to be notified |
tokenId |
string | The id of the token |
progress |
number | The current progress of a flow node |
startProcess(processVariables, instance, onStarted, onEnded, onTokenEnded)
Starts the execution of a BPMN process. This can involve the creation of
multiple instances of the process, if the process contains such events.
When encountering User Tasks in the ongoing execution, they are added to
the userTasks
array property.
Parameters:
Name | Type | Description |
---|---|---|
processVariables |
object | The process variables in the init state |
instance |
object | string | contains the instance object that came from another engine to be contiued here (might contain only an id of an activity to start) |
onStarted |
function | function that is executed when the new instance starts |
onEnded |
function | function that is executed when the new instance ends |
onTokenEnded |
function | function that is executed when a token ends its execution |
(async) stopInstance(instanceID)
Stops instance
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
string | id of the instance we want to stop |
(async) stopUnfulfilledInstance(instanceID, unfulfilledConstraints)
Stop every token of this instance due to unfulfilled constraints
Parameters:
Name | Type | Description |
---|---|---|
instanceID |
String | ID of process instance |
unfulfilledConstraints |
Array | List of unfulfilled constraints |