Class: Engine

@proceed/core.Engine()

Every instance is associated with exactly one BPMN process definition and can contain multiple instances of said process.

Constructor

new Engine()

Creates a new Engine instance.

Source:

Members

_bpmn

The description of the process that is deployed to this engine instance

Source:

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
Source:

definitionId :string

The name of the file the process description is taken from before being executed in this module

Type:
  • string
Source:

importDefinitionId

The definitionId for the process description of the imported process executed in this module

Source:

instanceIDs :Array.<string>

The globally known IDs for the instances created within this BPMN process

Type:
  • Array.<string>
Source:

machineInformation :object

id, ip and name of this machine

Type:
  • object
Source:

processID :string

The ID of the process for this Engine instance

Type:
  • string
Source:

userTasks :Array.<object>

The user tasks when encountered in a process instance and awaiting handling.

Type:
  • Array.<object>
Source:

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

Source:

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

Source:

deleteInstance(instanceID)

Deletes the instance with the given id

Parameters:
Name Type Description
instanceID string

id of the instance to be deleted

Source:

(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 data)

importDefinitionId string

-optional-- the definitionId under which we can find the imported process definition we want to start here module)

Source:

getInstance(instanceID) → {object}

Returns the instance with the given id

Parameters:
Name Type Description
instanceID string

id of the instance we want to get

Source:
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

Source:

(async) pauseInstance(instanceID)

Pauses an instance

Parameters:
Name Type Description
instanceID string

id of the instance we want to pause

Source:

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

Source:

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

Source:

(async) stopInstance(instanceID)

Stops instance

Parameters:
Name Type Description
instanceID string

id of the instance we want to stop

Source:

(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

Source: