@5minds/processcube_engine
Version:
The ProcessCube Engine. Stores and executes BPMNs.
77 lines (76 loc) • 2.52 kB
TypeScript
import { Correlation, EventType, FlowNodeInstance, Identity, ProcessInstanceMetadata, ProcessInstanceQuery, ProcessInstanceState } from '@5minds/processcube_engine_sdk';
export type ProcessInstanceInternalList = {
processInstances: Array<ProcessInstanceInternal>;
totalCount: number;
};
/**
* Describes a non-sanitized ProcessInstance used internally by the engine.
*
* CAUTION:
* Contains sensitive information, such as a users Auth token and should NEVER be returned through public channels!
* Use the SDK's 'ProcessInstance' type for that.
*/
export type ProcessInstanceInternal = {
correlationId: string;
processInstanceId: string;
processDefinitionId: string;
processModelId: string;
processModelName?: string;
processModelVersion?: string;
parentProcessInstanceId?: string;
embeddedProcessModelId?: string;
hash: string;
xml: string;
state: ProcessInstanceState;
error: Error;
ownerId: string;
ownerToken: string;
startedByRootAccessToken: boolean;
createdAt?: Date;
finishedAt?: Date;
restartedAt?: Date;
terminatedByUserId?: string;
durationInMilliseconds?: number;
startEventId?: string;
startEventType?: EventType;
startToken?: any;
endEventId?: string;
endEventType?: EventType;
endToken?: any;
metadata?: ProcessInstanceMetadata;
correlation?: Correlation;
triggeredByFlowNodeInstance?: FlowNodeInstance;
};
export type CreateProcessInstanceRequest = {
identity: Identity;
startedByRootAccessToken: boolean;
correlationId: string;
processInstanceId: string;
processDefinitionId: string;
processModelId: string;
processModelName?: string;
processModelVersion?: string;
processModelHash: string;
parentProcessInstanceId?: string;
embeddedProcessModelId?: string;
startEventId?: string;
startEventType?: EventType;
startToken?: unknown;
triggeredByFlowNodeInstanceId?: string;
};
/**
* Used in conjunction with "FinishProcessInstance" - Contains information about the end event the process was finished with.
*/
export type FinishProcessInstancePayload = {
endEventId: string;
endEventType?: EventType;
endEventToken?: any;
};
/**
* For internal use only - A Process Instance query, coupled with information on the requesting user.
* Used for authorization checks.
*/
export type ProcessInstanceInternalQuery = ProcessInstanceQuery & {
allowedLanes?: Array<string>;
requestingUserId?: string;
};