@Test public void testTerminatedInternalWithGateway() { BpmnModelInstance instance = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway() .endEvent() .moveToLastGateway() .endEvent(TERMINATION) .done(); initEndEvent(instance, TERMINATION); ProcessDefinition processDefinition = processEngineTestRule.deployAndGetDefinition(instance); processEngineRule.getRuntimeService().startProcessInstanceById(processDefinition.getId()); HistoricProcessInstance entity = getHistoricProcessInstanceWithAssertion(processDefinition); assertThat(entity.getState(), is(HistoricProcessInstance.STATE_COMPLETED)); }
.userTask("userTask1") .endEvent() .moveToLastGateway() .sequenceFlowId("flow2") .userTask("userTask2")
@Test public void testParallelExecutions() { // given BpmnModelInstance instance = Bpmn.createExecutableProcess("Process") .startEvent() .parallelGateway() .scriptTask() .scriptFormat("javascript") .camundaResultVariable("abc") .scriptText("execution.setVariableLocal('abc', foo);") .endEvent() .moveToLastGateway() .scriptTask() .scriptFormat("javascript") .camundaResultVariable("abc") .scriptText("execution.setVariableLocal('abc', foo);") .endEvent() .done(); testRule.deploy(instance); // when runtimeService.startProcessInstanceByKey("Process", Variables.createVariables().putValueTyped("foo", Variables.stringValue("bar", true))); // then List<VariableInstance> variables = runtimeService.createVariableInstanceQuery().list(); assertEquals(0, variables.size()); List<HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery().variableName("abc").list(); assertEquals(2, historicVariables.size()); }
.callActivity("callActivity").calledElement("subprocess") .endEvent() .moveToLastGateway() .userTask("parentUserTask") .endEvent()
.name(TASK_AFTER_CONDITION+1) .endEvent() .moveToLastGateway() .intermediateCatchEvent(CONDITIONAL_EVENT) .conditionalEventDefinition()
.name(TASK_AFTER_CONDITION+1) .endEvent() .moveToLastGateway() .intermediateCatchEvent(CONDITIONAL_EVENT) .conditionalEventDefinition()
@Test public void testTerminatedInternalWithGateway() { BpmnModelInstance instance = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .parallelGateway() .endEvent() .moveToLastGateway() .endEvent(TERMINATION) .done(); initEndEvent(instance, TERMINATION); ProcessDefinition processDefinition = processEngineTestRule.deployAndGetDefinition(instance); processEngineRule.getRuntimeService().startProcessInstanceById(processDefinition.getId()); HistoricProcessInstance entity = getHistoricProcessInstanceWithAssertion(processDefinition); assertThat(entity.getState(), is(HistoricProcessInstance.STATE_COMPLETED)); }
.userTask("userTask1") .endEvent() .moveToLastGateway() .sequenceFlowId("flow2") .userTask("userTask2")
@Test public void testParallelExecutions() { // given BpmnModelInstance instance = Bpmn.createExecutableProcess("Process") .startEvent() .parallelGateway() .scriptTask() .scriptFormat("javascript") .camundaResultVariable("abc") .scriptText("execution.setVariableLocal('abc', foo);") .endEvent() .moveToLastGateway() .scriptTask() .scriptFormat("javascript") .camundaResultVariable("abc") .scriptText("execution.setVariableLocal('abc', foo);") .endEvent() .done(); testRule.deploy(instance); // when runtimeService.startProcessInstanceByKey("Process", Variables.createVariables().putValueTyped("foo", Variables.stringValue("bar", true))); // then List<VariableInstance> variables = runtimeService.createVariableInstanceQuery().list(); assertEquals(0, variables.size()); List<HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery().variableName("abc").list(); assertEquals(2, historicVariables.size()); }
.callActivity("callActivity").calledElement("subprocess") .endEvent() .moveToLastGateway() .userTask("parentUserTask") .endEvent()
.name(TASK_AFTER_CONDITION+1) .endEvent() .moveToLastGateway() .intermediateCatchEvent(CONDITIONAL_EVENT) .conditionalEventDefinition()
.name(TASK_AFTER_CONDITION+1) .endEvent() .moveToLastGateway() .intermediateCatchEvent(CONDITIONAL_EVENT) .conditionalEventDefinition()