import { Execution } from './Execution'; import { Node } from '../elements/'; import { TOKEN_STATUS } from '../'; import { Loop } from './Loop'; import { Item } from './Item'; import { IToken, IExecution } from '../interfaces/engine'; declare enum TOKEN_TYPE { Primary = "Primary", SubProcess = "SubProcess", Instance = "Instance", Diverge = "Diverge", EventSubProcess = "EventSubProces", BoundaryEvent = "BoundaryEvent", AdHoc = "AdHoc" } declare class Token implements IToken { id: any; type: TOKEN_TYPE; execution: IExecution; dataPath: string; startNodeId: any; parentToken?: Token; originItem: Item; path: Item[]; loop: Loop; _currentNode: Node; get currentNode(): Node; processId: any; status: TOKEN_STATUS; input: {}; output: {}; messageMatchingKey: {}; itemsKey: any; get data(): any; get currentItem(): Item; get firstItem(): Item; hasNode(nodeId: any): Boolean; get lastItem(): Item; get childrenTokens(): Token[]; getFullPath(path?: any[]): Item[]; constructor(type: TOKEN_TYPE, execution: Execution, startNode: Node, dataPath?: any, parentToken?: Token, originItem?: Item); /** * * @param execution * @param startNode * @param dataPath * @param parentToken * @param originItem * @param loop * @param data */ static startNewToken(type: TOKEN_TYPE, execution: any, startNode: any, dataPath: any, parentToken: Token, originItem: Item, loop: Loop, data?: any, noExecute?: boolean, itemsKey?: any): Promise; save(): { id: any; type: TOKEN_TYPE; status: TOKEN_STATUS; dataPath: string; loopId: any; parentToken: any; originItem: any; startNodeId: any; currentNode: any; itemsKey: any; }; static load(execution: Execution, da: any): Token; stop(): void; resume(): void; restored(): void; getSubProcessToken(): Token; getChildrenTokens(): any[]; preExecute(): Promise; preNext(): Promise; /** * 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 */ execute(input: any): Promise; addItemToPath(item: any): void; processError(errorCode: any, callingEvent: any): Promise; getScopeCatchEvent(type: 'error' | 'escalation' | 'cancel', code: any): any; private checkTokensForError; processCancel(callingEvent: any): Promise; processEscalation(escalationCode: any, callingEvent: any): Promise; /** * * renamed from applyInput to appendData * @param inputData */ appendData(inputData: any, item: any): void; /** * is called by Gateways to cancel current token * * */ terminate(): Promise; /** * is called by events to cancel current token * * */ continue(): Promise; signal(data: any, options?: {}): Promise; signal2(): Promise; end(cancel?: Boolean): Promise; setCurrentNode(newCurrentNode: Node): void; goNext(): Promise; log(...msg: any[]): void; logS(...msg: any[]): void; logE(...msg: any[]): void; info(msg: any): void; error(msg: any): void; } export { Token, TOKEN_TYPE };