activiti7启动流程实例,动态设置assignee人

左心房为你撑大大i 提交于 2019-12-03 15:49:00
package com.zcc.activiti03;import org.activiti.engine.ProcessEngine;import org.activiti.engine.ProcessEngineConfiguration;import org.activiti.engine.RuntimeService;import org.activiti.engine.TaskService;import org.activiti.engine.runtime.ProcessInstance;import org.activiti.engine.task.Task;import org.activiti.engine.task.TaskQuery;import java.util.HashMap;import java.util.List;import java.util.Map;/** *启动流程实例,动态设置assignee人 */public class AssigneeUEL {    public static void main(String[] args) {        //创建流程引擎配置类        ProcessEngineConfiguration processEngineConfiguration=                ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");        //流程引擎对象        ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();        //获取runtimeService        RuntimeService runtimeService = processEngine.getRuntimeService();        //设置assignee,用户可以在界面上设置任务节点的执行人        Map<String,Object> map=new HashMap<>();        map.put("assignee0","张三");        map.put("assignee1","李四");        map.put("assignee2","王五");        //启动流程实例,同时设置任务节点执行人        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess2", map);        System.out.println(processInstance.getName());    }}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!