UNPKG

@5minds/processcube_engine

Version:

The ProcessCube Engine. Stores and executes BPMNs.

48 lines (47 loc) 2.86 kB
import { Identity as PublicIdentity, UserTaskResult } from '@5minds/processcube_engine_sdk'; import { InternalIdentity as Identity } from '../Contracts/index'; import type { FlowNodeInstanceDatabaseAdapter, ProcessInstanceDatabaseAdapter } from '../Tools/DatabaseAdaptersSequelize'; import type { ExecuteProcessService } from './ExecuteProcessService'; import type { MessageEventService } from './MessageEventService'; import type { SignalEventService } from './SignalEventService'; /** * Gatekeeper Service for Core Access. */ export declare class CoreAccessService { private readonly executeProcessService; private readonly flowNodeInstanceDatabaseAdapter; private readonly messageEventService; private readonly processInstanceDatabaseAdapter; private readonly signalEventService; private readonly logger; constructor(executeProcessService: ExecuteProcessService, flowNodeInstanceDatabaseAdapter: FlowNodeInstanceDatabaseAdapter, messageEventService: MessageEventService, processInstanceDatabaseAdapter: ProcessInstanceDatabaseAdapter, signalEventService: SignalEventService); transferOwnership(processInstanceId: string, newOwner: PublicIdentity): Promise<void>; finishExternalServiceTask<TResult>(externalTaskId: string, externalTaskResult: TResult): Promise<void>; finishUntypedTask(identity: Identity, taskInstanceId: string): Promise<void>; finishManualTask(identity: Identity, manualTaskInstanceId: string): Promise<void>; finishUserTask(identity: Identity, userTaskInstanceId: string, userTaskResult: UserTaskResult): Promise<void>; triggerMessageEvent(identity: Identity, messageName: string, options?: { customCorrelationId?: string; processInstanceId?: string; payload?: any; triggerValue?: string; messageChannel?: string; }): Promise<void>; triggerSignalEvent(identity: Identity, signalName: string, options?: { customCorrelationId?: string; processInstanceId?: string; payload?: any; triggerValue?: string; signalChannel?: string; }): Promise<void>; retryProcessInstance(identity: Identity, processInstanceId: string, processDefinitionHash: string, flowNodeInstanceId?: string, newStartToken?: Record<string, any>): Promise<void>; killProcessInstance(identity: Identity, processInstanceId: string): Promise<void>; /** * CAUTION: * This is only for those rare cases, when the engine stops processing a ProcessInstance and therefore no longer holds it in active memory. * Then, and ONLY then, we must handle process instance termination manually. Consider this an emergency circuit breaker. * Killing a process should only ever be done through the Process Instance class. */ private killProcessInstanceManually; private sendProcessTerminatedNotification; }