package cn.stylefeng.workflow.instance.core.actions.handle;


import cn.stylefeng.workflow.api.entity.design.Node;
import cn.stylefeng.workflow.api.entity.instance.RuntimeNode;
import cn.stylefeng.workflow.api.enums.NodeTypeEnum;
import cn.stylefeng.workflow.api.pojo.InstanceContext;
import cn.stylefeng.workflow.instance.core.actions.approver.base.BaseApprovalNodeAction;
import cn.stylefeng.workflow.instance.modular.task.service.RuTaskService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class HandleNodeAction extends BaseApprovalNodeAction {

    @Resource
    private RuTaskService ruTaskService;

    @Override
    public NodeTypeEnum getNodeType() {
        return NodeTypeEnum.HANDLE;
    }

    @Override
    protected void createWaitToDoTask(Node node, RuntimeNode runtimeNode, InstanceContext instanceContext) {
        ruTaskService.createWaitToHandleTask(node, runtimeNode, instanceContext);
    }

}
