package cn.axzo.workflow.core.deletage;

import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.DelegateExecution;

import java.util.Collections;
import java.util.List;

/**
 * 任务节点的审批人查询器接口
 *
 * @author wangli
 * @since 2023/11/16 10:43
 */
public interface BpmnTaskAssigneeSelector {

    String getType();

    /**
     * 判断是否支持当前审批指定类型
     */
    boolean support(String param);

    /**
     * 查询具体审批人
     */
    List<BpmnTaskDelegateAssigner> select(FlowElement flowElement, DelegateExecution execution, Boolean throwException);

    /**
     * 审批人筛选项获取类型
     */
    default List<String> getTypes(FlowElement flowElement) {
        return Collections.emptyList();
    }
}
