activiti7流程实例启动

假如想象 提交于 2019-12-03 15:48:15
package com.zcc.acvitivi;import org.activiti.engine.ProcessEngine;import org.activiti.engine.ProcessEngineConfiguration;import org.activiti.engine.RuntimeService;import org.activiti.engine.runtime.ProcessInstance;/** * 启动流程实例 * 相关表: * act_hi_actinst 已完成信息 * act_hi_identitylink 参与表 * act_hi_procinst 流程实例 * act_hi_taskinst 任务实例 * act_ru_execution 执行表 * act_ru_identitylink 参与表 * act_ru_task 任务表 */public class ActivitiStartInstance {    public static void main(String[] args) {        //创建流程引擎配置类        ProcessEngineConfiguration processEngineConfiguration=                ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");        //流程引擎对象        ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();        //获取RuntimeService        RuntimeService runtimeService = processEngine.getRuntimeService();        //根据key启动流程实例        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess");        System.out.println("流程部署id"+processInstance.getDeploymentId());        System.out.println("流程实例id"+processInstance.getId());        System.out.println("活动id"+processInstance.getActivityId());    }}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!