@rs-box/ez-flow
Version:
Library for a workflow engine
33 lines (32 loc) • 1.29 kB
TypeScript
import { Predicate } from '../work/predicate';
import { Work } from '../work/work';
import { WorkContext } from '../work/work-context';
import { WorkReport } from '../work/work-report';
import { AbstractWorkFlow } from './abstract-work-flow';
export declare class ConditionalFlow extends AbstractWorkFlow {
private toExecute;
private nextOnTrue;
private nextOnFalse;
private predicate?;
constructor(name: string, toExecute: Work, nextOnTrue: Work, nextOnFalse: Work, predicate?: Predicate | undefined);
call(workContext: WorkContext): Promise<WorkReport>;
static Builder: {
new (): {
name: string;
toExecute: Work;
nextOnTrue: Work;
nextOnFalse: Work;
predicate: Predicate | undefined;
withName(name: string): ConditionalFlow.Builder;
withWork(work: Work): ConditionalFlow.Builder;
then(work: Work): ConditionalFlow.Builder;
otherwise(work: Work): ConditionalFlow.Builder;
when(predicate: Predicate): ConditionalFlow.Builder;
build(): ConditionalFlow;
};
newFlow(): ConditionalFlow.Builder;
};
}
export declare namespace ConditionalFlow {
type Builder = typeof ConditionalFlow.Builder.prototype;
}