Skip to content

Commit

Permalink
Merge branch 'master' into feat/CIV-15766
Browse files Browse the repository at this point in the history
  • Loading branch information
ShwetaTandel-hmcts authored Dec 10, 2024
2 parents d828fad + 5d16262 commit 2c25224
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 21 deletions.
1 change: 1 addition & 0 deletions charts/civil-camunda/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ java:
HMC_HEARINGS_SUBSCRIPTION_ENABLED: false
ACA_SERVICE_API_BASEURL: http://${SERVICE_NAME}-aac-manage-case-assignment
HMC_API_URL: http://${SERVICE_NAME}-wiremock
ROLE_ASSIGNMENT_URL: http://am-role-assignment-service-aat.service.core-compute-aat.internal
postgresql:
enabled: true
releaseNameOverride: ${SERVICE_NAME}-postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<bpmn:collaboration id="Collaboration_0lkiw1g">
<bpmn:participant id="Participant_1nspjir" name="Apply NoC Decision for Defendant Lip" processRef="APPLY_NOC_DECISION_DEFENDANT_LIP" />
</bpmn:collaboration>
<bpmn:process id="APPLY_NOC_DECISION_DEFENDANT_LIP" name="Apply noc decision lip" isExecutable="true" camunda:historyTimeToLive="P90D">
<bpmn:process id="APPLY_NOC_DECISION_DEFENDANT_LIP" name="Apply noc decision defendant lip" isExecutable="true" camunda:historyTimeToLive="P90D">
<bpmn:endEvent id="Event_0l4t4tn">
<bpmn:incoming>Flow_1s0jw89</bpmn:incoming>
</bpmn:endEvent>
Expand Down
128 changes: 113 additions & 15 deletions src/main/resources/camunda/upload_translated_document_ga_lip_notify.bpmn
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:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_18h9iji" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.1">
<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.11.0">
<bpmn:process id="UPLOAD_TRANSLATED_DOCUMENT_GA_LIP_ID" name="Upload translated document GA Lip" isExecutable="true" camunda:historyTimeToLive="P90D">
<bpmn:startEvent id="StartEvent_1" name="Start">
<bpmn:outgoing>Flow_0g2t112</bpmn:outgoing>
Expand All @@ -12,7 +12,8 @@
<bpmn:extensionElements>
<camunda:in variables="all" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_0hg3qpe</bpmn:incoming>
<bpmn:incoming>Flow_1wq77hr</bpmn:incoming>
<bpmn:incoming>Flow_05b0ay8</bpmn:incoming>
<bpmn:outgoing>Flow_0qmsc9o</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:callActivity id="Activity_0gt1863" name="Start Ga Business Process" calledElement="GA_StartGeneralApplicationBusinessProcess">
Expand Down Expand Up @@ -69,7 +70,7 @@
<bpmn:incoming>Flow_05nwln1</bpmn:incoming>
<bpmn:outgoing>Flow_1tjecyy</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_0hg3qpe" sourceRef="RespondentDashboardTranslatedDocUploadedGA" targetRef="Activity_1cweuly" />
<bpmn:sequenceFlow id="Flow_0hg3qpe" sourceRef="RespondentDashboardTranslatedDocUploadedGA" targetRef="Gateway_0nb8bqq" />
<bpmn:serviceTask id="AddDocumentsToMainCaseID" name="Add PDF Document To Main Case" camunda:type="external" camunda:topic="updateFromGACaseEvent">
<bpmn:extensionElements>
<camunda:inputOutput>
Expand All @@ -84,6 +85,49 @@
<bpmn:sequenceFlow id="Flow_1tjecyy" sourceRef="ApplicantDashboardTranslatedDocUploadedGA" targetRef="RespondentDashboardTranslatedDocUploadedGA" />
<bpmn:sequenceFlow id="Flow_05nwln1" sourceRef="NotifyTranslatedDocumentUploadedToRespondentGA" targetRef="ApplicantDashboardTranslatedDocUploadedGA" />
<bpmn:sequenceFlow id="Flow_0hmed5p" sourceRef="NotifyTranslatedDocumentUploadedToApplicantGA" targetRef="NotifyTranslatedDocumentUploadedToRespondentGA" />
<bpmn:exclusiveGateway id="Gateway_0nb8bqq">
<bpmn:incoming>Flow_0hg3qpe</bpmn:incoming>
<bpmn:outgoing>Flow_1u52am6</bpmn:outgoing>
<bpmn:outgoing>Flow_06pv761</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_1u52am6" name="LR applicant" sourceRef="Gateway_0nb8bqq" targetRef="Gateway_14xtsk2">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${empty flowFlags.LIP_APPLICANT || !flowFlags.LIP_APPLICANT}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="BulkPrintOrderApplicant" name="Bulk print order applicant" camunda:type="external" camunda:topic="processExternalCaseEventGASpec">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">SEND_TRANSLATED_ORDER_TO_LIP_APPLICANT</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_06pv761</bpmn:incoming>
<bpmn:outgoing>Flow_1o113vl</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_06pv761" name="LiP Applicant" sourceRef="Gateway_0nb8bqq" targetRef="BulkPrintOrderApplicant">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.LIP_APPLICANT &amp;&amp; flowFlags.LIP_APPLICANT}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="BulkPrintOrderRespondent" name="Bulk print order respondent" camunda:type="external" camunda:topic="processExternalCaseEventGASpec">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">SEND_TRANSLATED_ORDER_TO_LIP_RESPONDENT</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0zobuvp</bpmn:incoming>
<bpmn:outgoing>Flow_1wq77hr</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_1wq77hr" sourceRef="BulkPrintOrderRespondent" targetRef="Activity_1cweuly" />
<bpmn:exclusiveGateway id="Gateway_14xtsk2">
<bpmn:incoming>Flow_1u52am6</bpmn:incoming>
<bpmn:incoming>Flow_1o113vl</bpmn:incoming>
<bpmn:outgoing>Flow_05b0ay8</bpmn:outgoing>
<bpmn:outgoing>Flow_0zobuvp</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_05b0ay8" name="LR Respondent" sourceRef="Gateway_14xtsk2" targetRef="Activity_1cweuly">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${empty flowFlags.LIP_RESPONDENT || !flowFlags.LIP_RESPONDENT}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_1o113vl" sourceRef="BulkPrintOrderApplicant" targetRef="Gateway_14xtsk2" />
<bpmn:sequenceFlow id="Flow_0zobuvp" name="LiP Respondent" sourceRef="Gateway_14xtsk2" targetRef="BulkPrintOrderRespondent">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.LIP_RESPONDENT &amp;&amp; flowFlags.LIP_RESPONDENT}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
</bpmn:process>
<bpmn:message id="Message_0ttrrz3" name="UPLOAD_TRANSLATED_DOCUMENT_GA_LIP" />
<bpmn:error id="Error_1alq6sw" name="StartBusinessAbort" errorCode="ABORT" />
Expand All @@ -101,8 +145,9 @@
<bpmndi:BPMNShape id="Event_0nc34kd_di" bpmnElement="Event_0nc34kd">
<dc:Bounds x="262" y="79" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_066t3h2" bpmnElement="AddDocumentsToMainCaseID">
<dc:Bounds x="360" y="167" width="100" height="80" />
<bpmndi:BPMNShape id="Activity_15wxp1o_di" bpmnElement="NotifyTranslatedDocumentUploadedToRespondentGA">
<dc:Bounds x="670" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1up0lu9_di" bpmnElement="NotifyTranslatedDocumentUploadedToApplicantGA">
<dc:Bounds x="520" y="167" width="100" height="80" />
Expand All @@ -112,21 +157,34 @@
<dc:Bounds x="980" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_15wxp1o_di" bpmnElement="NotifyTranslatedDocumentUploadedToRespondentGA">
<dc:Bounds x="670" y="170" width="100" height="80" />
<bpmndi:BPMNShape id="Activity_0fr8sra_di" bpmnElement="ApplicantDashboardTranslatedDocUploadedGA">
<dc:Bounds x="820" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_07ek9xj_di" bpmnElement="Event_07ek9xj">
<dc:Bounds x="1332" y="192" width="36" height="36" />
<bpmndi:BPMNShape id="BPMNShape_066t3h2" bpmnElement="AddDocumentsToMainCaseID">
<dc:Bounds x="360" y="167" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0fr8sra_di" bpmnElement="ApplicantDashboardTranslatedDocUploadedGA">
<dc:Bounds x="820" y="170" width="100" height="80" />
<bpmndi:BPMNShape id="Gateway_0nb8bqq_di" bpmnElement="Gateway_0nb8bqq" isMarkerVisible="true">
<dc:Bounds x="1155" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_14xtsk2_di" bpmnElement="Gateway_14xtsk2" isMarkerVisible="true">
<dc:Bounds x="1355" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1gjfcvf_di" bpmnElement="BulkPrintOrderApplicant">
<dc:Bounds x="1220" y="300" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0pwnstm_di" bpmnElement="BulkPrintOrderRespondent">
<dc:Bounds x="1440" y="300" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_14sbez9_di" bpmnElement="Activity_1cweuly">
<dc:Bounds x="1140" y="170" width="100" height="80" />
<dc:Bounds x="1560" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_07ek9xj_di" bpmnElement="Event_07ek9xj">
<dc:Bounds x="1762" y="192" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1p3emre_di" bpmnElement="Event_1p3emre">
<dc:Bounds x="262" y="149" width="36" height="36" />
<bpmndi:BPMNLabel>
Expand All @@ -142,12 +200,12 @@
<di:waypoint x="230" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0qmsc9o_di" bpmnElement="Flow_0qmsc9o">
<di:waypoint x="1240" y="210" />
<di:waypoint x="1332" y="210" />
<di:waypoint x="1660" y="210" />
<di:waypoint x="1762" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0hg3qpe_di" bpmnElement="Flow_0hg3qpe">
<di:waypoint x="1080" y="210" />
<di:waypoint x="1140" y="210" />
<di:waypoint x="1155" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_07n1ssi_di" bpmnElement="Flow_07n1ssi">
<di:waypoint x="330" y="207" />
Expand All @@ -169,6 +227,46 @@
<di:waypoint x="620" y="209" />
<di:waypoint x="670" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1u52am6_di" bpmnElement="Flow_1u52am6">
<di:waypoint x="1205" y="210" />
<di:waypoint x="1355" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1249" y="192" width="62" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_06pv761_di" bpmnElement="Flow_06pv761">
<di:waypoint x="1180" y="235" />
<di:waypoint x="1180" y="340" />
<di:waypoint x="1220" y="340" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1188" y="263" width="64" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1wq77hr_di" bpmnElement="Flow_1wq77hr">
<di:waypoint x="1540" y="340" />
<di:waypoint x="1610" y="340" />
<di:waypoint x="1610" y="250" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_05b0ay8_di" bpmnElement="Flow_05b0ay8">
<di:waypoint x="1405" y="210" />
<di:waypoint x="1560" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1444" y="192" width="77" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1o113vl_di" bpmnElement="Flow_1o113vl">
<di:waypoint x="1320" y="340" />
<di:waypoint x="1380" y="340" />
<di:waypoint x="1380" y="235" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0zobuvp_di" bpmnElement="Flow_0zobuvp">
<di:waypoint x="1380" y="235" />
<di:waypoint x="1380" y="340" />
<di:waypoint x="1440" y="340" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1392" y="273" width="79" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import org.camunda.bpm.engine.variable.VariableMap;
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 java.util.Map;

