一.任务说明
1.三我的会签, 2我的经过,则经过java
二.流程xml
这里使用 {nrOfCompletedInstances/nrOfInstances >= 0.6 结束任务, 在activit变量表中能够找到这个参数, 处理人个数, 已处理个数,剩余处理个数.oop
<process id="test_many_instance" name="单任务多实例" isExecutable="true"> <startEvent id="startevent1" name="启动流程"/> <userTask id="usertask1" name="多人并行会签" activiti:assignee="${user}"> <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${users}" activiti:elementVariable="user"> <completionCondition>${nrOfCompletedInstances/nrOfInstances >= 0.6 }</completionCondition> </multiInstanceLoopCharacteristics> </userTask> <endEvent id="endevent1" name="结束流程"/> <parallelGateway id="bingxingwang1" name="并行网关"/> <parallelGateway id="bingxingwangguan2" name="并行网关2"/> <userTask id="usertaskone" name="管理员任务" activiti:assignee="thinkgem"/> <sequenceFlow id="flow21" sourceRef="bingxingwang1" targetRef="usertaskone"/> <sequenceFlow id="flow22" sourceRef="usertaskone" targetRef="bingxingwangguan2"/> <sequenceFlow id="flow1" name="多人会签flow" sourceRef="startevent1" targetRef="bingxingwang1"/> <sequenceFlow id="flow2" sourceRef="bingxingwang1" targetRef="usertask1"/> <sequenceFlow id="flow3" name="结束flow" sourceRef="usertask1" targetRef="bingxingwangguan2"/> <sequenceFlow id="flow4" sourceRef="bingxingwangguan2" targetRef="endevent1"/> </process>
三.java 启动代码spa
Pubform bean=new Pubform(); bean.setContent("头痛"); pubformService.save(bean); Map<String, Object> variables=new HashMap<String, Object>(); String businessKey = bean.getId().toString(); variables.put("type", "pubForm流程"); variables.put("busId", bean.getId()); List<String> users=Arrays.asList("sd_zhb","sd_zhb2","thinkgem"); // variables.put("users", users) ; // 2.启动流程 String processDefinitionKey=rmap.get("processDefinitionKey"); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables); bean.setProcessInstanceId(processInstance.getId()); pubformService.save(bean);