Skip to content

Commit

Permalink
Added test for correlation parameters on start event
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Saratz authored and filiphr committed Jan 25, 2024
1 parent 5f59d32 commit d4280e6
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ public void testStaticEventRegistryProcessStart() {
assertThat(runtimeService.createProcessInstanceQuery().list()).isEmpty();
}

@Test
@Deployment(resources = {
"org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testStaticEventRegistryProcessWithCorrelationParameter.bpmn20.xml",
"org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.sendTestEventProcess.bpmn20.xml",
"org/flowable/engine/test/eventregistry/SendInternalEventTaskTest.simple.event"
})
public void testStaticEventRegistryProcessWithCorrelationParameter() {
sendEvent("gonzo", "start");
assertThat(runtimeService.createProcessInstanceQuery().count()).isZero();

sendEvent("kermit", "start");
assertThat(runtimeService.createProcessInstanceQuery().list())
.extracting(ProcessInstance::getProcessDefinitionKey)
.containsExactlyInAnyOrder("eventRegistryDynamicStartTestProcessWithCorrelationParameter");

Task task = taskService.createTaskQuery().singleResult();
assertThat(task).isNotNull();

taskService.complete(task.getId());

assertThat(runtimeService.createProcessInstanceQuery().list()).isEmpty();

}

@Test
@Deployment(resources = {
"org/flowable/engine/test/eventregistry/DynamicProcessStartEventRegistryDeploymentTest.testDynamicEventRegistryProcessStart.bpmn20.xml",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:flowable="http://flowable.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:design="http://flowable.org/design" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://flowable.org/test" design:palette="flowable-engage-process-palette">
<process id="eventRegistryDynamicStartTestProcessWithCorrelationParameter" name="Event Registry Dynamic Start Test Process With Correlation Parameter" isExecutable="true" flowable:candidateStarterGroups="flowableUser">
<extensionElements>
<design:stencilid><![CDATA[BPMNDiagram]]></design:stencilid>
<design:creationdate><![CDATA[2023-11-27T16:04:40.123Z]]></design:creationdate>
<design:modificationdate><![CDATA[2023-11-27T16:04:53.548Z]]></design:modificationdate>
</extensionElements>
<userTask id="bpmnTask_2" name="Test Task" flowable:formFieldValidation="false">
<extensionElements>
<flowable:task-candidates-type><![CDATA[all]]></flowable:task-candidates-type>
<design:stencilid><![CDATA[FormTask]]></design:stencilid>
<design:stencilsuperid><![CDATA[Task]]></design:stencilsuperid>
</extensionElements>
</userTask>
<startEvent id="bpmnStartEvent_1" isInterrupting="false">
<extensionElements>
<flowable:eventType><![CDATA[simpleTest]]></flowable:eventType>
<flowable:startEventCorrelationConfiguration><![CDATA[startNewInstance]]></flowable:startEventCorrelationConfiguration>
<flowable:eventCorrelationParameter name="customer" value="kermit"></flowable:eventCorrelationParameter>
<flowable:eventCorrelationParameter name="action" value="start"></flowable:eventCorrelationParameter>
<flowable:eventOutParameter source="name" target="name"></flowable:eventOutParameter>
<flowable:eventOutParameter source="action" target="action"></flowable:eventOutParameter>
<design:stencilid><![CDATA[StartEventRegistryEvent]]></design:stencilid>
</extensionElements>
</startEvent>
<endEvent id="bpmnEndEvent_4">
<extensionElements>
<design:stencilid><![CDATA[EndNoneEvent]]></design:stencilid>
</extensionElements>
</endEvent>
<sequenceFlow id="bpmnSequenceFlow_5" sourceRef="bpmnTask_2" targetRef="bpmnEndEvent_4">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
<sequenceFlow id="bpmnSequenceFlow_3" sourceRef="bpmnStartEvent_1" targetRef="bpmnTask_2">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_eventRegistryDynamicStartTestProcess">
<bpmndi:BPMNPlane bpmnElement="eventRegistryDynamicStartTestProcess" id="BPMNPlane_eventRegistryDynamicStartTestProcess">
<bpmndi:BPMNShape bpmnElement="bpmnTask_2" id="BPMNShape_bpmnTask_2">
<omgdc:Bounds height="80.0" width="100.0" x="462.0" y="343.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="bpmnStartEvent_1" id="BPMNShape_bpmnStartEvent_1">
<omgdc:Bounds height="30.0" width="30.0" x="383.0" y="368.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="bpmnEndEvent_4" id="BPMNShape_bpmnEndEvent_4">
<omgdc:Bounds height="28.0" width="28.0" x="612.0" y="369.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="bpmnSequenceFlow_3" id="BPMNEdge_bpmnSequenceFlow_3" flowable:sourceDockerX="15.0" flowable:sourceDockerY="15.0" flowable:targetDockerX="50.0" flowable:targetDockerY="40.0">
<omgdi:waypoint x="413.0" y="383.0"></omgdi:waypoint>
<omgdi:waypoint x="462.0" y="383.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="bpmnSequenceFlow_5" id="BPMNEdge_bpmnSequenceFlow_5" flowable:sourceDockerX="50.0" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0">
<omgdi:waypoint x="562.0" y="383.0"></omgdi:waypoint>
<omgdi:waypoint x="612.0" y="383.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

0 comments on commit d4280e6

Please sign in to comment.