summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-10-31 07:37:41 -0500
committerdaniel <dc443y@att.com>2017-10-31 11:41:54 -0500
commitaa7d5c71a2bdd2b3a4241e0fd42d6c6872790537 (patch)
treee99dcabbe979ee94fc2e82c5d225e8e98d511cc1
parent229fd3addfa9145d3565b9489c9a2f3f29d47010 (diff)
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 <dc443y@att.com>
-rw-r--r--controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl4
1 files changed, 3 insertions, 1 deletions
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}";