Commit 85426568bf273290b27c38b552c8456ff15fb24e
1 parent
0e988ce5
flowable单元测试
Showing
36 changed files
with
1939 additions
and
0 deletions
yudao-module-bpm/yudao-module-bpm-biz/pom.xml
| @@ -64,5 +64,18 @@ | @@ -64,5 +64,18 @@ | ||
| 64 | <groupId>cn.iocoder.boot</groupId> | 64 | <groupId>cn.iocoder.boot</groupId> |
| 65 | <artifactId>yudao-spring-boot-starter-flowable</artifactId> | 65 | <artifactId>yudao-spring-boot-starter-flowable</artifactId> |
| 66 | </dependency> | 66 | </dependency> |
| 67 | + <!--junit4--> | ||
| 68 | + <dependency> | ||
| 69 | + <groupId>junit</groupId> | ||
| 70 | + <artifactId>junit</artifactId> | ||
| 71 | + <version>4.11</version> | ||
| 72 | + <scope>test</scope> | ||
| 73 | + </dependency> | ||
| 74 | + <dependency> | ||
| 75 | + <groupId>com.h2database</groupId> | ||
| 76 | + <artifactId>h2</artifactId> | ||
| 77 | + <version>1.4.196</version> | ||
| 78 | + <scope>test</scope> | ||
| 79 | + </dependency> | ||
| 67 | </dependencies> | 80 | </dependencies> |
| 68 | </project> | 81 | </project> |
yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/AbstractOATest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.bpm; | ||
| 2 | + | ||
| 3 | +import org.flowable.engine.*; | ||
| 4 | +import org.flowable.engine.impl.ProcessEngineImpl; | ||
| 5 | +import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; | ||
| 6 | +import org.flowable.engine.impl.test.TestHelper; | ||
| 7 | +import org.flowable.engine.test.FlowableRule; | ||
| 8 | +import org.junit.AfterClass; | ||
| 9 | +import org.junit.Before; | ||
| 10 | +import org.junit.BeforeClass; | ||
| 11 | +import org.junit.Rule; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 抽象测试基类 | ||
| 15 | + * | ||
| 16 | + * @author henryyan cuicui | ||
| 17 | + */ | ||
| 18 | +public abstract class AbstractOATest { | ||
| 19 | + | ||
| 20 | + protected String configurationResource = "flowable.cfg.xml"; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 专门用于测试套件 | ||
| 24 | + */ | ||
| 25 | + @Rule | ||
| 26 | + public FlowableRule activitiRule = new FlowableRule("flowable.cfg.xml"); | ||
| 27 | + | ||
| 28 | + protected ProcessEngineConfigurationImpl processEngineConfiguration; | ||
| 29 | + | ||
| 30 | + protected ProcessEngine processEngine; | ||
| 31 | + protected RepositoryService repositoryService; | ||
| 32 | + protected RuntimeService runtimeService; | ||
| 33 | + protected TaskService taskService; | ||
| 34 | + protected HistoryService historyService; | ||
| 35 | + protected IdentityService identityService; | ||
| 36 | + protected ManagementService managementService; | ||
| 37 | + protected FormService formService; | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 开始测试 | ||
| 41 | + */ | ||
| 42 | + @BeforeClass | ||
| 43 | + public static void setUpForClass() throws Exception { | ||
| 44 | + System.out.println("++++++++ 开始测试 ++++++++"); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * 结束测试 | ||
| 49 | + */ | ||
| 50 | + @AfterClass | ||
| 51 | + public static void testOverForClass() throws Exception { | ||
| 52 | + System.out.println("-------- 结束测试 --------"); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + protected void initializeProcessEngine() { | ||
| 56 | + processEngine = TestHelper.getProcessEngine(configurationResource); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 初始化变量 | ||
| 61 | + */ | ||
| 62 | + @Before | ||
| 63 | + public void setUp() throws Exception { | ||
| 64 | + if (processEngine == null) { | ||
| 65 | + initializeProcessEngine(); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration(); | ||
| 69 | + repositoryService = processEngine.getRepositoryService(); | ||
| 70 | + runtimeService = processEngine.getRuntimeService(); | ||
| 71 | + taskService = processEngine.getTaskService(); | ||
| 72 | + historyService = processEngine.getHistoryService(); | ||
| 73 | + identityService = processEngine.getIdentityService(); | ||
| 74 | + managementService = processEngine.getManagementService(); | ||
| 75 | + formService = processEngine.getFormService(); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | +} |
yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/ConditionTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.bpm; | ||
| 2 | + | ||
| 3 | +import org.flowable.engine.history.HistoricDetail; | ||
| 4 | +import org.flowable.engine.history.HistoricFormProperty; | ||
| 5 | +import org.flowable.engine.history.HistoricProcessInstance; | ||
| 6 | +import org.flowable.engine.history.HistoricVariableUpdate; | ||
| 7 | +import org.flowable.engine.repository.ProcessDefinition; | ||
| 8 | +import org.flowable.engine.runtime.ProcessInstance; | ||
| 9 | +import org.flowable.engine.test.Deployment; | ||
| 10 | +import org.flowable.task.api.Task; | ||
| 11 | +import org.joda.time.DateTime; | ||
| 12 | +import org.junit.Test; | ||
| 13 | + | ||
| 14 | +import java.text.SimpleDateFormat; | ||
| 15 | +import java.util.*; | ||
| 16 | + | ||
| 17 | +import static org.junit.Assert.assertEquals; | ||
| 18 | +import static org.junit.Assert.assertNotNull; | ||
| 19 | + | ||
| 20 | +/** | ||
| 21 | + * 条件测试 | ||
| 22 | + * 1 某个节点-支付额度需要大于70% | ||
| 23 | + * 2 支付条件完成后,开始倒计时15天,要完成流程处理 | ||
| 24 | + * @author cuicui | ||
| 25 | + */ | ||
| 26 | +public class ConditionTest extends AbstractOATest { | ||
| 27 | + | ||
| 28 | + @Test | ||
| 29 | + @Deployment(resources = {"chapter6/leave-timeLimit-money/leave-formkey-ext.bpmn", "chapter6/leave-timeLimit-money/leave-start.form", | ||
| 30 | + "chapter6/leave-timeLimit-money/approve-deptLeader.form", "chapter6/leave-timeLimit-money/approve-hr.form", "chapter6/leave-timeLimit-money/report-back.form", | ||
| 31 | + "chapter6/leave-timeLimit-money/modify-apply.form"}) | ||
| 32 | + public void allPass() throws Exception { | ||
| 33 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 34 | + Map<String, String> variables = new HashMap<String, String>(); | ||
| 35 | + Calendar ca = Calendar.getInstance(); | ||
| 36 | + String startDate = sdf.format(ca.getTime()); | ||
| 37 | + ca.add(Calendar.DAY_OF_MONTH, 2); // 当前日期加2天 | ||
| 38 | + String endDate = sdf.format(ca.getTime()); | ||
| 39 | + | ||
| 40 | + // 启动流程 | ||
| 41 | + variables.put("startDate", startDate); | ||
| 42 | + variables.put("endDate", endDate); | ||
| 43 | + variables.put("reason", "公休"); | ||
| 44 | + | ||
| 45 | + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult(); | ||
| 46 | + | ||
| 47 | + // 读取启动表单 | ||
| 48 | + Object renderedStartForm = formService.getRenderedStartForm(processDefinition.getId()); | ||
| 49 | + assertNotNull(renderedStartForm); | ||
| 50 | + | ||
| 51 | + // 启动流程 | ||
| 52 | + // 设置当前用户 | ||
| 53 | + String currentUserId = "henryyan"; | ||
| 54 | + identityService.setAuthenticatedUserId(currentUserId); | ||
| 55 | + ProcessInstance processInstance = formService.submitStartFormData(processDefinition.getId(), variables); | ||
| 56 | + assertNotNull(processInstance); | ||
| 57 | + | ||
| 58 | + // 部门领导审批通过 | ||
| 59 | + Task deptLeaderTask = taskService.createTaskQuery().taskCandidateGroup("deptLeader").singleResult(); | ||
| 60 | + assertNotNull(formService.getRenderedTaskForm(deptLeaderTask.getId())); | ||
| 61 | + variables = new HashMap<String, String>(); | ||
| 62 | + variables.put("deptLeaderApproved", "true"); | ||
| 63 | + formService.submitTaskFormData(deptLeaderTask.getId(), variables); | ||
| 64 | + | ||
| 65 | + // 人事审批通过 | ||
| 66 | + Task hrTask = taskService.createTaskQuery().taskCandidateGroup("hr").singleResult(); | ||
| 67 | + assertNotNull(formService.getRenderedTaskForm(hrTask.getId())); | ||
| 68 | + variables = new HashMap<String, String>(); | ||
| 69 | + variables.put("hrApproved", "true"); | ||
| 70 | + //手动设置支付金额 | ||
| 71 | + variables.put("amountMoney", "19999"); | ||
| 72 | + formService.submitTaskFormData(hrTask.getId(), variables); | ||
| 73 | + //判断支付金额是否>1万元 | ||
| 74 | + // 财务打款通过 | ||
| 75 | + Task caiwuTask = taskService.createTaskQuery().taskCandidateGroup("caiwu").singleResult(); | ||
| 76 | + printTask(caiwuTask); | ||
| 77 | + taskService.complete(caiwuTask.getId()); | ||
| 78 | + //判断倒计时15天 | ||
| 79 | + Task chuNaTask = taskService.createTaskQuery().taskCandidateGroup("chuNa").singleResult(); | ||
| 80 | + printTask(chuNaTask); | ||
| 81 | + taskService.complete(chuNaTask.getId()); | ||
| 82 | + | ||
| 83 | + // 销假(根据申请人的用户ID读取) | ||
| 84 | +// Task reportBackTask = taskService.createTaskQuery().taskAssignee(currentUserId).singleResult(); | ||
| 85 | +// assertNotNull(formService.getRenderedTaskForm(reportBackTask.getId())); | ||
| 86 | +// variables = new HashMap<String, String>(); | ||
| 87 | +// variables.put("reportBackDate", sdf.format(ca.getTime())); | ||
| 88 | +// formService.submitTaskFormData(reportBackTask.getId(), variables); | ||
| 89 | + | ||
| 90 | + // 验证流程是否已经结束 | ||
| 91 | + HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().finished().singleResult(); | ||
| 92 | + assertNotNull(historicProcessInstance); | ||
| 93 | + | ||
| 94 | + // 读取历史变量 | ||
| 95 | + Map<String, Object> historyVariables = packageVariables(processInstance); | ||
| 96 | + | ||
| 97 | + // 验证执行结果 | ||
| 98 | + assertEquals("ok", historyVariables.get("result")); | ||
| 99 | + | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /** | ||
| 103 | + * 查询过期任务 | ||
| 104 | + * @throws Exception | ||
| 105 | + */ | ||
| 106 | + @Test | ||
| 107 | + @Deployment(resources = {"chapter6/leave-timeLimit-money/leave-formkey-ext.bpmn", "chapter6/leave-timeLimit-money/leave-start.form", | ||
| 108 | + "chapter6/leave-timeLimit-money/approve-deptLeader.form", "chapter6/leave-timeLimit-money/approve-hr.form", "chapter6/leave-timeLimit-money/report-back.form", | ||
| 109 | + "chapter6/leave-timeLimit-money/modify-apply.form"}) | ||
| 110 | + public void dueDate() throws Exception { | ||
| 111 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 112 | + Map<String, String> variables = new HashMap<String, String>(); | ||
| 113 | + Calendar ca = Calendar.getInstance(); | ||
| 114 | + String startDate = sdf.format(ca.getTime()); | ||
| 115 | + ca.add(Calendar.DAY_OF_MONTH, 2); // 当前日期加2天 | ||
| 116 | + String endDate = sdf.format(ca.getTime()); | ||
| 117 | + | ||
| 118 | + // 启动流程 | ||
| 119 | + variables.put("startDate", startDate); | ||
| 120 | + variables.put("endDate", endDate); | ||
| 121 | + variables.put("reason", "公休"); | ||
| 122 | + | ||
| 123 | + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult(); | ||
| 124 | + | ||
| 125 | + // 读取启动表单 | ||
| 126 | + Object renderedStartForm = formService.getRenderedStartForm(processDefinition.getId()); | ||
| 127 | + assertNotNull(renderedStartForm); | ||
| 128 | + | ||
| 129 | + // 启动流程 | ||
| 130 | + // 设置当前用户 | ||
| 131 | + String currentUserId = "henryyan"; | ||
| 132 | + identityService.setAuthenticatedUserId(currentUserId); | ||
| 133 | + ProcessInstance processInstance = formService.submitStartFormData(processDefinition.getId(), variables); | ||
| 134 | + assertNotNull(processInstance); | ||
| 135 | + | ||
| 136 | + // 部门领导审批通过 | ||
| 137 | + Task deptLeaderTask = taskService.createTaskQuery().taskCandidateGroup("deptLeader").singleResult(); | ||
| 138 | + assertNotNull(formService.getRenderedTaskForm(deptLeaderTask.getId())); | ||
| 139 | + variables = new HashMap<String, String>(); | ||
| 140 | + variables.put("deptLeaderApproved", "true"); | ||
| 141 | + formService.submitTaskFormData(deptLeaderTask.getId(), variables); | ||
| 142 | + | ||
| 143 | + // 人事审批通过 | ||
| 144 | + Task hrTask = taskService.createTaskQuery().taskCandidateGroup("hr").singleResult(); | ||
| 145 | + assertNotNull(formService.getRenderedTaskForm(hrTask.getId())); | ||
| 146 | + variables = new HashMap<String, String>(); | ||
| 147 | + variables.put("hrApproved", "true"); | ||
| 148 | + //手动设置支付金额 | ||
| 149 | + variables.put("amountMoney", "19999"); | ||
| 150 | + formService.submitTaskFormData(hrTask.getId(), variables); | ||
| 151 | + //判断支付金额是否>1万元 | ||
| 152 | + // 财务打款通过 | ||
| 153 | + Task caiwuTask = taskService.createTaskQuery().taskCandidateGroup("caiwu").singleResult(); | ||
| 154 | + printTask(caiwuTask); | ||
| 155 | + | ||
| 156 | + //设置5天前就过期了 | ||
| 157 | + DateTime dateTime = DateTime.now(); | ||
| 158 | + DateTime minusDays = dateTime.minusDays(5); | ||
| 159 | + taskService.setDueDate(caiwuTask.getId(),minusDays.toDate()); | ||
| 160 | + //查询今天以前的过期任务 | ||
| 161 | + List<Task> listTask = taskService.createTaskQuery().taskDueBefore(new Date()).list(); | ||
| 162 | + for (Task task : listTask) { | ||
| 163 | + printTask(task); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + // 销假(根据申请人的用户ID读取) | ||
| 167 | +// Task reportBackTask = taskService.createTaskQuery().taskAssignee(currentUserId).singleResult(); | ||
| 168 | +// assertNotNull(formService.getRenderedTaskForm(reportBackTask.getId())); | ||
| 169 | +// variables = new HashMap<String, String>(); | ||
| 170 | +// variables.put("reportBackDate", sdf.format(ca.getTime())); | ||
| 171 | +// formService.submitTaskFormData(reportBackTask.getId(), variables); | ||
| 172 | + | ||
| 173 | + // 验证流程是否已经结束 | ||
| 174 | + HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().finished().singleResult(); | ||
| 175 | + assertNotNull(historicProcessInstance); | ||
| 176 | + | ||
| 177 | + // 读取历史变量 | ||
| 178 | + Map<String, Object> historyVariables = packageVariables(processInstance); | ||
| 179 | + | ||
| 180 | + // 验证执行结果 | ||
| 181 | + assertEquals("ok", historyVariables.get("result")); | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + /** | ||
| 186 | + * 任意流程的跳转 | ||
| 187 | + */ | ||
| 188 | + @Test | ||
| 189 | + public void taskJump(){ | ||
| 190 | + // 当前任务 | ||
| 191 | + String taskId="ddd"; | ||
| 192 | + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); | ||
| 193 | + String assignee = "下一个自由跳转人"; | ||
| 194 | + taskService.setAssignee(taskId,assignee); | ||
| 195 | + // 自由跳转 | ||
| 196 | + String taskDefKey="目标-任务名称"; | ||
| 197 | + //moveActivityIdTo的两个参数,源任务key,目标任务key | ||
| 198 | + runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()).moveActivityIdTo(task.getTaskDefinitionKey(), taskDefKey).changeState(); | ||
| 199 | + | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + | ||
| 203 | + /** | ||
| 204 | + * 读取历史变量并封装到Map中 | ||
| 205 | + */ | ||
| 206 | + private Map<String, Object> packageVariables(ProcessInstance processInstance) { | ||
| 207 | + Map<String, Object> historyVariables = new HashMap<String, Object>(); | ||
| 208 | + List<HistoricDetail> list = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).list(); | ||
| 209 | + for (HistoricDetail historicDetail : list) { | ||
| 210 | + if (historicDetail instanceof HistoricFormProperty) { | ||
| 211 | + // 表单中的字段 | ||
| 212 | + HistoricFormProperty field = (HistoricFormProperty) historicDetail; | ||
| 213 | + historyVariables.put(field.getPropertyId(), field.getPropertyValue()); | ||
| 214 | + System.out.println("form field: taskId=" + field.getTaskId() + ", " + field.getPropertyId() + " = " + field.getPropertyValue()); | ||
| 215 | + } else if (historicDetail instanceof HistoricVariableUpdate) { | ||
| 216 | + HistoricVariableUpdate variable = (HistoricVariableUpdate) historicDetail; | ||
| 217 | + historyVariables.put(variable.getVariableName(), variable.getValue()); | ||
| 218 | + System.out.println("variable: " + variable.getVariableName() + " = " + variable.getValue()); | ||
| 219 | + } | ||
| 220 | + } | ||
| 221 | + return historyVariables; | ||
| 222 | + } | ||
| 223 | + private void printTask(Task task){ | ||
| 224 | + System.out.println(task.getName()+" : " + task.getDueDate()); | ||
| 225 | + } | ||
| 226 | +} |
yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/LeaveFormKeyTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.bpm; | ||
| 2 | + | ||
| 3 | +import org.flowable.engine.history.HistoricDetail; | ||
| 4 | +import org.flowable.engine.history.HistoricFormProperty; | ||
| 5 | +import org.flowable.engine.history.HistoricProcessInstance; | ||
| 6 | +import org.flowable.engine.history.HistoricVariableUpdate; | ||
| 7 | +import org.flowable.engine.repository.ProcessDefinition; | ||
| 8 | +import org.flowable.engine.runtime.ProcessInstance; | ||
| 9 | +import org.flowable.engine.test.Deployment; | ||
| 10 | +import org.flowable.task.api.Task; | ||
| 11 | +import org.junit.Test; | ||
| 12 | + | ||
| 13 | +import java.text.SimpleDateFormat; | ||
| 14 | +import java.util.Calendar; | ||
| 15 | +import java.util.HashMap; | ||
| 16 | +import java.util.List; | ||
| 17 | +import java.util.Map; | ||
| 18 | + | ||
| 19 | +import static org.junit.Assert.assertEquals; | ||
| 20 | +import static org.junit.Assert.assertNotNull; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * @author henryyan | ||
| 24 | + */ | ||
| 25 | +public class LeaveFormKeyTest extends AbstractOATest { | ||
| 26 | + | ||
| 27 | + @Test | ||
| 28 | + @Deployment(resources = {"chapter6/leave-formkey/leave-formkey.bpmn", "chapter6/leave-formkey/leave-start.form", | ||
| 29 | + "chapter6/leave-formkey/approve-deptLeader.form", "chapter6/leave-formkey/approve-hr.form", "chapter6/leave-formkey/report-back.form", | ||
| 30 | + "chapter6/leave-formkey/modify-apply.form"}) | ||
| 31 | + public void allPass() throws Exception { | ||
| 32 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 33 | + Map<String, String> variables = new HashMap<String, String>(); | ||
| 34 | + Calendar ca = Calendar.getInstance(); | ||
| 35 | + String startDate = sdf.format(ca.getTime()); | ||
| 36 | + ca.add(Calendar.DAY_OF_MONTH, 2); // 当前日期加2天 | ||
| 37 | + String endDate = sdf.format(ca.getTime()); | ||
| 38 | + | ||
| 39 | + // 启动流程 | ||
| 40 | + variables.put("startDate", startDate); | ||
| 41 | + variables.put("endDate", endDate); | ||
| 42 | + variables.put("reason", "公休"); | ||
| 43 | + | ||
| 44 | + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult(); | ||
| 45 | + | ||
| 46 | + // 读取启动表单 | ||
| 47 | + Object renderedStartForm = formService.getRenderedStartForm(processDefinition.getId()); | ||
| 48 | + assertNotNull(renderedStartForm); | ||
| 49 | + | ||
| 50 | + // 启动流程 | ||
| 51 | + // 设置当前用户 | ||
| 52 | + String currentUserId = "henryyan"; | ||
| 53 | + identityService.setAuthenticatedUserId(currentUserId); | ||
| 54 | + ProcessInstance processInstance = formService.submitStartFormData(processDefinition.getId(), variables); | ||
| 55 | + assertNotNull(processInstance); | ||
| 56 | + | ||
| 57 | + // 部门领导审批通过 | ||
| 58 | + Task deptLeaderTask = taskService.createTaskQuery().taskCandidateGroup("deptLeader").singleResult(); | ||
| 59 | + assertNotNull(formService.getRenderedTaskForm(deptLeaderTask.getId())); | ||
| 60 | + variables = new HashMap<String, String>(); | ||
| 61 | + variables.put("deptLeaderApproved", "true"); | ||
| 62 | + formService.submitTaskFormData(deptLeaderTask.getId(), variables); | ||
| 63 | + | ||
| 64 | + // 人事审批通过 | ||
| 65 | + Task hrTask = taskService.createTaskQuery().taskCandidateGroup("hr").singleResult(); | ||
| 66 | + assertNotNull(formService.getRenderedTaskForm(hrTask.getId())); | ||
| 67 | + variables = new HashMap<String, String>(); | ||
| 68 | + variables.put("hrApproved", "true"); | ||
| 69 | + formService.submitTaskFormData(hrTask.getId(), variables); | ||
| 70 | + | ||
| 71 | + // 销假(根据申请人的用户ID读取) | ||
| 72 | + Task reportBackTask = taskService.createTaskQuery().taskAssignee(currentUserId).singleResult(); | ||
| 73 | + assertNotNull(formService.getRenderedTaskForm(reportBackTask.getId())); | ||
| 74 | + variables = new HashMap<String, String>(); | ||
| 75 | + variables.put("reportBackDate", sdf.format(ca.getTime())); | ||
| 76 | + formService.submitTaskFormData(reportBackTask.getId(), variables); | ||
| 77 | + | ||
| 78 | + // 验证流程是否已经结束 | ||
| 79 | + HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().finished().singleResult(); | ||
| 80 | + assertNotNull(historicProcessInstance); | ||
| 81 | + | ||
| 82 | + // 读取历史变量 | ||
| 83 | + Map<String, Object> historyVariables = packageVariables(processInstance); | ||
| 84 | + | ||
| 85 | + // 验证执行结果 | ||
| 86 | + assertEquals("ok", historyVariables.get("result")); | ||
| 87 | + | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /** | ||
| 91 | + * 任意流程的跳转 | ||
| 92 | + */ | ||
| 93 | + @Test | ||
| 94 | + public void taskJump(){ | ||
| 95 | + // 当前任务 | ||
| 96 | + String taskId="ddd"; | ||
| 97 | + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); | ||
| 98 | + String assignee = "下一个自由跳转人"; | ||
| 99 | + taskService.setAssignee(taskId,assignee); | ||
| 100 | + // 自由跳转 | ||
| 101 | + String taskDefKey="目标-任务名称"; | ||
| 102 | + //moveActivityIdTo的两个参数,源任务key,目标任务key | ||
| 103 | + runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()).moveActivityIdTo(task.getTaskDefinitionKey(), taskDefKey).changeState(); | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + /** | ||
| 108 | + * 领导驳回后申请人取消申请 | ||
| 109 | + */ | ||
| 110 | + @Test | ||
| 111 | + @Deployment(resources = "chapter6/dynamic-form/leave.bpmn") | ||
| 112 | + public void cancelApply() throws Exception { | ||
| 113 | + | ||
| 114 | + // 设置当前用户 | ||
| 115 | + String currentUserId = "henryyan"; | ||
| 116 | + identityService.setAuthenticatedUserId(currentUserId); | ||
| 117 | + | ||
| 118 | + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("leave").singleResult(); | ||
| 119 | + | ||
| 120 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 121 | + Map<String, String> variables = new HashMap<String, String>(); | ||
| 122 | + Calendar ca = Calendar.getInstance(); | ||
| 123 | + String startDate = sdf.format(ca.getTime()); | ||
| 124 | + ca.add(Calendar.DAY_OF_MONTH, 2); | ||
| 125 | + String endDate = sdf.format(ca.getTime()); | ||
| 126 | + | ||
| 127 | + // 启动流程 | ||
| 128 | + variables.put("startDate", startDate); | ||
| 129 | + variables.put("endDate", endDate); | ||
| 130 | + variables.put("reason", "公休"); | ||
| 131 | + ProcessInstance processInstance = formService.submitStartFormData(processDefinition.getId(), variables); | ||
| 132 | + assertNotNull(processInstance); | ||
| 133 | + | ||
| 134 | + // 部门领导审批通过 | ||
| 135 | + Task deptLeaderTask = taskService.createTaskQuery().taskCandidateGroup("deptLeader").singleResult(); | ||
| 136 | + variables = new HashMap<String, String>(); | ||
| 137 | + variables.put("deptLeaderApproved", "false"); | ||
| 138 | + formService.submitTaskFormData(deptLeaderTask.getId(), variables); | ||
| 139 | + | ||
| 140 | + // 调整申请 | ||
| 141 | + Task modifyApply = taskService.createTaskQuery().taskAssignee(currentUserId).singleResult(); | ||
| 142 | + variables = new HashMap<String, String>(); | ||
| 143 | + variables.put("reApply", "false"); | ||
| 144 | + variables.put("startDate", startDate); | ||
| 145 | + variables.put("endDate", endDate); | ||
| 146 | + variables.put("reason", "公休"); | ||
| 147 | + formService.submitTaskFormData(modifyApply.getId(), variables); | ||
| 148 | + | ||
| 149 | + // 读取历史变量 | ||
| 150 | + Map<String, Object> historyVariables = packageVariables(processInstance); | ||
| 151 | + | ||
| 152 | + // 验证执行结果 | ||
| 153 | + assertEquals("canceled", historyVariables.get("result")); | ||
| 154 | + | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + /** | ||
| 158 | + * 读取历史变量并封装到Map中 | ||
| 159 | + */ | ||
| 160 | + private Map<String, Object> packageVariables(ProcessInstance processInstance) { | ||
| 161 | + Map<String, Object> historyVariables = new HashMap<String, Object>(); | ||
| 162 | + List<HistoricDetail> list = historyService.createHistoricDetailQuery().processInstanceId(processInstance.getId()).list(); | ||
| 163 | + for (HistoricDetail historicDetail : list) { | ||
| 164 | + if (historicDetail instanceof HistoricFormProperty) { | ||
| 165 | + // 表单中的字段 | ||
| 166 | + HistoricFormProperty field = (HistoricFormProperty) historicDetail; | ||
| 167 | + historyVariables.put(field.getPropertyId(), field.getPropertyValue()); | ||
| 168 | + System.out.println("form field: taskId=" + field.getTaskId() + ", " + field.getPropertyId() + " = " + field.getPropertyValue()); | ||
| 169 | + } else if (historicDetail instanceof HistoricVariableUpdate) { | ||
| 170 | + HistoricVariableUpdate variable = (HistoricVariableUpdate) historicDetail; | ||
| 171 | + historyVariables.put(variable.getVariableName(), variable.getValue()); | ||
| 172 | + System.out.println("variable: " + variable.getVariableName() + " = " + variable.getValue()); | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + return historyVariables; | ||
| 176 | + } | ||
| 177 | +} |
yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/MultiInstancesTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.bpm; | ||
| 2 | + | ||
| 3 | +import org.flowable.engine.history.HistoricDetail; | ||
| 4 | +import org.flowable.engine.history.HistoricFormProperty; | ||
| 5 | +import org.flowable.engine.history.HistoricProcessInstance; | ||
| 6 | +import org.flowable.engine.history.HistoricVariableUpdate; | ||
| 7 | +import org.flowable.engine.repository.ProcessDefinition; | ||
| 8 | +import org.flowable.engine.runtime.ProcessInstance; | ||
| 9 | +import org.flowable.engine.test.Deployment; | ||
| 10 | +import org.flowable.task.api.Task; | ||
| 11 | +import org.junit.Test; | ||
| 12 | + | ||
| 13 | +import java.text.SimpleDateFormat; | ||
| 14 | +import java.util.*; | ||
| 15 | + | ||
| 16 | +import static org.junit.Assert.assertEquals; | ||
| 17 | +import static org.junit.Assert.assertNotNull; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * @author henryyan | ||
| 21 | + * testMultiInstanceForUserTask 会签 | ||
| 22 | + * cn.iocoder.yudao.module.bpm.framework.flowable.core.behavior.BpmUserTaskActivityBehavior#handleAssignments(org.flowable.task.service.TaskService, java.lang.String, java.lang.String, java.util.List, java.util.List, org.flowable.task.service.impl.persistence.entity.TaskEntity, org.flowable.common.engine.impl.el.ExpressionManager, org.flowable.engine.delegate.DelegateExecution, org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl) | ||
| 23 | + * | ||
| 24 | + * 发生了死锁 | ||
| 25 | + * cn.iocoder.yudao.module.bpm.controller.admin.task.BpmProcessInstanceController#createProcessInstance(cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCreateReqVO) | ||
| 26 | + * 执行了两次,任务分配到了同一个人 | ||
| 27 | + */ | ||
| 28 | +public class MultiInstancesTest extends AbstractOATest { | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * Java Service多实例(是否顺序结果一样) | ||
| 32 | + */ | ||
| 33 | + @Test | ||
| 34 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceFixedNumbers.bpmn"}) | ||
| 35 | + public void testParallel() throws Exception { | ||
| 36 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 37 | + long loop = 3; | ||
| 38 | + variables.put("loop", loop); | ||
| 39 | + variables.put("counter", 0); // 计数器 | ||
| 40 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testMultiInstanceFixedNumbers", variables); | ||
| 41 | + Object variable = runtimeService.getVariable(processInstance.getId(), "counter"); | ||
| 42 | + assertEquals(loop, variable); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 用户任务多实例--顺序 | ||
| 47 | + */ | ||
| 48 | + @Test | ||
| 49 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.sequential.bpmn"}) | ||
| 50 | + public void testForUserSequence() throws Exception { | ||
| 51 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask"); | ||
| 52 | + long count = taskService.createTaskQuery().processInstanceId(processInstance.getId()).count(); | ||
| 53 | + assertEquals(1, count); | ||
| 54 | + | ||
| 55 | + Task task = taskService.createTaskQuery().singleResult(); | ||
| 56 | + taskService.complete(task.getId()); | ||
| 57 | + count = taskService.createTaskQuery().processInstanceId(processInstance.getId()).count(); | ||
| 58 | + assertEquals(1, count); | ||
| 59 | + | ||
| 60 | + task = taskService.createTaskQuery().singleResult(); | ||
| 61 | + taskService.complete(task.getId()); | ||
| 62 | + count = taskService.createTaskQuery().processInstanceId(processInstance.getId()).count(); | ||
| 63 | + assertEquals(1, count); | ||
| 64 | + | ||
| 65 | + task = taskService.createTaskQuery().singleResult(); | ||
| 66 | + taskService.complete(task.getId()); | ||
| 67 | + count = taskService.createTaskQuery().processInstanceId(processInstance.getId()).count(); | ||
| 68 | + assertEquals(0, count); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 用户任务多实例--并行 | ||
| 73 | + */ | ||
| 74 | + @Test | ||
| 75 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.nosequential.bpmn"}) | ||
| 76 | + public void testForUserNoSequential() throws Exception { | ||
| 77 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask"); | ||
| 78 | + long count = taskService.createTaskQuery().processInstanceId(processInstance.getId()).count(); | ||
| 79 | + assertEquals(3, count); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 用户任务多实例,通过用户数量决定实例个数--并行 | ||
| 84 | + */ | ||
| 85 | + @Test | ||
| 86 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.users.nosequential.bpmn"}) | ||
| 87 | + public void testForUserCreateByUsersNoSequential() throws Exception { | ||
| 88 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 89 | + List<String> users = Arrays.asList("user1", "user2", "user3"); | ||
| 90 | + variables.put("users", users); | ||
| 91 | + runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask", variables); | ||
| 92 | + for (String userId : users) { | ||
| 93 | + assertEquals(1, taskService.createTaskQuery().taskAssignee(userId).count()); | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 用户任务多实例,通过用户数量决定实例个数--顺序 | ||
| 99 | + */ | ||
| 100 | + @Test | ||
| 101 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.users.sequential.bpmn"}) | ||
| 102 | + public void testForUserCreateByUsersSequential() throws Exception { | ||
| 103 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 104 | + List<String> users = Arrays.asList("user1", "user2", "user3"); | ||
| 105 | + variables.put("users", users); | ||
| 106 | + runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask", variables); | ||
| 107 | + for (String userId : users) { | ||
| 108 | + Task task = taskService.createTaskQuery().taskAssignee(userId).singleResult(); | ||
| 109 | + taskService.complete(task.getId()); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + /** | ||
| 114 | + * 用户任务多实例,按照任务完成的百分比比率决定是否提前结束流程 | ||
| 115 | + */ | ||
| 116 | + @Test | ||
| 117 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.users.sequential.with.complete.conditon.bpmn"}) | ||
| 118 | + public void testForUserCreateByUsersSequentialWithCompleteCondition() throws Exception { | ||
| 119 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 120 | + List<String> users = Arrays.asList("user1", "user2", "user3"); | ||
| 121 | + variables.put("users", users); | ||
| 122 | + variables.put("rate", 0.6d); | ||
| 123 | + runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask", variables); | ||
| 124 | + | ||
| 125 | + Task task = taskService.createTaskQuery().taskAssignee("user1").singleResult(); | ||
| 126 | + taskService.complete(task.getId()); | ||
| 127 | + | ||
| 128 | + task = taskService.createTaskQuery().taskAssignee("user2").singleResult(); | ||
| 129 | + taskService.complete(task.getId()); | ||
| 130 | + | ||
| 131 | + long count = historyService.createHistoricProcessInstanceQuery().finished().count(); | ||
| 132 | + assertEquals(1, count); | ||
| 133 | + | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * 用户任务多实例,按照任务完成的百分比比率决定是否提前结束流程 | ||
| 138 | + */ | ||
| 139 | + @Test | ||
| 140 | + @Deployment(resources = {"diagrams/chapter9/testMultiInstanceForUserTask.exception.bpmn"}) | ||
| 141 | + public void testForUserCreateByUsersException() throws Exception { | ||
| 142 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 143 | + List<String> users = Arrays.asList("user1", "user2", "user3"); | ||
| 144 | + variables.put("users", users); | ||
| 145 | + runtimeService.startProcessInstanceByKey("testMultiInstanceForUserTask", variables); | ||
| 146 | + | ||
| 147 | + Task task = taskService.createTaskQuery().taskAssignee("user1").singleResult(); | ||
| 148 | + taskService.complete(task.getId()); | ||
| 149 | + | ||
| 150 | + task = taskService.createTaskQuery().taskAssignee("user2").singleResult(); | ||
| 151 | + taskService.complete(task.getId()); | ||
| 152 | + | ||
| 153 | + task = taskService.createTaskQuery().taskAssignee("user3").singleResult(); | ||
| 154 | + taskService.complete(task.getId()); | ||
| 155 | + | ||
| 156 | + List<Task> list = taskService.createTaskQuery().list(); | ||
| 157 | + for (Task task2 : list) { | ||
| 158 | + System.out.println("============" + task2.getName()); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + } | ||
| 162 | + ///////////////////////////////////////////////// | ||
| 163 | + /** | ||
| 164 | + * 全部通过 | ||
| 165 | + */ | ||
| 166 | + @Test | ||
| 167 | + @Deployment(resources = {"diagrams/chapter9/leave-countersign.bpmn"}) | ||
| 168 | + public void testAllApproved() throws Exception { | ||
| 169 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 170 | + List<String> users = Arrays.asList("groupLeader", "deptLeader", "hr"); | ||
| 171 | + variables.put("users", users); | ||
| 172 | + identityService.setAuthenticatedUserId("henryyan"); | ||
| 173 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leave-countersign", variables); | ||
| 174 | + for (String user : users) { | ||
| 175 | + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).taskAssignee(user).singleResult(); | ||
| 176 | + Map<String, Object> taskVariables = new HashMap<String, Object>(); | ||
| 177 | + taskVariables.put("approved", "true"); | ||
| 178 | + taskService.complete(task.getId(), taskVariables); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + Task task = taskService.createTaskQuery().taskAssignee("henryyan").singleResult(); | ||
| 182 | + assertNotNull(task); | ||
| 183 | + assertEquals("销假", task.getName()); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + /** | ||
| 187 | + * 部分通过 | ||
| 188 | + */ | ||
| 189 | + @Test | ||
| 190 | + @Deployment(resources = {"diagrams/chapter9/leave-countersign.bpmn"}) | ||
| 191 | + public void testNotAllApproved() throws Exception { | ||
| 192 | + Map<String, Object> variables = new HashMap<String, Object>(); | ||
| 193 | + List<String> users = Arrays.asList("groupLeader", "deptLeader", "hr"); | ||
| 194 | + variables.put("users", users); | ||
| 195 | + identityService.setAuthenticatedUserId("henryyan"); | ||
| 196 | + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leave-countersign", variables); | ||
| 197 | + for (String user : users) { | ||
| 198 | + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).taskAssignee(user).singleResult(); | ||
| 199 | + Map<String, Object> taskVariables = new HashMap<String, Object>(); | ||
| 200 | + taskVariables.put("approved", "false"); | ||
| 201 | + taskService.complete(task.getId(), taskVariables); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + Task task = taskService.createTaskQuery().taskAssignee("henryyan").singleResult(); | ||
| 205 | + assertNotNull(task); | ||
| 206 | + assertEquals("调整申请", task.getName()); | ||
| 207 | + } | ||
| 208 | +} |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/dynamic-form/leave-dynamic-form-with-javascript.zip
0 → 100644
No preview for this file type
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/dynamic-form/leave-dynamic-form.zip
0 → 100644
No preview for this file type
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/dynamic-form/leave.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.kafeitu.me/activiti/leave"> | ||
| 3 | + <process id="leave" name="请假流程-动态表单" isExecutable="true"> | ||
| 4 | + <documentation>请假流程演示-动态表单</documentation> | ||
| 5 | + <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"> | ||
| 6 | + <extensionElements> | ||
| 7 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 8 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 9 | + <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty> | ||
| 10 | + <activiti:formProperty id="validScript" type="javascript" default="alert('表单已经加载完毕');"></activiti:formProperty> | ||
| 11 | + </extensionElements> | ||
| 12 | + </startEvent> | ||
| 13 | + <userTask id="deptLeaderAudit" name="部门领导审批" activiti:candidateGroups="deptLeader"> | ||
| 14 | + <extensionElements> | ||
| 15 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 16 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 17 | + <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty> | ||
| 18 | + <activiti:formProperty id="deptLeaderApproved" name="审批意见" type="enum" required="true"> | ||
| 19 | + <activiti:value id="true" name="同意"></activiti:value> | ||
| 20 | + <activiti:value id="false" name="拒绝"></activiti:value> | ||
| 21 | + </activiti:formProperty> | ||
| 22 | + </extensionElements> | ||
| 23 | + </userTask> | ||
| 24 | + <exclusiveGateway id="exclusivegateway5" name="Exclusive Gateway"></exclusiveGateway> | ||
| 25 | + <userTask id="modifyApply" name="调整申请" activiti:assignee="${applyUserId}"> | ||
| 26 | + <extensionElements> | ||
| 27 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 28 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 29 | + <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty> | ||
| 30 | + <activiti:formProperty id="reApply" name="重新申请" type="enum" required="true"> | ||
| 31 | + <activiti:value id="true" name="重新申请"></activiti:value> | ||
| 32 | + <activiti:value id="false" name="取消申请"></activiti:value> | ||
| 33 | + </activiti:formProperty> | ||
| 34 | + </extensionElements> | ||
| 35 | + </userTask> | ||
| 36 | + <userTask id="hrAudit" name="人事审批" activiti:candidateGroups="hr"> | ||
| 37 | + <extensionElements> | ||
| 38 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 39 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 40 | + <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty> | ||
| 41 | + <activiti:formProperty id="hrApproved" name="审批意见" type="enum" required="true"> | ||
| 42 | + <activiti:value id="true" name="同意"></activiti:value> | ||
| 43 | + <activiti:value id="false" name="拒绝"></activiti:value> | ||
| 44 | + </activiti:formProperty> | ||
| 45 | + </extensionElements> | ||
| 46 | + </userTask> | ||
| 47 | + <exclusiveGateway id="exclusivegateway6" name="Exclusive Gateway"></exclusiveGateway> | ||
| 48 | + <userTask id="reportBack" name="销假" activiti:assignee="${applyUserId}"> | ||
| 49 | + <extensionElements> | ||
| 50 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 51 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 52 | + <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty> | ||
| 53 | + <activiti:formProperty id="reportBackDate" name="销假日期" type="date" default="${endDate}" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 54 | + </extensionElements> | ||
| 55 | + </userTask> | ||
| 56 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 57 | + <exclusiveGateway id="exclusivegateway7" name="Exclusive Gateway"></exclusiveGateway> | ||
| 58 | + <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="deptLeaderAudit"></sequenceFlow> | ||
| 59 | + <sequenceFlow id="flow3" sourceRef="deptLeaderAudit" targetRef="exclusivegateway5"></sequenceFlow> | ||
| 60 | + <sequenceFlow id="flow4" name="拒绝" sourceRef="exclusivegateway5" targetRef="modifyApply"> | ||
| 61 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'false'}]]></conditionExpression> | ||
| 62 | + </sequenceFlow> | ||
| 63 | + <sequenceFlow id="flow5" name="同意" sourceRef="exclusivegateway5" targetRef="hrAudit"> | ||
| 64 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | ||
| 65 | + </sequenceFlow> | ||
| 66 | + <sequenceFlow id="flow6" sourceRef="hrAudit" targetRef="exclusivegateway6"></sequenceFlow> | ||
| 67 | + <sequenceFlow id="flow7" name="同意" sourceRef="exclusivegateway6" targetRef="reportBack"> | ||
| 68 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'true'}]]></conditionExpression> | ||
| 69 | + </sequenceFlow> | ||
| 70 | + <sequenceFlow id="flow8" name="销假" sourceRef="reportBack" targetRef="endevent1"> | ||
| 71 | + <extensionElements> | ||
| 72 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'ok')}"></activiti:executionListener> | ||
| 73 | + </extensionElements> | ||
| 74 | + </sequenceFlow> | ||
| 75 | + <sequenceFlow id="flow9" name="拒绝" sourceRef="exclusivegateway6" targetRef="modifyApply"> | ||
| 76 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'false'}]]></conditionExpression> | ||
| 77 | + </sequenceFlow> | ||
| 78 | + <sequenceFlow id="flow10" name="重新申请" sourceRef="exclusivegateway7" targetRef="deptLeaderAudit"> | ||
| 79 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression> | ||
| 80 | + </sequenceFlow> | ||
| 81 | + <sequenceFlow id="flow11" sourceRef="modifyApply" targetRef="exclusivegateway7"></sequenceFlow> | ||
| 82 | + <sequenceFlow id="flow12" name="结束流程" sourceRef="exclusivegateway7" targetRef="endevent1"> | ||
| 83 | + <extensionElements> | ||
| 84 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'canceled')}"></activiti:executionListener> | ||
| 85 | + </extensionElements> | ||
| 86 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression> | ||
| 87 | + </sequenceFlow> | ||
| 88 | + <textAnnotation id="textannotation1" textFormat="text/plain"> | ||
| 89 | + <text>请求被驳回后员工可以选择继续申请,或者取消本次申请</text> | ||
| 90 | + </textAnnotation> | ||
| 91 | + <association id="association1" sourceRef="modifyApply" targetRef="textannotation1"></association> | ||
| 92 | + </process> | ||
| 93 | + <bpmndi:BPMNDiagram id="BPMNDiagram_leave"> | ||
| 94 | + <bpmndi:BPMNPlane bpmnElement="leave" id="BPMNPlane_leave"> | ||
| 95 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 96 | + <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="30.0"></omgdc:Bounds> | ||
| 97 | + </bpmndi:BPMNShape> | ||
| 98 | + <bpmndi:BPMNShape bpmnElement="deptLeaderAudit" id="BPMNShape_deptLeaderAudit"> | ||
| 99 | + <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="20.0"></omgdc:Bounds> | ||
| 100 | + </bpmndi:BPMNShape> | ||
| 101 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway5" id="BPMNShape_exclusivegateway5"> | ||
| 102 | + <omgdc:Bounds height="40.0" width="40.0" x="250.0" y="27.0"></omgdc:Bounds> | ||
| 103 | + </bpmndi:BPMNShape> | ||
| 104 | + <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply"> | ||
| 105 | + <omgdc:Bounds height="55.0" width="105.0" x="218.0" y="108.0"></omgdc:Bounds> | ||
| 106 | + </bpmndi:BPMNShape> | ||
| 107 | + <bpmndi:BPMNShape bpmnElement="hrAudit" id="BPMNShape_hrAudit"> | ||
| 108 | + <omgdc:Bounds height="55.0" width="105.0" x="358.0" y="20.0"></omgdc:Bounds> | ||
| 109 | + </bpmndi:BPMNShape> | ||
| 110 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway6" id="BPMNShape_exclusivegateway6"> | ||
| 111 | + <omgdc:Bounds height="40.0" width="40.0" x="495.0" y="27.0"></omgdc:Bounds> | ||
| 112 | + </bpmndi:BPMNShape> | ||
| 113 | + <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack"> | ||
| 114 | + <omgdc:Bounds height="55.0" width="105.0" x="590.0" y="20.0"></omgdc:Bounds> | ||
| 115 | + </bpmndi:BPMNShape> | ||
| 116 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 117 | + <omgdc:Bounds height="35.0" width="35.0" x="625.0" y="223.0"></omgdc:Bounds> | ||
| 118 | + </bpmndi:BPMNShape> | ||
| 119 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway7" id="BPMNShape_exclusivegateway7"> | ||
| 120 | + <omgdc:Bounds height="40.0" width="40.0" x="250.0" y="220.0"></omgdc:Bounds> | ||
| 121 | + </bpmndi:BPMNShape> | ||
| 122 | + <bpmndi:BPMNShape bpmnElement="textannotation1" id="BPMNShape_textannotation1"> | ||
| 123 | + <omgdc:Bounds height="57.0" width="120.0" x="361.0" y="174.0"></omgdc:Bounds> | ||
| 124 | + </bpmndi:BPMNShape> | ||
| 125 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 126 | + <omgdi:waypoint x="45.0" y="47.0"></omgdi:waypoint> | ||
| 127 | + <omgdi:waypoint x="90.0" y="47.0"></omgdi:waypoint> | ||
| 128 | + </bpmndi:BPMNEdge> | ||
| 129 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | ||
| 130 | + <omgdi:waypoint x="195.0" y="47.0"></omgdi:waypoint> | ||
| 131 | + <omgdi:waypoint x="250.0" y="47.0"></omgdi:waypoint> | ||
| 132 | + </bpmndi:BPMNEdge> | ||
| 133 | + <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> | ||
| 134 | + <omgdi:waypoint x="270.0" y="67.0"></omgdi:waypoint> | ||
| 135 | + <omgdi:waypoint x="270.0" y="108.0"></omgdi:waypoint> | ||
| 136 | + <bpmndi:BPMNLabel> | ||
| 137 | + <omgdc:Bounds height="11.0" width="22.0" x="280.0" y="67.0"></omgdc:Bounds> | ||
| 138 | + </bpmndi:BPMNLabel> | ||
| 139 | + </bpmndi:BPMNEdge> | ||
| 140 | + <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> | ||
| 141 | + <omgdi:waypoint x="290.0" y="47.0"></omgdi:waypoint> | ||
| 142 | + <omgdi:waypoint x="358.0" y="47.0"></omgdi:waypoint> | ||
| 143 | + <bpmndi:BPMNLabel> | ||
| 144 | + <omgdc:Bounds height="11.0" width="22.0" x="300.0" y="30.0"></omgdc:Bounds> | ||
| 145 | + </bpmndi:BPMNLabel> | ||
| 146 | + </bpmndi:BPMNEdge> | ||
| 147 | + <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> | ||
| 148 | + <omgdi:waypoint x="463.0" y="47.0"></omgdi:waypoint> | ||
| 149 | + <omgdi:waypoint x="495.0" y="47.0"></omgdi:waypoint> | ||
| 150 | + </bpmndi:BPMNEdge> | ||
| 151 | + <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> | ||
| 152 | + <omgdi:waypoint x="535.0" y="47.0"></omgdi:waypoint> | ||
| 153 | + <omgdi:waypoint x="590.0" y="47.0"></omgdi:waypoint> | ||
| 154 | + <bpmndi:BPMNLabel> | ||
| 155 | + <omgdc:Bounds height="11.0" width="22.0" x="544.0" y="30.0"></omgdc:Bounds> | ||
| 156 | + </bpmndi:BPMNLabel> | ||
| 157 | + </bpmndi:BPMNEdge> | ||
| 158 | + <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | ||
| 159 | + <omgdi:waypoint x="642.0" y="75.0"></omgdi:waypoint> | ||
| 160 | + <omgdi:waypoint x="642.0" y="223.0"></omgdi:waypoint> | ||
| 161 | + <bpmndi:BPMNLabel> | ||
| 162 | + <omgdc:Bounds height="11.0" width="22.0" x="652.0" y="75.0"></omgdc:Bounds> | ||
| 163 | + </bpmndi:BPMNLabel> | ||
| 164 | + </bpmndi:BPMNEdge> | ||
| 165 | + <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> | ||
| 166 | + <omgdi:waypoint x="515.0" y="67.0"></omgdi:waypoint> | ||
| 167 | + <omgdi:waypoint x="514.0" y="135.0"></omgdi:waypoint> | ||
| 168 | + <omgdi:waypoint x="323.0" y="135.0"></omgdi:waypoint> | ||
| 169 | + <bpmndi:BPMNLabel> | ||
| 170 | + <omgdc:Bounds height="11.0" width="22.0" x="525.0" y="67.0"></omgdc:Bounds> | ||
| 171 | + </bpmndi:BPMNLabel> | ||
| 172 | + </bpmndi:BPMNEdge> | ||
| 173 | + <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> | ||
| 174 | + <omgdi:waypoint x="250.0" y="240.0"></omgdi:waypoint> | ||
| 175 | + <omgdi:waypoint x="142.0" y="239.0"></omgdi:waypoint> | ||
| 176 | + <omgdi:waypoint x="142.0" y="75.0"></omgdi:waypoint> | ||
| 177 | + <bpmndi:BPMNLabel> | ||
| 178 | + <omgdc:Bounds height="11.0" width="44.0" x="152.0" y="221.0"></omgdc:Bounds> | ||
| 179 | + </bpmndi:BPMNLabel> | ||
| 180 | + </bpmndi:BPMNEdge> | ||
| 181 | + <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> | ||
| 182 | + <omgdi:waypoint x="270.0" y="163.0"></omgdi:waypoint> | ||
| 183 | + <omgdi:waypoint x="270.0" y="220.0"></omgdi:waypoint> | ||
| 184 | + </bpmndi:BPMNEdge> | ||
| 185 | + <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12"> | ||
| 186 | + <omgdi:waypoint x="290.0" y="240.0"></omgdi:waypoint> | ||
| 187 | + <omgdi:waypoint x="625.0" y="240.0"></omgdi:waypoint> | ||
| 188 | + <bpmndi:BPMNLabel> | ||
| 189 | + <omgdc:Bounds height="11.0" width="44.0" x="429.0" y="247.0"></omgdc:Bounds> | ||
| 190 | + </bpmndi:BPMNLabel> | ||
| 191 | + </bpmndi:BPMNEdge> | ||
| 192 | + <bpmndi:BPMNEdge bpmnElement="association1" id="BPMNEdge_association1"> | ||
| 193 | + <omgdi:waypoint x="323.0" y="135.0"></omgdi:waypoint> | ||
| 194 | + <omgdi:waypoint x="421.0" y="174.0"></omgdi:waypoint> | ||
| 195 | + </bpmndi:BPMNEdge> | ||
| 196 | + </bpmndi:BPMNPlane> | ||
| 197 | + </bpmndi:BPMNDiagram> | ||
| 198 | +</definitions> | ||
| 0 | \ No newline at end of file | 199 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/dynamic-form/leave.png
0 → 100644
27.6 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/approve-deptLeader.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="deptLeaderApproved">审批意见:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <select name="deptLeaderApproved" id="deptLeaderApproved"> | ||
| 27 | + <option value="true">同意</option> | ||
| 28 | + <option value="false">拒绝</option> | ||
| 29 | + </select> | ||
| 30 | + </div> | ||
| 31 | +</div> | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/approve-hr.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="hrApproved">审批意见:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <select name="hrApproved" id="hrApproved"> | ||
| 27 | + <option value="true">同意</option> | ||
| 28 | + <option value="false">拒绝</option> | ||
| 29 | + </select> | ||
| 30 | + </div> | ||
| 31 | +</div> | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/leave-formkey.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.kafeitu.me/activiti"> | ||
| 3 | + <process id="leave-formkey" name="请假流程-外置表单" isExecutable="true"> | ||
| 4 | + <documentation>《Activiti实战》第6章的例子--外置表单</documentation> | ||
| 5 | + <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId" activiti:formKey="chapter6/leave-formkey/leave-start.form"></startEvent> | ||
| 6 | + <userTask id="deptLeaderVerify" name="部门经理审批" activiti:candidateGroups="deptLeader" activiti:formKey="chapter6/leave-formkey/approve-deptLeader.form"></userTask> | ||
| 7 | + <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway> | ||
| 8 | + <userTask id="hrVerify" name="人事经理审批" activiti:candidateGroups="hr" activiti:formKey="chapter6/leave-formkey/approve-hr.form"></userTask> | ||
| 9 | + <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway> | ||
| 10 | + <userTask id="reportBack" name="销假" activiti:assignee="${applyUserId}" activiti:formKey="chapter6/leave-formkey/report-back.form"></userTask> | ||
| 11 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 12 | + <userTask id="modifyApply" name="调整申请内容" activiti:assignee="${applyUserId}" activiti:formKey="chapter6/leave-formkey/modify-apply.form"></userTask> | ||
| 13 | + <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway> | ||
| 14 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="deptLeaderVerify"></sequenceFlow> | ||
| 15 | + <sequenceFlow id="flow2" sourceRef="deptLeaderVerify" targetRef="exclusivegateway1"></sequenceFlow> | ||
| 16 | + <sequenceFlow id="flow3" name="同意" sourceRef="exclusivegateway1" targetRef="hrVerify"> | ||
| 17 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | ||
| 18 | + </sequenceFlow> | ||
| 19 | + <sequenceFlow id="flow4" sourceRef="hrVerify" targetRef="exclusivegateway2"></sequenceFlow> | ||
| 20 | + <sequenceFlow id="flow5" name="同意" sourceRef="exclusivegateway2" targetRef="reportBack"> | ||
| 21 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'true'}]]></conditionExpression> | ||
| 22 | + </sequenceFlow> | ||
| 23 | + <sequenceFlow id="flow6" sourceRef="reportBack" targetRef="endevent1"> | ||
| 24 | + <extensionElements> | ||
| 25 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'ok')}"></activiti:executionListener> | ||
| 26 | + </extensionElements> | ||
| 27 | + </sequenceFlow> | ||
| 28 | + <sequenceFlow id="flow7" name="不同意" sourceRef="exclusivegateway2" targetRef="modifyApply"> | ||
| 29 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'false'}]]></conditionExpression> | ||
| 30 | + </sequenceFlow> | ||
| 31 | + <sequenceFlow id="flow8" name="不同意" sourceRef="exclusivegateway1" targetRef="modifyApply"> | ||
| 32 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | ||
| 33 | + </sequenceFlow> | ||
| 34 | + <sequenceFlow id="flow9" sourceRef="modifyApply" targetRef="exclusivegateway3"></sequenceFlow> | ||
| 35 | + <sequenceFlow id="flow10" name="调整后继续申请" sourceRef="exclusivegateway3" targetRef="deptLeaderVerify"> | ||
| 36 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression> | ||
| 37 | + </sequenceFlow> | ||
| 38 | + <sequenceFlow id="flow11" name="取消申请,并设置取消标志" sourceRef="exclusivegateway3" targetRef="endevent1"> | ||
| 39 | + <extensionElements> | ||
| 40 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'canceled')}"></activiti:executionListener> | ||
| 41 | + </extensionElements> | ||
| 42 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression> | ||
| 43 | + </sequenceFlow> | ||
| 44 | + <textAnnotation id="textannotation1" textFormat="text/plain"> | ||
| 45 | + <text>请求被驳回后员工可以选择继续申请,或者取消本次申请</text> | ||
| 46 | + </textAnnotation> | ||
| 47 | + <association id="association1" sourceRef="modifyApply" targetRef="textannotation1"></association> | ||
| 48 | + </process> | ||
| 49 | + <bpmndi:BPMNDiagram id="BPMNDiagram_leave-formkey"> | ||
| 50 | + <bpmndi:BPMNPlane bpmnElement="leave-formkey" id="BPMNPlane_leave-formkey"> | ||
| 51 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 52 | + <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="50.0"></omgdc:Bounds> | ||
| 53 | + </bpmndi:BPMNShape> | ||
| 54 | + <bpmndi:BPMNShape bpmnElement="deptLeaderVerify" id="BPMNShape_deptLeaderVerify"> | ||
| 55 | + <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="40.0"></omgdc:Bounds> | ||
| 56 | + </bpmndi:BPMNShape> | ||
| 57 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1"> | ||
| 58 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="47.0"></omgdc:Bounds> | ||
| 59 | + </bpmndi:BPMNShape> | ||
| 60 | + <bpmndi:BPMNShape bpmnElement="hrVerify" id="BPMNShape_hrVerify"> | ||
| 61 | + <omgdc:Bounds height="55.0" width="105.0" x="310.0" y="40.0"></omgdc:Bounds> | ||
| 62 | + </bpmndi:BPMNShape> | ||
| 63 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2"> | ||
| 64 | + <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="47.0"></omgdc:Bounds> | ||
| 65 | + </bpmndi:BPMNShape> | ||
| 66 | + <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack"> | ||
| 67 | + <omgdc:Bounds height="55.0" width="105.0" x="580.0" y="40.0"></omgdc:Bounds> | ||
| 68 | + </bpmndi:BPMNShape> | ||
| 69 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 70 | + <omgdc:Bounds height="35.0" width="35.0" x="615.0" y="213.0"></omgdc:Bounds> | ||
| 71 | + </bpmndi:BPMNShape> | ||
| 72 | + <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply"> | ||
| 73 | + <omgdc:Bounds height="55.0" width="105.0" x="198.0" y="120.0"></omgdc:Bounds> | ||
| 74 | + </bpmndi:BPMNShape> | ||
| 75 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3"> | ||
| 76 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="210.0"></omgdc:Bounds> | ||
| 77 | + </bpmndi:BPMNShape> | ||
| 78 | + <bpmndi:BPMNShape bpmnElement="textannotation1" id="BPMNShape_textannotation1"> | ||
| 79 | + <omgdc:Bounds height="57.0" width="112.0" x="340.0" y="168.0"></omgdc:Bounds> | ||
| 80 | + </bpmndi:BPMNShape> | ||
| 81 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 82 | + <omgdi:waypoint x="45.0" y="67.0"></omgdi:waypoint> | ||
| 83 | + <omgdi:waypoint x="90.0" y="67.0"></omgdi:waypoint> | ||
| 84 | + </bpmndi:BPMNEdge> | ||
| 85 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 86 | + <omgdi:waypoint x="195.0" y="67.0"></omgdi:waypoint> | ||
| 87 | + <omgdi:waypoint x="230.0" y="67.0"></omgdi:waypoint> | ||
| 88 | + </bpmndi:BPMNEdge> | ||
| 89 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | ||
| 90 | + <omgdi:waypoint x="270.0" y="67.0"></omgdi:waypoint> | ||
| 91 | + <omgdi:waypoint x="310.0" y="67.0"></omgdi:waypoint> | ||
| 92 | + <bpmndi:BPMNLabel> | ||
| 93 | + <omgdc:Bounds height="11.0" width="22.0" x="269.0" y="50.0"></omgdc:Bounds> | ||
| 94 | + </bpmndi:BPMNLabel> | ||
| 95 | + </bpmndi:BPMNEdge> | ||
| 96 | + <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> | ||
| 97 | + <omgdi:waypoint x="415.0" y="67.0"></omgdi:waypoint> | ||
| 98 | + <omgdi:waypoint x="470.0" y="67.0"></omgdi:waypoint> | ||
| 99 | + </bpmndi:BPMNEdge> | ||
| 100 | + <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> | ||
| 101 | + <omgdi:waypoint x="510.0" y="67.0"></omgdi:waypoint> | ||
| 102 | + <omgdi:waypoint x="580.0" y="67.0"></omgdi:waypoint> | ||
| 103 | + <bpmndi:BPMNLabel> | ||
| 104 | + <omgdc:Bounds height="11.0" width="22.0" x="529.0" y="50.0"></omgdc:Bounds> | ||
| 105 | + </bpmndi:BPMNLabel> | ||
| 106 | + </bpmndi:BPMNEdge> | ||
| 107 | + <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> | ||
| 108 | + <omgdi:waypoint x="632.0" y="95.0"></omgdi:waypoint> | ||
| 109 | + <omgdi:waypoint x="632.0" y="213.0"></omgdi:waypoint> | ||
| 110 | + </bpmndi:BPMNEdge> | ||
| 111 | + <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> | ||
| 112 | + <omgdi:waypoint x="490.0" y="87.0"></omgdi:waypoint> | ||
| 113 | + <omgdi:waypoint x="490.0" y="147.0"></omgdi:waypoint> | ||
| 114 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | ||
| 115 | + <bpmndi:BPMNLabel> | ||
| 116 | + <omgdc:Bounds height="11.0" width="33.0" x="438.0" y="119.0"></omgdc:Bounds> | ||
| 117 | + </bpmndi:BPMNLabel> | ||
| 118 | + </bpmndi:BPMNEdge> | ||
| 119 | + <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | ||
| 120 | + <omgdi:waypoint x="250.0" y="87.0"></omgdi:waypoint> | ||
| 121 | + <omgdi:waypoint x="250.0" y="120.0"></omgdi:waypoint> | ||
| 122 | + <bpmndi:BPMNLabel> | ||
| 123 | + <omgdc:Bounds height="11.0" width="33.0" x="260.0" y="87.0"></omgdc:Bounds> | ||
| 124 | + </bpmndi:BPMNLabel> | ||
| 125 | + </bpmndi:BPMNEdge> | ||
| 126 | + <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> | ||
| 127 | + <omgdi:waypoint x="250.0" y="175.0"></omgdi:waypoint> | ||
| 128 | + <omgdi:waypoint x="250.0" y="210.0"></omgdi:waypoint> | ||
| 129 | + </bpmndi:BPMNEdge> | ||
| 130 | + <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> | ||
| 131 | + <omgdi:waypoint x="230.0" y="230.0"></omgdi:waypoint> | ||
| 132 | + <omgdi:waypoint x="142.0" y="230.0"></omgdi:waypoint> | ||
| 133 | + <omgdi:waypoint x="142.0" y="95.0"></omgdi:waypoint> | ||
| 134 | + <bpmndi:BPMNLabel> | ||
| 135 | + <omgdc:Bounds height="11.0" width="77.0" x="159.0" y="210.0"></omgdc:Bounds> | ||
| 136 | + </bpmndi:BPMNLabel> | ||
| 137 | + </bpmndi:BPMNEdge> | ||
| 138 | + <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> | ||
| 139 | + <omgdi:waypoint x="270.0" y="230.0"></omgdi:waypoint> | ||
| 140 | + <omgdi:waypoint x="615.0" y="230.0"></omgdi:waypoint> | ||
| 141 | + <bpmndi:BPMNLabel> | ||
| 142 | + <omgdc:Bounds height="33.0" width="100.0" x="58.0" y="-37.0"></omgdc:Bounds> | ||
| 143 | + </bpmndi:BPMNLabel> | ||
| 144 | + </bpmndi:BPMNEdge> | ||
| 145 | + <bpmndi:BPMNEdge bpmnElement="association1" id="BPMNEdge_association1"> | ||
| 146 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | ||
| 147 | + <omgdi:waypoint x="396.0" y="168.0"></omgdi:waypoint> | ||
| 148 | + </bpmndi:BPMNEdge> | ||
| 149 | + </bpmndi:BPMNPlane> | ||
| 150 | + </bpmndi:BPMNDiagram> | ||
| 151 | +</definitions> | ||
| 0 | \ No newline at end of file | 152 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/leave-formkey.png
0 → 100644
27.4 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/leave-formkey.zip
0 → 100644
No preview for this file type
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/leave-start.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 3 | + <div class="controls"> | ||
| 4 | + <input type="text" id="startDate" name="startDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | +<div class="control-group"> | ||
| 8 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 9 | + <div class="controls"> | ||
| 10 | + <input type="text" id="endDate" name="endDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 11 | + </div> | ||
| 12 | +</div> | ||
| 13 | +<div class="control-group"> | ||
| 14 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 15 | + <div class="controls"> | ||
| 16 | + <textarea id="reason" name="reason" required></textarea> | ||
| 17 | + </div> | ||
| 18 | +</div> | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/modify-apply.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 3 | + <div class="controls"> | ||
| 4 | + <input type="text" id="startDate" name="startDate" value="${startDate}" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | +<div class="control-group"> | ||
| 8 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 9 | + <div class="controls"> | ||
| 10 | + <input type="text" id="endDate" name="endDate" value="${endDate}" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 11 | + </div> | ||
| 12 | +</div> | ||
| 13 | +<div class="control-group"> | ||
| 14 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 15 | + <div class="controls"> | ||
| 16 | + <textarea id="reason" name="reason" required>${reason}</textarea> | ||
| 17 | + </div> | ||
| 18 | +</div> | ||
| 19 | +<div class="control-group"> | ||
| 20 | + <label class="control-label" for="reason">是否继续申请:</label> | ||
| 21 | + <div class="controls"> | ||
| 22 | + <select id="reApply" name="reApply"> | ||
| 23 | + <option value='true'>重新申请</option> | ||
| 24 | + <option value='false'>结束流程</option> | ||
| 25 | + </select> | ||
| 26 | + </div> | ||
| 27 | +</div> | ||
| 0 | \ No newline at end of file | 28 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-formkey/report-back.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="reportBackDate">销假日期:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <input type="text" id="reportBackDate" name="reportBackDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 27 | + </div> | ||
| 28 | +</div> | ||
| 0 | \ No newline at end of file | 29 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/approve-deptLeader.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="deptLeaderApproved">审批意见:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <select name="deptLeaderApproved" id="deptLeaderApproved"> | ||
| 27 | + <option value="true">同意</option> | ||
| 28 | + <option value="false">拒绝</option> | ||
| 29 | + </select> | ||
| 30 | + </div> | ||
| 31 | +</div> | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/approve-hr.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="hrApproved">审批意见:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <select name="hrApproved" id="hrApproved"> | ||
| 27 | + <option value="true">同意</option> | ||
| 28 | + <option value="false">拒绝</option> | ||
| 29 | + </select> | ||
| 30 | + </div> | ||
| 31 | +</div> | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/leave-formkey-ext.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.kafeitu.me/activiti"> | ||
| 3 | + <process id="conditionTest" name="请假流程-外置表单" isExecutable="true"> | ||
| 4 | + <documentation>《Activiti实战》第6章的例子--外置表单</documentation> | ||
| 5 | + <extensionElements> | ||
| 6 | + <activiti:executionListener event="start" delegateExpression="${execution.setVariable('leave', leaveEntityManager.newLeave(execution))}"></activiti:executionListener> | ||
| 7 | + </extensionElements> | ||
| 8 | + <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId" activiti:formKey="chapter6/leave-timeLimit-money/leave-start.form"></startEvent> | ||
| 9 | + <userTask id="deptLeaderVerify" name="部门经理审批" activiti:candidateGroups="deptLeader" activiti:formKey="chapter6/leave-timeLimit-money/approve-deptLeader.form"> | ||
| 10 | + <extensionElements> | ||
| 11 | + <activiti:taskListener event="complete" expression="${leave.setDeptLeaderApproved(deptLeaderApproved)}"></activiti:taskListener> | ||
| 12 | + </extensionElements> | ||
| 13 | + </userTask> | ||
| 14 | + <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway> | ||
| 15 | + <userTask id="hrVerify" name="人事经理审批" activiti:candidateGroups="hr" activiti:formKey="chapter6/leave-timeLimit-money/approve-hr.form"></userTask> | ||
| 16 | + <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway> | ||
| 17 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 18 | + <userTask id="modifyApply" name="调整申请内容" activiti:assignee="${applyUserId}" activiti:formKey="chapter6/leave-timeLimit-money/modify-apply.form"></userTask> | ||
| 19 | + <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway> | ||
| 20 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="deptLeaderVerify"></sequenceFlow> | ||
| 21 | + <sequenceFlow id="flow2" sourceRef="deptLeaderVerify" targetRef="exclusivegateway1"></sequenceFlow> | ||
| 22 | + <sequenceFlow id="flow3" name="同意" sourceRef="exclusivegateway1" targetRef="hrVerify"> | ||
| 23 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | ||
| 24 | + </sequenceFlow> | ||
| 25 | + <sequenceFlow id="flow4" sourceRef="hrVerify" targetRef="exclusivegateway2"></sequenceFlow> | ||
| 26 | + <sequenceFlow id="flow7" name="不同意" sourceRef="exclusivegateway2" targetRef="modifyApply"> | ||
| 27 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'false'}]]></conditionExpression> | ||
| 28 | + </sequenceFlow> | ||
| 29 | + <sequenceFlow id="flow8" name="不同意" sourceRef="exclusivegateway1" targetRef="modifyApply"> | ||
| 30 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${deptLeaderApproved == 'true'}]]></conditionExpression> | ||
| 31 | + </sequenceFlow> | ||
| 32 | + <sequenceFlow id="flow9" sourceRef="modifyApply" targetRef="exclusivegateway3"></sequenceFlow> | ||
| 33 | + <sequenceFlow id="flow10" name="调整后继续申请" sourceRef="exclusivegateway3" targetRef="deptLeaderVerify"> | ||
| 34 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression> | ||
| 35 | + </sequenceFlow> | ||
| 36 | + <sequenceFlow id="flow11" name="取消申请,并设置取消标志" sourceRef="exclusivegateway3" targetRef="endevent1"> | ||
| 37 | + <extensionElements> | ||
| 38 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'canceled')}"></activiti:executionListener> | ||
| 39 | + </extensionElements> | ||
| 40 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression> | ||
| 41 | + </sequenceFlow> | ||
| 42 | + <exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway> | ||
| 43 | + <sequenceFlow id="flow12" name="同意" sourceRef="exclusivegateway2" targetRef="exclusivegateway4"> | ||
| 44 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${hrApproved == 'true'}]]></conditionExpression> | ||
| 45 | + </sequenceFlow> | ||
| 46 | + <userTask id="usertask1" name="财务打款" activiti:candidateGroups="caiwu" activiti:dueDate="${moneyDateVariable}"> | ||
| 47 | + <documentation>倒计时30秒</documentation> | ||
| 48 | + </userTask> | ||
| 49 | + <sequenceFlow id="flow13" name="金额 >= 1万元" sourceRef="exclusivegateway4" targetRef="usertask1"> | ||
| 50 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${amountMoney >= 10000}]]></conditionExpression> | ||
| 51 | + </sequenceFlow> | ||
| 52 | + <userTask id="usertask2" name="金额不够重新付款"></userTask> | ||
| 53 | + <sequenceFlow id="flow14" name="金额 < 1万" sourceRef="exclusivegateway4" targetRef="usertask2"> | ||
| 54 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${amountMoney < 10000}]]></conditionExpression> | ||
| 55 | + </sequenceFlow> | ||
| 56 | + <userTask id="usertask3" name="打款完成" activiti:candidateGroups="chuNa"></userTask> | ||
| 57 | + <sequenceFlow id="flow15" sourceRef="usertask1" targetRef="usertask3"></sequenceFlow> | ||
| 58 | + <textAnnotation id="textannotation1" textFormat="text/plain"> | ||
| 59 | + <text>请求被驳回后员工可以选择继续申请,或者取消本次申请</text> | ||
| 60 | + </textAnnotation> | ||
| 61 | + <association id="association1" sourceRef="modifyApply" targetRef="textannotation1"></association> | ||
| 62 | + </process> | ||
| 63 | + <bpmndi:BPMNDiagram id="BPMNDiagram_conditionTest"> | ||
| 64 | + <bpmndi:BPMNPlane bpmnElement="conditionTest" id="BPMNPlane_conditionTest"> | ||
| 65 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 66 | + <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="50.0"></omgdc:Bounds> | ||
| 67 | + </bpmndi:BPMNShape> | ||
| 68 | + <bpmndi:BPMNShape bpmnElement="deptLeaderVerify" id="BPMNShape_deptLeaderVerify"> | ||
| 69 | + <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="40.0"></omgdc:Bounds> | ||
| 70 | + </bpmndi:BPMNShape> | ||
| 71 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1"> | ||
| 72 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="47.0"></omgdc:Bounds> | ||
| 73 | + </bpmndi:BPMNShape> | ||
| 74 | + <bpmndi:BPMNShape bpmnElement="hrVerify" id="BPMNShape_hrVerify"> | ||
| 75 | + <omgdc:Bounds height="55.0" width="105.0" x="310.0" y="40.0"></omgdc:Bounds> | ||
| 76 | + </bpmndi:BPMNShape> | ||
| 77 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2"> | ||
| 78 | + <omgdc:Bounds height="40.0" width="40.0" x="470.0" y="47.0"></omgdc:Bounds> | ||
| 79 | + </bpmndi:BPMNShape> | ||
| 80 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 81 | + <omgdc:Bounds height="35.0" width="35.0" x="615.0" y="213.0"></omgdc:Bounds> | ||
| 82 | + </bpmndi:BPMNShape> | ||
| 83 | + <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply"> | ||
| 84 | + <omgdc:Bounds height="55.0" width="105.0" x="198.0" y="120.0"></omgdc:Bounds> | ||
| 85 | + </bpmndi:BPMNShape> | ||
| 86 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3"> | ||
| 87 | + <omgdc:Bounds height="40.0" width="40.0" x="230.0" y="210.0"></omgdc:Bounds> | ||
| 88 | + </bpmndi:BPMNShape> | ||
| 89 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4"> | ||
| 90 | + <omgdc:Bounds height="40.0" width="40.0" x="600.0" y="47.0"></omgdc:Bounds> | ||
| 91 | + </bpmndi:BPMNShape> | ||
| 92 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 93 | + <omgdc:Bounds height="55.0" width="105.0" x="760.0" y="40.0"></omgdc:Bounds> | ||
| 94 | + </bpmndi:BPMNShape> | ||
| 95 | + <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2"> | ||
| 96 | + <omgdc:Bounds height="55.0" width="105.0" x="568.0" y="140.0"></omgdc:Bounds> | ||
| 97 | + </bpmndi:BPMNShape> | ||
| 98 | + <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3"> | ||
| 99 | + <omgdc:Bounds height="55.0" width="105.0" x="910.0" y="40.0"></omgdc:Bounds> | ||
| 100 | + </bpmndi:BPMNShape> | ||
| 101 | + <bpmndi:BPMNShape bpmnElement="textannotation1" id="BPMNShape_textannotation1"> | ||
| 102 | + <omgdc:Bounds height="57.0" width="112.0" x="340.0" y="168.0"></omgdc:Bounds> | ||
| 103 | + </bpmndi:BPMNShape> | ||
| 104 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 105 | + <omgdi:waypoint x="45.0" y="67.0"></omgdi:waypoint> | ||
| 106 | + <omgdi:waypoint x="90.0" y="67.0"></omgdi:waypoint> | ||
| 107 | + </bpmndi:BPMNEdge> | ||
| 108 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 109 | + <omgdi:waypoint x="195.0" y="67.0"></omgdi:waypoint> | ||
| 110 | + <omgdi:waypoint x="230.0" y="67.0"></omgdi:waypoint> | ||
| 111 | + </bpmndi:BPMNEdge> | ||
| 112 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | ||
| 113 | + <omgdi:waypoint x="270.0" y="67.0"></omgdi:waypoint> | ||
| 114 | + <omgdi:waypoint x="310.0" y="67.0"></omgdi:waypoint> | ||
| 115 | + <bpmndi:BPMNLabel> | ||
| 116 | + <omgdc:Bounds height="42.0" width="22.0" x="269.0" y="50.0"></omgdc:Bounds> | ||
| 117 | + </bpmndi:BPMNLabel> | ||
| 118 | + </bpmndi:BPMNEdge> | ||
| 119 | + <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> | ||
| 120 | + <omgdi:waypoint x="415.0" y="67.0"></omgdi:waypoint> | ||
| 121 | + <omgdi:waypoint x="470.0" y="67.0"></omgdi:waypoint> | ||
| 122 | + </bpmndi:BPMNEdge> | ||
| 123 | + <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> | ||
| 124 | + <omgdi:waypoint x="490.0" y="87.0"></omgdi:waypoint> | ||
| 125 | + <omgdi:waypoint x="490.0" y="147.0"></omgdi:waypoint> | ||
| 126 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | ||
| 127 | + <bpmndi:BPMNLabel> | ||
| 128 | + <omgdc:Bounds height="42.0" width="33.0" x="438.0" y="119.0"></omgdc:Bounds> | ||
| 129 | + </bpmndi:BPMNLabel> | ||
| 130 | + </bpmndi:BPMNEdge> | ||
| 131 | + <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | ||
| 132 | + <omgdi:waypoint x="250.0" y="87.0"></omgdi:waypoint> | ||
| 133 | + <omgdi:waypoint x="250.0" y="120.0"></omgdi:waypoint> | ||
| 134 | + <bpmndi:BPMNLabel> | ||
| 135 | + <omgdc:Bounds height="42.0" width="33.0" x="260.0" y="87.0"></omgdc:Bounds> | ||
| 136 | + </bpmndi:BPMNLabel> | ||
| 137 | + </bpmndi:BPMNEdge> | ||
| 138 | + <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9"> | ||
| 139 | + <omgdi:waypoint x="250.0" y="175.0"></omgdi:waypoint> | ||
| 140 | + <omgdi:waypoint x="250.0" y="210.0"></omgdi:waypoint> | ||
| 141 | + </bpmndi:BPMNEdge> | ||
| 142 | + <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10"> | ||
| 143 | + <omgdi:waypoint x="230.0" y="230.0"></omgdi:waypoint> | ||
| 144 | + <omgdi:waypoint x="142.0" y="230.0"></omgdi:waypoint> | ||
| 145 | + <omgdi:waypoint x="142.0" y="95.0"></omgdi:waypoint> | ||
| 146 | + <bpmndi:BPMNLabel> | ||
| 147 | + <omgdc:Bounds height="42.0" width="77.0" x="159.0" y="210.0"></omgdc:Bounds> | ||
| 148 | + </bpmndi:BPMNLabel> | ||
| 149 | + </bpmndi:BPMNEdge> | ||
| 150 | + <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"> | ||
| 151 | + <omgdi:waypoint x="270.0" y="230.0"></omgdi:waypoint> | ||
| 152 | + <omgdi:waypoint x="615.0" y="230.0"></omgdi:waypoint> | ||
| 153 | + <bpmndi:BPMNLabel> | ||
| 154 | + <omgdc:Bounds height="42.0" width="100.0" x="58.0" y="-37.0"></omgdc:Bounds> | ||
| 155 | + </bpmndi:BPMNLabel> | ||
| 156 | + </bpmndi:BPMNEdge> | ||
| 157 | + <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12"> | ||
| 158 | + <omgdi:waypoint x="510.0" y="67.0"></omgdi:waypoint> | ||
| 159 | + <omgdi:waypoint x="600.0" y="67.0"></omgdi:waypoint> | ||
| 160 | + <bpmndi:BPMNLabel> | ||
| 161 | + <omgdc:Bounds height="14.0" width="24.0" x="510.0" y="67.0"></omgdc:Bounds> | ||
| 162 | + </bpmndi:BPMNLabel> | ||
| 163 | + </bpmndi:BPMNEdge> | ||
| 164 | + <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13"> | ||
| 165 | + <omgdi:waypoint x="640.0" y="67.0"></omgdi:waypoint> | ||
| 166 | + <omgdi:waypoint x="760.0" y="67.0"></omgdi:waypoint> | ||
| 167 | + <bpmndi:BPMNLabel> | ||
| 168 | + <omgdc:Bounds height="14.0" width="72.0" x="640.0" y="67.0"></omgdc:Bounds> | ||
| 169 | + </bpmndi:BPMNLabel> | ||
| 170 | + </bpmndi:BPMNEdge> | ||
| 171 | + <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14"> | ||
| 172 | + <omgdi:waypoint x="620.0" y="87.0"></omgdi:waypoint> | ||
| 173 | + <omgdi:waypoint x="620.0" y="140.0"></omgdi:waypoint> | ||
| 174 | + <bpmndi:BPMNLabel> | ||
| 175 | + <omgdc:Bounds height="14.0" width="54.0" x="620.0" y="87.0"></omgdc:Bounds> | ||
| 176 | + </bpmndi:BPMNLabel> | ||
| 177 | + </bpmndi:BPMNEdge> | ||
| 178 | + <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15"> | ||
| 179 | + <omgdi:waypoint x="865.0" y="67.0"></omgdi:waypoint> | ||
| 180 | + <omgdi:waypoint x="910.0" y="67.0"></omgdi:waypoint> | ||
| 181 | + </bpmndi:BPMNEdge> | ||
| 182 | + <bpmndi:BPMNEdge bpmnElement="association1" id="BPMNEdge_association1"> | ||
| 183 | + <omgdi:waypoint x="303.0" y="147.0"></omgdi:waypoint> | ||
| 184 | + <omgdi:waypoint x="396.0" y="168.0"></omgdi:waypoint> | ||
| 185 | + </bpmndi:BPMNEdge> | ||
| 186 | + </bpmndi:BPMNPlane> | ||
| 187 | + </bpmndi:BPMNDiagram> | ||
| 188 | +</definitions> | ||
| 0 | \ No newline at end of file | 189 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/leave-formkey-ext.png
0 → 100644
17.3 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/leave-start.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 3 | + <div class="controls"> | ||
| 4 | + <input type="text" id="startDate" name="startDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | +<div class="control-group"> | ||
| 8 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 9 | + <div class="controls"> | ||
| 10 | + <input type="text" id="endDate" name="endDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 11 | + </div> | ||
| 12 | +</div> | ||
| 13 | +<div class="control-group"> | ||
| 14 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 15 | + <div class="controls"> | ||
| 16 | + <textarea id="reason" name="reason" required></textarea> | ||
| 17 | + </div> | ||
| 18 | +</div> | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/modify-apply.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 3 | + <div class="controls"> | ||
| 4 | + <input type="text" id="startDate" name="startDate" value="${startDate}" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | +<div class="control-group"> | ||
| 8 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 9 | + <div class="controls"> | ||
| 10 | + <input type="text" id="endDate" name="endDate" value="${endDate}" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 11 | + </div> | ||
| 12 | +</div> | ||
| 13 | +<div class="control-group"> | ||
| 14 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 15 | + <div class="controls"> | ||
| 16 | + <textarea id="reason" name="reason" required>${reason}</textarea> | ||
| 17 | + </div> | ||
| 18 | +</div> | ||
| 19 | +<div class="control-group"> | ||
| 20 | + <label class="control-label" for="reason">是否继续申请:</label> | ||
| 21 | + <div class="controls"> | ||
| 22 | + <select id="reApply" name="reApply"> | ||
| 23 | + <option value='true'>重新申请</option> | ||
| 24 | + <option value='false'>结束流程</option> | ||
| 25 | + </select> | ||
| 26 | + </div> | ||
| 27 | +</div> | ||
| 0 | \ No newline at end of file | 28 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/chapter6/leave-timeLimit-money/report-back.form
0 → 100644
| 1 | +<div class="control-group"> | ||
| 2 | + <label class="control-label" for="startDate">申请人:</label> | ||
| 3 | + <div class="controls">${applyUserId}</div> | ||
| 4 | +</div> | ||
| 5 | +<div class="control-group"> | ||
| 6 | + <label class="control-label" for="startDate">开始时间:</label> | ||
| 7 | + <div class="controls"> | ||
| 8 | + <input type="text" id="startDate" name="startDate" value="${startDate}" readonly /> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<div class="control-group"> | ||
| 12 | + <label class="control-label" for="endDate">结束时间:</label> | ||
| 13 | + <div class="controls"> | ||
| 14 | + <input type="text" id="endDate" name="endDate" value="${endDate}" readonly /> | ||
| 15 | + </div> | ||
| 16 | +</div> | ||
| 17 | +<div class="control-group"> | ||
| 18 | + <label class="control-label" for="reason">请假原因:</label> | ||
| 19 | + <div class="controls"> | ||
| 20 | + <textarea id="reason" name="reason" readonly>${reason}</textarea> | ||
| 21 | + </div> | ||
| 22 | +</div> | ||
| 23 | +<div class="control-group"> | ||
| 24 | + <label class="control-label" for="reportBackDate">销假日期:</label> | ||
| 25 | + <div class="controls"> | ||
| 26 | + <input type="text" id="reportBackDate" name="reportBackDate" class="datepicker" data-date-format="yyyy-mm-dd" required /> | ||
| 27 | + </div> | ||
| 28 | +</div> | ||
| 0 | \ No newline at end of file | 29 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/leave-countersign.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 3 | + 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" | ||
| 4 | + xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" | ||
| 5 | + targetNamespace="http://www.activiti.org/test"> | ||
| 6 | + <process id="leave-countersign" name="请假流程-会签" isExecutable="true"> | ||
| 7 | + <documentation>请假流程演示-会签</documentation> | ||
| 8 | + <startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"> | ||
| 9 | + <extensionElements> | ||
| 10 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 11 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 12 | + <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty> | ||
| 13 | + <activiti:formProperty id="users" name="审批参与人" type="users" required="true"></activiti:formProperty> | ||
| 14 | + <activiti:formProperty id="validScript" type="javascript" default="alert('表单已经加载完毕');"></activiti:formProperty> | ||
| 15 | + </extensionElements> | ||
| 16 | + </startEvent> | ||
| 17 | + <userTask id="countersign" name="[部门/人事]联合会签" activiti:assignee="${user}"> | ||
| 18 | + <extensionElements> | ||
| 19 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 20 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 21 | + <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty> | ||
| 22 | + <activiti:formProperty id="approved" name="审批意见" type="enum" required="true"> | ||
| 23 | + <activiti:value id="true" name="同意"></activiti:value> | ||
| 24 | + <activiti:value id="false" name="拒绝"></activiti:value> | ||
| 25 | + </activiti:formProperty> | ||
| 26 | + <activiti:taskListener event="complete" delegateExpression="${leaveCounterSignCompleteListener}"></activiti:taskListener> | ||
| 27 | + </extensionElements> | ||
| 28 | + <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="users" | ||
| 29 | + activiti:elementVariable="user"></multiInstanceLoopCharacteristics> | ||
| 30 | + </userTask> | ||
| 31 | + <userTask id="reportBack" name="销假" activiti:assignee="${applyUserId}"> | ||
| 32 | + <extensionElements> | ||
| 33 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 34 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" writable="false"></activiti:formProperty> | ||
| 35 | + <activiti:formProperty id="reason" name="请假原因" type="string" writable="false"></activiti:formProperty> | ||
| 36 | + <activiti:formProperty id="reportBackDate" name="销假日期" type="date" default="${endDate}" datePattern="yyyy-MM-dd" | ||
| 37 | + required="true"></activiti:formProperty> | ||
| 38 | + </extensionElements> | ||
| 39 | + </userTask> | ||
| 40 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 41 | + <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="countersign"> | ||
| 42 | + <extensionElements> | ||
| 43 | + <activiti:executionListener event="take" expression="${execution.setVariable('approvedCounter', 0)}"></activiti:executionListener> | ||
| 44 | + </extensionElements> | ||
| 45 | + </sequenceFlow> | ||
| 46 | + <sequenceFlow id="flow8" name="销假" sourceRef="reportBack" targetRef="endevent1"> | ||
| 47 | + <extensionElements> | ||
| 48 | + <activiti:executionListener event="take" expression="${execution.setVariable('result', 'ok')}"></activiti:executionListener> | ||
| 49 | + </extensionElements> | ||
| 50 | + </sequenceFlow> | ||
| 51 | + <sequenceFlow id="flow13" name="全部通过" sourceRef="exclusivegateway1" targetRef="reportBack"> | ||
| 52 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvedCounter == users.size()}]]></conditionExpression> | ||
| 53 | + </sequenceFlow> | ||
| 54 | + <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway> | ||
| 55 | + <sequenceFlow id="flow14" sourceRef="countersign" targetRef="exclusivegateway1"></sequenceFlow> | ||
| 56 | + <userTask id="modifyApply" name="调整申请" activiti:assignee="${applyUserId}"> | ||
| 57 | + <extensionElements> | ||
| 58 | + <activiti:formProperty id="startDate" name="请假开始日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 59 | + <activiti:formProperty id="endDate" name="请假结束日期" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty> | ||
| 60 | + <activiti:formProperty id="reason" name="请假原因" type="string" required="true"></activiti:formProperty> | ||
| 61 | + <activiti:formProperty id="reApply" name="重新申请" type="enum" required="true"> | ||
| 62 | + <activiti:value id="true" name="重新申请"></activiti:value> | ||
| 63 | + <activiti:value id="false" name="取消申请"></activiti:value> | ||
| 64 | + </activiti:formProperty> | ||
| 65 | + </extensionElements> | ||
| 66 | + </userTask> | ||
| 67 | + <sequenceFlow id="flow15" name="部分通过" sourceRef="exclusivegateway1" targetRef="modifyApply"> | ||
| 68 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvedCounter < users.size()}]]></conditionExpression> | ||
| 69 | + </sequenceFlow> | ||
| 70 | + <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway> | ||
| 71 | + <sequenceFlow id="flow16" sourceRef="modifyApply" targetRef="exclusivegateway2"></sequenceFlow> | ||
| 72 | + <sequenceFlow id="flow17" sourceRef="exclusivegateway2" targetRef="endevent1"> | ||
| 73 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'false'}]]></conditionExpression> | ||
| 74 | + </sequenceFlow> | ||
| 75 | + <sequenceFlow id="flow18" name="重新申请" sourceRef="exclusivegateway2" targetRef="countersign"> | ||
| 76 | + <extensionElements> | ||
| 77 | + <activiti:executionListener event="take" expression="${execution.setVariable('approvedCounter', 0)}"></activiti:executionListener> | ||
| 78 | + </extensionElements> | ||
| 79 | + <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reApply == 'true'}]]></conditionExpression> | ||
| 80 | + </sequenceFlow> | ||
| 81 | + </process> | ||
| 82 | + <bpmndi:BPMNDiagram id="BPMNDiagram_leave-countersign"> | ||
| 83 | + <bpmndi:BPMNPlane bpmnElement="leave-countersign" id="BPMNPlane_leave-countersign"> | ||
| 84 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 85 | + <omgdc:Bounds height="35.0" width="35.0" x="10.0" y="30.0"></omgdc:Bounds> | ||
| 86 | + </bpmndi:BPMNShape> | ||
| 87 | + <bpmndi:BPMNShape bpmnElement="reportBack" id="BPMNShape_reportBack"> | ||
| 88 | + <omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds> | ||
| 89 | + </bpmndi:BPMNShape> | ||
| 90 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 91 | + <omgdc:Bounds height="35.0" width="35.0" x="375.0" y="203.0"></omgdc:Bounds> | ||
| 92 | + </bpmndi:BPMNShape> | ||
| 93 | + <bpmndi:BPMNShape bpmnElement="countersign" id="BPMNShape_countersign"> | ||
| 94 | + <omgdc:Bounds height="55.0" width="105.0" x="90.0" y="20.0"></omgdc:Bounds> | ||
| 95 | + </bpmndi:BPMNShape> | ||
| 96 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1"> | ||
| 97 | + <omgdc:Bounds height="40.0" width="40.0" x="220.0" y="27.0"></omgdc:Bounds> | ||
| 98 | + </bpmndi:BPMNShape> | ||
| 99 | + <bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply"> | ||
| 100 | + <omgdc:Bounds height="55.0" width="105.0" x="188.0" y="110.0"></omgdc:Bounds> | ||
| 101 | + </bpmndi:BPMNShape> | ||
| 102 | + <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2"> | ||
| 103 | + <omgdc:Bounds height="40.0" width="40.0" x="220.0" y="200.0"></omgdc:Bounds> | ||
| 104 | + </bpmndi:BPMNShape> | ||
| 105 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 106 | + <omgdi:waypoint x="45.0" y="47.0"></omgdi:waypoint> | ||
| 107 | + <omgdi:waypoint x="90.0" y="47.0"></omgdi:waypoint> | ||
| 108 | + </bpmndi:BPMNEdge> | ||
| 109 | + <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8"> | ||
| 110 | + <omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint> | ||
| 111 | + <omgdi:waypoint x="392.0" y="203.0"></omgdi:waypoint> | ||
| 112 | + <bpmndi:BPMNLabel> | ||
| 113 | + <omgdc:Bounds height="11.0" width="100.0" x="-22.0" y="-17.0"></omgdc:Bounds> | ||
| 114 | + </bpmndi:BPMNLabel> | ||
| 115 | + </bpmndi:BPMNEdge> | ||
| 116 | + <bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13"> | ||
| 117 | + <omgdi:waypoint x="260.0" y="47.0"></omgdi:waypoint> | ||
| 118 | + <omgdi:waypoint x="340.0" y="47.0"></omgdi:waypoint> | ||
| 119 | + <bpmndi:BPMNLabel> | ||
| 120 | + <omgdc:Bounds height="11.0" width="100.0" x="-29.0" y="-17.0"></omgdc:Bounds> | ||
| 121 | + </bpmndi:BPMNLabel> | ||
| 122 | + </bpmndi:BPMNEdge> | ||
| 123 | + <bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14"> | ||
| 124 | + <omgdi:waypoint x="195.0" y="47.0"></omgdi:waypoint> | ||
| 125 | + <omgdi:waypoint x="220.0" y="47.0"></omgdi:waypoint> | ||
| 126 | + </bpmndi:BPMNEdge> | ||
| 127 | + <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15"> | ||
| 128 | + <omgdi:waypoint x="240.0" y="67.0"></omgdi:waypoint> | ||
| 129 | + <omgdi:waypoint x="240.0" y="110.0"></omgdi:waypoint> | ||
| 130 | + <bpmndi:BPMNLabel> | ||
| 131 | + <omgdc:Bounds height="11.0" width="100.0" x="10.0" y="0.0"></omgdc:Bounds> | ||
| 132 | + </bpmndi:BPMNLabel> | ||
| 133 | + </bpmndi:BPMNEdge> | ||
| 134 | + <bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16"> | ||
| 135 | + <omgdi:waypoint x="240.0" y="165.0"></omgdi:waypoint> | ||
| 136 | + <omgdi:waypoint x="240.0" y="200.0"></omgdi:waypoint> | ||
| 137 | + </bpmndi:BPMNEdge> | ||
| 138 | + <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17"> | ||
| 139 | + <omgdi:waypoint x="260.0" y="220.0"></omgdi:waypoint> | ||
| 140 | + <omgdi:waypoint x="375.0" y="220.0"></omgdi:waypoint> | ||
| 141 | + </bpmndi:BPMNEdge> | ||
| 142 | + <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18"> | ||
| 143 | + <omgdi:waypoint x="220.0" y="220.0"></omgdi:waypoint> | ||
| 144 | + <omgdi:waypoint x="142.0" y="220.0"></omgdi:waypoint> | ||
| 145 | + <omgdi:waypoint x="142.0" y="75.0"></omgdi:waypoint> | ||
| 146 | + <bpmndi:BPMNLabel> | ||
| 147 | + <omgdc:Bounds height="11.0" width="100.0" x="9.0" y="14.0"></omgdc:Bounds> | ||
| 148 | + </bpmndi:BPMNLabel> | ||
| 149 | + </bpmndi:BPMNEdge> | ||
| 150 | + </bpmndi:BPMNPlane> | ||
| 151 | + </bpmndi:BPMNDiagram> | ||
| 152 | +</definitions> | ||
| 0 | \ No newline at end of file | 153 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/leave-countersign.png
0 → 100644
20 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceFixedNumbers.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceFixedNumbers" name="testMultiInstanceFixedNumbers" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <serviceTask id="servicetask1" name="Service Task" activiti:expression="${counter + 1}" activiti:resultVariableName="counter"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="false"> | ||
| 7 | + <loopCardinality>${loop}</loopCardinality> | ||
| 8 | + </multiInstanceLoopCharacteristics> | ||
| 9 | + </serviceTask> | ||
| 10 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow> | ||
| 11 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 12 | + <sequenceFlow id="flow2" sourceRef="receivetask1" targetRef="endevent1"></sequenceFlow> | ||
| 13 | + <receiveTask id="receivetask1" name="Receive Task"></receiveTask> | ||
| 14 | + <sequenceFlow id="flow3" sourceRef="servicetask1" targetRef="receivetask1"></sequenceFlow> | ||
| 15 | + </process> | ||
| 16 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceFixedNumbers"> | ||
| 17 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceFixedNumbers" id="BPMNPlane_testMultiInstanceFixedNumbers"> | ||
| 18 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 19 | + <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="50.0"></omgdc:Bounds> | ||
| 20 | + </bpmndi:BPMNShape> | ||
| 21 | + <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1"> | ||
| 22 | + <omgdc:Bounds height="55.0" width="105.0" x="116.0" y="40.0"></omgdc:Bounds> | ||
| 23 | + </bpmndi:BPMNShape> | ||
| 24 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 25 | + <omgdc:Bounds height="35.0" width="35.0" x="410.0" y="50.0"></omgdc:Bounds> | ||
| 26 | + </bpmndi:BPMNShape> | ||
| 27 | + <bpmndi:BPMNShape bpmnElement="receivetask1" id="BPMNShape_receivetask1"> | ||
| 28 | + <omgdc:Bounds height="55.0" width="105.0" x="260.0" y="40.0"></omgdc:Bounds> | ||
| 29 | + </bpmndi:BPMNShape> | ||
| 30 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 31 | + <omgdi:waypoint x="85.0" y="67.0"></omgdi:waypoint> | ||
| 32 | + <omgdi:waypoint x="116.0" y="67.0"></omgdi:waypoint> | ||
| 33 | + </bpmndi:BPMNEdge> | ||
| 34 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 35 | + <omgdi:waypoint x="365.0" y="67.0"></omgdi:waypoint> | ||
| 36 | + <omgdi:waypoint x="410.0" y="67.0"></omgdi:waypoint> | ||
| 37 | + </bpmndi:BPMNEdge> | ||
| 38 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | ||
| 39 | + <omgdi:waypoint x="221.0" y="67.0"></omgdi:waypoint> | ||
| 40 | + <omgdi:waypoint x="260.0" y="67.0"></omgdi:waypoint> | ||
| 41 | + </bpmndi:BPMNEdge> | ||
| 42 | + </bpmndi:BPMNPlane> | ||
| 43 | + </bpmndi:BPMNDiagram> | ||
| 44 | +</definitions> | ||
| 0 | \ No newline at end of file | 45 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.exception.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task" activiti:assignee="${user}"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${users}" activiti:elementVariable="user"></multiInstanceLoopCharacteristics> | ||
| 7 | + </userTask> | ||
| 8 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 9 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 10 | + <sequenceFlow id="flow2" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow> | ||
| 11 | + <userTask id="usertask2" name="User Task2"></userTask> | ||
| 12 | + <sequenceFlow id="flow3" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow> | ||
| 13 | + </process> | ||
| 14 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 15 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 16 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 17 | + <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="80.0"></omgdc:Bounds> | ||
| 18 | + </bpmndi:BPMNShape> | ||
| 19 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 20 | + <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="70.0"></omgdc:Bounds> | ||
| 21 | + </bpmndi:BPMNShape> | ||
| 22 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 23 | + <omgdc:Bounds height="35.0" width="35.0" x="340.0" y="190.0"></omgdc:Bounds> | ||
| 24 | + </bpmndi:BPMNShape> | ||
| 25 | + <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2"> | ||
| 26 | + <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="180.0"></omgdc:Bounds> | ||
| 27 | + </bpmndi:BPMNShape> | ||
| 28 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 29 | + <omgdi:waypoint x="125.0" y="97.0"></omgdi:waypoint> | ||
| 30 | + <omgdi:waypoint x="170.0" y="97.0"></omgdi:waypoint> | ||
| 31 | + </bpmndi:BPMNEdge> | ||
| 32 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 33 | + <omgdi:waypoint x="275.0" y="207.0"></omgdi:waypoint> | ||
| 34 | + <omgdi:waypoint x="340.0" y="207.0"></omgdi:waypoint> | ||
| 35 | + </bpmndi:BPMNEdge> | ||
| 36 | + <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> | ||
| 37 | + <omgdi:waypoint x="222.0" y="125.0"></omgdi:waypoint> | ||
| 38 | + <omgdi:waypoint x="222.0" y="180.0"></omgdi:waypoint> | ||
| 39 | + </bpmndi:BPMNEdge> | ||
| 40 | + </bpmndi:BPMNPlane> | ||
| 41 | + </bpmndi:BPMNDiagram> | ||
| 42 | +</definitions> | ||
| 0 | \ No newline at end of file | 43 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.exception.png
0 → 100644
11.5 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.nosequential.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="false"> | ||
| 7 | + <loopCardinality>3</loopCardinality> | ||
| 8 | + </multiInstanceLoopCharacteristics> | ||
| 9 | + </userTask> | ||
| 10 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 11 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 12 | + <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> | ||
| 13 | + </process> | ||
| 14 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 15 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 16 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 17 | + <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="80.0"></omgdc:Bounds> | ||
| 18 | + </bpmndi:BPMNShape> | ||
| 19 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 20 | + <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="70.0"></omgdc:Bounds> | ||
| 21 | + </bpmndi:BPMNShape> | ||
| 22 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 23 | + <omgdc:Bounds height="35.0" width="35.0" x="330.0" y="80.0"></omgdc:Bounds> | ||
| 24 | + </bpmndi:BPMNShape> | ||
| 25 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 26 | + <omgdi:waypoint x="125.0" y="97.0"></omgdi:waypoint> | ||
| 27 | + <omgdi:waypoint x="170.0" y="97.0"></omgdi:waypoint> | ||
| 28 | + </bpmndi:BPMNEdge> | ||
| 29 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 30 | + <omgdi:waypoint x="275.0" y="97.0"></omgdi:waypoint> | ||
| 31 | + <omgdi:waypoint x="330.0" y="97.0"></omgdi:waypoint> | ||
| 32 | + </bpmndi:BPMNEdge> | ||
| 33 | + </bpmndi:BPMNPlane> | ||
| 34 | + </bpmndi:BPMNDiagram> | ||
| 35 | +</definitions> | ||
| 0 | \ No newline at end of file | 36 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.sequential.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="true"> | ||
| 7 | + <loopCardinality>3</loopCardinality> | ||
| 8 | + </multiInstanceLoopCharacteristics> | ||
| 9 | + </userTask> | ||
| 10 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 11 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 12 | + <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> | ||
| 13 | + </process> | ||
| 14 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 15 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 16 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 17 | + <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="80.0"></omgdc:Bounds> | ||
| 18 | + </bpmndi:BPMNShape> | ||
| 19 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 20 | + <omgdc:Bounds height="55.0" width="105.0" x="170.0" y="70.0"></omgdc:Bounds> | ||
| 21 | + </bpmndi:BPMNShape> | ||
| 22 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 23 | + <omgdc:Bounds height="35.0" width="35.0" x="330.0" y="80.0"></omgdc:Bounds> | ||
| 24 | + </bpmndi:BPMNShape> | ||
| 25 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 26 | + <omgdi:waypoint x="125.0" y="97.0"></omgdi:waypoint> | ||
| 27 | + <omgdi:waypoint x="170.0" y="97.0"></omgdi:waypoint> | ||
| 28 | + </bpmndi:BPMNEdge> | ||
| 29 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 30 | + <omgdi:waypoint x="275.0" y="97.0"></omgdi:waypoint> | ||
| 31 | + <omgdi:waypoint x="330.0" y="97.0"></omgdi:waypoint> | ||
| 32 | + </bpmndi:BPMNEdge> | ||
| 33 | + </bpmndi:BPMNPlane> | ||
| 34 | + </bpmndi:BPMNDiagram> | ||
| 35 | +</definitions> | ||
| 0 | \ No newline at end of file | 36 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.users.nosequential.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task" activiti:assignee="${user}"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${users}" activiti:elementVariable="user"></multiInstanceLoopCharacteristics> | ||
| 7 | + </userTask> | ||
| 8 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 9 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 10 | + <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> | ||
| 11 | + </process> | ||
| 12 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 13 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 14 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 15 | + <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="90.0"></omgdc:Bounds> | ||
| 16 | + </bpmndi:BPMNShape> | ||
| 17 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 18 | + <omgdc:Bounds height="55.0" width="105.0" x="130.0" y="80.0"></omgdc:Bounds> | ||
| 19 | + </bpmndi:BPMNShape> | ||
| 20 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 21 | + <omgdc:Bounds height="35.0" width="35.0" x="290.0" y="90.0"></omgdc:Bounds> | ||
| 22 | + </bpmndi:BPMNShape> | ||
| 23 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 24 | + <omgdi:waypoint x="85.0" y="107.0"></omgdi:waypoint> | ||
| 25 | + <omgdi:waypoint x="130.0" y="107.0"></omgdi:waypoint> | ||
| 26 | + </bpmndi:BPMNEdge> | ||
| 27 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 28 | + <omgdi:waypoint x="235.0" y="107.0"></omgdi:waypoint> | ||
| 29 | + <omgdi:waypoint x="290.0" y="107.0"></omgdi:waypoint> | ||
| 30 | + </bpmndi:BPMNEdge> | ||
| 31 | + </bpmndi:BPMNPlane> | ||
| 32 | + </bpmndi:BPMNDiagram> | ||
| 33 | +</definitions> | ||
| 0 | \ No newline at end of file | 34 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.users.sequential.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task" activiti:assignee="${user}"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="true" activiti:collection="${users}" activiti:elementVariable="user"></multiInstanceLoopCharacteristics> | ||
| 7 | + </userTask> | ||
| 8 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 9 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 10 | + <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> | ||
| 11 | + </process> | ||
| 12 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 13 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 14 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 15 | + <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="90.0"></omgdc:Bounds> | ||
| 16 | + </bpmndi:BPMNShape> | ||
| 17 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 18 | + <omgdc:Bounds height="55.0" width="105.0" x="130.0" y="80.0"></omgdc:Bounds> | ||
| 19 | + </bpmndi:BPMNShape> | ||
| 20 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 21 | + <omgdc:Bounds height="35.0" width="35.0" x="290.0" y="90.0"></omgdc:Bounds> | ||
| 22 | + </bpmndi:BPMNShape> | ||
| 23 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 24 | + <omgdi:waypoint x="85.0" y="107.0"></omgdi:waypoint> | ||
| 25 | + <omgdi:waypoint x="130.0" y="107.0"></omgdi:waypoint> | ||
| 26 | + </bpmndi:BPMNEdge> | ||
| 27 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 28 | + <omgdi:waypoint x="235.0" y="107.0"></omgdi:waypoint> | ||
| 29 | + <omgdi:waypoint x="290.0" y="107.0"></omgdi:waypoint> | ||
| 30 | + </bpmndi:BPMNEdge> | ||
| 31 | + </bpmndi:BPMNPlane> | ||
| 32 | + </bpmndi:BPMNDiagram> | ||
| 33 | +</definitions> | ||
| 0 | \ No newline at end of file | 34 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.users.sequential.with.complete.conditon.bpmn
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"> | ||
| 3 | + <process id="testMultiInstanceForUserTask" name="testMultiInstanceForUserTask" isExecutable="true"> | ||
| 4 | + <startEvent id="startevent1" name="Start"></startEvent> | ||
| 5 | + <userTask id="usertask1" name="User Task" activiti:assignee="${user}"> | ||
| 6 | + <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${users}" activiti:elementVariable="user"> | ||
| 7 | + <completionCondition>${nrOfCompletedInstances / nrOfInstances >= rate}</completionCondition> | ||
| 8 | + </multiInstanceLoopCharacteristics> | ||
| 9 | + </userTask> | ||
| 10 | + <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow> | ||
| 11 | + <endEvent id="endevent1" name="End"></endEvent> | ||
| 12 | + <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow> | ||
| 13 | + </process> | ||
| 14 | + <bpmndi:BPMNDiagram id="BPMNDiagram_testMultiInstanceForUserTask"> | ||
| 15 | + <bpmndi:BPMNPlane bpmnElement="testMultiInstanceForUserTask" id="BPMNPlane_testMultiInstanceForUserTask"> | ||
| 16 | + <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"> | ||
| 17 | + <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="90.0"></omgdc:Bounds> | ||
| 18 | + </bpmndi:BPMNShape> | ||
| 19 | + <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"> | ||
| 20 | + <omgdc:Bounds height="55.0" width="105.0" x="130.0" y="80.0"></omgdc:Bounds> | ||
| 21 | + </bpmndi:BPMNShape> | ||
| 22 | + <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"> | ||
| 23 | + <omgdc:Bounds height="35.0" width="35.0" x="290.0" y="90.0"></omgdc:Bounds> | ||
| 24 | + </bpmndi:BPMNShape> | ||
| 25 | + <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | ||
| 26 | + <omgdi:waypoint x="85.0" y="107.0"></omgdi:waypoint> | ||
| 27 | + <omgdi:waypoint x="130.0" y="107.0"></omgdi:waypoint> | ||
| 28 | + </bpmndi:BPMNEdge> | ||
| 29 | + <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | ||
| 30 | + <omgdi:waypoint x="235.0" y="107.0"></omgdi:waypoint> | ||
| 31 | + <omgdi:waypoint x="290.0" y="107.0"></omgdi:waypoint> | ||
| 32 | + </bpmndi:BPMNEdge> | ||
| 33 | + </bpmndi:BPMNPlane> | ||
| 34 | + </bpmndi:BPMNDiagram> | ||
| 35 | +</definitions> | ||
| 0 | \ No newline at end of file | 36 | \ No newline at end of file |
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/diagrams/chapter9/testMultiInstanceForUserTask.users.sequential.with.complete.conditon.png
0 → 100644
7.82 KB
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/flowable.cfg.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 3 | + xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
| 4 | + http://www.springframework.org/schema/beans/spring-beans.xsd"> | ||
| 5 | + | ||
| 6 | + <bean id="processEngineConfiguration" class="org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration"> | ||
| 7 | + <!--保存到文件模式--> | ||
| 8 | + <!--<property name="jdbcUrl" value="jdbc:h2:file:~/activiti-in-action-chapter6;AUTO_SERVER=TRUE" />--> | ||
| 9 | + <!--内存模式--> | ||
| 10 | + <property name="jdbcUrl" value="jdbc:h2:mem:activiti-in-action-chapter6;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE" /> | ||
| 11 | + <property name="jdbcDriver" value="org.h2.Driver" /> | ||
| 12 | + <property name="jdbcUsername" value="sa" /> | ||
| 13 | + <property name="jdbcPassword" value="" /> | ||
| 14 | + | ||
| 15 | + <!--HistoryLevel--> | ||
| 16 | + <property name="history" value="full" /> | ||
| 17 | + <property name="databaseSchemaUpdate" value="true" /> | ||
| 18 | + <property name="flowable5CompatibilityEnabled" value="false" /> | ||
| 19 | +<!-- <property name="jobExecutorActivate" value="false" />--> | ||
| 20 | + </bean> | ||
| 21 | +</beans> | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |