入职离职工作流基础架构搭建
This commit is contained in:
@@ -122,4 +122,12 @@ public interface IWfProcessService {
|
||||
* @return
|
||||
*/
|
||||
String startClaim(Map<String, Object> variables);
|
||||
|
||||
/**
|
||||
* 根据模型分类启动不同模型
|
||||
* @param category
|
||||
* @return
|
||||
*/
|
||||
String commonStart(String category);
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user