Skip to content

bpmn-server / Token

Class: Token#

Implements#

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

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#

Token

Defined in#

engine/Token.ts:116

Properties#

id#

id: any

Implementation of#

IToken.id

Defined in#

engine/Token.ts:58


type#

type: TOKEN_TYPE

Implementation of#

IToken.type

Defined in#

engine/Token.ts:59


execution#

execution: IExecution

Implementation of#

IToken.execution

Defined in#

engine/Token.ts:60


dataPath#

dataPath: string

Implementation of#

IToken.dataPath

Defined in#

engine/Token.ts:61


startNodeId#

startNodeId: any

Implementation of#

IToken.startNodeId

Defined in#

engine/Token.ts:62


parentToken#

Optional parentToken: Token

Implementation of#

IToken.parentToken

Defined in#

engine/Token.ts:63


originItem#

originItem: Item

Implementation of#

IToken.originItem

Defined in#

engine/Token.ts:65


path#

path: Item[]

Implementation of#

IToken.path

Defined in#

engine/Token.ts:66


loop#

loop: Loop

Implementation of#

IToken.loop

Defined in#

engine/Token.ts:67


currentNode#

currentNode: Node

Implementation of#

IToken.currentNode

Defined in#

engine/Token.ts:68


processId#

processId: any

Implementation of#

IToken.processId

Defined in#

engine/Token.ts:69


status#

status: TOKEN_STATUS

Implementation of#

IToken.status

Defined in#

engine/Token.ts:70


input#

input: Object

Defined in#

engine/Token.ts:71


output#

output: Object

Defined in#

engine/Token.ts:72


messageMatchingKey#

messageMatchingKey: Object

Defined in#

engine/Token.ts:73


itemsKey#

itemsKey: any

Defined in#

engine/Token.ts:74

Accessors#

data#

get data(): any

Returns#

any

Implementation of#

IToken.data

Defined in#

engine/Token.ts:76


currentItem#

get currentItem(): Item

Returns#

Item

Implementation of#

IToken.currentItem

Defined in#

engine/Token.ts:79


firstItem#

get firstItem(): Item

Returns#

Item

Implementation of#

IToken.firstItem

Defined in#

engine/Token.ts:82


lastItem#

get lastItem(): Item

Returns#

Item

Implementation of#

IToken.lastItem

Defined in#

engine/Token.ts:94


childrenTokens#

get childrenTokens(): Token[]

Returns#

Token[]

Implementation of#

IToken.childrenTokens

Defined in#

engine/Token.ts:104

Methods#

hasNode#

hasNode(nodeId): Boolean

Parameters#

Name Type
nodeId any

Returns#

Boolean

Defined in#

engine/Token.ts:86


getFullPath#

getFullPath(path?): Item[]

Parameters#

Name Type Default value
path any[] []

Returns#

Item[]

Implementation of#

IToken.getFullPath

Defined in#

engine/Token.ts:110


startNewToken#

startNewToken(type, execution, startNode, dataPath, parentToken, originItem, loop, data?, noExecute?, itemsKey?): 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
itemsKey any null

Returns#

Promise\<Token>

Defined in#

engine/Token.ts:146


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
itemsKey any

Implementation of#

IToken.save

Defined in#

engine/Token.ts:177


load#

load(execution, da): Token

Parameters#

Name Type
execution Execution
da any

Returns#

Token

Defined in#

engine/Token.ts:192


stop#

stop(): void

Returns#

void

Implementation of#

IToken.stop

Defined in#

engine/Token.ts:206


resume#

resume(): void

Returns#

void

Implementation of#

IToken.resume

Defined in#

engine/Token.ts:215


restored#

restored(): void

Returns#

void

Implementation of#

IToken.restored

Defined in#

engine/Token.ts:219


getSubProcessToken#

getSubProcessToken(): Token

Returns#

Token

Implementation of#

IToken.getSubProcessToken