Expand Down Expand Up @@ -42,12 +43,13 @@ void setup() {
processInstance = engine.getRuntimeService().startProcessInstanceByKey(processId);
}

@Test
void shouldNotifyTranslatedDocumentUploaded() {
@ParameterizedTest
@CsvSource({"false,false", "true,false", "true,true", "false,true"})
void shouldNotifyTranslatedDocumentUploaded(boolean lipApplicant, boolean lipRespondent) {
VariableMap variables = Variables.createVariables();
variables.put("flowFlags", Map.of(
LIP_APPLICANT, false,
LIP_RESPONDENT, false));
LIP_APPLICANT, lipApplicant,
LIP_RESPONDENT, lipRespondent));

//assert process has started
assertFalse(processInstance.isEnded());
Expand Down Expand Up @@ -106,6 +108,28 @@ void shouldNotifyTranslatedDocumentUploaded() {
"RespondentDashboardTranslatedDocUploadedGA",
variables
);
if (lipApplicant) {
//post translated document to LiP applicant
ExternalTask bulkPrintApplicantTask = assertNextExternalTask(NOTIFY_EVENT);
assertCompleteExternalTask(
bulkPrintApplicantTask,
NOTIFY_EVENT,
"SEND_TRANSLATED_ORDER_TO_LIP_APPLICANT",
"BulkPrintOrderApplicant",
variables
);
}
if (lipRespondent) {
//post translated document to LiP respondent
ExternalTask bulkPrintRespondentTask = assertNextExternalTask(NOTIFY_EVENT);
assertCompleteExternalTask(
bulkPrintRespondentTask,
NOTIFY_EVENT,
"SEND_TRANSLATED_ORDER_TO_LIP_RESPONDENT",
"BulkPrintOrderRespondent",
variables
);
}

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

0 comments on commit 2c25224

Please sign in to comment.