package cn.axzo.workflow.server.controller.delegate;

import cn.axzo.workflow.common.enums.ApproverSpecifyEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;

import java.util.List;

import static cn.axzo.workflow.core.common.code.FlowableEngineRespCode.ENGINE_USER_TASK_TYPE_NOT_SUPPORT;


/**
 * todo 本期需求不实现
 * 基于"发起人多级主管"查询审批人
 *
 * @author wangli
 * @since 2023/11/16 11:42
 */
@Component
public class BasedInitiatorLeaderRecursionTaskAssigneeSelector extends AbstractBpmnTaskAssigneeSelector {
    @Override
    public String getType() {
        return ApproverSpecifyEnum.initiatorLeaderRecursion.getType();
    }

    @Override
    public boolean support(String param) {
        return getType().equals(param);
    }

    @Override
    public List<BpmnTaskDelegateAssigner> select(FlowElement flowElement, DelegateExecution execution,
                                                 Boolean throwException) {
        throw new WorkflowEngineException(ENGINE_USER_TASK_TYPE_NOT_SUPPORT);
    }

}