Defined in#

engine/Token.ts:224


getChildrenTokens#

getChildrenTokens(): any[]

Returns#

any[]

Implementation of#

IToken.getChildrenTokens

Defined in#

engine/Token.ts:233


preExecute#

preExecute(): Promise\<boolean>

Returns#

Promise\<boolean>

Implementation of#

IToken.preExecute

Defined in#

engine/Token.ts:245


preNext#

preNext(): Promise\<boolean>

Returns#

Promise\<boolean>

Implementation of#

IToken.preNext

Defined in#

engine/Token.ts:252


execute#

execute(input): Promise\<void>

this is the primary exectuion method for a token, it executes from current node till: a node hits a wait

Pre-Conditions: currentNode is set status!= end

Parameters#

Name Type
input any

Returns#

Promise\<void>

Implementation of#

IToken.execute

Defined in#

engine/Token.ts:265


processError#

processError(errorCode, callingEvent): Promise\<void>

Parameters#

Name Type
errorCode any
callingEvent any

Returns#

Promise\<void>

Implementation of#

IToken.processError

Defined in#

engine/Token.ts:335


getScopeCatchEvent#

getScopeCatchEvent(type, code): any

Parameters#

Name Type
type "error" | "escalation" | "cancel"
code any

Returns#

any

Defined in#

engine/Token.ts:350


processCancel#

processCancel(callingEvent): Promise\<void>

Parameters#

Name Type
callingEvent any

Returns#

Promise\<void>

Implementation of#

IToken.processCancel

Defined in#

engine/Token.ts:426


processEscalation#

processEscalation(escalationCode, callingEvent): Promise\<void>

Parameters#

Name Type
escalationCode any
callingEvent any

Returns#

Promise\<void>

Implementation of#

IToken.processEscalation

Defined in#

engine/Token.ts:434


appendData#

appendData(inputData, item): void

renamed from applyInput to appendData

Parameters#

Name Type
inputData any
item any

Returns#

void

Implementation of#

IToken.appendData

Defined in#

engine/Token.ts:451


terminate#

terminate(): Promise\<void>

is called by Gateways to cancel current token

Returns#

Promise\<void>

Implementation of#

IToken.terminate

Defined in#

engine/Token.ts:458


continue#

continue(): Promise\<void>

is called by events to cancel current token

Returns#

Promise\<void>

Defined in#

engine/Token.ts:468


signal#

signal(data, options?): Promise\<void>

Parameters#

Name Type
data any
options Object

Returns#

Promise\<void>

Implementation of#

IToken.signal

Defined in#

engine/Token.ts:477


end#

end(cancel?): Promise\<void>

Parameters#

Name Type Default value
cancel Boolean false

Returns#

Promise\<void>

Implementation of#

IToken.end

Defined in#

engine/Token.ts:528


setCurrentNode#

setCurrentNode(newCurrentNode): void

Parameters#

Name Type
newCurrentNode Node

Returns#

void

Defined in#

engine/Token.ts:575


goNext#

goNext(): Promise\<void>

Returns#

Promise\<void>

Implementation of#

IToken.goNext

Defined in#

engine/Token.ts:585


log#

log(...msg): void

Parameters#

Name Type
...msg any[]

Returns#

void

Implementation of#

IToken.log

Defined in#

engine/Token.ts:675


logS#

logS(...msg): void

Parameters#

Name Type
...msg any[]

Returns#

void

Defined in#

engine/Token.ts:678


logE#

logE(...msg): void

Parameters#

Name Type
...msg any[]

Returns#

void

Defined in#

engine/Token.ts:681


info#

info(msg): void

Parameters#

Name Type
msg any

Returns#

void

Implementation of#

IToken.info

Defined in#

engine/Token.ts:684


error#

error(msg): void

Parameters#

Name Type
msg any

Returns#

void

Implementation of#

IToken.error

Defined in#

engine/Token.ts:687