zoukankan      html  css  js  c++  java
  • activiti7启动流程实例,动态设置assignee人

    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());

    }
    }
  • 相关阅读:
    A1141. PAT Ranking of Institutions
    A1140. Look-and-say Sequence
    A1139. First Contact
    A1138. Postorder Traversal
    A1137. Final Grading
    A1136. Delayed Palindrome
    A1135. Is It A Red-Black Tree
    A1134. Vertex Cover
    A1133. Splitting A Linked List
    layer.open打开iframe页面的调用父页面方法及关闭
  • 原文地址:https://www.cnblogs.com/yscec/p/11802783.html
Copyright © 2011-2022 走看看