From c5be6dd6efd7fe329ecb6dfadd9b2e41f9cbe322 Mon Sep 17 00:00:00 2001 From: jeswanth Date: Fri, 24 Jan 2025 11:30:20 +0000 Subject: [PATCH] CIV-15963 apply noc for defendant lip for claimant online notification --- .../apply_noc_decision_defendant_lip.bpmn | 476 +++++++++--------- .../ApplyNocDecisionDefendantLipTest.java | 123 +++-- 2 files changed, 321 insertions(+), 278 deletions(-) diff --git a/src/main/resources/camunda/apply_noc_decision_defendant_lip.bpmn b/src/main/resources/camunda/apply_noc_decision_defendant_lip.bpmn index 7b7c61503..9ce4c4aa8 100644 --- a/src/main/resources/camunda/apply_noc_decision_defendant_lip.bpmn +++ b/src/main/resources/camunda/apply_noc_decision_defendant_lip.bpmn @@ -1,59 +1,23 @@ - + + + + + + - - ${(!empty flowFlags.CLAIM_STATE_DURING_NOC&& flowFlags.CLAIM_STATE_DURING_NOC)} - - - ${flowState == "MAIN.FULL_DEFENCE"} - - - ${(empty flowFlags.CLAIM_STATE_DURING_NOC|| !flowFlags.CLAIM_STATE_DURING_NOC)} - - - - ${flowState == "MAIN.FULL_ADMISSION" || flowState == "MAIN.PART_ADMISSION"} - - - - - ${empty flowFlags.GENERAL_APPLICATION_ENABLED || !flowFlags.GENERAL_APPLICATION_ENABLED} - - - - ${!empty flowFlags.GENERAL_APPLICATION_ENABLED && flowFlags.GENERAL_APPLICATION_ENABLED} - - - ${(empty flowFlags.DEFENDANT_NOC_ONLINE || !flowFlags.DEFENDANT_NOC_ONLINE)} - - - ${(!empty flowFlags.DEFENDANT_NOC_ONLINE && flowFlags.DEFENDANT_NOC_ONLINE)} - - - - - - - Flow_0dm1zjw - - - - - Flow_1x9k7i6 - - Flow_0lzi8gi - Flow_0zuhu8o Flow_1pv62eu + Flow_0zuhu8o Flow_1pv62eu - Flow_1esrkok Flow_0y8qy6v + Flow_1esrkok @@ -98,7 +62,6 @@ Flow_1yhff7r Flow_1tclzid - @@ -106,44 +69,39 @@ Flow_1tclzid - Flow_1yziurq - - - - - NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED - - - Flow_0y1k0m6 - Flow_1wc31ya + Flow_0rz35k4 + + Flow_08bhmdx + Flow_0lzi8gi + Flow_1yk0wbv + + + Flow_1s0jw89 + + + Flow_1tzp590 + Flow_08bhmdx + Flow_03l80qi + NOTIFY_DEFENDANT_AFTER_NOC_APPROVAL - Flow_1esrkok - Flow_1yziurq - Flow_0zuhu8o - Flow_03l80qi - Flow_0wio7uf + Flow_0gdbty8 + Flow_0wntx79 - - + - NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL + UPDATE_CASE_DETAILS_AFTER_NOC - Flow_0wio7uf - Flow_0y1k0m6 + Flow_00ec3ti + Flow_0gdbty8 - - Flow_08bhmdx - Flow_0lzi8gi - Flow_1yk0wbv - @@ -152,263 +110,333 @@ Flow_0dm1zjw Flow_00ec3ti + + + + NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL + + + Flow_0wntx79 + Flow_1lekkvg + + + + + NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED + + + Flow_1lekkvg + Flow_1tzp590 + Flow_1s0jw89 - - Flow_1s0jw89 - + + + ${(!empty flowFlags.DEFENDANT_NOC_ONLINE && flowFlags.DEFENDANT_NOC_ONLINE)} + + + ${(!empty flowFlags.CLAIM_STATE_DURING_NOC&& flowFlags.CLAIM_STATE_DURING_NOC)} + + + ${(empty flowFlags.CLAIM_STATE_DURING_NOC|| !flowFlags.CLAIM_STATE_DURING_NOC)} + + + ${flowState == "MAIN.FULL_ADMISSION" || flowState == "MAIN.PART_ADMISSION"} + + + ${flowState == "MAIN.FULL_DEFENCE"} + + + ${(empty flowFlags.DEFENDANT_NOC_ONLINE || !flowFlags.DEFENDANT_NOC_ONLINE)} + + + + ${empty flowFlags.GENERAL_APPLICATION_ENABLED || !flowFlags.GENERAL_APPLICATION_ENABLED} + + + ${!empty flowFlags.GENERAL_APPLICATION_ENABLED && flowFlags.GENERAL_APPLICATION_ENABLED} + + + + + ${(!empty flowFlags.LIP_CASE && flowFlags.LIP_CASE)} - - - - UPDATE_CASE_DETAILS_AFTER_NOC - - - Flow_00ec3ti - Flow_07yvyzr - - - Flow_07yvyzr - Flow_08bhmdx - Flow_03l80qi - - + + + ${(empty flowFlags.LIP_CASE || !flowFlags.LIP_CASE)} + + + + + + + + Flow_0dm1zjw + + - Flow_1wc31ya + Flow_0rz35k4 + Flow_03l80qi + Flow_12ge31q Flow_1x9k7i6 - + + Flow_1x9k7i6 + + + + + CREATE_NOC_ONLINE_DASHBOARD_NOTIFICATION_FOR_CLAIMANT + + + Flow_0zuhu8o + Flow_1esrkok + Flow_12ge31q + - + - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - - - - - - - + + + + + - - - + + - - + + - + + + + + + + + - + - - + + + - - + + + - - + + - + - + + + + + + + + - + - + - - - + + + + + + + - + - - - + + + - + - - - - + + + + - + - - - - - - - - + + + + - + - - - - - - - - - - - - + + + + + - + - - - - - - - + + + - + - - - + + + + + + + + - + - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + + + + - - - - + + + + - - + + - + + + + + + + + + + + + - - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ApplyNocDecisionDefendantLipTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ApplyNocDecisionDefendantLipTest.java index 124c48aef..e2f52e585 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ApplyNocDecisionDefendantLipTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/ApplyNocDecisionDefendantLipTest.java @@ -120,6 +120,32 @@ void shouldRunProcessIfClaimantIsNotRepresented() { "UPDATE_CASE_DETAILS_AFTER_NOC", "UpdateCaseDetailsAfterNoC" ); +//complete notify claimant + ExternalTask notifyDefendantAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyDefendantAfterNoc, + PROCESS_CASE_EVENT, + "NOTIFY_DEFENDANT_AFTER_NOC_APPROVAL", + "NotifyDefendantLipAfterNocApproval" + ); + + //complete notify defendant + ExternalTask notifyDefendantSolicitorAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyDefendantSolicitorAfterNoc, + PROCESS_CASE_EVENT, + "NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL", + "NotifyDefendant1SolicitorRepresented" + ); + + //complete notify defendant + ExternalTask notifyClaimant = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyClaimant, + PROCESS_CASE_EVENT, + "NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED", + "NotifyClaimantLipDefendantRepresented" + ); //Proceed Offline ExternalTask proceedOfflineTask = assertNextExternalTask(PROCESS_CASE_EVENT); @@ -148,33 +174,6 @@ void shouldRunProcessIfClaimantIsNotRepresented() { NOTIFY_RPA_ON_CASE_HANDED_OFFLINE_ACTIVITY_ID ); - //complete notify claimant - ExternalTask notifyDefendantAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyDefendantAfterNoc, - PROCESS_CASE_EVENT, - "NOTIFY_DEFENDANT_AFTER_NOC_APPROVAL", - "NotifyDefendantLipAfterNocApproval" - ); - - //complete notify defendant - ExternalTask notifyDefendantSolicitorAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyDefendantSolicitorAfterNoc, - PROCESS_CASE_EVENT, - "NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL", - "NotifyDefendant1SolicitorRepresented" - ); - - //complete notify defendant - ExternalTask notifyClaimant = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyClaimant, - PROCESS_CASE_EVENT, - "NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED", - "NotifyClaimantLipDefendantRepresented" - ); - //end business process ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); completeBusinessProcess(endBusinessProcess); @@ -238,6 +237,14 @@ void shouldStayAsIsIfClaimantIsNotRepresentedWithDefendantNocOnline() { "NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED", "NotifyClaimantLipDefendantRepresented" ); + //complete dashboard notification + ExternalTask dashboardClaimantNotification = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + dashboardClaimantNotification, + PROCESS_CASE_EVENT, + "CREATE_NOC_ONLINE_DASHBOARD_NOTIFICATION_FOR_CLAIMANT", + "createOnlineDashboardNotificationForClaimant" + ); //end business process ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); @@ -276,6 +283,32 @@ void shouldMoveTheCaseOffline_IfClaimStateIsClaimantIntentionForGivenResponseTyp "UPDATE_CASE_DETAILS_AFTER_NOC", "UpdateCaseDetailsAfterNoC" ); + //complete notify claimant + ExternalTask notifyDefendantAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyDefendantAfterNoc, + PROCESS_CASE_EVENT, + "NOTIFY_DEFENDANT_AFTER_NOC_APPROVAL", + "NotifyDefendantLipAfterNocApproval" + ); + + //complete notify defendant + ExternalTask notifyDefendantSolicitorAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyDefendantSolicitorAfterNoc, + PROCESS_CASE_EVENT, + "NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL", + "NotifyDefendant1SolicitorRepresented" + ); + + //complete notify defendant + ExternalTask notifyClaimant = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + notifyClaimant, + PROCESS_CASE_EVENT, + "NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED", + "NotifyClaimantLipDefendantRepresented" + ); //Proceed Offline ExternalTask proceedOfflineTask = assertNextExternalTask(PROCESS_CASE_EVENT); @@ -304,33 +337,6 @@ void shouldMoveTheCaseOffline_IfClaimStateIsClaimantIntentionForGivenResponseTyp NOTIFY_RPA_ON_CASE_HANDED_OFFLINE_ACTIVITY_ID ); - //complete notify claimant - ExternalTask notifyDefendantAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyDefendantAfterNoc, - PROCESS_CASE_EVENT, - "NOTIFY_DEFENDANT_AFTER_NOC_APPROVAL", - "NotifyDefendantLipAfterNocApproval" - ); - - //complete notify defendant - ExternalTask notifyDefendantSolicitorAfterNoc = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyDefendantSolicitorAfterNoc, - PROCESS_CASE_EVENT, - "NOTIFY_DEFENDANT_SOLICITOR_AFTER_NOC_APPROVAL", - "NotifyDefendant1SolicitorRepresented" - ); - - //complete notify defendant - ExternalTask notifyClaimant = assertNextExternalTask(PROCESS_CASE_EVENT); - assertCompleteExternalTask( - notifyClaimant, - PROCESS_CASE_EVENT, - "NOTIFY_CLAIMANT_DEFENDANT_REPRESENTED", - "NotifyClaimantLipDefendantRepresented" - ); - //end business process ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); completeBusinessProcess(endBusinessProcess); @@ -395,6 +401,15 @@ void shouldStayAsIsIfClaimantIsNotRepresentedWithDefendantResponseIsFullDefence( "NotifyClaimantLipDefendantRepresented" ); + //complete dashboard notification + ExternalTask dashboardClaimantNotification = assertNextExternalTask(PROCESS_CASE_EVENT); + assertCompleteExternalTask( + dashboardClaimantNotification, + PROCESS_CASE_EVENT, + "CREATE_NOC_ONLINE_DASHBOARD_NOTIFICATION_FOR_CLAIMANT", + "createOnlineDashboardNotificationForClaimant" + ); + //end business process ExternalTask endBusinessProcess = assertNextExternalTask(END_BUSINESS_PROCESS); completeBusinessProcess(endBusinessProcess);