import { Vertex, LEVEL_ENUM, Interface, Param, Return, Variable, ProcessComponent, ProcessInterface, Process, ActionOptions } from '..'; import View from '../page/View'; import { LogicItem } from './LogicItem'; export declare function catchFn(logic: Logic): (err: any) => Promise; /** * 逻辑类 */ export declare class Logic extends Vertex { /** * 概念类型 */ readonly level: LEVEL_ENUM; /** * Id */ readonly id: string; /** * 名称 */ readonly name: string; /** * 描述 */ readonly description: string; /** * serviceId 或者 viewId */ readonly moduleId: string; /** * 值为 view 或者 microService 或者 processComponent */ readonly moduleType: 'view' | 'microService' | 'process'; /** * serviceId 或者 viewId */ readonly serviceId: string; /** * 值为 view 或者 microService */ readonly serviceType: 'view' | 'entity' | 'microService'; /** * 所属实体 Id */ readonly entityId: string; /** * 输入参数列表 */ readonly params: Array; /** * 输出参数列表 */ readonly returns: Array; /** * 局部变量列表 */ readonly variables: Array; /** * 逻辑体 */ readonly body: Array; /** * 画布 */ readonly playgroundId: string; /** * 画布 */ readonly playground: Array; /** * 接口 */ readonly interface: Interface; /** * 视图 */ readonly view: View; /** * 流程组件 */ readonly processComponent: ProcessComponent; /** * 流程组件 */ readonly process: Process; /** * 正在请求的 Promise * 前端 UI 状态 */ contentPromise: Promise; /** * 树组件的子节点字段 */ readonly moreChildrenFields: Array; /** * 归属的模块 */ readonly moduleName: string; /** * @param source 需要合并的部分参数 */ /** * 逻辑配置的cron表达式 */ cron: string; /** * 定时类型,当前只能是cronTrigger */ triggerType: string; /** * 事务 * { * "enabled": "事务是否生效; true | false", // 目前只有这一个属性有使用到 * "propagation": "事务的传播机制", * "isolation": "事务的隔离级别", * "rollbackFor": ["事务需要捕获且回滚的异常"], * "noRollbackFor": ["事务无需回滚的异常"] * * } */ transactional: Record; /** * 定时任务 */ constructor(source?: Partial); /** * 添加逻辑 */ create(none?: void, actionOptions?: ActionOptions): Promise; /** * 删除逻辑 */ delete(none?: void, actionOptions?: ActionOptions): Promise; /** * 修改逻辑 */ update(none?: void, actionOptions?: ActionOptions, then?: () => Promise): Promise; /** * 更新所有调用了此Logic的LogicNode */ callLogicUpdate(actionOptions?: ActionOptions): Promise; /** * 设置逻辑名称 */ setName(name: string): Promise; /** * 设置逻辑描述 */ setDescription(description: string): Promise; _onChange(): void; /** * 按当前 id 加载逻辑数据 */ load(): Promise; isContentLoaded(): boolean; /** * 批量添加参数 */ addParamList(params: Array): Promise; /** * 添加逻辑节点 * @param item */ addItem(item: LogicItem, actionOptions?: ActionOptions): Promise; /** * 删除逻辑节点 * @param item */ removeItem(item: LogicItem, actionOptions?: ActionOptions): Promise; /** * * @param type * @returns */ findLogicItemByType(type: string): LogicItem; /** * 从后端 JSON 生成规范的 Logic 对象 */ static from(source: any, parent: Interface | View | ProcessComponent | ProcessInterface, currentLogic?: Logic): Logic; /** * 更新定时任务 */ updateTimer(cron: string): Promise; /** * 更新事务属性 */ setTransaction(transactional: Record): Promise; /** * 验证表达式正确与否 */ validateTimer(): Promise; /** * 输出最近十次运行结果 */ testTimer(): Promise; /** * 更新接口缓存 */ updateCronCache(): Promise; } export default Logic;