本文實例講述了activiti取得流程圖的方法,具體操作步驟如下:
1.發布流程程式碼如下:
repositoryService.createDeployment() .name("expense-process.bar") .addClasspathResource("org/activiti/expenseProcess.bpmn20.xml") .addClasspathResource("org/activiti/expenseProcess.png") .deploy();
2.根據key取得流程圖程式碼如下:
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() .processDefinitionKey("expense") .singleResult(); String diagramResourceName = processDefinition.getDiagramResourceName(); InputStream ServiceResourceNames Service. diagramResourceName);
3.如果想流程發布的時候不產生流程圖,需要進行如下設定:
<property name="createDiagramOnDeploy" value="false" />