package cn.axzo.workflow.core.service;

import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
import io.swagger.annotations.ApiOperation;

import javax.annotation.Nullable;
import java.util.List;

@ApiOperation("流程模型 - 部署流程")
public interface BpmnProcessModelService {

    /**
     * 获取流程模型的查询结果
     */
    BpmPageResult<BpmnModelDetailVO> getModelPage(BpmnModelSearchDTO dto);

    /**
     * 创建流程,
     * return modelId的主键
     */
    String createBpmModel(BpmnModelCreateDTO dto);

    String createBpmModelWithXml(String fileUrl);

    /**
     * 获取模型
     */
    BpmnModelDetailVO getById(String processModelId, @Nullable String tenantId);

    /**
     * 获取模型
     */
    BpmnModelDetailVO getByKey(String processModelKey, @Nullable String tenantId);

    /**
     * 修改流程信息
     */
    void updateBpmModel(BpmnModelUpdateDTO dto);

    /**
     * 部署模型
     * return 部署完成的流程定义Id
     */
    String deployBpmModelById(String processModelId, @Nullable String tenantId, BpmnTaskDelegateAssigner operator);

    /**
     * 部署模型
     * return 部署完成的流程定义Id
     */
    String deployBpmModelByKey(String processModelKey, @Nullable String tenantId, BpmnTaskDelegateAssigner operator);

    /**
     * 删除模型
     */
    void deleteBpmModelById(String processModelId, @Nullable String tenantId);

    void deleteBpmModelByKey(String processModelKey, @Nullable String tenantId);

    void unDeployBpmModelById(String processModelId, @Nullable String tenantId, BpmnTaskDelegateAssigner operator);

    void changeStatus(String modelId, Integer status, BpmnTaskDelegateAssigner operator);

    List<String> getModelCategoryList();

    List<String> getTenantIds();
}
