流程属性
<process id="holiday2" isClosed="false" isExecutable="true" processType="None" name="第一个流程">
userTask属性设置
<userTask activiti:assignee="${assignee0}" activiti:exclusive="true" id="_3" name="填写请假单"/>
activiti:assignee="${assignee0}" 动态绑定assignee
//1.得到ProcessEngine对象
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
//2.得到RuntimeService对象
RuntimeService runtimeService = processEngine.getRuntimeService();
//3.设置assignee的取值 用户可以在界面上设置流程的执行人
Map<String,Object> map = new HashMap<String,Object>();
map.put("assignee0","zhangsan");
map.put("assignee1","lishi");
map.put("assignee2","wangwu");
//4.启动流程实例,同时还要设置流程定义的assignee的值
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("holiday2", map);
//5.输出
System.out.println(processEngine.getName());
流程变量
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1542005753287" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProcess_1" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:assignee="zhangsan" activiti:exclusive="true" id="_3" name="填写请假申请单"/>
<userTask activiti:assignee="lishi" activiti:exclusive="true" id="_4" name="部门经理审批"/>
<userTask activiti:assignee="wangwu" activiti:exclusive="true" id="_5" name="总经理审批"/>
<userTask activiti:assignee="zhaoliu" activiti:exclusive="true" id="_6" name="人事经理存档"/>
<endEvent id="_7" name="EndEvent"/>
<sequenceFlow id="_8" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_9" sourceRef="_3" targetRef="_4"/>
<sequenceFlow id="_10" sourceRef="_4" targetRef="_5">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${holiday.num>3}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_11" sourceRef="_4" targetRef="_6">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${holiday.num<=3}]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_12" sourceRef="_5" targetRef="_6"/>
<sequenceFlow id="_13" sourceRef="_6" targetRef="_7"/>
</process>
</definitions>
对应的流程图
流程图.png组任务、候选人
<userTasj activiti:candiadteUsers="张三,李四"/>
多个候选人之间用英文‘逗号’隔开
网友评论