verify(mockModificationBuilder).setVariable(eq("var"), argThat(EqualsPrimitiveValue.stringValue("value"))); verify(mockModificationBuilder).setVariable(eq("var"), argThat(EqualsPrimitiveValue.integerValue(52))); verify(mockModificationBuilder).setVariableLocal(eq("varLocal"), argThat(EqualsPrimitiveValue.integerValue(74)));
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS) public void testStartBeforeWithVariables() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("exclusiveGateway"); runtimeService.createProcessInstanceModification(processInstance.getId()).startBeforeActivity("task2").setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue").setVariables(Variables.createVariables().putValue("procInstMapVar", "procInstMapValue")) .setVariablesLocal(Variables.createVariables().putValue("localMapVar", "localMapValue")).execute(); ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstance.getId()); assertNotNull(updatedTree); assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").activity("task2").done()); ActivityInstance task2Instance = getChildInstanceForActivity(updatedTree, "task2"); assertNotNull(task2Instance); assertEquals(1, task2Instance.getExecutionIds().length); String task2ExecutionId = task2Instance.getExecutionIds()[0]; assertEquals(4, runtimeService.createVariableInstanceQuery().count()); assertEquals("procInstValue", runtimeService.getVariableLocal(processInstance.getId(), "procInstVar")); assertEquals("localValue", runtimeService.getVariableLocal(task2ExecutionId, "localVar")); assertEquals("procInstMapValue", runtimeService.getVariableLocal(processInstance.getId(), "procInstMapVar")); assertEquals("localMapValue", runtimeService.getVariableLocal(task2ExecutionId, "localMapVar")); completeTasksInOrder("task1", "task2"); assertProcessEnded(processInstance.getId()); }
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("subProcessTask") .setVariable("nrOfInstances", 3) .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("innerTask") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
@Deployment(resources = EXCLUSIVE_GATEWAY_PROCESS) public void testStartBeforeWithVariables() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("exclusiveGateway"); runtimeService.createProcessInstanceModification(processInstance.getId()).startBeforeActivity("task2").setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue").setVariables(Variables.createVariables().putValue("procInstMapVar", "procInstMapValue")) .setVariablesLocal(Variables.createVariables().putValue("localMapVar", "localMapValue")).execute(); ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstance.getId()); assertNotNull(updatedTree); assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processInstance.getProcessDefinitionId()).activity("task1").activity("task2").done()); ActivityInstance task2Instance = getChildInstanceForActivity(updatedTree, "task2"); assertNotNull(task2Instance); assertEquals(1, task2Instance.getExecutionIds().length); String task2ExecutionId = task2Instance.getExecutionIds()[0]; assertEquals(4, runtimeService.createVariableInstanceQuery().count()); assertEquals("procInstValue", runtimeService.getVariableLocal(processInstance.getId(), "procInstVar")); assertEquals("localValue", runtimeService.getVariableLocal(task2ExecutionId, "localVar")); assertEquals("procInstMapValue", runtimeService.getVariableLocal(processInstance.getId(), "procInstMapVar")); assertEquals("localMapValue", runtimeService.getVariableLocal(task2ExecutionId, "localMapVar")); completeTasksInOrder("task1", "task2"); assertProcessEnded(processInstance.getId()); }
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("subProcessTask") .setVariable("nrOfInstances", 3) .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("task2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("subProcessTask") .setVariable("nrOfInstances", 3) .execute();
.createProcessInstanceModification(processInstance.getId()) .startTransition("flow2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("subProcessTask") .setVariable("nrOfInstances", 3) .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("task2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("innerTask") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("task2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startTransition("flow2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();
.createProcessInstanceModification(processInstance.getId()) .startBeforeActivity("task2") .setVariable("procInstVar", "procInstValue") .setVariableLocal("localVar", "localValue") .execute();