【从零开始学Java】第三章 HelloWorld入门程序
2021-04-03 07:25
标签:权限 class 等等 规范 new str 步骤 his super 1、流程定义部署方式 【从零开始学Java】第三章 HelloWorld入门程序 标签:权限 class 等等 规范 new str 步骤 his super 原文地址:https://www.cnblogs.com/wybing/p/13462117.htmlpackage 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("流程部署成功!");
}
}
文章标题:【从零开始学Java】第三章 HelloWorld入门程序
文章链接:http://soscw.com/index.php/essay/71716.html