package com.chinaweal.aiccs.aiccs.business.service;

import com.chinaweal.aiccs.aiccs.business.entity.*;
import com.chinaweal.aiccs.aiccs.business.entity.dto.ResultMap;
import com.chinaweal.aiccs.aiccs.business.rules.model.SequenceFlowModel;
import com.chinaweal.aiccs.aiccs.business.rules.model.RuleModel;

import java.util.List;

/**
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021/1/29 15:21
 **/
public interface WorkFlowService {

    ResultMap startAndClaim(String userID, List<String> nextUserIDs, String definitionName, String parentprocessid);

    ResultMap completeTaskToOther(String processid, String nextNodeID, List<String> nextUserIDs);

    ResultMap forceCompleteTaskToEnd(String processid);

    void claimGroup(String processid, String userID);

    List<TSRefGroupAndUser> findRefByGroupid(String groupid);

    TSTwfTask findTwfTaskByWorkflowID(String processid);

    TSHwfProcess findHwfProcessByID(String processid);

    TSTwfProcess findTwfProcessByID(String processid);

    List<TSTwfProcess> findTwfProcessByParentProcessid(String parentProcessid);

    TSTwfProcessNode findCurrentNode(String processid);

    List<SequenceFlowModel> findNextSequenceFlowList(String processid);

    List<TSTwfProcessNode> findTwfProcessNodeByProcessid(String processid);

    List<TSHwfProcessNode> findHwfProcessNodeByProcessid(String processid);

    RuleModel getRuleModel(String definitionName);

    /**
     * 通过processId、当前节点名称和回退节点名称获取回退到的用户id
     * @param processId
     * @param currentNode
     * @param nextNode
     * @return
     */
    String findLastTwfprocessnodeByProcessidAndNodename(String processId, String currentNode,String nextNode);

    ResultMap startAndClaimApp(String userID, List<String> nextUserIDs, String definitionName, String parentprocessid);
}
