@tachybase/module-workflow
Version:
A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.
30 lines (29 loc) • 911 B
TypeScript
import { Registry } from '@tego/server';
import { Instruction } from '.';
import type Processor from '../Processor';
import type { FlowNodeModel, JobModel } from '../types';
type Comparer = (a: any, b: any) => boolean;
export declare const BRANCH_INDEX: {
readonly DEFAULT: any;
readonly ON_TRUE: 1;
readonly ON_FALSE: 0;
};
export declare const calculators: Registry<Comparer>;
export declare class ConditionInstruction extends Instruction {
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<{
status: 1;
result: boolean;
nodeId: number;
nodeKey: any;
upstreamId: any;
cost: number;
} | {
result: any;
status: -2;
} | {
status: -1;
result: boolean;
}>;
resume(node: FlowNodeModel, branchJob: JobModel, processor: Processor): Promise<any>;
}
export default ConditionInstruction;