Skip to content

Commit

Permalink
Merge branch 'master' into CIV-16322
Browse files Browse the repository at this point in the history
  • Loading branch information
deepthidoppalapudihmcts authored Jan 23, 2025
2 parents 3ef9c1c + cdea8ac commit e9cd93f
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 39 deletions.
92 changes: 53 additions & 39 deletions src/main/resources/camunda/claimant_response_spec.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@
<bpmn:outgoing>Flow_ADMIT_PART_SETTLE_CLAIM</bpmn:outgoing>
<bpmn:outgoing>Flow_Flow_PAY_IMMEDIATELY</bpmn:outgoing>
<bpmn:outgoing>Flow_0f1j5lb</bpmn:outgoing>
<bpmn:outgoing>Flow_0fq9s3w</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_FULL_DEFENCE_NOT_PROCEED" name="Applicant confirms not to proceed(full/part admit)" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="ProceedOfflineForResponseToDefence">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${flowState == "MAIN.FULL_ADMIT_NOT_PROCEED" || flowState == "MAIN.PART_ADMIT_NOT_PROCEED" || flowState == "MAIN.PART_ADMIT_PAY_IMMEDIATELY"}</bpmn:conditionExpression>
<bpmn:sequenceFlow id="Flow_FULL_DEFENCE_NOT_PROCEED" name="Applicant confirms not to proceed(full/part admit) and JO online disabled" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="ProceedOfflineForResponseToDefence">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${flowState == "MAIN.FULL_ADMIT_NOT_PROCEED" || flowState == "MAIN.PART_ADMIT_NOT_PROCEED" || (flowState == "MAIN.PART_ADMIT_PAY_IMMEDIATELY" &amp;&amp; (empty flowFlags.JO_ONLINE_LIVE_ENABLED || !flowFlags.JO_ONLINE_LIVE_ENABLED))}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_FULL_DEFENCE_PROCEED" name="Applicant confirms to proceed (full/part admit)" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="Activity_0izac4m">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${flowState == "MAIN.FULL_ADMIT_PROCEED" || flowState == "MAIN.PART_ADMIT_PROCEED"}</bpmn:conditionExpression>
Expand Down Expand Up @@ -494,6 +495,7 @@
<bpmn:incoming>Flow_0unqxdq</bpmn:incoming>
<bpmn:incoming>Flow_1dx6rl0</bpmn:incoming>
<bpmn:incoming>Flow_JO_ONLINE_ENABLED</bpmn:incoming>
<bpmn:incoming>Flow_0fq9s3w</bpmn:incoming>
<bpmn:outgoing>Flow_189q5fx</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="Flow_0rg51dv" sourceRef="NotifyRoboticsOnContinuousFeed" targetRef="Gateway_1wy38h2" />
Expand Down Expand Up @@ -557,6 +559,9 @@
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.GENERAL_APPLICATION_ENABLED &amp;&amp; flowFlags.GENERAL_APPLICATION_ENABLED}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_0throvl" sourceRef="defendantLipApplicationOfflineDashboardNotification" targetRef="GenerateDashboardNotificationRespondent1" />
<bpmn:sequenceFlow id="Flow_0fq9s3w" name="Applicant confirms not to proceed part admit(pay immediately) and JO online Enabled" sourceRef="Gateway_PROCEED_OR_NOT_PROCEED" targetRef="Gateway_1wy38h2">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.JO_ONLINE_LIVE_ENABLED &amp;&amp; flowFlags.JO_ONLINE_LIVE_ENABLED &amp;&amp; flowState == "MAIN.PART_ADMIT_PAY_IMMEDIATELY"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:textAnnotation id="TextAnnotation_1o3q1xa">
<bpmn:text>2 Respondent representatives</bpmn:text>
</bpmn:textAnnotation>
Expand Down Expand Up @@ -592,6 +597,9 @@
<bpmndi:BPMNShape id="Event_1diii28_di" bpmnElement="StartEvent_1">
<dc:Bounds x="112" y="505" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_07ek9xj_di" bpmnElement="Event_07ek9xj">
<dc:Bounds x="2442" y="505" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_05zzi0k_di" bpmnElement="ClaimantResponseGenerateDirectionsQuestionnaire">
<dc:Bounds x="610" y="210" width="100" height="80" />
</bpmndi:BPMNShape>
Expand Down Expand Up @@ -723,6 +731,13 @@
<bpmndi:BPMNShape id="Activity_03c1gvw_di" bpmnElement="ClaimantDefendantAgreedMediationNotifyRespondent2">
<dc:Bounds x="1270" y="1350" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1lmfxkd" bpmnElement="Activity_0xp7fjj">
<dc:Bounds x="2280" y="483" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1d4axuj" bpmnElement="GenerateDashboardNotificationRespondent1">
<dc:Bounds x="2100" y="483" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_1wy38h2_di" bpmnElement="Gateway_1wy38h2" isMarkerVisible="true">
<dc:Bounds x="1635" y="498" width="50" height="50" />
</bpmndi:BPMNShape>
Expand All @@ -735,6 +750,13 @@
<bpmndi:BPMNShape id="Gateway_1jhr7mx_di" bpmnElement="Gateway_1jhr7mx" isMarkerVisible="true">
<dc:Bounds x="1079" y="1205" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_02ny4v1_di" bpmnElement="Gateway_02ny4v1" isMarkerVisible="true">
<dc:Bounds x="1915" y="498" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1ovf9ab_di" bpmnElement="defendantLipApplicationOfflineDashboardNotification">
<dc:Bounds x="2100" y="630" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_1o3q1xa_di" bpmnElement="TextAnnotation_1o3q1xa">
<dc:Bounds x="790" y="155" width="110" height="45" />
</bpmndi:BPMNShape>
Expand All @@ -757,23 +779,6 @@
<bpmndi:BPMNShape id="TextAnnotation_1l5q3bl_di" bpmnElement="TextAnnotation_1l5q3bl">
<dc:Bounds x="1270" y="1460" width="100" height="41" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_07ek9xj_di" bpmnElement="Event_07ek9xj">
<dc:Bounds x="2442" y="505" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1lmfxkd" bpmnElement="Activity_0xp7fjj">
<dc:Bounds x="2280" y="483" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_1d4axuj" bpmnElement="GenerateDashboardNotificationRespondent1">
<dc:Bounds x="2100" y="483" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_02ny4v1_di" bpmnElement="Gateway_02ny4v1" isMarkerVisible="true">
<dc:Bounds x="1915" y="498" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1ovf9ab_di" bpmnElement="defendantLipApplicationOfflineDashboardNotification">
<dc:Bounds x="2100" y="630" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1p3emre_di" bpmnElement="Event_1p3emre">
<dc:Bounds x="222" y="462" width="36" height="36" />
<bpmndi:BPMNLabel>
Expand Down Expand Up @@ -801,7 +806,7 @@
<di:waypoint x="430" y="730" />
<di:waypoint x="560" y="730" />
<bpmndi:BPMNLabel>
<dc:Bounds x="435" y="673" width="90" height="53" />
<dc:Bounds x="435" y="657" width="90" height="66" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0fz18qx_di" bpmnElement="Flow_FULL_DEFENCE_PROCEED">
Expand Down Expand Up @@ -1181,6 +1186,34 @@
<dc:Bounds x="1140" y="1126" width="59" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0csb8tm_di" bpmnElement="Flow_GA_Not_Enabled">
<di:waypoint x="1965" y="523" />
<di:waypoint x="2100" y="523" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1993" y="505" width="79" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1pzz9n6_di" bpmnElement="Flow_GA_Enabled">
<di:waypoint x="1940" y="548" />
<di:waypoint x="1940" y="670" />
<di:waypoint x="2100" y="670" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1980" y="653" width="59" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0throvl_di" bpmnElement="Flow_0throvl">
<di:waypoint x="2150" y="630" />
<di:waypoint x="2150" y="563" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0fq9s3w_di" bpmnElement="Flow_0fq9s3w">
<di:waypoint x="430" y="545" />
<di:waypoint x="430" y="1620" />
<di:waypoint x="1660" y="1620" />
<di:waypoint x="1660" y="550" />
<bpmndi:BPMNLabel>
<dc:Bounds x="435" y="1540" width="90" height="80" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_1574yb4_di" bpmnElement="Association_1574yb4">
<di:waypoint x="903" y="232" />
<di:waypoint x="892" y="200" />
Expand All @@ -1205,25 +1238,6 @@
<di:waypoint x="1230" y="1455" />
<di:waypoint x="1270" y="1464" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0csb8tm_di" bpmnElement="Flow_GA_Not_Enabled">
<di:waypoint x="1965" y="523" />
<di:waypoint x="2100" y="523" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1993" y="505" width="79" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1pzz9n6_di" bpmnElement="Flow_GA_Enabled">
<di:waypoint x="1940" y="548" />
<di:waypoint x="1940" y="670" />
<di:waypoint x="2100" y="670" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1980" y="653" width="59" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0throvl_di" bpmnElement="Flow_0throvl">
<di:waypoint x="2150" y="630" />
<di:waypoint x="2150" y="563" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class ClaimantResponseSpecTest extends BpmnBaseTest {
"ClaimantAgreedSettledPartAdmitNotifyLip";
private static final String CREATE_DEFENDANT_DASHBOARD_NOTIFICATION_FOR_CLAIMANT_RESPONSE = "CREATE_DEFENDANT_DASHBOARD_NOTIFICATION_FOR_CLAIMANT_RESPONSE";
private static final String CREATE_DEFENDANT_DASHBOARD_NOTIFICATION_FOR_CLAIMANT_RESPONSE_EVENT_ID = "GenerateDashboardNotificationRespondent1";
private static final String NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED = "NOTIFY_RESPONDENT_SOLICITOR1_FOR_CLAIMANT_CONFIRMS_NOT_TO_PROCEED";
private static final String NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED_EVENT_ID = "ClaimantConfirmsNotToProceedNotifyRespondentSolicitor1";
private static final String NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED_CC = "NOTIFY_RESPONDENT_SOLICITOR1_FOR_CLAIMANT_CONFIRMS_NOT_TO_PROCEED_CC";
private static final String NOTIFY_RESPONDENT_SOLICITOR1_CLAIMANT_CONFIRMS_NOT_TO_PROCEED_CC_EVENT_ID = "ClaimantConfirmsNotToProceedNotifyApplicantSolicitor1CC";

public ClaimantResponseSpecTest() {
super("claimant_response_spec.bpmn", "CLAIMANT_RESPONSE_PROCESS_ID_SPEC");
Expand Down Expand Up @@ -624,6 +628,113 @@ void shouldSuccessfullyCompleteClaimantResponse_WhenApplicantToSettle() {
assertNoExternalTasksLeft();
}

@Test
void shouldCompletePartAdmitPayImmediately_WhenApplicantConfirmsNotToProceed_JoFlagDisabled() {
//assert process has started
assertFalse(processInstance.isEnded());

//assert message start event
assertThat(getProcessDefinitionByMessage("CLAIMANT_RESPONSE_SPEC").getKey())
.isEqualTo("CLAIMANT_RESPONSE_PROCESS_ID_SPEC");

VariableMap variables = Variables.createVariables();
variables.putValue("flowState", "MAIN.PART_ADMIT_PAY_IMMEDIATELY");
variables.putValue("flowFlags", Map.of(
ONE_RESPONDENT_REPRESENTATIVE, true,
DASHBOARD_SERVICE_ENABLED, false,
JO_ONLINE_LIVE_ENABLED, false
));

//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
assertCompleteExternalTask(
startBusiness,
START_BUSINESS_TOPIC,
START_BUSINESS_EVENT,
START_BUSINESS_ACTIVITY,
variables
);

//complete the Robotics notification
ExternalTask proccedOffline = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
proccedOffline,
PROCESS_CASE_EVENT,
PROCEED_OFFLINE_EVENT,
PROCEED_OFFLINE_FOR_RESPONSE_TO_DEFENCE_ACTIVITY_ID,
variables
);
//complete the Respondent1 notification
ExternalTask notifyRespondentSolicitor1 = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
notifyRespondentSolicitor1,
PROCESS_CASE_EVENT,
NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED,
NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED_EVENT_ID,
variables
);
//complete the Applicant1 notification
ExternalTask notifyApplicantSolicitor1 = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
notifyApplicantSolicitor1,
PROCESS_CASE_EVENT,
NOTIFY_RESPONDENT_SOLICITOR1_CONFIRMS_NOT_TO_PROCEED_CC,
NOTIFY_RESPONDENT_SOLICITOR1_CLAIMANT_CONFIRMS_NOT_TO_PROCEED_CC_EVENT_ID,
variables
);

