diff --git a/src/main/resources/camunda/generate_non_divergent_spec_DJ_form.bpmn b/src/main/resources/camunda/generate_non_divergent_spec_DJ_form.bpmn
index a315a0c54..afba7a9e5 100644
--- a/src/main/resources/camunda/generate_non_divergent_spec_DJ_form.bpmn
+++ b/src/main/resources/camunda/generate_non_divergent_spec_DJ_form.bpmn
@@ -36,7 +36,7 @@
- Flow_0km211y
+ Flow_1lwtzuv
Flow_0e6m2vd
Flow_1g00tur
@@ -115,9 +115,8 @@
Flow_1lzj11s
- Flow_0km211y
+ Flow_0kudn22
-
@@ -180,6 +179,17 @@
+
+
+
+ SEND_JUDGMENT_DETAILS_CJES
+
+
+ Flow_0kudn22
+ Flow_1lwtzuv
+
+
+
@@ -189,195 +199,204 @@
-
-
-
-
-
-
-
+
-
-
-
-
+
-
+
-
+
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/camunda/judgement_by_admission_non_divergent_spec.bpmn b/src/main/resources/camunda/judgment_by_admission_non_divergent_spec.bpmn
similarity index 80%
rename from src/main/resources/camunda/judgement_by_admission_non_divergent_spec.bpmn
rename to src/main/resources/camunda/judgment_by_admission_non_divergent_spec.bpmn
index 56cdaf315..c956a3a45 100644
--- a/src/main/resources/camunda/judgement_by_admission_non_divergent_spec.bpmn
+++ b/src/main/resources/camunda/judgment_by_admission_non_divergent_spec.bpmn
@@ -35,7 +35,7 @@
- Flow_075i2tt
+ Flow_0mxt6kw
Flow_1lamj8i
Flow_1a58dzr
@@ -85,7 +85,7 @@
Flow_085619d
Flow_075i2tt
-
+
@@ -106,120 +106,138 @@
Flow_1o1rhx8
+
+
+
+ SEND_JUDGMENT_DETAILS_CJES
+
+
+ Flow_075i2tt
+ Flow_0mxt6kw
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
diff --git a/src/main/resources/camunda/notify_judgment_varied_determination_of_means.bpmn b/src/main/resources/camunda/notify_judgment_varied_determination_of_means.bpmn
index b33536292..5b6e90c90 100644
--- a/src/main/resources/camunda/notify_judgment_varied_determination_of_means.bpmn
+++ b/src/main/resources/camunda/notify_judgment_varied_determination_of_means.bpmn
@@ -1,5 +1,5 @@
-
+
@@ -7,16 +7,16 @@
Flow_1xqzkty
- Flow_0nvdd4d
Flow_1vs00o9
+ Flow_0nvdd4d
Flow_0nvdd4d
-
+
Flow_1xqzkty
@@ -29,20 +29,21 @@
Flow_0gpaflx
Flow_0y6slka
Flow_026m9v6
+ Flow_1j86psa
Flow_1og0z75
Flow_1og0z75
-
+
NOTIFY_CLAIMANT_JUDGMENT_VARIED_DETERMINATION_OF_MEANS
- Flow_1vs00o9
+ Flow_0oudwfn
Flow_0posdss
@@ -98,6 +99,27 @@
${(!empty flowFlags.TWO_RESPONDENT_REPRESENTATIVES && flowFlags.TWO_RESPONDENT_REPRESENTATIVES) || (!empty flowFlags.UNREPRESENTED_DEFENDANT_TWO && flowFlags.UNREPRESENTED_DEFENDANT_TWO)}
+
+
+
+ SEND_JUDGMENT_DETAILS_CJES
+
+
+ Flow_1vs00o9
+ Flow_1cjqk11
+
+
+
+ Flow_1cjqk11
+ Flow_0oudwfn
+ Flow_1j86psa
+
+
+ ${judgmentRecordedReason=="DETERMINATION_OF_MEANS"}
+
+
+ ${judgmentRecordedReason!="DETERMINATION_OF_MEANS"}
+
Two Respondent Representatives?
@@ -110,6 +132,10 @@
LIP Defendant
+
+ Record reason Determination of means?
+
+
@@ -121,131 +147,165 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
diff --git a/src/main/resources/camunda/record_judgment_notification.bpmn b/src/main/resources/camunda/record_judgment_notification.bpmn
index 193291671..0410a1592 100644
--- a/src/main/resources/camunda/record_judgment_notification.bpmn
+++ b/src/main/resources/camunda/record_judgment_notification.bpmn
@@ -1,5 +1,5 @@
-
+
Flow_08myj65
@@ -14,6 +14,7 @@
Flow_1gsn98m
+ Flow_1050fwj
Flow_1hce35l
@@ -82,7 +83,7 @@
Flow_1sdjpfm
Flow_18lw9cr
-
+
${empty flowFlags.UNREPRESENTED_DEFENDANT_ONE || (!empty flowFlags.UNREPRESENTED_DEFENDANT_ONE && !flowFlags.UNREPRESENTED_DEFENDANT_ONE)}
@@ -126,7 +127,7 @@
GEN_JUDGMENT_BY_DETERMINATION_DOC_CLAIMANT
- Flow_1uaqq7y
+ Flow_10krkxh
Flow_1s17rdm
@@ -140,175 +141,230 @@
+
+
+
+ SEND_JUDGMENT_DETAILS_CJES
+
+
+ Flow_1uaqq7y
+ Flow_0x7w9v3
+
+
+ Flow_0x7w9v3
+ Flow_10krkxh
+ Flow_1050fwj
+
+
+
+ ${judgmentRecordedReason=="DETERMINATION_OF_MEANS"}
+
+
+ ${judgmentRecordedReason!="DETERMINATION_OF_MEANS"}
+
Two Respondent Representatives?
+
+ Record reason Determination of means?
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
+
+
-
+
-
-
+
+
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GenerateNonDivergentSpecDJFormTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GenerateNonDivergentSpecDJFormTest.java
index 79cd91aed..0aa726c09 100644
--- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GenerateNonDivergentSpecDJFormTest.java
+++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GenerateNonDivergentSpecDJFormTest.java
@@ -20,6 +20,7 @@ class GenerateNonDivergentSpecDJFormTest extends BpmnBaseTest {
//CCD CASE EVENT
public static final String GEN_DJ_FORM_NON_DIVERGENT_SPEC_CLAIMANT = "GEN_DJ_FORM_NON_DIVERGENT_SPEC_CLAIMANT";
public static final String GEN_DJ_FORM_NON_DIVERGENT_SPEC_DEFENDANT = "GEN_DJ_FORM_NON_DIVERGENT_SPEC_DEFENDANT";
+ public static final String SEND_JUDGMENT_DETAILS_TO_CJES = "SEND_JUDGMENT_DETAILS_CJES";
public static final String POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT1 = "POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT1";
public static final String POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT2 = "POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT2";
public static final String CREATE_DASHBOARD_NOTIFICATION_DJ_NON_DIVERGENT_DEFENDANT = "CREATE_DASHBOARD_NOTIFICATION_DJ_NON_DIVERGENT_DEFENDANT";
@@ -28,6 +29,7 @@ class GenerateNonDivergentSpecDJFormTest extends BpmnBaseTest {
//ACTIVITY IDs
public static final String GENERATE_DJ_CLAIMANT_FORM_SPEC_ACTIVITY_ID = "GenerateDJFormNondivergentSpecClaimant";
public static final String GENERATE_DJ_DEFENDANT_FORM_SPEC_ACTIVITY_ID = "GenerateDJFormNondivergentSpecDefendant";
+ public static final String SEND_JUDGMENT_DETAILS_TO_CJES_ACTIVITY_ID = "SendJudgmentDetailsToCJES";
public static final String POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT1_ACTIVITY_ID = "PostDjLetterDefendant1";
public static final String POST_DJ_NON_DIVERGENT_LETTER_DEFENDANT2_ACTIVITY_ID = "PostDjLetterDefendant2";
public static final String CREATE_DASHBOARD_NOTIFICATION_DJ_NON_DIVERGENT_DEFENDANT_ACTIVITY_ID = "GenerateDashboardNotificationDJNonDivergentDefendant";
@@ -89,6 +91,14 @@ void shouldSuccessfullyComplete(boolean twoRepresentatives, boolean isLiPDefenda
GENERATE_DJ_DEFENDANT_FORM_SPEC_ACTIVITY_ID
);
+ //complete call to CJES for default Judgment
+ ExternalTask sendJudgmentDetailsToCJES = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgmentDetailsToCJES,
+ PROCESS_CASE_EVENT,
+ SEND_JUDGMENT_DETAILS_TO_CJES,
+ SEND_JUDGMENT_DETAILS_TO_CJES_ACTIVITY_ID
+ );
//end business process
if (!isLiPDefendant) {
diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/NotifyJudgmentVariedDeterminationOfMeansTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/NotifyJudgmentVariedDeterminationOfMeansTest.java
index 7a378eb10..8eefda341 100644
--- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/NotifyJudgmentVariedDeterminationOfMeansTest.java
+++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/NotifyJudgmentVariedDeterminationOfMeansTest.java
@@ -36,6 +36,7 @@ void shouldSuccessfullyNotifyJudgmentVariedDeterminationOfMeans(boolean twoRepre
ONE_RESPONDENT_REPRESENTATIVE, !twoRepresentatives,
TWO_RESPONDENT_REPRESENTATIVES, twoRepresentatives,
UNREPRESENTED_DEFENDANT_ONE, isLiPDefendant));
+ variables.put("judgmentRecordedReason", "DETERMINATION_OF_MEANS");
//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
@@ -46,6 +47,14 @@ void shouldSuccessfullyNotifyJudgmentVariedDeterminationOfMeans(boolean twoRepre
START_BUSINESS_ACTIVITY,
variables
);
+ //complete call to CJES for edit Judgment
+ ExternalTask sendJudgmentDetailsToCJES = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgmentDetailsToCJES,
+ PROCESS_CASE_EVENT,
+ "SEND_JUDGMENT_DETAILS_CJES",
+ "SendJudgmentDetailsToCJES"
+ );
//complete the notification to Claimant
ExternalTask claimantNotification = assertNextExternalTask(PROCESS_CASE_EVENT);
@@ -53,7 +62,8 @@ void shouldSuccessfullyNotifyJudgmentVariedDeterminationOfMeans(boolean twoRepre
claimantNotification,
PROCESS_CASE_EVENT,
"NOTIFY_CLAIMANT_JUDGMENT_VARIED_DETERMINATION_OF_MEANS",
- "NotifyClaimantJudgmentVariedDeterminationOfMeans"
+ "NotifyClaimantJudgmentVariedDeterminationOfMeans",
+ variables
);
if (!isLiPDefendant) {
@@ -99,6 +109,42 @@ void shouldSuccessfullyNotifyJudgmentVariedDeterminationOfMeans(boolean twoRepre
assertNoExternalTasksLeft();
}
+ @Test
+ void shouldBypassProcessesWhenJudgementRecordedReasonIsNotDeterminationOfMeans() {
+ //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("judgmentRecordedReason", "SOMETHING_ELSE");
+
+ //complete the start business process
+ ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
+ assertCompleteExternalTask(
+ startBusiness,
+ START_BUSINESS_TOPIC,
+ START_BUSINESS_EVENT,
+ START_BUSINESS_ACTIVITY,
+ variables
+ );
+
+ ExternalTask sendJudgement = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgement,
+ PROCESS_CASE_EVENT,
+ "SEND_JUDGMENT_DETAILS_CJES",
+ "SendJudgmentDetailsToCJES"
+ );
+
+ //end business process
+ ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS);
+ completeBusinessProcess(endBusinessProcess);
+
+ assertNoExternalTasksLeft();
+ }
+
@Test
void shouldAbort_whenStartBusinessProcessThrowsAnError() {
//assert process has started
diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RecordJudgmentDeterminationMeansNotificationTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RecordJudgmentDeterminationMeansNotificationTest.java
index 433031dcb..da64bc7a7 100644
--- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RecordJudgmentDeterminationMeansNotificationTest.java
+++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RecordJudgmentDeterminationMeansNotificationTest.java
@@ -46,6 +46,7 @@ void shouldSuccessfullyCompleteRecordJudgmentNotificationMultiparty(boolean twoR
TWO_RESPONDENT_REPRESENTATIVES, twoRepresentatives,
UNREPRESENTED_DEFENDANT_ONE, isLiPDefendant,
DASHBOARD_SERVICE_ENABLED, dashboardServiceEnabled));
+ variables.put("judgmentRecordedReason", "DETERMINATION_OF_MEANS");
//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
@@ -57,6 +58,14 @@ void shouldSuccessfullyCompleteRecordJudgmentNotificationMultiparty(boolean twoR
variables
);
+ ExternalTask sendJudgement = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgement,
+ PROCESS_CASE_EVENT,
+ "SEND_JUDGMENT_DETAILS_CJES",
+ "SendJudgmentDetailsCJES"
+ );
+
ExternalTask claimantDoc = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
claimantDoc,
@@ -132,6 +141,42 @@ void shouldSuccessfullyCompleteRecordJudgmentNotificationMultiparty(boolean twoR
assertNoExternalTasksLeft();
}
+ @Test
+ void shouldBypassProcessesWhenJudgementRecordedReasonIsNotDeterminationOfMeans() {
+ //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("judgmentRecordedReason", "SOMETHING_ELSE");
+
+ //complete the start business process
+ ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
+ assertCompleteExternalTask(
+ startBusiness,
+ START_BUSINESS_TOPIC,
+ START_BUSINESS_EVENT,
+ START_BUSINESS_ACTIVITY,
+ variables
+ );
+
+ ExternalTask sendJudgement = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgement,
+ PROCESS_CASE_EVENT,
+ "SEND_JUDGMENT_DETAILS_CJES",
+ "SendJudgmentDetailsCJES"
+ );
+
+ //end business process
+ ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS);
+ completeBusinessProcess(endBusinessProcess);
+
+ assertNoExternalTasksLeft();
+ }
+
@Test
void shouldAbort_whenStartBusinessProcessThrowsAnError() {
//assert process has started
diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgementByAdmissionTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgmentByAdmissionTest.java
similarity index 87%
rename from src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgementByAdmissionTest.java
rename to src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgmentByAdmissionTest.java
index 72472bd22..e98aa238b 100644
--- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgementByAdmissionTest.java
+++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/RequestNonDivergentJudgmentByAdmissionTest.java
@@ -12,7 +12,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
-class RequestNonDivergentJudgementByAdmissionTest extends BpmnBaseTest {
+class RequestNonDivergentJudgmentByAdmissionTest extends BpmnBaseTest {
public static final String MESSAGE_NAME = "JUDGEMENT_BY_ADMISSION_NON_DIVERGENT_SPEC";
public static final String PROCESS_ID = "JUDGEMENT_BY_ADMISSION_NON_DIVERGENT_SPEC_ID";
@@ -20,16 +20,18 @@ class RequestNonDivergentJudgementByAdmissionTest extends BpmnBaseTest {
public static final String JUDGMENT_BY_ADMISSION_DEFENDANT1_PIN_IN_LETTER_ACTIVITY_ID = "PostPINInLetterLIPDefendant";
public static final String GEN_JUDGMENT_BY_ADMISSION_DOC_CLAIMANT_EVENT = "GEN_JUDGMENT_BY_ADMISSION_DOC_CLAIMANT";
public static final String GEN_JUDGMENT_BY_ADMISSION_DOC_DEFENDANT_EVENT = "GEN_JUDGMENT_BY_ADMISSION_DOC_DEFENDANT";
+ public static final String SEND_JUDGMENT_DETAILS_EVENT = "SEND_JUDGMENT_DETAILS_CJES";
public static final String GENERATE_JUDGMENT_BY_ADMISSION_DOC_CLAIMANT_ACTIVITY_ID = "GenerateJudgmentByAdmissionDocClaimant";
public static final String GENERATE_JUDGMENT_BY_ADMISSION_DOC_DEFENDANT_ACTIVITY_ID = "GenerateJudgmentByAdmissionDocDefendant";
+ public static final String SEND_JUDGMENT_DETAILS_ACTIVITY_ID = "SendJudgmentDetailsToCJES";
- public RequestNonDivergentJudgementByAdmissionTest() {
- super("judgement_by_admission_non_divergent_spec.bpmn", PROCESS_ID);
+ public RequestNonDivergentJudgmentByAdmissionTest() {
+ super("judgment_by_admission_non_divergent_spec.bpmn", PROCESS_ID);
}
@ParameterizedTest
@ValueSource(booleans = {true, false})
- void shouldSuccessfullyCompleteRequestJudgementByAdmission(boolean isLiPDefendant) {
+ void shouldSuccessfullyCompleteRequestJudgmentByAdmission(boolean isLiPDefendant) {
//assert process has started
assertFalse(processInstance.isEnded());
@@ -83,6 +85,14 @@ void shouldSuccessfullyCompleteRequestJudgementByAdmission(boolean isLiPDefendan
GENERATE_JUDGMENT_BY_ADMISSION_DOC_DEFENDANT_ACTIVITY_ID
);
+ ExternalTask sendJudgmentDetailsToCJES = assertNextExternalTask(PROCESS_CASE_EVENT);
+ assertCompleteExternalTask(
+ sendJudgmentDetailsToCJES,
+ PROCESS_CASE_EVENT,
+ SEND_JUDGMENT_DETAILS_EVENT,
+ SEND_JUDGMENT_DETAILS_ACTIVITY_ID
+ );
+
if (isLiPDefendant) {
ExternalTask respondent1Notification = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(