标签:权限 class 等等 规范 new str 步骤 his super
1、流程定义部署方式
package com.an.processdeploy; import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngines; import org.activiti.engine.RepositoryService; import org.junit.jupiter.api.Test; import java.io.InputStream; import java.util.zip.ZipInputStream; public class ProcessDeploy { ProcessEngine processEngine= ProcessEngines.getDefaultProcessEngine(); @Test public void deployOne(){ RepositoryService repositoryService = processEngine.getRepositoryService(); repositoryService.createDeployment().name("请假流程") .addClasspathResource("helloworld.bpmn") .addClasspathResource("helloworld.png") .deploy(); System.out.println("流程部署成功!"); } @Test public void deployTwo(){ // helloworld.zip不加/ 从当前包中找文件 // helloworld.zip加/ 从classpath中找文件 InputStream inputStream = this.getClass().getResourceAsStream("/helloworld.zip"); RepositoryService repositoryService = processEngine.getRepositoryService(); repositoryService.createDeployment().name("请假流程") .addZipInputStream(new ZipInputStream(inputStream)) .deploy(); System.out.println("流程部署成功!"); } }
标签:权限 class 等等 规范 new str 步骤 his super
原文地址:https://www.cnblogs.com/wybing/p/13462117.html