Skip to content

Commit

Permalink
CIV-15761 added cron job triggers 600 code
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlynkhaw committed Dec 11, 2024
1 parent 044231d commit 7c8c721
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 58 deletions.
160 changes: 104 additions & 56 deletions src/main/resources/camunda/process_cosc_application.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.27.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" id="Definitions_18h9iji" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.9.0">
<bpmn:process id="PROCESS_COSC_APPLICATION_PROCESS_ID" name="Process COSC Application" isExecutable="true">
<bpmn:startEvent id="Event_0vk0w88" name="Start">
<bpmn:outgoing>Flow_116h4jr</bpmn:outgoing>
Expand All @@ -19,7 +19,8 @@
</camunda:properties>
<camunda:in variables="all" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_14mr64s</bpmn:incoming>
<bpmn:incoming>Flow_1ce0pyb</bpmn:incoming>
<bpmn:incoming>JoOnlineDisabled</bpmn:incoming>
<bpmn:outgoing>Flow_0x2wz2</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:sequenceFlow id="Flow_0x2wz2" sourceRef="Activity_0471ljz" targetRef="Event_1h61h5a" />
Expand Down Expand Up @@ -76,7 +77,7 @@
<bpmn:incoming>Flow_1juthvt</bpmn:incoming>
<bpmn:outgoing>Flow_14mr64s</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_14mr64s" sourceRef="DefendantDashboardNotificationCertificateGenerated" targetRef="Activity_0471ljz" />
<bpmn:sequenceFlow id="Flow_14mr64s" sourceRef="DefendantDashboardNotificationCertificateGenerated" targetRef="Gateway_0jn0zxa" />
<bpmn:serviceTask id="GenerateCoSCDocument" name="Generate CoSC Document" camunda:type="external" camunda:topic="processCaseEvent">
<bpmn:extensionElements>
<camunda:inputOutput>
Expand All @@ -89,6 +90,27 @@
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_1juthvt" sourceRef="GenerateCoSCDocument" targetRef="DefendantDashboardNotificationCertificateGenerated" />
<bpmn:sequenceFlow id="Flow_11c1g3g" sourceRef="SendJudgmentDetailsCJES" targetRef="GenerateCoSCDocument" />
<bpmn:serviceTask id="NotifyRPA" name="Notify RPA on Continuous Feed" camunda:type="external" camunda:topic="processCaseEvent">
<bpmn:extensionElements>
<camunda:inputOutput>
<camunda:inputParameter name="caseEvent">NOTIFY_RPA_ON_CONTINUOUS_FEED</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>JoOnlineEnabled</bpmn:incoming>
<bpmn:outgoing>Flow_1ce0pyb</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_0jn0zxa">
<bpmn:incoming>Flow_14mr64s</bpmn:incoming>
<bpmn:outgoing>JoOnlineEnabled</bpmn:outgoing>
<bpmn:outgoing>JoOnlineDisabled</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="JoOnlineEnabled" name="Jo Live Feed Enabled" sourceRef="Gateway_0jn0zxa" targetRef="NotifyRPA">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.IS_JO_LIVE_FEED_ACTIVE &amp;&amp; flowFlags.IS_JO_LIVE_FEED_ACTIVE}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_1ce0pyb" sourceRef="NotifyRPA" targetRef="Activity_0471ljz" />
<bpmn:sequenceFlow id="JoOnlineDisabled" name="Jo Live Feed Disabled" sourceRef="Gateway_0jn0zxa" targetRef="Activity_0471ljz">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!empty flowFlags.IS_JO_LIVE_FEED_ACTIVE &amp;&amp; !flowFlags.IS_JO_LIVE_FEED_ACTIVE}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:textAnnotation id="TextAnnotation_1jdkgsi">
<bpmn:text>PROCESS_COSC_APPLICATION</bpmn:text>
</bpmn:textAnnotation>
Expand All @@ -103,6 +125,74 @@
<bpmn:message id="Message_1ysab1l" name="Message_19rb2d5" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="PROCESS_COSC_APPLICATION_PROCESS_ID">
<bpmndi:BPMNEdge id="Flow_0an2om7_di" bpmnElement="JoOnlineDisabled">
<di:waypoint x="1285" y="210" />
<di:waypoint x="1480" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1299" y="176" width="63" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1ce0pyb_di" bpmnElement="Flow_1ce0pyb">
<di:waypoint x="1460" y="90" />
<di:waypoint x="1530" y="90" />
<di:waypoint x="1530" y="170" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0k7pan7_di" bpmnElement="JoOnlineEnabled">
<di:waypoint x="1260" y="185" />
<di:waypoint x="1260" y="90" />
<di:waypoint x="1360" y="90" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1271" y="56" width="63" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_11c1g3g_di" bpmnElement="Flow_11c1g3g">
<di:waypoint x="930" y="390" />
<di:waypoint x="1010" y="390" />
<di:waypoint x="1010" y="250" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1juthvt_di" bpmnElement="Flow_1juthvt">
<di:waypoint x="1060" y="210" />
<di:waypoint x="1110" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14mr64s_di" bpmnElement="Flow_14mr64s">
<di:waypoint x="1210" y="210" />
<di:waypoint x="1235" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1xfttkv_di" bpmnElement="Flow_1xfttkv">
<di:waypoint x="730" y="235" />
<di:waypoint x="730" y="390" />
<di:waypoint x="830" y="390" />
<bpmndi:BPMNLabel>
<dc:Bounds x="737" y="319" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0xb4xrg_di" bpmnElement="Flow_0xb4xrg">
<di:waypoint x="755" y="210" />
<di:waypoint x="960" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="802" y="192" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_18kikyy_di" bpmnElement="Flow_18kikyy">
<di:waypoint x="660" y="210" />
<di:waypoint x="705" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1y0ic2q_di" bpmnElement="Flow_1y0ic2q">
<di:waypoint x="440" y="149" />
<di:waypoint x="440" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1a5jscb_di" bpmnElement="Flow_1a5jsca">
<di:waypoint x="490" y="210" />
<di:waypoint x="560" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0x2wz2v_di" bpmnElement="Flow_0x2wz2">
<di:waypoint x="1580" y="210" />
<di:waypoint x="1632" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_116h4jn_di" bpmnElement="Flow_116h4jr">
<di:waypoint x="338" y="210" />
<di:waypoint x="390" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_0vk0w99_di" bpmnElement="Event_0vk0w88">
<dc:Bounds x="302" y="192" width="36" height="36" />
<bpmndi:BPMNLabel>
Expand All @@ -113,10 +203,10 @@
<dc:Bounds x="422" y="81" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1h61h5s_di" bpmnElement="Event_1h61h5a">
<dc:Bounds x="1472" y="192" width="36" height="36" />
<dc:Bounds x="1632" y="192" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1j68eid_di" bpmnElement="Activity_0471ljz">
<dc:Bounds x="1320" y="170" width="100" height="80" />
<dc:Bounds x="1480" y="170" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_15x2r24_di" bpmnElement="Activity_15x2r20">
<dc:Bounds x="390" y="167" width="100" height="80" />
Expand All @@ -127,16 +217,22 @@
<bpmndi:BPMNShape id="Gateway_0pc8yx4_di" bpmnElement="Gateway_0pc8yx4" isMarkerVisible="true">
<dc:Bounds x="705" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_163l4ja_di" bpmnElement="DefendantDashboardNotificationCertificateGenerated">
<dc:Bounds x="1160" y="170" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_06kis6x_di" bpmnElement="SendJudgmentDetailsCJES">
<dc:Bounds x="830" y="350" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_163l4ja_di" bpmnElement="DefendantDashboardNotificationCertificateGenerated">
<dc:Bounds x="1110" y="170" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0pdgmm5_di" bpmnElement="GenerateCoSCDocument">
<dc:Bounds x="960" y="170" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_11tbshq_di" bpmnElement="NotifyRPA">
<dc:Bounds x="1360" y="50" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_0jn0zxa_di" bpmnElement="Gateway_0jn0zxa" isMarkerVisible="true">
<dc:Bounds x="1235" y="185" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_1jdkgsi_di" bpmnElement="TextAnnotation_1jdkgsi">
<dc:Bounds x="160" y="82" width="213" height="33" />
</bpmndi:BPMNShape>
Expand All @@ -149,45 +245,6 @@
<dc:Bounds x="456" y="130" width="27" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_116h4jn_di" bpmnElement="Flow_116h4jr">
<di:waypoint x="338" y="210" />
<di:waypoint x="390" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0x2wz2v_di" bpmnElement="Flow_0x2wz2">
<di:waypoint x="1420" y="210" />
<di:waypoint x="1472" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1a5jscb_di" bpmnElement="Flow_1a5jsca">
<di:waypoint x="490" y="210" />
<di:waypoint x="560" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1y0ic2q_di" bpmnElement="Flow_1y0ic2q">
<di:waypoint x="440" y="149" />
<di:waypoint x="440" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_18kikyy_di" bpmnElement="Flow_18kikyy">
<di:waypoint x="660" y="210" />
<di:waypoint x="705" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0xb4xrg_di" bpmnElement="Flow_0xb4xrg">
<di:waypoint x="755" y="210" />
<di:waypoint x="960" y="210" />
<bpmndi:BPMNLabel>
<dc:Bounds x="802" y="192" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1xfttkv_di" bpmnElement="Flow_1xfttkv">
<di:waypoint x="730" y="235" />
<di:waypoint x="730" y="390" />
<di:waypoint x="830" y="390" />
<bpmndi:BPMNLabel>
<dc:Bounds x="737" y="319" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14mr64s_di" bpmnElement="Flow_14mr64s">
<di:waypoint x="1260" y="210" />
<di:waypoint x="1320" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_0ct49aq_di" bpmnElement="Association_0ct49aq">
<di:waypoint x="308" y="197" />
<di:waypoint x="228" y="115" />
Expand All @@ -196,15 +253,6 @@
<di:waypoint x="741" y="196" />
<di:waypoint x="789" y="140" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1juthvt_di" bpmnElement="Flow_1juthvt">
<di:waypoint x="1060" y="210" />
<di:waypoint x="1160" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_11c1g3g_di" bpmnElement="Flow_11c1g3g">
<di:waypoint x="930" y="390" />
<di:waypoint x="1010" y="390" />
<di:waypoint x="1010" y="250" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;

