LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.
Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.
talk is cheap, show others the code and KPI, Keep progress,make a better result.
Survive during the day and develop at night。
目录
概 述
流程定义ZIp部署:在这里插入代码片
/**
* 通过流程部署ID获取流程图图片
*/
@Test
public void getImageById()throws Exception{
InputStream inputStream=processEngine.getRepositoryService()
.getResourceAsStream(“7501”, “HelloWorld/HelloWorld.png”); // 根据流程部署ID和资源名称获取输入流
FileUtils.copyInputStreamToFile(inputStream, new File(“D:/helloWorld.png”));
}
二、流程定义删除
```java
public class ProcessDefineTest2 {
/**
* 获取默认流程引擎实例,会自动读取activiti.cfg.xml文件
*/
private ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
/**
* 删除搜友key相同的流程定义
*/
@Test
public void deleteKey() {
List<ProcessDefinition> pdList=processEngine.getRepositoryService()
.createProcessDefinitionQuery().processDefinitionKey("myFirstProcess").list();
for(ProcessDefinition pd:pdList) {
processEngine.getRepositoryService().deleteDeployment(pd.getDeploymentId(),true); // 默认是false true就是级联删除
}
}
}
分析:
小结:
(五)Activiti之获取流程定义图片和流程定义删除,请大家指正~
参考资料和推荐阅读
1.链接: 参考资料.