From aa7d5c71a2bdd2b3a4241e0fd42d6c6872790537 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 31 Oct 2017 07:37:41 -0500 Subject: Fix Abatement Processing The drools engine will now only fire the event rule if the event is an onset. This prevents abatements from being processed as onsets. Issue-Id: POLICY-407 Change-Id: Ic74efa74fbb1dc0e01d7c36a06fdaf48fc8a3238 Signed-off-by: Daniel Cruz --- .../src/main/resources/__closedLoopControlName__.drl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'controlloop') diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index 93b4e0a8a..acc980686 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -203,6 +203,8 @@ rule "${policyName}.EVENT" // Retract it from memory // retract($event); + } else if ($event.closedLoopEventStatus != ControlLoopEventStatus.ONSET) { + throw new ControlLoopException($event.closedLoopEventStatus + " received with no prior onset"); } else { // // Create an EventManager @@ -261,7 +263,7 @@ rule "${policyName}.EVENT" VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event); notification.notification = ControlLoopNotificationType.REJECTED; - notification.message = "Exception occurred " + e.getMessage(); + notification.message = "Exception occurred: " + e.getMessage(); notification.policyName = drools.getRule().getName(); notification.policyScope = "${policyScope}"; notification.policyVersion = "${policyVersion}"; -- cgit 1.2.3-korg