@flowlab/event
Version:
FlowLab event-driven system
19 lines (18 loc) • 601 B
TypeScript
import { Workflow } from '../core/Workflow';
/**
* 条件节点:根据 input/context 判断分支路径
*/
export declare class ConditionNode {
name: string;
private conditionFn;
private branches;
constructor(name: string, conditionFn: (input: any, context: any) => string | boolean, branches: Record<string, Workflow>);
/**
* 解析当前输入下应该进入哪个分支
*/
resolveBranch(input: any, context: any): Promise<string | boolean>;
/**
* 获取指定分支的工作流
*/
getBranch(branch: string | boolean): Workflow | undefined;
}