Expand All @@ -14,23 +15,31 @@ class ProcessCoscApplicationTest extends BpmnBaseTest {
private static final String MESSAGE_NAME = "PROCESS_COSC_APPLICATION";
private static final String PROCESS_ID = "PROCESS_COSC_APPLICATION_PROCESS_ID";
private static final String SEND_DETAILS_CJES = "sendDetailsToCJES";
private static final String NOTIFY_RPA = "NOTIFY_RPA_ON_CONTINUOUS_FEED";
private static final String NOTIFY_RPA_ACTIVITY_ID = "NotifyRPA";

public ProcessCoscApplicationTest() {
super("process_cosc_application.bpmn", PROCESS_ID);
}

@ParameterizedTest
@CsvSource({
"true", "false"
"false, false",
"false, true",
"true, false",
"true, true",
})
void shouldSuccessfullyCompleteAcknowledgeClaim_whenCalled(boolean cjes) {
void shouldSuccessfullyCompleteAcknowledgeClaim_whenCalled(boolean cjes, boolean joFlag) {
//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("flowFlags", Map.of(
IS_JO_LIVE_FEED_ACTIVE, joFlag
));
variables.put(SEND_DETAILS_CJES, cjes);

//complete the start business process
Expand Down Expand Up @@ -76,6 +85,17 @@ void shouldSuccessfullyCompleteAcknowledgeClaim_whenCalled(boolean cjes) {
"DefendantDashboardNotificationCertificateGenerated"
);

if (joFlag) {
ExternalTask notifyRPA = assertNextExternalTask(PROCESS_CASE_EVENT);
assertCompleteExternalTask(
notifyRPA,
PROCESS_CASE_EVENT,
NOTIFY_RPA,
NOTIFY_RPA_ACTIVITY_ID,
variables
);
}

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

0 comments on commit 7c8c721

Please sign in to comment.