Skip to content

Commit

Permalink
CIV-10128 Claimant Response notification (#704)
Browse files Browse the repository at this point in the history
* CIV-10128 New flow for claimant response event

* CIV-8420 change notification name

* CIV-10128 change event Id

* CIV-10128 Claimant Response test

---------

Co-authored-by: ElifDenizEsea <[email protected]>
  • Loading branch information
laperla11 and ElifDenizEsea authored Sep 12, 2023
1 parent bf4dc88 commit f2c2989
Show file tree
Hide file tree
Showing 2 changed files with 227 additions and 0 deletions.
159 changes: 159 additions & 0 deletions src/main/resources/camunda/claimant_response_cui.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_18h9iji" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.14.0">
<bpmn:process id="CLAIMANT_RESPONSE_CUI_PROCESS_ID" name="CLAIMANT_RESPONSE_CUI_PROCESS_ID" isExecutable="true">
<bpmn:startEvent id="CLRCUI_StartEvent_1" name="start">
<bpmn:outgoing>Flow_0uwkh9v</bpmn:outgoing>
<bpmn:messageEventDefinition id="MessageEventDefinition_1oxj7lg" messageRef="Message_0ttrrz3" />
</bpmn:startEvent>
<bpmn:endEvent id="CLRUI_End">
<bpmn:incoming>Flow_1utmlsv</bpmn:incoming>
</bpmn:endEvent>
<bpmn:exclusiveGateway id="Gateway_PROCEED_OR_NOT_PROCEED">
<bpmn:incoming>Flow_1uzxrbl</bpmn:incoming>
<bpmn:outgoing>CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION</bpmn:outgoing>
<bpmn:outgoing>Flow_14tv10k</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION" name="&#10;part admit not settled" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="Gateway_NO_MEDIATION">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${flowState == "MAIN.PART_ADMIT_NOT_SETTLED_NO_MEDIATION"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="JudicialReferral" name="Proceed to judicial referral (Response to defence)" camunda:type="external" camunda:topic="processCaseEvent">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">JUDICIAL_REFERRAL</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>CLRCUI_NO_MEDIATION_RULE</bpmn:incoming>
<bpmn:outgoing>Flow_1stajpv</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_NO_MEDIATION">
<bpmn:incoming>CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION</bpmn:incoming>
<bpmn:outgoing>CLRCUI_NO_MEDIATION_RULE</bpmn:outgoing>
<bpmn:outgoing>Flow_0mw4pz5</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="CLRCUI_NO_MEDIATION_RULE" name="no mediation&#10;" sourceRef="Gateway_NO_MEDIATION" targetRef="JudicialReferral">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!(!empty flowFlags.AGREED_TO_MEDIATION &amp;&amp; flowFlags.AGREED_TO_MEDIATION)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="Event_1iyxejm">
<bpmn:incoming>Flow_0r584ez</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0uwkh9v" sourceRef="CLRCUI_StartEvent_1" targetRef="Activity_1sl3er4" />
<bpmn:callActivity id="Activity_1sl3er4" name="Start Business Process" calledElement="StartBusinessProcess">
<bpmn:extensionElements>
<camunda:out variables="all" />
<camunda:in variables="all" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_0uwkh9v</bpmn:incoming>
<bpmn:outgoing>Flow_1uzxrbl</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="Flow_1uzxrbl" sourceRef="Activity_1sl3er4" targetRef="Gateway_PROCEED_OR_NOT_PROCEED" />
<bpmn:boundaryEvent id="Event_0yhzfu9" attachedToRef="Activity_1sl3er4">
<bpmn:outgoing>Flow_0r584ez</bpmn:outgoing>
<bpmn:errorEventDefinition id="ErrorEventDefinition_0g5dg3k" />
</bpmn:boundaryEvent>
<bpmn:sequenceFlow id="Flow_0r584ez" sourceRef="Event_0yhzfu9" targetRef="Event_1iyxejm" />
<bpmn:callActivity id="END_BUSINESS_PROCESS" name="End Business Process" calledElement="EndBusinessProcess">
<bpmn:extensionElements>
<camunda:in variables="all" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_1stajpv</bpmn:incoming>
<bpmn:incoming>Flow_14tv10k</bpmn:incoming>
<bpmn:incoming>Flow_0mw4pz5</bpmn:incoming>
<bpmn:outgoing>Flow_1utmlsv</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="Flow_1stajpv" sourceRef="JudicialReferral" targetRef="END_BUSINESS_PROCESS" />
<bpmn:sequenceFlow id="Flow_1utmlsv" sourceRef="END_BUSINESS_PROCESS" targetRef="CLRUI_End" />
<bpmn:sequenceFlow id="Flow_14tv10k" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="END_BUSINESS_PROCESS" />
<bpmn:sequenceFlow id="Flow_0mw4pz5" sourceRef="Gateway_NO_MEDIATION" targetRef="END_BUSINESS_PROCESS" />
</bpmn:process>
<bpmn:message id="Message_0ttrrz3" name="CLAIMANT_RESPONSE_CUI" />
<bpmn:error id="Error_1alq6sw" name="StartBusinessAbort" errorCode="ABORT" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CLAIMANT_RESPONSE_CUI_PROCESS_ID">
<bpmndi:BPMNShape id="Event_1diii28_di" bpmnElement="CLRCUI_StartEvent_1">
<dc:Bounds x="152" y="195" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="160" y="238" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_07ek9xj_di" bpmnElement="CLRUI_End">
<dc:Bounds x="992" y="182" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0p15z9i_di" bpmnElement="Gateway_PROCEED_OR_NOT_PROCEED" isMarkerVisible="true">
<dc:Bounds x="435" y="185" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="427" y="242" width="73" height="53" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1xj9809" bpmnElement="JudicialReferral">
<dc:Bounds x="680" y="160" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1hhtr5s_di" bpmnElement="Gateway_NO_MEDIATION" isMarkerVisible="true">
<dc:Bounds x="565" y="185" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="559" y="161" width="61" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1iyxejm_di" bpmnElement="Event_1iyxejm">
<dc:Bounds x="272" y="72" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1sl3er4_di" bpmnElement="Activity_1sl3er4">
<dc:Bounds x="240" y="173" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0negovp_di" bpmnElement="END_BUSINESS_PROCESS">
<dc:Bounds x="850" y="160" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0yhzfu9_di" bpmnElement="Event_0yhzfu9">
<dc:Bounds x="272" y="155" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0fz18qx_di" bpmnElement="CLRCUI_PART_ADMISSION_NOT_SETTLED_NO_MEDIATION">
<di:waypoint x="485" y="210" />
<di:waypoint x="565" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="485" y="210" width="69" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1c8x2s3_di" bpmnElement="CLRCUI_NO_MEDIATION_RULE">
<di:waypoint x="615" y="210" />
<di:waypoint x="680" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="608" y="216" width="63" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0uwkh9v_di" bpmnElement="Flow_0uwkh9v">
<di:waypoint x="188" y="213" />
<di:waypoint x="240" y="213" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1uzxrbl_di" bpmnElement="Flow_1uzxrbl">
<di:waypoint x="340" y="213" />
<di:waypoint x="436" y="211" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0r584ez_di" bpmnElement="Flow_0r584ez">
<di:waypoint x="290" y="155" />
<di:waypoint x="290" y="108" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1stajpv_di" bpmnElement="Flow_1stajpv">
<di:waypoint x="780" y="200" />
<di:waypoint x="850" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1utmlsv_di" bpmnElement="Flow_1utmlsv">
<di:waypoint x="950" y="200" />
<di:waypoint x="992" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14tv10k_di" bpmnElement="Flow_14tv10k">
<di:waypoint x="460" y="185" />
<di:waypoint x="460" y="80" />
<di:waypoint x="900" y="80" />
<di:waypoint x="900" y="160" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0mw4pz5_di" bpmnElement="Flow_0mw4pz5">
<di:waypoint x="590" y="185" />
<di:waypoint x="590" y="120" />
<di:waypoint x="870" y="120" />
<di:waypoint x="870" y="160" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package uk.gov.hmcts.reform.civil.bpmn;

import org.camunda.bpm.engine.externaltask.ExternalTask;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;
import org.junit.jupiter.api.Test;

import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;

public class ClaimantResponseCuiTest extends BpmnBaseTest {

private static final String MESSAGE_NAME = "CLAIMANT_RESPONSE_CUI";
private static final String PROCESS_ID = "CLAIMANT_RESPONSE_CUI_PROCESS_ID";
private static final String JUDICIAL_REFERRAL_EVENT = "JUDICIAL_REFERRAL";
private static final String JUDICIAL_REFERRAL_ACTIVITY_ID = "JudicialReferral";

public ClaimantResponseCuiTest() {
super(
"claimant_response_cui.bpmn",
"CLAIMANT_RESPONSE_CUI_PROCESS_ID"
);
}

@Test
void shouldRunProcess() {

//assert process has started
assertFalse(processInstance.isEnded());

//assert message start event
assertThat(getProcessDefinitionByMessage(MESSAGE_NAME).getKey()).isEqualTo(PROCESS_ID);
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
VariableMap variables = Variables.createVariables();
variables.putValue("flowState", "MAIN.PART_ADMIT_NOT_SETTLED_NO_MEDIATION");
variables.put(FLOW_FLAGS, Map.of(
ONE_RESPONDENT_REPRESENTATIVE, true,
TWO_RESPONDENT_REPRESENTATIVES, false,
GENERAL_APPLICATION_ENABLED, true,
IS_MULTI_TRACK, true
));
assertCompleteExternalTask(
startBusiness,
START_BUSINESS_TOPIC,
START_BUSINESS_EVENT,
START_BUSINESS_ACTIVITY,
variables
);
ExternalTask judicialReferral = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
judicialReferral,
PROCESS_CASE_EVENT,
JUDICIAL_REFERRAL_EVENT,
JUDICIAL_REFERRAL_ACTIVITY_ID,
variables
);
endBusinessProcess();
assertNoExternalTasksLeft();
}

private void endBusinessProcess() {
ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS);
completeBusinessProcess(endBusinessProcess);
}

}

0 comments on commit f2c2989

Please sign in to comment.