//complete the Robotics notification
ExternalTask moveCaseToOffline = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
moveCaseToOffline,
PROCESS_CASE_EVENT,
NOTIFY_RPA_ON_CASE_HANDED_OFFLINE,
NOTIFY_RPA_ON_CASE_HANDED_OFFLINE_ACTIVITY_ID,
variables
);

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

assertNoExternalTasksLeft();
}

@Test
void shouldSuccessfullyCompleteWhenPartPayImmediately_JoFlagEnabled() {
//assert process has started
assertFalse(processInstance.isEnded());

//assert message start event
assertThat(getProcessDefinitionByMessage("CLAIMANT_RESPONSE_SPEC").getKey())
.isEqualTo("CLAIMANT_RESPONSE_PROCESS_ID_SPEC");

VariableMap variables = Variables.createVariables();
variables.putValue("flowState", "MAIN.PART_ADMIT_PAY_IMMEDIATELY");
variables.putValue("flowFlags", Map.of(
DASHBOARD_SERVICE_ENABLED, true,
JO_ONLINE_LIVE_ENABLED, true
));

//complete the start business process
ExternalTask startBusiness = assertNextExternalTask(START_BUSINESS_TOPIC);
assertCompleteExternalTask(
startBusiness,
START_BUSINESS_TOPIC,
START_BUSINESS_EVENT,
START_BUSINESS_ACTIVITY,
variables
);

createDefendantDashboardNotification();

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

assertNoExternalTasksLeft();
}

private void createDefendantDashboardNotification() {
ExternalTask notificationTask = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
Expand Down

0 comments on commit e9cd93f

Please sign in to comment.