-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CIV-15230 LR notification stay update requested (#1122)
- Loading branch information
1 parent
b2575fd
commit 3f0d5b5
Showing
2 changed files
with
270 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
<?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="4.12.0"> | ||
<bpmn:process id="STAY_UPDATE_REQUESTED" name="Stay Update Requested" isExecutable="true" camunda:historyTimeToLive="P90D"> | ||
<bpmn:serviceTask id="NotifyClaimantStayUpdateRequested" name="Notify Claimant" camunda:type="external" camunda:topic="processCaseEvent"> | ||
<bpmn:extensionElements> | ||
<camunda:inputOutput> | ||
<camunda:inputParameter name="caseEvent">NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED</camunda:inputParameter> | ||
</camunda:inputOutput> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_78545522598879</bpmn:incoming> | ||
<bpmn:outgoing>Flow_1fxs0vt2555454745</bpmn:outgoing> | ||
</bpmn:serviceTask> | ||
<bpmn:startEvent id="stay_update_requested_event" name="Start"> | ||
<bpmn:outgoing>Flow_87785545545544</bpmn:outgoing> | ||
<bpmn:messageEventDefinition id="MessageEventDefinition_1dvrj2w" messageRef="Message_07sm7e9" /> | ||
</bpmn:startEvent> | ||
<bpmn:endEvent id="Event_8784535453452"> | ||
<bpmn:incoming>Flow_5845212254322</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="Flow_5845212254322" sourceRef="Activity_12015456423" targetRef="Event_8784535453452" /> | ||
<bpmn:callActivity id="Activity_12015456423" name="End Business Process" calledElement="EndBusinessProcess"> | ||
<bpmn:extensionElements> | ||
<camunda:properties> | ||
<camunda:property name="variables" value="all" /> | ||
</camunda:properties> | ||
<camunda:in variables="all" /> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_1xckrvu54455522188</bpmn:incoming> | ||
<bpmn:outgoing>Flow_5845212254322</bpmn:outgoing> | ||
</bpmn:callActivity> | ||
<bpmn:callActivity id="Activity_7842657675667" name="Start Business Process" calledElement="StartBusinessProcess"> | ||
<bpmn:extensionElements> | ||
<camunda:in variables="all" /> | ||
<camunda:out variables="all" /> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_87785545545544</bpmn:incoming> | ||
<bpmn:outgoing>Flow_78545522598879</bpmn:outgoing> | ||
</bpmn:callActivity> | ||
<bpmn:endEvent id="Event_55878855778"> | ||
<bpmn:incoming>Flow_77875455488</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:boundaryEvent id="Event_0kza4it444" name="Abort" attachedToRef="Activity_7842657675667"> | ||
<bpmn:outgoing>Flow_77875455488</bpmn:outgoing> | ||
<bpmn:errorEventDefinition id="ErrorEventDefinition_09jmy6o" /> | ||
</bpmn:boundaryEvent> | ||
<bpmn:sequenceFlow id="Flow_77875455488" sourceRef="Event_0kza4it444" targetRef="Event_55878855778" /> | ||
<bpmn:sequenceFlow id="Flow_87785545545544" sourceRef="stay_update_requested_event" targetRef="Activity_7842657675667" /> | ||
<bpmn:sequenceFlow id="Flow_78545522598879" sourceRef="Activity_7842657675667" targetRef="NotifyClaimantStayUpdateRequested" /> | ||
<bpmn:serviceTask id="NotifyDefendantStayUpdateRequested" name="Notify Defendant" camunda:type="external" camunda:topic="processCaseEvent"> | ||
<bpmn:extensionElements> | ||
<camunda:inputOutput> | ||
<camunda:inputParameter name="caseEvent">NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED</camunda:inputParameter> | ||
</camunda:inputOutput> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_0s8cobk</bpmn:incoming> | ||
<bpmn:incoming>Flow_1v2px67</bpmn:incoming> | ||
<bpmn:outgoing>Flow_1xckrvu54455522188</bpmn:outgoing> | ||
</bpmn:serviceTask> | ||
<bpmn:sequenceFlow id="Flow_1xckrvu54455522188" sourceRef="NotifyDefendantStayUpdateRequested" targetRef="Activity_12015456423" /> | ||
<bpmn:sequenceFlow id="Flow_1fxs0vt2555454745" sourceRef="NotifyClaimantStayUpdateRequested" targetRef="Gateway_0304545" /> | ||
<bpmn:exclusiveGateway id="Gateway_0304545"> | ||
<bpmn:incoming>Flow_1fxs0vt2555454745</bpmn:incoming> | ||
<bpmn:outgoing>Flow_0s8cobk</bpmn:outgoing> | ||
<bpmn:outgoing>Flow_0z093jw</bpmn:outgoing> | ||
</bpmn:exclusiveGateway> | ||
<bpmn:sequenceFlow id="Flow_0s8cobk" name="No" sourceRef="Gateway_0304545" targetRef="NotifyDefendantStayUpdateRequested"> | ||
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(!empty flowFlags.ONE_RESPONDENT_REPRESENTATIVE && flowFlags.ONE_RESPONDENT_REPRESENTATIVE) || (!empty flowFlags.UNREPRESENTED_DEFENDANT_ONE && flowFlags.UNREPRESENTED_DEFENDANT_ONE)}</bpmn:conditionExpression> | ||
</bpmn:sequenceFlow> | ||
<bpmn:serviceTask id="NotifyDefendant2StayUpdateRequested" name="Notify Defendant 2" camunda:type="external" camunda:topic="processCaseEvent"> | ||
<bpmn:extensionElements> | ||
<camunda:inputOutput> | ||
<camunda:inputParameter name="caseEvent">NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED</camunda:inputParameter> | ||
</camunda:inputOutput> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_0z093jw</bpmn:incoming> | ||
<bpmn:outgoing>Flow_1v2px67</bpmn:outgoing> | ||
</bpmn:serviceTask> | ||
<bpmn:sequenceFlow id="Flow_0z093jw" name="Yes" sourceRef="Gateway_0304545" targetRef="NotifyDefendant2StayUpdateRequested"> | ||
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(!empty flowFlags.TWO_RESPONDENT_REPRESENTATIVES && flowFlags.TWO_RESPONDENT_REPRESENTATIVES) || (!empty flowFlags.UNREPRESENTED_DEFENDANT_TWO && flowFlags.UNREPRESENTED_DEFENDANT_TWO)}</bpmn:conditionExpression> | ||
</bpmn:sequenceFlow> | ||
<bpmn:sequenceFlow id="Flow_1v2px67" sourceRef="NotifyDefendant2StayUpdateRequested" targetRef="NotifyDefendantStayUpdateRequested" /> | ||
<bpmn:textAnnotation id="TextAnnotation_0tzn7kc"> | ||
<bpmn:text>Two respondent representatives?</bpmn:text> | ||
</bpmn:textAnnotation> | ||
<bpmn:association id="Association_0gcnkmh" sourceRef="Gateway_0304545" targetRef="TextAnnotation_0tzn7kc" /> | ||
</bpmn:process> | ||
<bpmn:error id="Error_0lou1w7" name="StartBusinessAbort" errorCode="ABORT" /> | ||
<bpmn:message id="Message_07sm7e9" name="STAY_UPDATE_REQUESTED" /> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="STAY_UPDATE_REQUESTED"> | ||
<bpmndi:BPMNEdge id="Flow_1v2px67_di" bpmnElement="Flow_1v2px67"> | ||
<di:waypoint x="760" y="160" /> | ||
<di:waypoint x="760" y="227" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_0z093jw_di" bpmnElement="Flow_0z093jw"> | ||
<di:waypoint x="570" y="242" /> | ||
<di:waypoint x="570" y="120" /> | ||
<di:waypoint x="710" y="120" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="576" y="178" width="18" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_0s8cobk_di" bpmnElement="Flow_0s8cobk"> | ||
<di:waypoint x="595" y="267" /> | ||
<di:waypoint x="710" y="267" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="645" y="249" width="15" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1fxs0vt_di" bpmnElement="Flow_1fxs0vt2555454745"> | ||
<di:waypoint x="490" y="267" /> | ||
<di:waypoint x="545" y="267" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1xckrvu_di" bpmnElement="Flow_1xckrvu54455522188"> | ||
<di:waypoint x="810" y="269" /> | ||
<di:waypoint x="900" y="269" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1a5jscb_di" bpmnElement="Flow_78545522598879"> | ||
<di:waypoint x="330" y="267" /> | ||
<di:waypoint x="390" y="267" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_116h4jn_di" bpmnElement="Flow_87785545545544"> | ||
<di:waypoint x="188" y="270" /> | ||
<di:waypoint x="230" y="270" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1y0ic2q_di" bpmnElement="Flow_77875455488"> | ||
<di:waypoint x="280" y="209" /> | ||
<di:waypoint x="280" y="175" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_0x2wz2v_di" bpmnElement="Flow_5845212254322"> | ||
<di:waypoint x="1000" y="270" /> | ||
<di:waypoint x="1112" y="270" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNShape id="Activity_0ipbyde_di" bpmnElement="NotifyClaimantStayUpdateRequested"> | ||
<dc:Bounds x="390" y="227" width="100" height="80" /> | ||
<bpmndi:BPMNLabel /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_0vk0w99_di" bpmnElement="stay_update_requested_event"> | ||
<dc:Bounds x="152" y="252" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="158" y="295" width="25" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_1h61h5s_di" bpmnElement="Event_8784535453452"> | ||
<dc:Bounds x="1112" y="252" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Activity_1j68eid_di" bpmnElement="Activity_12015456423"> | ||
<dc:Bounds x="900" y="230" width="100" height="80" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Activity_15x2r24_di" bpmnElement="Activity_7842657675667"> | ||
<dc:Bounds x="230" y="227" width="100" height="80" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_1n2x861_di" bpmnElement="Event_55878855778"> | ||
<dc:Bounds x="262" y="139" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="BPMNShape_1smbj8l" bpmnElement="NotifyDefendantStayUpdateRequested"> | ||
<dc:Bounds x="710" y="227" width="100" height="80" /> | ||
<bpmndi:BPMNLabel /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Gateway_030oovp_di" bpmnElement="Gateway_0304545" isMarkerVisible="true"> | ||
<dc:Bounds x="545" y="242" width="50" height="50" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="OtherTrialReadyNotifyRespondentSolicitor2_di" bpmnElement="NotifyDefendant2StayUpdateRequested"> | ||
<dc:Bounds x="710" y="80" width="100" height="80" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="TextAnnotation_0tzn7kc_di" bpmnElement="TextAnnotation_0tzn7kc"> | ||
<dc:Bounds x="550" y="320" width="100" height="54" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_0kza4it_di" bpmnElement="Event_0kza4it444"> | ||
<dc:Bounds x="262" y="209" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="296" y="190" width="27" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="Association_0gcnkmh_di" bpmnElement="Association_0gcnkmh"> | ||
<di:waypoint x="578" y="284" /> | ||
<di:waypoint x="593" y="320" /> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn:definitions> |
89 changes: 89 additions & 0 deletions
89
src/test/java/uk/gov/hmcts/reform/civil/bpmn/StayUpdateRequestedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
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 StayUpdateRequestedTest extends BpmnBaseTest { | ||
|
||
public static final String MESSAGE_NAME = "STAY_UPDATE_REQUESTED"; | ||
public static final String PROCESS_ID = "STAY_UPDATE_REQUESTED"; | ||
|
||
//CCD CASE EVENT | ||
public static final String NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED | ||
= "NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED"; | ||
public static final String NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED | ||
= "NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED"; | ||
public static final String NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED | ||
= "NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED"; | ||
|
||
//ACTIVITY IDs | ||
private static final String NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED_ACTIVITY_ID | ||
= "NotifyClaimantStayUpdateRequested"; | ||
private static final String NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED_ACTIVITY_ID | ||
= "NotifyDefendantStayUpdateRequested"; | ||
private static final String NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED_ACTIVITY_ID | ||
= "NotifyDefendant2StayUpdateRequested"; | ||
|
||
public StayUpdateRequestedTest() { | ||
super("stay_update_requested.bpmn", PROCESS_ID); | ||
} | ||
|
||
@Test | ||
void shouldSuccessfullyCompleteAmendRestitchBundle() { | ||
//assert process has started | ||
assertFalse(processInstance.isEnded()); | ||
|
||
//assert message start event | ||
assertThat(getProcessDefinitionByMessage(MESSAGE_NAME).getKey()).isEqualTo(PROCESS_ID); | ||
|
||
VariableMap variables = Variables.createVariables(); | ||
variables.put("flowFlags", Map.of( | ||
TWO_RESPONDENT_REPRESENTATIVES, true | ||
)); | ||
|
||
//complete the start business process | ||
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC); | ||
assertCompleteExternalTask(startBusiness, START_BUSINESS_TOPIC, | ||
START_BUSINESS_EVENT, START_BUSINESS_ACTIVITY, variables | ||
); | ||
|
||
ExternalTask notificationTask; | ||
|
||
//complete the claimant notification | ||
notificationTask = assertNextExternalTask(PROCESS_CASE_EVENT); | ||
assertCompleteExternalTask(notificationTask, PROCESS_CASE_EVENT, | ||
NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED, | ||
NOTIFY_CLAIMANT_STAY_UPDATE_REQUESTED_ACTIVITY_ID, | ||
variables | ||
); | ||
|
||
//complete the defendant 2 notification | ||
notificationTask = assertNextExternalTask(PROCESS_CASE_EVENT); | ||
assertCompleteExternalTask(notificationTask, PROCESS_CASE_EVENT, | ||
NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED, | ||
NOTIFY_DEFENDANT2_STAY_UPDATE_REQUESTED_ACTIVITY_ID, | ||
variables | ||
); | ||
|
||
//complete the defendant notification | ||
notificationTask = assertNextExternalTask(PROCESS_CASE_EVENT); | ||
assertCompleteExternalTask(notificationTask, PROCESS_CASE_EVENT, | ||
NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED, | ||
NOTIFY_DEFENDANT_STAY_UPDATE_REQUESTED_ACTIVITY_ID, | ||
variables | ||
); | ||
|
||
//end business process | ||
ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); | ||
completeBusinessProcess(endBusinessProcess); | ||
|
||
assertNoExternalTasksLeft(); | ||
} | ||
} |