bpmn-server / APIEngine
Class: APIEngine#
Hierarchy#
APIComponent
↳ APIEngine
Implements#
Table of contents#
Constructors#
Properties#
Accessors#
Methods#
- getUser
- qualify
- can
- targets
- start
- invoke
- assign
- throwMessage
- throwSignal
- startEvent
- retry
- restart
- upgrade
Constructors#
constructor#
• new APIEngine(api): APIEngine
Parameters#
| Name | Type |
|---|---|
api |
any |
Returns#
Inherited from#
APIComponent.constructor
Defined in#
packages/bpmn-server/src/API/API.ts:65
Properties#
api#
• api: BPMNAPI
Inherited from#
APIComponent.api
Defined in#
packages/bpmn-server/src/API/API.ts:63
Accessors#
server#
• get server(): IBPMNServer
Returns#
Inherited from#
APIComponent.server
Defined in#
packages/bpmn-server/src/API/API.ts:68
filters#
• get filters(): IQueryFilter[]
What the add-ons narrow a user's queries by (the Assignment add-on: the tasks offered to them). A server that says nothing of add-ons (no registrations, no configuration's addOns): undefined, so the user's own narrowing applies, as before; nothing is opened by not knowing.
Returns#
Inherited from#
APIComponent.filters
Defined in#
packages/bpmn-server/src/API/API.ts:76
Methods#
getUser#
▸ getUser(user): any
Parameters#
| Name | Type |
|---|---|
user |
any |
Returns#
any
Inherited from#
APIComponent.getUser
Defined in#
packages/bpmn-server/src/API/API.ts:80
qualify#
▸ qualify(kind, user, query): Promise\<any>
A query narrowed to what this user may see (docs/design/context-object.md): their tenant's (SecureUser), then
pre-query, its listeners' conditions all holding. No listener (the policies' add-ons off, a server from before
add-ons): the user's own built-in narrowing, the tasks offered to them. Not narrowed for an administrator.
Parameters#
| Name | Type |
|---|---|
kind |
"items" | "instances" | "startEvents" | "deleteInstances" |
user |
ISecureUser |
query |
any |
Returns#
Promise\<any>
Inherited from#
APIComponent.qualify
Defined in#
packages/bpmn-server/src/API/API.ts:90
can#
▸ can(action, user, on?): Promise\<boolean>
Whether this user may do this (the one check of each action: canStart, canInvoke, canAssign, canRestart,
canFireEvent, canModifyModel, canDeleteModel): the user's own rule, then pre-action, whose listeners may refuse
by throwing (the error is the caller's). No listener: the built-in rules only.
Parameters#
| Name | Type |
|---|---|
action |
string |
user |
ISecureUser |
on |
Object |
on.item? |
any |
on.instance? |
any |
on.element? |
any |
on.model? |
string |
on.input? |
any |
on.assignment? |
any |
Returns#
Promise\<boolean>
Inherited from#
APIComponent.can
Defined in#
packages/bpmn-server/src/API/API.ts:110
targets#
▸ targets(query): Promise\<{ item: any ; instance: any }[]>
The waiting items a query finds, each with its case (what a pre-action decides on); none when nothing listens.
Parameters#
| Name | Type |
|---|---|
query |
any |
Returns#
Promise\<{ item: any ; instance: any }[]>
Inherited from#
APIComponent.targets
Defined in#
packages/bpmn-server/src/API/API.ts:119
start#
▸ start(name, data?, user?, options?): Promise\<IExecution>
start a new Instance of specified model
Parameters#
| Name | Type | Description |
|---|---|---|
name |
any |
name of the model to start. |
data |
Object |
- |
user? |
ISecureUser |
user object {} |
options |
IEngineOptions |
- |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:302
invoke#
▸ invoke(query, data?, user?, options?): Promise\<IExecution>
continue with the execution of a particular item that is in a wait state, typically a user task
Parameters#
| Name | Type |
|---|---|
query |
any |
data |
Object |
user? |
ISecureUser |
options |
IEngineOptions |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:308
assign#
▸ assign(query, data, assignment, user?, options?): Promise\<IExecution>
provide assignment data to a user task Also, updates item data
Parameters#
| Name | Type |
|---|---|
query |
any |
data |
any |
assignment |
any |
user? |
ISecureUser |
options |
IEngineOptions |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:316
throwMessage#
▸ throwMessage(messageId, data, messageMatchingKey, user?, options?): Promise\<IExecution>
throw a message with an id, system will identify receiving item
Parameters#
| Name | Type |
|---|---|
messageId |
any |
data |
any |
messageMatchingKey |
any |
user? |
ISecureUser |
options |
IEngineOptions |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:328
throwSignal#
▸ throwSignal(signalId, data, messageMatchingKey, user?, options?): Promise\<any>
throw a signal with an id, system will identify receiving item(s)
Parameters#
| Name | Type |
|---|---|
signalId |
any |
data |
any |
messageMatchingKey |
any |
user? |
ISecureUser |
options |
IEngineOptions |
Returns#
Promise\<any>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:334
startEvent#
▸ startEvent(query, elementId, data?, user?, options?): Promise\<IExecution>
start a second event node (in a subprocess) for a running instance
Parameters#
| Name | Type |
|---|---|
query |
any |
elementId |
any |
data |
Object |
user? |
ISecureUser |
options |
IEngineOptions |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:338
retry#
▸ retry(itemQuery, user?): Promise\<IExecution>
Runs a failed item's work again (its status error), and the instance on from it.
Parameters#
| Name | Type |
|---|---|
itemQuery |
any |
user? |
ISecureUser |
Returns#
Promise\<IExecution>
Defined in#
packages/bpmn-server/src/API/API.ts:348
restart#
▸ restart(itemQuery, data, user, options?): Promise\<IExecution>
restarting an already completed instance at a particular node
this function requires dataStore.enableSavePoints to be true in configuration.ts
this add a savePoint for each item, allowing you to select that item to restore it
Parameters#
| Name | Type | Description |
|---|---|---|
itemQuery |
any |
Query to find a single item |
data |
any |
- |
user |
ISecureUser |
- |
options |
Object |
- |
Returns#
Promise\<IExecution>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:352
upgrade#
▸ upgrade(model, afterNodeIds, user?): Promise\<string[] | { errors: any }>
upgrade running instances with the latest revised bpmn model default behaviour is that running instances will retain the model at start However, this routine will upgrade already started instances with the revised model
Parameters#
| Name | Type | Description |
|---|---|---|
model |
any |
Model Name |
afterNodeIds |
any |
list of nodeIds, to check if already started, don't apply the upgrade |
user? |
ISecureUser |
- |
Returns#
Promise\<string[] | { errors: any }>
Implementation of#
Defined in#
packages/bpmn-server/src/API/API.ts:359