
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.TaskEventType;
import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwTask;
import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwTaskActor;
import org.jeecg.modules.workFlow.flowlong.engine.model.NodeModel;

import java.util.List;
import java.util.function.Supplier;

/**
 * 流程任务监听
 *

 */
public interface TaskListener {

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

}
