import { NODE_ACTION, TOKEN_STATUS } from './Enums'; import { IItemData, IInstanceData } from './'; import { ILogger, IAppDelegate, IBPMNServer, IDefinition, Token, Item, Element, Node, IServerComponent } from '../'; interface IScriptHandler { evaluateExpression(scope: IItem | IToken, expression: any): any; executeScript(scope: IItem | IExecution, script: any): any; } interface IToken { id: any; type: any; execution: IExecution; dataPath: string; startNodeId: any; parentToken?: IToken; originItem: IItem; path: IItem[]; loop: any; currentNode: any; processId: any; status: TOKEN_STATUS; data: any; currentItem: IItem; lastItem: IItem; firstItem: Item; childrenTokens: Token[]; itemsKey: any; save(): { id: any; type: any; status: TOKEN_STATUS; dataPath: string; loopId: any; parentToken: any; originItem: any; startNodeId: any; currentNode: any; }; resume(): void; stop(): void; processError(errorCode: any, callingEvent: any): any; processEscalation(escalationCode: any, callingEvent: any): any; processCancel(callingEvent: any): any; restored(): void; getChildrenTokens(): any[]; preExecute(): Promise; preNext(): Promise; /** * this is the primary exectuion method for a token */ execute(inputData: any): Promise; appendData(inputData: any, item: IItem): void; /** * is called by Gateways to cancel current token * * */ terminate(): void; signal(data: any): Promise; getFullPath(fullPath?: any): Item[]; end(): Promise; goNext(): Promise; getSubProcessToken(): IToken; log(...msg: any): void; info(...msg: any): void; error(msg: any): void; } interface IExecution extends IServerComponent { instance: IInstanceData; server: IBPMNServer; tokens: Map; definition: IDefinition; appDelegate: IAppDelegate; logger: ILogger; process: any; promises: any; listener: any; isLocked: boolean; errors: any; item: any; messageMatchingKey: any; worker: any; userName: any; id: any; status: any; action: NODE_ACTION; options: any; name: any; getNodeById(id: any): Node; getToken(id: number): IToken; getItemsData(): IItemData[]; save(): Promise; end(): Promise; /** * * causes the execution to stop from running any further * */ stop(): void; terminate(): void; execute(startNodeId?: any, inputData?: {}): Promise; /** * * invoke scenarios: * itemId * elementId - but only one is active * elementId - for a startEvent in a secondary process * * @param executionId * @param inputData */ signalItem(executionId: any, inputData: any, options?: {}): Promise; signalEvent(executionId: any, inputData: any, options?: {}): Promise; signalRepeatTimerEvent(executionId: any, prevItem: any, inputData: any, options?: {}): Promise; getItems(query?: any): IItem[]; getState(): IInstanceData; restored(): void; resume(): void; report(): void; uids: {}; getNewId(scope: string): number; getUUID(): any; doExecutionEvent(process: any, event: any, eventDetails?: any): Promise; doItemEvent(item: any, event: any, eventDetails?: any): Promise; log(...msg: any): void; logS(...msg: any): void; logE(...msg: any): void; info(...msg: any): void; error(msg: any): void; appendData(inputData: any, item: IItem, dataPath?: any, assignment?: any): void; getData(dataPath: any): any; processQueue(): any; } interface IItem extends IItemData { element: Element; token: Token; context: IExecution; node: Node; } export { IItem, IToken, IExecution, IScriptHandler };