package cn.stylefeng.workflow.instance.modular.task.strategy.samesubmit;

import cn.stylefeng.workflow.api.entity.task.RuTask;
import cn.stylefeng.workflow.api.enums.TaskStatusEnum;
import cn.stylefeng.workflow.api.enums.strategy.SamePersonApprovalPolicyEnum;
import cn.stylefeng.workflow.instance.modular.task.strategy.samesubmit.base.SameSubmitRule;
import org.springframework.stereotype.Component;

@Component
public class SameSubmitAutoJumpRule extends SameSubmitRule {

    @Override
    public SamePersonApprovalPolicyEnum getSameSubmitRuleType() {
        return SamePersonApprovalPolicyEnum.JUMP;
    }

    @Override
    public RuTask processTask(RuTask originTask, Long applicantUserId, Long applicantOrgId) {
        originTask.setTaskStatus(TaskStatusEnum.JUMPED.getCode());
        return null;
    }

}
