精华内容
下载资源
问答
  • 提供的Service方法如下: Java /** * 获取当前任务流程图 * * @param ...public InputStream generateDiagram(String processInstanceId) { ... //方法中用到的参数是流程实例ID,其实Task...

    提供的Service方法如下:

    Java

    /**
    * 获取当前任务流程图
    *
    * @param processInstanceId
    * @return
    */
    @Override
    public InputStream generateDiagram(String processInstanceId) {
        //方法中用到的参数是流程实例ID,其实TaskId也可以转为这个。调用taskService查询即可。
        Command<InputStream> cmd = new ProcessInstanceDiagramCmd(processInstanceId, runtimeService, repositoryService, processEngine, historyService);
        return managementService.executeCommand(cmd);
    }

    而ProcessInstanceDiagramCmd采用了Activiti的命令模式。就是继承Command接口,其实这个地方完全可以使用纯Service方法去搞定,我之所以这么写,还是受到了国内临远大师的影响。

    本次绘制的流程图分为两种情况:1、流程实例还未执行完毕,也就是流程还没有结束,还有运行的任务。2、已经执行完毕的流程,流程已经进入了流程历史。不管属于以上哪种情况的流程图都会绘制流程走向。

    具体代码如下:

    Java

    import com.google.common.collect.Lists;
    import org.activiti.bpmn.model.BpmnModel;
    import org.activiti.engine.HistoryService;
    import org.activiti.engine.RepositoryService;
    import org.activiti.engine.RuntimeService;
    import org.activiti.engine.history.HistoricActivityInstance;
    import org.activiti.engine.history.HistoricProcessInstance;
    import org.activiti.engine.impl.context.Context;
    import org.activiti.engine.impl.interceptor.Command;
    import org.activiti.engine.impl.interceptor.CommandContext;
    import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
    import org.activiti.engine.impl.pvm.PvmTransition;
    import org.activiti.engine.impl.pvm.process.ActivityImpl;
    import org.activiti.engine.runtime.ProcessInstance;
    import org.activiti.image.impl.DefaultProcessDiagramGenerator;
    import org.activiti.spring.ProcessEngineFactoryBean;
    
    import java.io.InputStream;
    import java.util.*;
    
    /**
     * 根据流程实例ID生成流程图
     *
     * @author Chen Zhiguo
     */
    public class ProcessInstanceDiagramCmd implements Command<InputStream> {
    
        protected String processInstanceId;
    
        private RuntimeService runtimeService;
    
        private RepositoryService repositoryService;
    
        private ProcessEngineFactoryBean processEngine;
    
        private HistoryService historyService;
    
        public ProcessInstanceDiagramCmd(String processInstanceId, RuntimeService runtimeService, RepositoryService repositoryService, ProcessEngineFactoryBean processEngine, HistoryService historyService) {
            this.processInstanceId = processInstanceId;
            this.runtimeService = runtimeService;
            this.repositoryService = repositoryService;
            this.processEngine = processEngine;
            this.historyService = historyService;
        }
    
        public InputStream execute(CommandContext commandContext) {
            ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
                    .processInstanceId(processInstanceId).singleResult();
    
            HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
    
            if (processInstance == null && historicProcessInstance == null) {
                return null;
            }
    
            ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) repositoryService
                    .getProcessDefinition(processInstance == null ? historicProcessInstance.getProcessDefinitionId() : processInstance.getProcessDefinitionId());
    
            BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
    
            List<String> activeActivityIds = Lists.newArrayList();
            if (processInstance != null) {
                activeActivityIds = runtimeService.getActiveActivityIds(processInstance.getProcessInstanceId());
            } else {
                activeActivityIds.add(historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).activityType("endEvent")
                        .singleResult().getActivityId());
            }
            // 使用spring注入引擎请使用下面的这行代码
            Context.setProcessEngineConfiguration(processEngine.getProcessEngineConfiguration());
    
            List<String> highLightedFlows = getHighLightedFlows(processDefinition, processInstanceId);
    
            InputStream imageStream = new DefaultProcessDiagramGenerator().generateDiagram(bpmnModel, "png", activeActivityIds,
                    highLightedFlows);
    
            return imageStream;
        }
    
        /**
         * getHighLightedFlows
         *
         * @param processDefinition
         * @param processInstanceId
         * @return
         */
        private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) {
    
            List<String> highLightedFlows = new ArrayList<String>();
    
    //        List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery()
    //                .processInstanceId(processInstanceId)
    //                        //order by startime asc is not correct. use default order is correct.
    //                        //.orderByHistoricActivityInstanceStartTime().asc()/*.orderByActivityId().asc()*/
    //                .list();
            //上面注释掉的代码是官方的rest方法中提供的方案,可是我在实际测试中有Bug出现,所以做了一下修改。注意下面List内容的排序会影响流程走向红线丢失的问题
            List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId)
                    .orderByHistoricActivityInstanceStartTime().orderByHistoricActivityInstanceEndTime().asc().list();
            LinkedList<HistoricActivityInstance> hisActInstList = new LinkedList<HistoricActivityInstance>();
            hisActInstList.addAll(historicActivityInstances);
    
            getHighlightedFlows(processDefinition.getActivities(), hisActInstList, highLightedFlows);
    
            return highLightedFlows;
        }
    
        /**
         * getHighlightedFlows
         * <p/>
         * code logic:
         * 1. Loop all activities by id asc order;
         * 2. Check each activity's outgoing transitions and eventBoundery outgoing transitions, if outgoing transitions's destination.id is in other executed activityIds, add this transition to highLightedFlows List;
         * 3. But if activity is not a parallelGateway or inclusiveGateway, only choose the earliest flow.
         *
         * @param activityList
         * @param hisActInstList
         * @param highLightedFlows
         */
        private void getHighlightedFlows(List<ActivityImpl> activityList, LinkedList<HistoricActivityInstance> hisActInstList, List<String> highLightedFlows) {
    
            //check out startEvents in activityList
            List<ActivityImpl> startEventActList = new ArrayList<ActivityImpl>();
            Map<String, ActivityImpl> activityMap = new HashMap<String, ActivityImpl>(activityList.size());
            for (ActivityImpl activity : activityList) {
    
                activityMap.put(activity.getId(), activity);
    
                String actType = (String) activity.getProperty("type");
                if (actType != null && actType.toLowerCase().indexOf("startevent") >= 0) {
                    startEventActList.add(activity);
                }
            }
    
            //These codes is used to avoid a bug:
            //ACT-1728 If the process instance was started by a callActivity, it will be not have the startEvent activity in ACT_HI_ACTINST table
            //Code logic:
            //Check the first activity if it is a startEvent, if not check out the startEvent's highlight outgoing flow.
            HistoricActivityInstance firstHistActInst = hisActInstList.getFirst();
            String firstActType = (String) firstHistActInst.getActivityType();
            if (firstActType != null && firstActType.toLowerCase().indexOf("startevent") < 0) {
                PvmTransition startTrans = getStartTransaction(startEventActList, firstHistActInst);
                if (startTrans != null) {
                    highLightedFlows.add(startTrans.getId());
                }
            }
    
            while (!hisActInstList.isEmpty()) {
                HistoricActivityInstance histActInst = hisActInstList.removeFirst();
                ActivityImpl activity = activityMap.get(histActInst.getActivityId());
                if (activity != null) {
                    boolean isParallel = false;
                    String type = histActInst.getActivityType();
                    if ("parallelGateway".equals(type) || "inclusiveGateway".equals(type)) {
                        isParallel = true;
                    } else if ("subProcess".equals(histActInst.getActivityType())) {
                        getHighlightedFlows(activity.getActivities(), hisActInstList, highLightedFlows);
                    }
    
                    List<PvmTransition> allOutgoingTrans = new ArrayList<PvmTransition>();
                    allOutgoingTrans.addAll(activity.getOutgoingTransitions());
                    allOutgoingTrans.addAll(getBoundaryEventOutgoingTransitions(activity));
                    List<String> activityHighLightedFlowIds = getHighlightedFlows(allOutgoingTrans, hisActInstList, isParallel);
                    highLightedFlows.addAll(activityHighLightedFlowIds);
                }
            }
        }
    
        /**
         * Check out the outgoing transition connected to firstActInst from startEventActList
         *
         * @param startEventActList
         * @param firstActInst
         * @return
         */
        private PvmTransition getStartTransaction(List<ActivityImpl> startEventActList, HistoricActivityInstance firstActInst) {
            for (ActivityImpl startEventAct : startEventActList) {
                for (PvmTransition trans : startEventAct.getOutgoingTransitions()) {
                    if (trans.getDestination().getId().equals(firstActInst.getActivityId())) {
                        return trans;
                    }
                }
            }
            return null;
        }
    
        /**
         * getBoundaryEventOutgoingTransitions
         *
         * @param activity
         * @return
         */
        private List<PvmTransition> getBoundaryEventOutgoingTransitions(ActivityImpl activity) {
            List<PvmTransition> boundaryTrans = new ArrayList<PvmTransition>();
            for (ActivityImpl subActivity : activity.getActivities()) {
                String type = (String) subActivity.getProperty("type");
                if (type != null && type.toLowerCase().indexOf("boundary") >= 0) {
                    boundaryTrans.addAll(subActivity.getOutgoingTransitions());
                }
            }
            return boundaryTrans;
        }
    
        /**
         * find out single activity's highlighted flowIds
         *
         * @param pvmTransitionList
         * @param hisActInstList
         * @param isParallel
         * @return
         */
        private List<String> getHighlightedFlows(List<PvmTransition> pvmTransitionList, LinkedList<HistoricActivityInstance> hisActInstList, boolean isParallel) {
    
            List<String> highLightedFlowIds = new ArrayList<String>();
    
            PvmTransition earliestTrans = null;
            HistoricActivityInstance earliestHisActInst = null;
    
            for (PvmTransition pvmTransition : pvmTransitionList) {
    
                String destActId = pvmTransition.getDestination().getId();
                HistoricActivityInstance destHisActInst = findHisActInst(hisActInstList, destActId);
                if (destHisActInst != null) {
                    if (isParallel) {
                        highLightedFlowIds.add(pvmTransition.getId());
                    } else if (earliestHisActInst == null || (earliestHisActInst.getId().compareTo(destHisActInst.getId()) > 0)) {
                        earliestTrans = pvmTransition;
                        earliestHisActInst = destHisActInst;
                    }
                }
            }
    
            if ((!isParallel) && earliestTrans != null) {
                highLightedFlowIds.add(earliestTrans.getId());
            }
    
            return highLightedFlowIds;
        }
    
        private HistoricActivityInstance findHisActInst(LinkedList<HistoricActivityInstance> hisActInstList, String actId) {
            for (HistoricActivityInstance hisActInst : hisActInstList) {
                if (hisActInst.getActivityId().equals(actId)) {
                    return hisActInst;
                }
            }
            return null;
        }
    }


    最重要的是在控制层,通过流程实例id获取到流程图的文件流时,通过以下方法可以展示在jsp页面上:
    public String viewImage(){
    InputStream in = repositoryService.getResourceAsStream.getImageStream(deploymentId,imageName);
    //此处方法实际项目应该放在service里面
    HttpServletResponse resp = ServletActionContext.getResponse();
    try { OutputStream out = resp.getOutputStream(); // 把图片的输入流程写入resp的输出流中
    byte[] b = new byte[1024];
    for (int len = -1; (len= in.read(b))!=-1; ) {
    out.write(b, 0, len);
    } // 关闭流
    out.close();
    in.close(); }
    catch (IOException e) {
    e.printStackTrace();
    }
    return null;
    }

    上面这个方法是控制层的代码,在jsp页面上,使用一个<img>标签来展示流程图
    <img src = ""> <img>标签的src属性为上面这个方法的路径


    转载于:https://www.cnblogs.com/baihaojie/p/5991968.html

    展开全文
  • ProcessEngine processEngine=ProcessEngines.... /**部署流程定义(从inputStream)*/ @Test public void deploymentProcess_inpustream(){ InputStream inputBpmn=this.getClass().getResourceAs...
    ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine();
    

    /**部署流程定义(从inputStream)*/
    @Test
    public void deploymentProcess_inpustream(){
    InputStream  inputBpmn=this.getClass().getResourceAsStream("receiveTask.bpmn");
    InputStream  inputPng=this.getClass().getResourceAsStream("receiveTask.png");
    Deployment deployment=processEngine.getRepositoryService()
                 .createDeployment()
                 .name("部署名称")
                 .addInputStream("receiveTask.bpmn", inputBpmn)   // 部署ID:3801
                 .addInputStream("receiveTask.png", inputPng)     // 部署名称:部署名称
                 .deploy();
    System.out.println("部署ID:"+deployment.getId());
    System.out.println("部署名称:"+deployment.getName());
    }

    /**启动流程实例+设置流程变量+获取流程变量+向后执行一步*/
    @Test
    public void startProcessIntance(){
    // 流程实例key
    String processKey="receiveTask";
    ProcessInstance pi=processEngine.getRuntimeService()
              .startProcessInstanceByKey(processKey);
    System.out.println("流程实例ID:"+pi.getId());     // 流程实例ID:4101
    System.out.println("流程定义ID:"+pi.getProcessDefinitionId()); // 流程定义ID:receiveTask:1:3804

    // 查询 任务中的 流程
    ProcessInstance  pit=processEngine.getRuntimeService()
                .createProcessInstanceQuery()
                .processInstanceId(pi.getId())
                .singleResult();
    /*if(pit==null){
    HistoricProcessInstance hpi=processEngine.getHistoryService()
                       .createHistoricProcessInstanceQuery()
                       .processInstanceId(pi.getId())
                       .singleResult();
    System.out.println(" "+hpi.getId()+" "+hpi.getProcessDefinitionId()+" "+hpi.getStartTime()+" "+hpi.getEndTime());
    }*/

    // 执行流程对象
    Execution execution1=processEngine.getRuntimeService()
                .createExecutionQuery()
                .processInstanceId(pi.getId())
                .activityId("receivetask1")
                .singleResult();
    /**使用流程变量设置当日销售额,用来传递业务参数*/             
    processEngine.getRuntimeService().setVariable(execution1.getId(), "汇总当日销售额", 2000);

    /**向后执行一步,如果流程处于等待状态,使得流程继续执行*/
    processEngine.getRuntimeService().signal(execution1.getId());
    /**查询执行对象ID*/
    Execution execution2=processEngine.getRuntimeService()
                .createExecutionQuery()
                .processInstanceId(pi.getId())
                .activityId("receivetask2")
                .singleResult();
    /**从流程变量中获取汇总当日销售额的值*/
    Integer value=(Integer)processEngine.getRuntimeService().getVariable(execution2.getId(), "汇总当日销售额");
    System.out.println("给老板发送短信:金额是:"+value);   //给老板发送短信:金额是:2000
    /**向后执行一步,如果流程处于等待状态,使得流程继续执行*/
    processEngine.getRuntimeService().signal(execution2.getId());
    }
    展开全文
  • 主要介绍了activiti获取流程图的方法,需要的朋友可以参考下
  • //获取流程实例的所有历史活动,即经历的各个审批节点 List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list(); map.put(...
      @RequestMapping(value = "findPicture")
        @ResponseBody
        public Map findPicture(String processInstanceId){
            Map map=new HashMap();
            try {
            HistoricProcessInstance historicProcessInstance=historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
    
            BpmnModel bpmnModel=repositoryService.getBpmnModel(historicProcessInstance.getProcessDefinitionId());
    
            List<String> activityIds=new ArrayList<>();
            //判断流程实例是否已经结束
            if (historicProcessInstance.getEndTime()==null){
                //获取该流程实例的当前活动节点
                  //在得到的流程图片上会以红框高亮显示
                activityIds= runtimeService.getActiveActivityIds(processInstanceId);
            }
            //获取流程图信息
            InputStream inputStream=processEngineConfiguration.getProcessDiagramGenerator().generateDiagram(bpmnModel,"png",activityIds);
                //转换方便页面展示图拍呢
                byte[] bytes=IOUtils.toByteArray(inputStream);
                String img=new String(Base64.encodeBase64(bytes));
                //获取该流程实例的所有历史活动,即经历的各个审批节点
            List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();
            map.put("success",true);
            map.put("data",img);
            return map;
            } catch (IOException e) {
                e.printStackTrace();
            }
            map.put("success",false);
            map.put("data",null);
            return map;
        }

     

    展开全文
  • 某个流程实例的节点信息都是存放在ACT_HI_ACTINST表中 business key存放在ACT_HI_PROCINST中,得到HistoricProcessInstance后获得对应的流程实例id。然后根据流程实例id获得ACT_HI_ACTINST对应的数据。即审批记录...
    已知businessid即eventid获得对应的审批记录 
    

    某个流程实例的节点信息都是存放在ACT_HI_ACTINST表中

    business key存放在ACT_HI_PROCINST中,得到HistoricProcessInstance后获得对应的流程实例id。然后根据流程实例id获得ACT_HI_ACTINST对应的数据。即审批记录存放在ACT_HI_ACTINST中。结束时间不为空则说明已经审批完成

    
     /**
    	 * 
    	 * @CreateUser:xxxxx
    	 * @ReturnType:List
    	 * @param businessEventId
    	 * @return
    	 * @CreateDate:2014-6-10下午5:07:02
    	 * @UseFor :获得某个流程实例各个节点的审批记录
    	 */
    	public List getApproveHistory(String businessEventId) {
    
    		List<TaskBo> taskBoList = new ArrayList<TaskBo>();
    		HistoricProcessInstance hisProcessInstance = (HistoricProcessInstance) historyService
    				.createHistoricProcessInstanceQuery()
    				.processInstanceBusinessKey(businessEventId).singleResult();
    		// 该流程实例的所有节点审批记录
    		List<HistoricActivityInstanceQuery> hisActInstList = getHisUserTaskActivityInstanceList(hisProcessInstance
    				.getId());
    		for (Iterator iterator = hisActInstList.iterator(); iterator.hasNext();) {
    			// 需要转换成HistoricActivityInstance
    			HistoricActivityInstance activityInstance = (HistoricActivityInstance) iterator
    					.next();
    			//如果还没结束则不放里面
    			if ("".equals(taskBo.getEndTime()) || taskBo.getEndTime() == null) {
    				continue;
    			}
    			TaskBo taskBo = new TaskBo();
    			taskBo.setTaskName(activityInstance.getActivityName());
    			// 获得审批人名称 Assignee存放的是审批用户id
    			if (activityInstance.getAssignee() != null) {
    				taskBo.setApproveUserName(getUserName(activityInstance
    						.getAssignee()));
    			} else {
    				taskBo.setApproveUserName("");
    			}
    			// 获取流程节点开始时间
    			taskBo.setStartTime(activityInstance.getStartTime() != null ? DateTimeUtil
    					.getFormatDate(activityInstance.getStartTime(),
    							WorkflowConstants.DATEFORMATSTRING) : "");
    			// 获取流程节点结束时间
    			if (activityInstance.getEndTime() == null) {
    				taskBo.setEndTime("");
    			} else {
    				taskBo.setEndTime(DateTimeUtil.getFormatDate(
    						activityInstance.getEndTime(),
    						WorkflowConstants.DATEFORMATSTRING));
    			}
    			taskBoList.add(taskBo);
    		}
    		return taskBoList;
    	}
    
    	/**
    	 * 
    	 * @CreateUser:xxxx
    	 * @ReturnType:List
    	 * @param processInstanceId
    	 * @return
    	 * @CreateDate:2014-6-25下午5:03:13
    	 * @UseFor :在 ACT_HI_ACTINST 表中找到对应流程实例的userTask节点 不包括startEvent
    	 */
    	private List<HistoricActivityInstanceQuery> getHisUserTaskActivityInstanceList(
    			String processInstanceId) {
    		List<HistoricActivityInstanceQuery> hisActivityInstanceList = ((HistoricActivityInstanceQuery) historyService
    				.createHistoricActivityInstanceQuery()
    				.processInstanceId(processInstanceId).activityType("userTask")
    				.finished().orderByHistoricActivityInstanceEndTime().desc())
    				.list();
    		return hisActivityInstanceList;
    	}
    
    	/**
    	 * 
    	 * @CreateUser:xxxx
    	 * @ReturnType:String
    	 * @param userId
    	 * @return
    	 * @CreateDate:2014-6-10下午5:04:30
    	 * @UseFor :获得审批人
    	 */
    	private String getUserName(String userId) {
    		User user = (User) identityService.createUserQuery().userId(userId)
    				.singleResult();
    		return user.getFirstName();
    	}
    
    展开全文
  • activiti学习笔记(二) 获取流程实例

    千次阅读 2017-08-05 20:53:03
    获取流程实例 流程实例获取的源码解析    以获取默认的流程实例为例,来解释整个流程实例获取过程 文件位置:/org/activiti/engine/ProcessEngines.java    第一步:通过getDefaultProcessEngine来获取...
  • Activiti获取某个流程实例的FormKey

    千次阅读 2017-04-11 10:59:05
    //获取需查询的任务实例 HistoricTaskInstance task = (HistoricTaskInstance) historyService .createHistoricTaskInstanceQuery().taskId(taskId) .singleResult(); //获取流程定义对象 ...
  • String="xiaoming"; identityService.setAuthenticatedUserId(userAccount);
  • activity实例任务加签

    千次阅读 2020-06-26 17:50:48
    根据一级流程实例查找二级流程执行实例 判断二级执行实例是否是多实例任务节点的父级实例 通过两级执行实例创建三级执行实例; 通过二级执行实例获取nrOfInstances并+1 加签思路2 通知新的实例开始执行,并创建...
  • activity获取流程

    2019-03-24 18:04:08
    网上找到可能会报错 是 InputStream inputStream = p.generateDiagram(bpmnModel, “png”, highLightedActivitis, ...这一块,简单看了下,就是花流程图的方法,有好多种参数 Controller层 public void queryPic...
  • activity实例任务减签

    千次阅读 2020-06-26 16:04:44
    前言 加签或减签的操作在多实例任务节点中是经常遇见的,...3、根据执行实例Id获取到当前执行实例的父级实例(二级实例) 4、根据二级执行实例删除三级实例数据,并删除关联数据(关联表) 5、根据二级执行实例获取nrOfIn
  • activity实例节点任意跳转

    千次阅读 2020-07-01 23:16:29
    想必还记得我们在之前的篇章中谈到的那个流程实例跳转过程中的3级实例树吧?以多实例节点跳出为例 需要的参数,任务ID、目标节点 判断当前的节点是否是多实例任务节点 获取二级执行实例信息 删除二级实
  • 工作流流程实例迁移

    千次阅读 2020-02-02 20:09:35
    摘要:flowable6.5版本提供了流程实例的迁移API,开发人员可以将指定版本下的流程实例迁移到最新的版本中。本文重点讲解Flowable的这些APi使用,以及对比Camunda工作流引擎流程实例迁移功能。 流程迁移API说明 流程...
  • Activity流程框架

    千次阅读 2019-07-12 12:47:37
    流程定义 流程实例 流程变量 任务 起始结束 网关 ProcessEngine 线程安全 是Activiti5的核心,所有的服务都需要通过ProcessEngine来创建 Activiti5的持久化层采用的是Mybatis 通过ProcessEngine创建的7个service: ...
  • 1.根据实例取得该实例信息的个例 HistoricProcessInstance processInstance= ProcessEngines.getDefaultProcessEngine(). getHistoryService().createHistoricProcessInstanceQuery(). processInstanceId...
  • 没有部署相应的流程图。
  • Android Activity startActivity流程简介

    千次阅读 2018-11-14 10:35:30
    Android Activity startActivity流程简介
  • activity流程变量使用

    千次阅读 2020-06-25 15:39:06
    activity中有一个非常强大的功能就是可以动态设置流程变量,activity流程变量的用处总结下来,作用有几点,一是可以动态为某个流程节点设置执行条件,在流程运转的过程中进行传递,第二个就是配合网关和监听器一起...
  • 获取 ActivityManagerService 服务

    千次阅读 2019-03-17 01:11:57
    获取 ActivityManagerService 服务一、Java 层获取系统服务二、SystemServiceRegistry 静态代码块,创建并保存服务三、获取 ActivityManagerService 服务流程四、补充:API 25 获取 AMS 的方式 API 26 一、Java 层...
  • activiti,根据流程实例id,获取下个userTask节点的配置信息,需要在每个节点都添加complete的监听器   public class Competeistener implements TaskListener {  private ProcessEngine processEngine = ...
  • flowable流程实例管理接口

    千次阅读 2019-08-17 14:37:40
    一、流程实例的管理接口常见功能: 1.启动一个流程(即创建一个流程实例) 2.本人发起的流程实例 3.本人参与的流程实例 4.挂起/激活流程实例 5.提前终止流程实例(或又叫撤销流程) 6.彻底删除流程实例 7.流程图查看...
  • 查找到原因:点击驳回,流程实例返回的是null taskService.complete(taskId, variables); //4:当任务完成之后,需要指定下一个任务的办理人(使用类)-----已经开发完成 ProcessInstance pi = runtimeService....
  • aiciviti 查询历史流程实例需求根据流程定义key,依赖historyservice服务来完成代码 需求 用户和管理员有时候需要统计,有多少个业务实例通过了审核,这个时候需要查询指定流程下的已完成的流程实例,用做后期的统计...
  • 流程实例启动: 获取ProcessEngine对象 获取runtimeService对象 创建流程实例,流程定义的key需要知道 创建ActivitiStartInstance类 public class ActivitiStartInstance { public static void main(String[] ...
  • Activiti流程实例查询

    2020-04-25 21:10:38
    一代码 /** * Copyright (C), 2020-2020, ...* FileName: ProcessInstanceQuery.java * Author: cakin * Date: 2020/4/25 * Description: 流程实例查询 */ package com.syc.activiti.chapter9; import java.util...
  • Activity流程——调用子流程

    千次阅读 2020-06-14 12:11:54
    BPMN2.0区分一般的子流程,通常也称作嵌入式子流程,与... 当流程执行到大call activity时,会创建一个新的执行,作为达到调用活动的执行的子执行。这个子执行之后用于执行子流程,潜在地创建了类似普通流程的并行子...
  • 本文章基于Android9.0,测试demo为在一个已经启动的MainActivity中点击按钮通过调用startActivity启动SecondActivity,通过在源码中添加log定位分析整个流程。 启动操作: startActivity(new Intent(this, ...
  • activity启动流程

    千次阅读 2012-11-24 16:44:58
    再有一个是以类图的方式展现的activity启动的流程,可以看到各个类的主要作用 主要函数 分析: startActivityLocked 1、 getRecordForAppLocked获取调用者的相关信息保存到ProcessRecord变量,这里传递的...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 30,333
精华内容 12,133
关键字:

获取activity流程实例