Skip to content

Commit

Permalink
CIV-0000 Bulk sp4 to master (#1096)
Browse files Browse the repository at this point in the history
* added new task for DN.

* fixed build error.

---------

Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: neeta-hmcts <[email protected]>
  • Loading branch information
3 people authored Sep 27, 2024
1 parent 84a1548 commit 015279d
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1tyi3u6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.7.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0">
<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" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1tyi3u6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.9.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.18.0">
<bpmn:collaboration id="GenerateDirectionsOrder">
<bpmn:participant id="Participant_058zit7" name="Generate Directions Order" processRef="GA_GENERATE_DIRECTIONS_ORDER_ID" />
</bpmn:collaboration>
Expand All @@ -20,6 +20,20 @@
<bpmn:outgoing>Flow_1u4hj3q</bpmn:outgoing>
<bpmn:outgoing>Flow_1qchrvw</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:boundaryEvent id="Event_0qc2eoy" name="Abort" attachedToRef="Activity_0vuxatn">
<bpmn:errorEventDefinition id="ErrorEventDefinition_002mhpf" />
</bpmn:boundaryEvent>
<bpmn:sequenceFlow id="Flow_1karrfz" sourceRef="Event_0ks94xn" targetRef="Activity_0vuxatn" />
<bpmn:sequenceFlow id="Flow_1u4hj3q" sourceRef="Activity_0vuxatn" targetRef="Event_1s3ugpj" />
<bpmn:sequenceFlow id="Flow_1qchrvw" sourceRef="Activity_0vuxatn" targetRef="CreatePDFDocument" />
<bpmn:sequenceFlow id="Flow_1yg2hgc" sourceRef="LinkDocumentToParentCase" targetRef="Gateway_0m4i6qo" />
<bpmn:sequenceFlow id="Flow_1830oky" sourceRef="Activity_0sa4hmt" targetRef="Event_0tam17y" />
<bpmn:sequenceFlow id="Flow_0d4lf2a" sourceRef="CreatePDFDocument" targetRef="LinkDocumentToParentCase" />
<bpmn:sequenceFlow id="Flow_1yzn09e" sourceRef="applicantNotificationForOrderMadeByJudge" targetRef="Gateway_1wekfjk" />
<bpmn:sequenceFlow id="Flow_1bgft9o" sourceRef="respondentNotificationForOrderMadeByJudge" targetRef="Activity_0sa4hmt" />
<bpmn:sequenceFlow id="Flow_041g7uu" name="Yes" sourceRef="Gateway_0m4i6qo" targetRef="applicantNotificationForOrderMadeByJudge">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(!empty flowFlags.LIP_APPLICANT &amp;&amp; flowFlags.LIP_APPLICANT)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="LinkDocumentToParentCase" name="Link Document To Parent Case" camunda:type="external" camunda:topic="updateFromGACaseEvent">
<bpmn:extensionElements>
<camunda:inputOutput>
Expand All @@ -29,41 +43,71 @@
<bpmn:incoming>Flow_0d4lf2a</bpmn:incoming>
<bpmn:outgoing>Flow_1yg2hgc</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:boundaryEvent id="Event_0qc2eoy" name="Abort" attachedToRef="Activity_0vuxatn">
<bpmn:errorEventDefinition id="ErrorEventDefinition_002mhpf" />
</bpmn:boundaryEvent>
<bpmn:sequenceFlow id="Flow_1karrfz" sourceRef="Event_0ks94xn" targetRef="Activity_0vuxatn" />
<bpmn:sequenceFlow id="Flow_1u4hj3q" sourceRef="Activity_0vuxatn" targetRef="Event_1s3ugpj" />
<bpmn:sequenceFlow id="Flow_1qchrvw" sourceRef="Activity_0vuxatn" targetRef="CreatePDFDocument" />
<bpmn:sequenceFlow id="Flow_1yg2hgc" sourceRef="LinkDocumentToParentCase" targetRef="Activity_0sa4hmt" />
<bpmn:sequenceFlow id="Flow_1830oky" sourceRef="Activity_0sa4hmt" targetRef="Event_0tam17y" />
<bpmn:sequenceFlow id="Flow_1u69kcw" name="Yes" sourceRef="Gateway_1wekfjk" targetRef="respondentNotificationForOrderMadeByJudge">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(!empty flowFlags.LIP_RESPONDENT &amp;&amp; flowFlags.LIP_RESPONDENT)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="CreatePDFDocument" name="Create PDF Document" camunda:type="external" camunda:topic="applicationProcessCaseEventGASpec">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">GENERATE_JUDGES_FORM</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1qchrvw</bpmn:incoming>
<bpmn:outgoing>Flow_0d4lf2a</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:endEvent id="Event_0tam17y">
<bpmn:incoming>Flow_1830oky</bpmn:incoming>
</bpmn:endEvent>
<bpmn:callActivity id="Activity_0sa4hmt" name="End Business Process" calledElement="GA_EndBusinessProcess">
<bpmn:extensionElements>
<camunda:in variables="all" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_1yg2hgc</bpmn:incoming>
<bpmn:incoming>Flow_1bgft9o</bpmn:incoming>
<bpmn:incoming>Flow_0t75ukk</bpmn:incoming>
<bpmn:outgoing>Flow_1830oky</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="Flow_0d4lf2a" sourceRef="CreatePDFDocument" targetRef="LinkDocumentToParentCase" />
<bpmn:serviceTask id="CreatePDFDocument" name="Create PDF Document" camunda:type="external" camunda:topic="applicationProcessCaseEventGASpec">
<bpmn:serviceTask id="respondentNotificationForOrderMadeByJudge" name="Create dashboard notification for respondent" camunda:type="external" camunda:topic="applicationProcessCaseEventGASpec">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">GENERATE_JUDGES_FORM</camunda:inputParameter>
<camunda:inputParameter name="caseEvent">CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1qchrvw</bpmn:incoming>
<bpmn:outgoing>Flow_0d4lf2a</bpmn:outgoing>
<bpmn:incoming>Flow_1u69kcw</bpmn:incoming>
<bpmn:outgoing>Flow_1bgft9o</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_1wekfjk" name="LiP respondent ?">
<bpmn:incoming>Flow_1yzn09e</bpmn:incoming>
<bpmn:incoming>Flow_03vqbjk</bpmn:incoming>
<bpmn:outgoing>Flow_1u69kcw</bpmn:outgoing>
<bpmn:outgoing>Flow_0t75ukk</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:serviceTask id="applicantNotificationForOrderMadeByJudge" name="Create Dahsboard notification for applicant" camunda:type="external" camunda:topic="applicationProcessCaseEventGASpec">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_041g7uu</bpmn:incoming>
<bpmn:outgoing>Flow_1yzn09e</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_0m4i6qo" name="LiP applicant ?">
<bpmn:incoming>Flow_1yg2hgc</bpmn:incoming>
<bpmn:outgoing>Flow_041g7uu</bpmn:outgoing>
<bpmn:outgoing>Flow_03vqbjk</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_03vqbjk" name="No" sourceRef="Gateway_0m4i6qo" targetRef="Gateway_1wekfjk">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(empty flowFlags.LIP_APPLICANT || !flowFlags.LIP_APPLICANT)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_0t75ukk" name="No" sourceRef="Gateway_1wekfjk" targetRef="Activity_0sa4hmt">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${(empty flowFlags.LIP_RESPONDENT || !flowFlags.LIP_RESPONDENT)}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
</bpmn:process>
<bpmn:message id="Message_1opqhjn" name="MAKE_DECISION" />
<bpmn:message id="Message_1lvd10f" name="GENERATE_DIRECTIONS_ORDER" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="GenerateDirectionsOrder">
<bpmndi:BPMNShape id="Participant_058zit7_di" bpmnElement="Participant_058zit7" isHorizontal="true">
<dc:Bounds x="160" y="100" width="1090" height="390" />
<dc:Bounds x="160" y="100" width="1350" height="390" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0ks94xn_di" bpmnElement="Event_0ks94xn">
Expand All @@ -79,17 +123,37 @@
<dc:Bounds x="309" y="228" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1iluc48_di" bpmnElement="LinkDocumentToParentCase">
<dc:Bounds x="670" y="228" width="100" height="80" />
<dc:Bounds x="620" y="228" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_0w8fywr" bpmnElement="CreatePDFDocument">
<dc:Bounds x="470" y="228" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0tam17y_di" bpmnElement="Event_0tam17y">
<dc:Bounds x="1072" y="250" width="36" height="36" />
<dc:Bounds x="1382" y="250" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0sa4hmt_di" bpmnElement="Activity_0sa4hmt">
<dc:Bounds x="860" y="228" width="100" height="80" />
<dc:Bounds x="1230" y="228" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_0w8fywr" bpmnElement="CreatePDFDocument">
<dc:Bounds x="480" y="228" width="100" height="80" />
<bpmndi:BPMNShape id="Activity_13l7ejy_di" bpmnElement="respondentNotificationForOrderMadeByJudge">
<dc:Bounds x="1080" y="228" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1wekfjk_di" bpmnElement="Gateway_1wekfjk" isMarkerVisible="true">
<dc:Bounds x="985" y="243" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="978" y="223" width="83" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1pj9989_di" bpmnElement="applicantNotificationForOrderMadeByJudge">
<dc:Bounds x="840" y="228" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0m4i6qo_di" bpmnElement="Gateway_0m4i6qo" isMarkerVisible="true">
<dc:Bounds x="755" y="243" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="745" y="300" width="72" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0qc2eoy_di" bpmnElement="Event_0qc2eoy">
<dc:Bounds x="341" y="210" width="36" height="36" />
Expand All @@ -107,19 +171,60 @@
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1qchrvw_di" bpmnElement="Flow_1qchrvw">
<di:waypoint x="409" y="268" />
<di:waypoint x="480" y="268" />
<di:waypoint x="470" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1yg2hgc_di" bpmnElement="Flow_1yg2hgc">
<di:waypoint x="770" y="269" />
<di:waypoint x="860" y="270" />
<di:waypoint x="720" y="268" />
<di:waypoint x="755" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1830oky_di" bpmnElement="Flow_1830oky">
<di:waypoint x="960" y="268" />
<di:waypoint x="1072" y="268" />
<di:waypoint x="1330" y="268" />
<di:waypoint x="1382" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0d4lf2a_di" bpmnElement="Flow_0d4lf2a">
<di:waypoint x="580" y="268" />
<di:waypoint x="670" y="268" />
<di:waypoint x="570" y="268" />
<di:waypoint x="620" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1yzn09e_di" bpmnElement="Flow_1yzn09e">
<di:waypoint x="940" y="268" />
<di:waypoint x="985" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1bgft9o_di" bpmnElement="Flow_1bgft9o">
<di:waypoint x="1180" y="268" />
<di:waypoint x="1230" y="268" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_041g7uu_di" bpmnElement="Flow_041g7uu">
<di:waypoint x="805" y="268" />
<di:waypoint x="840" y="268" />
<bpmndi:BPMNLabel>
<dc:Bounds x="814" y="250" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1u69kcw_di" bpmnElement="Flow_1u69kcw">
<di:waypoint x="1035" y="268" />
<di:waypoint x="1080" y="268" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1049" y="250" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_03vqbjk_di" bpmnElement="Flow_03vqbjk">
<di:waypoint x="780" y="243" />
<di:waypoint x="780" y="180" />
<di:waypoint x="970" y="180" />
<di:waypoint x="970" y="268" />
<di:waypoint x="985" y="268" />
<bpmndi:BPMNLabel>
<dc:Bounds x="868" y="162" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0t75ukk_di" bpmnElement="Flow_0t75ukk">
<di:waypoint x="1010" y="293" />
<di:waypoint x="1010" y="350" />
<di:waypoint x="1280" y="350" />
<di:waypoint x="1280" y="308" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1139" y="332" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.camunda.bpm.engine.variable.Variables;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand All @@ -28,6 +30,18 @@ public class GeneralApplicationJudgeMakesOrderAfterHearingTest extends BpmnBaseG
private static final String ADD_PDF_ID = "LinkDocumentToParentCase";

private static final String LIP_APPLICANT = "LIP_APPLICANT";
private static final String LIP_RESPONDENT = "LIP_RESPONDENT";

private static final String CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE_EVENT = "CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE";
private static final String CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE_ACTIVITY = "applicantNotificationForOrderMadeByJudge";

private static final String CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE_EVENT = "CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE";
private static final String CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE_ACTIVITY = "respondentNotificationForOrderMadeByJudge";

private static final String UPDATE_CLAIMANT_GA_TASK_LIST_GA_COMPLETE_EVENT = "UPDATE_CLAIMANT_TASK_LIST_GA_COMPLETE";
private static final String GENERAL_APPLICATION_CLAIMANT_TASK_LIST_ACTIVITY_ID = "GeneralApplicationClaimantTaskList";
private static final String UPDATE_RESPONDENT_GA_TASK_LIST_GA_COMPLETE_EVENT = "UPDATE_RESPONDENT_TASK_LIST_GA_COMPLETE";
private static final String GENERAL_APPLICATION_RESPONDENT_TASK_LIST_ACTIVITY_ID = "GeneralApplicationRespondentTaskList";

public GeneralApplicationJudgeMakesOrderAfterHearingTest() {
super("general_application_judge_makes_order_after_hearing.bpmn", "GA_GENERATE_DIRECTIONS_ORDER_ID");
Expand All @@ -52,8 +66,9 @@ void setup() {
processInstance = engine.getRuntimeService().startProcessInstanceByKey(processId);
}

@Test
void shouldSuccessfullyCompleteCreatePDFDocument_whenCalled() {
@ParameterizedTest
@CsvSource({"false,false", "true,false", "true,true", "false,true"})
void shouldSuccessfullyCompleteCreatePDFDocument_whenCalled(boolean isLipApplicant, boolean isLipRespondent) {
//assert process has started
assertFalse(processInstance.isEnded());

Expand All @@ -62,7 +77,8 @@ void shouldSuccessfullyCompleteCreatePDFDocument_whenCalled() {

VariableMap variables = Variables.createVariables();
variables.put("flowFlags", Map.of(
LIP_APPLICANT, false));
LIP_APPLICANT, isLipApplicant,
LIP_RESPONDENT, isLipRespondent));

//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
Expand Down Expand Up @@ -94,10 +110,52 @@ void shouldSuccessfullyCompleteCreatePDFDocument_whenCalled() {
variables
);

if (isLipApplicant) {
ExternalTask updateCuiClaimantDashboard = assertNextExternalTask(MAKE_DECISION_CASE_EVENT);
assertCompleteExternalTask(
updateCuiClaimantDashboard,
MAKE_DECISION_CASE_EVENT,
CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE_EVENT,
CREATE_APPLICANT_DASHBOARD_NOTIFICATION_ORDER_MADE_ACTIVITY,
variables
);
}

if (isLipRespondent) {
ExternalTask updateCuiDefendantDashboard = assertNextExternalTask(MAKE_DECISION_CASE_EVENT);
assertCompleteExternalTask(
updateCuiDefendantDashboard,
MAKE_DECISION_CASE_EVENT,
CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE_EVENT,
CREATE_RESPONDENT_DASHBOARD_NOTIFICATION_ORDER_MADE_ACTIVITY,
variables
);
}

//end business process
ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS);
completeBusinessProcess(endBusinessProcess);

if (isLipApplicant || isLipRespondent) {
ExternalTask claimantTaskListUpdate = assertNextExternalTask(APPLICATION_EVENT_GASPEC);
assertCompleteExternalTask(
claimantTaskListUpdate,
APPLICATION_EVENT_GASPEC,
UPDATE_CLAIMANT_GA_TASK_LIST_GA_COMPLETE_EVENT,
GENERAL_APPLICATION_CLAIMANT_TASK_LIST_ACTIVITY_ID,
variables
);

ExternalTask respondentTaskListUpdate = assertNextExternalTask(APPLICATION_EVENT_GASPEC);
assertCompleteExternalTask(
respondentTaskListUpdate,
APPLICATION_EVENT_GASPEC,
UPDATE_RESPONDENT_GA_TASK_LIST_GA_COMPLETE_EVENT,
GENERAL_APPLICATION_RESPONDENT_TASK_LIST_ACTIVITY_ID,
variables
);
}

assertNoExternalTasksLeft();
}

Expand Down

0 comments on commit 015279d

Please sign in to comment.