bpmn-server / Token
Class: Token#
Implements#
Table of contents#
Constructors#
Properties#
- id
- type
- execution
- dataPath
- startNodeId
- parentToken
- originItem
- path
- loop
- currentNode
- processId
- status
- input
- output
- messageMatchingKey
Accessors#
Methods#
- hasNode
- getFullPath
- startNewToken
- save
- load
- stop
- resume
- restored
- getSubProcessToken
- getChildrenTokens
- preExecute
- preNext
- execute
- processError
- processEscalation
- appendData
- terminate
- continue
- signal
- end
- setCurrentNode
- goNext
- log
- info
- error
Constructors#
constructor#
• new Token(type, execution, startNode, dataPath?, parentToken?, originItem?): Token
Parameters#
| Name | Type |
|---|---|
type |
TOKEN_TYPE |
execution |
Execution |
startNode |
Node |
dataPath? |
any |
parentToken? |
Token |
originItem? |
Item |
Returns#
Defined in#
Properties#
id#
• id: any
Implementation of#
Defined in#
type#
• type: TOKEN_TYPE
Implementation of#
Defined in#
execution#
• execution: IExecution
Implementation of#
Defined in#
dataPath#
• dataPath: string
Implementation of#
Defined in#
startNodeId#
• startNodeId: any
Implementation of#
Defined in#
parentToken#
• Optional parentToken: Token
Implementation of#
Defined in#
originItem#
• originItem: Item
Implementation of#
Defined in#
path#
• path: Item[]
Implementation of#
Defined in#
loop#
• loop: Loop
Implementation of#
Defined in#
currentNode#
• currentNode: Node
Implementation of#
Defined in#
processId#
• processId: any
Implementation of#
Defined in#
status#
• status: TOKEN_STATUS
Implementation of#
Defined in#
input#
• input: Object
Defined in#
output#
• output: Object
Defined in#
messageMatchingKey#
• messageMatchingKey: Object
Defined in#
Accessors#
data#
• get data(): any
Returns#
any
Implementation of#
Defined in#
currentItem#
• get currentItem(): Item
Returns#
Implementation of#
Defined in#
firstItem#
• get firstItem(): Item
Returns#
Implementation of#
Defined in#
lastItem#
• get lastItem(): Item
Returns#
Implementation of#
Defined in#
childrenTokens#
• get childrenTokens(): Token[]
Returns#
Token[]
Implementation of#
Defined in#
Methods#
hasNode#
▸ hasNode(nodeId): Boolean
Parameters#
| Name | Type |
|---|---|
nodeId |
any |
Returns#
Boolean
Defined in#
getFullPath#
▸ getFullPath(path?): Item[]
Parameters#
| Name | Type | Default value |
|---|---|---|
path |
any[] |
[] |
Returns#
Item[]
Implementation of#
Defined in#
startNewToken#
▸ startNewToken(type, execution, startNode, dataPath, parentToken, originItem, loop, data?, noExecute?): Promise\<Token>
Parameters#
| Name | Type | Default value |
|---|---|---|
type |
TOKEN_TYPE |
undefined |
execution |
any |
undefined |
startNode |
any |
undefined |
dataPath |
any |
undefined |
parentToken |
Token |
undefined |
originItem |
Item |
undefined |
loop |
Loop |
undefined |
data |
any |
null |
noExecute |
boolean |
false |
Returns#
Promise\<Token>
Defined in#
save#
▸ save(): Object
Returns#
Object
| Name | Type |
|---|---|
id |
any |
type |
TOKEN_TYPE |
status |
TOKEN_STATUS |
dataPath |
string |
loopId |
any |
parentToken |
any |
originItem |
any |
startNodeId |
any |
currentNode |
any |
Implementation of#
Defined in#
load#
▸ load(execution, da): Token
Parameters#
| Name | Type |
|---|---|
execution |
Execution |
da |
any |
Returns#
Defined in#
stop#
▸ stop(): void
Returns#
void
Implementation of#
Defined in#
resume#
▸ resume(): void
Returns#
void
Implementation of#
Defined in#
restored#
▸ restored(): void
Returns#
void
Implementation of#
Defined in#
getSubProcessToken#
▸ getSubProcessToken(): Token
Returns#
Implementation of#
Defined in#
getChildrenTokens#
▸ getChildrenTokens(): any[]
Returns#
any[]
Implementation of#
Defined in#
preExecute#
▸ preExecute(): Promise\<boolean>
Returns#
Promise\<boolean>
Implementation of#
Defined in#
preNext#
▸ preNext(): Promise\<boolean>
Returns#
Promise\<boolean>
Implementation of#
Defined in#
execute#
▸ execute(input): Promise\<void>
this is the primary exectuion method for a token Pre-Conditions: currentNode is set status!= end
Parameters#
| Name | Type |
|---|---|
input |
any |
Returns#
Promise\<void>
Implementation of#
Defined in#
processError#
▸ processError(): Promise\<void>
Returns#
Promise\<void>
Implementation of#
Defined in#
processEscalation#
▸ processEscalation(): Promise\<void>
Returns#
Promise\<void>
Defined in#
appendData#
▸ appendData(inputData, item): void
renamed from applyInput to appendData
Parameters#
| Name | Type |
|---|---|
inputData |
any |
item |
any |
Returns#
void
Implementation of#
Defined in#
terminate#
▸ terminate(): Promise\<void>
is called by Gateways to cancel current token
Returns#
Promise\<void>
Implementation of#
Defined in#
continue#
▸ continue(): Promise\<void>
is called by events to cancel current token
Returns#
Promise\<void>
Defined in#
signal#
▸ signal(data, options?): Promise\<void>
Parameters#
| Name | Type |
|---|---|
data |
any |
options |
Object |
Returns#
Promise\<void>
Implementation of#
Defined in#
end#
▸ end(cancel?): Promise\<void>
Parameters#
| Name | Type | Default value |
|---|---|---|
cancel |
Boolean |
false |
Returns#
Promise\<void>
Implementation of#
Defined in#
setCurrentNode#
▸ setCurrentNode(newCurrentNode): void
Parameters#
| Name | Type |
|---|---|
newCurrentNode |
Node |
Returns#
void
Defined in#
goNext#
▸ goNext(): Promise\<void>
Returns#
Promise\<void>
Implementation of#
Defined in#
log#
▸ log(msg): void
Parameters#
| Name | Type |
|---|---|
msg |
any |
Returns#
void
Implementation of#
Defined in#
info#
▸ info(msg): void
Parameters#
| Name | Type |
|---|---|
msg |
any |
Returns#
void
Implementation of#
Defined in#
error#
▸ error(msg): void
Parameters#
| Name | Type |
|---|---|
msg |
any |
Returns#
void