package com.zcc.acvitivi;import org.activiti.engine.ProcessEngine;import org.activiti.engine.ProcessEngineConfiguration;import org.activiti.engine.RepositoryService;import org.activiti.engine.repository.Deployment;/** * 流程定义部署 * 相关表: * act_re_deployment * act_re_procdef * act_ge_bytearray * */public class ActivitiDeployment { public static void main(String[] args) { //创建流程引擎配置类 ProcessEngineConfiguration processEngineConfiguration= ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml"); //流程引擎对象 ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine(); //创建RepositoryService RepositoryService repositoryService = processEngine.getRepositoryService(); //部署对象 Deployment deployment = repositoryService.createDeployment(). addClasspathResource("diagram/my2.bpmn") .name("请假流程").deploy(); System.out.println(deployment.getId()); System.out.println(deployment.getKey()); }}
来源:https://www.cnblogs.com/yscec/p/11802752.html