Skip to content

bpmn-server / Engine

Class: Engine#

super class for various objects that are part of the server

Hierarchy#

Engine

Implements#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new Engine(server): Engine

Parameters#

Name Type
server any

Returns#

Engine

Overrides#

ServerComponent.constructor

Defined in#

server/Engine.ts:13

Properties#

runningCounter#

runningCounter: number = 0

Defined in#

server/Engine.ts:11


callsCounter#

callsCounter: number = 0

Defined in#

server/Engine.ts:12


server#

server: any

Inherited from#

ServerComponent.server

Defined in#

server/ServerComponent.ts:9

Accessors#

configuration#

get configuration(): any

Returns#

any

Inherited from#

ServerComponent.configuration

Defined in#

server/ServerComponent.ts:14


logger#

get logger(): any

Returns#

any

Inherited from#

ServerComponent.logger

Defined in#

server/ServerComponent.ts:15


cron#

get cron(): Cron

Returns#

Cron

Inherited from#

ServerComponent.cron

Defined in#

server/ServerComponent.ts:16


cache#

get cache(): CacheManager

Returns#

CacheManager

Inherited from#

ServerComponent.cache

Defined in#

server/ServerComponent.ts:17


appDelegate#

get appDelegate(): any

Returns#

any

Inherited from#

ServerComponent.appDelegate

Defined in#

server/ServerComponent.ts:18


engine#

get engine(): IEngine

Returns#

IEngine

Inherited from#

ServerComponent.engine

Defined in#

server/ServerComponent.ts:19


dataStore#

get dataStore(): any

Returns#

any

Inherited from#

ServerComponent.dataStore

Defined in#

server/ServerComponent.ts:20


definitions#

get definitions(): any

Returns#

any

Inherited from#

ServerComponent.definitions

Defined in#

server/ServerComponent.ts:21


listener#

get listener(): any

Returns#

any

Inherited from#

ServerComponent.listener

Defined in#

server/ServerComponent.ts:22

Methods#

start#

start(name, data?, startNodeId?, userName?, options?): Promise\<Execution>

loads a definitions and start execution

Parameters#

Name Type Default value Description
name any undefined name of the process to start
data any {} input data
startNodeId string null in process has multiple start node; you need to specify which one
userName string null -
options Object {} -

Returns#

Promise\<Execution>

Implementation of#

IEngine.start

Defined in#

server/Engine.ts:25


restart#

restart(itemQuery, data, userName, options?): Promise\<Execution>

Parameters#

Name Type
itemQuery any
data any
userName any
options Object

Returns#

Promise\<Execution>

Implementation of#

IEngine.restart

Defined in#

server/Engine.ts:79


get#

get(instanceQuery): Promise\<Execution>

restores an instance into memeory or provides you access to a running instance

this will also resume execution

Parameters#

Name Type Description
instanceQuery any criteria to fetch the instance query example: jsonl { id: instanceId} { data: {caseId: 1005}} { items.id : 'abcc111322'} { items.itemKey : 'businesskey here'}

Returns#

Promise\<Execution>

Implementation of#

IEngine.get

Defined in#

server/Engine.ts:128


lock#

lock(executionId): Promise\<void>

lock instance

Parameters#

Name Type
executionId any

Returns#

Promise\<void>

Defined in#

server/Engine.ts:138


release#

release(execution): Promise\<void>

release instance lock

Parameters#

Name Type
execution Execution

Returns#

Promise\<void>

Defined in#

server/Engine.ts:147


restore#

restore(instanceId, itemId?): Promise\<Execution>

* Loads instance into memory for purpose of execution Locks instance first if required check if in cache

Parameters#

Name Type Default value
instanceId any undefined
itemId any null

Returns#

Promise\<Execution>

Defined in#

server/Engine.ts:171


invokeItem#

invokeItem(itemQuery, data?): Promise\<Execution>

Parameters#

Name Type
itemQuery any
data Object

Returns#

Promise\<Execution>

Defined in#

server/Engine.ts:203


assign#

assign(itemQuery, data?, assignment?, userName, options?): Promise\<Execution>

update an existing item that is in a wait state with an assignment can modify data or assignment or both


Parameters#

Name Type Description
itemQuery any criteria to retrieve the item
data Object
assignment Object -
userName string -
options Object -

Returns#

Promise\<Execution>

Implementation of#

IEngine.assign

Defined in#

server/Engine.ts:216


invoke#

invoke(itemQuery, data?, userName?, options?): Promise\<Execution>

Continue an existing item that is in a wait state


scenario:

itemId  {itemId: value }
itemKey     {itemKey: value}
instance,task   {instanceId: instanceId, elementId: value }

Parameters#

Name Type Default value Description
itemQuery any undefined criteria to retrieve the item
data Object {}
userName string null -
options Object {} -

Returns#

Promise\<Execution>

Implementation of#

IEngine.invoke

Defined in#

server/Engine.ts:270


startRepeatTimerEvent#

startRepeatTimerEvent(instanceId, prevItem, data?, options?): Promise\<Execution>

Repeat Timers need to create new Item

Parameters#

Name Type
instanceId any
prevItem any
data Object
options Object

Returns#

Promise\<Execution>

Implementation of#

IEngine.startRepeatTimerEvent

Defined in#

server/Engine.ts:341


startEvent#

startEvent(instanceId, elementId, data?, userName?, options?): Promise\<Execution>

Invoking an event (usually start event of a secondary process) against an existing instance or Invoking a start event (of a secondary process) against an existing instance


 instance,task

{instanceId: instanceId, elementId: value }

Parameters#

Name Type Default value
instanceId any undefined
elementId any undefined
data Object {}
userName string null
options Object {}

Returns#

Promise\<Execution>

Implementation of#

IEngine.startEvent

Defined in#

server/Engine.ts:383


throwMessage#

throwMessage(messageId, data?, matchingQuery?): Promise\<Execution>

signal/message raise a signal or throw a message

will seach for a matching event/task given the signalId/messageId

that can be againt a running instance or it may start a new instance#

Parameters#

Name Type Description
messageId any the id of the message or signal as per bpmn definition
data Object message data
matchingQuery Object -

Returns#

Promise\<Execution>

Implementation of#

IEngine.throwMessage

Defined in#

server/Engine.ts:411


throwSignal#

throwSignal(signalId, data?, matchingQuery?): Promise\<any[]>

signal/message raise a signal or throw a message

will seach for a matching event/task given the signalId/messageId

that can be againt a running instance or it may start a new instance#

Parameters#

Name Type Description
signalId any -
data Object message data
matchingQuery Object should match the itemKey (if specified)

Returns#

Promise\<any[]>

Implementation of#

IEngine.throwSignal

Defined in#

server/Engine.ts:468


exception#

exception(exc, execution): Promise\<any>

Parameters#

Name Type
exc any
execution any

Returns#

Promise\<any>

Defined in#

server/Engine.ts:515


sanitizeData#

sanitizeData(data): any

Parameters#

Name Type
data any

Returns#

any

Defined in#

server/Engine.ts:523