入职离职工作流基础架构搭建

This commit is contained in:
2025-02-24 18:48:42 +08:00
parent 46d601745f
commit f229565c36
7 changed files with 89 additions and 43 deletions

View File

@@ -122,4 +122,12 @@ public interface IWfProcessService {
* @return
*/
String startClaim(Map<String, Object> variables);
/**
* 根据模型分类启动不同模型
* @param category
* @return
*/
String commonStart(String category);
}

View File

@@ -644,6 +644,27 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
}
}
/**
* 根据分类启动不同模型
* @param category
* @return
*/
@Override
public String commonStart(String category) {
try {
List<ProcessDefinition> processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionCategory(category).list();
// 传个空参进去,不破坏其他模型
Map<String, Object> variables = new HashMap<String, Object>();
// 拿到最新版本的模型
return startProcess(processDefinition.get(processDefinition.size()-1), variables);
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("流程启动错误");
}
}
/**
* 通过DefinitionKey启动流程
* @param procDefKey 流程定义Key