
package org.jeecg.modules.workFlow.flowlong.engine.listener;

import org.jeecg.modules.workFlow.flowlong.engine.core.FlowCreator;
import org.jeecg.modules.workFlow.flowlong.engine.core.enums.InstanceEventType;
import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwHisInstance;
import org.jeecg.modules.workFlow.flowlong.engine.model.NodeModel;

import java.util.function.Supplier;

/**
 * 流程实例监听
 *

 */
public interface InstanceListener {

    /**
     * 流程引擎监听通知
     *
     * @param eventType   事件类型
     * @param supplier    监听实例提供者
     * @param nodeModel   当前执行节点 {@link NodeModel}
     * @param flowCreator 处理人员
     * @return 通知结果 true 成功 false 失败
     */
    boolean notify(InstanceEventType eventType, Supplier<FlwHisInstance> supplier, NodeModel nodeModel, FlowCreator flowCreator);

}
