@5minds/processcube_engine
Version:
The ProcessCube Engine. Stores and executes BPMNs.
20 lines (19 loc) • 1.18 kB
TypeScript
import schedule from 'node-schedule';
import { Model, Subscription } from '@5minds/processcube_engine_sdk';
export type TimerSubscription = Subscription & {
job: schedule.Job;
};
export declare class TimerFacade {
private readonly logger;
constructor();
initializeTimer(flowNodeId: string, timerType: Model.Events.TimerType, timerValue: string, timerCallback: Function, flowNode?: Model.Events.TimerEvent, timerStartedDate?: Date): TimerSubscription;
startCycleTimer(timerValue: string, timerCallback: Function, timerExpiredEventName: string, flowNode?: Model.Events.TimerEvent): TimerSubscription;
startDateTimer(timerValue: string, timerCallback: Function, timerExpiredEventName: string): TimerSubscription;
startDurationTimer(timerValue: string, timerCallback: Function, timerExpiredEventName: string, timerStartedDate?: Date): TimerSubscription;
triggerTimerImmediately(subscription: TimerSubscription, timerType: Model.Events.TimerType): void;
cancelTimerSubscription(subscription: TimerSubscription): void;
private validateDateTimer;
private validateDurationTimer;
private validateCyclicTimer;
private createTimer;
}