Contents
bpmn-server / Engine
Class: Engine
super class for various objects that are part of the server
Hierarchy
-
ServerComponent
↳
Engine
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- start
- restart
- get
- lock
- release
- restore
- invokeItem
- assign
- invoke
- startRepeatTimerEvent
- startEvent
- throwMessage
- throwSignal
Constructors
constructor
• new Engine(server
): Engine
Parameters
Name | Type |
---|---|
server |
any |
Returns
Overrides
Defined in
Properties
server
• server: any
Inherited from
Defined in
Accessors
configuration
• get
configuration(): any
Returns
any
Inherited from
ServerComponent.configuration
Defined in
logger
• get
logger(): any
Returns
any
Inherited from
ServerComponent.logger
Defined in
cron
• get
cron(): Cron
Returns
Inherited from
ServerComponent.cron
Defined in
cache
• get
cache(): CacheManager
Returns
Inherited from
ServerComponent.cache
Defined in
appDelegate
• get
appDelegate(): any
Returns
any
Inherited from
ServerComponent.appDelegate
Defined in
engine
• get
engine(): IEngine
Returns
Inherited from
ServerComponent.engine
Defined in
dataStore
• get
dataStore(): any
Returns
any
Inherited from
ServerComponent.dataStore
Defined in
definitions
• get
definitions(): any
Returns
any
Inherited from
ServerComponent.definitions
Defined in
listener
• get
listener(): any
Returns
any
Inherited from
ServerComponent.listener
Defined in
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
Defined in
restart
▸ restart(itemQuery
, data
, userName
, options?
): Promise
<Execution
>
Parameters
Name | Type |
---|---|
itemQuery |
any |
data |
any |
userName |
any |
options |
Object |
Returns
Promise
<Execution
>
Implementation of
Defined in
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
Defined in
lock
▸ lock(executionId
): Promise
<void
>
lock instance
Parameters
Name | Type |
---|---|
executionId |
any |
Returns
Promise
<void
>
Defined in
release
▸ release(execution
): Promise
<void
>
release instance lock
Parameters
Name | Type |
---|---|
execution |
Execution |
Returns
Promise
<void
>
Defined in
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
invokeItem
▸ invokeItem(itemQuery
, data?
): Promise
<Execution
>
Parameters
Name | Type |
---|---|
itemQuery |
any |
data |
Object |
Returns
Promise
<Execution
>
Defined in
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
Defined in
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
Defined in
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
Defined in
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
Defined in
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
Defined in
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
[]>