diff options
author | 2017-10-30 07:58:34 -0500 | |
---|---|---|
committer | 2017-10-30 08:08:59 -0500 | |
commit | 08c54826db08f104359e36a67e4a3affb477a245 (patch) | |
tree | 3899d7df05736589f5d2dcef07c3b60d4c8dfba7 /controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources | |
parent | c9d429d17c8e19620ff760870d295ce05d5190af (diff) |
Fix Final Failure on AAI Queries
The drools engine will now send final failure notifications
if there is an error returned from A&AI queries instead of
rejected notifications.
Issue-Id: POLICY-364
Change-Id: Ie9c22686d859c633bad47d223726957cc9599f7c
Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources')
-rw-r--r-- | controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl | 83 |
1 files changed, 42 insertions, 41 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 2f8d86127..725e01e22 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 @@ -294,49 +294,50 @@ rule "${policyName}.EVENT.MANAGER" logger.info("{}: {}: event={} manager={} clTimer={}", $params.getClosedLoopControlName(), drools.getRule().getName(), $event, $manager, $clTimer); - // - // Check which event this is. - // - ControlLoopEventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event); - - // - // Check what kind of event this is - // - if (eventStatus == NEW_EVENT_STATUS.SUBSEQUENT_ONSET) { - // - // We don't care about subsequent onsets - // - logger.info("{}: {}: subsequent onset", - $params.getClosedLoopControlName(), drools.getRule().getName()); - retract($event); - return; - } - if (eventStatus == NEW_EVENT_STATUS.SYNTAX_ERROR) { - // - // Ignore any bad syntax events - // - logger.warn("{}: {}: syntax error", - $params.getClosedLoopControlName(), drools.getRule().getName()); - retract($event); - return; - } - // - // We only want the initial ONSET event in memory, - // all the other events need to be retracted to support - // cleanup and avoid the other rules being fired for this event. - // - if (eventStatus != NEW_EVENT_STATUS.FIRST_ONSET) { - logger.warn("{}: {}: no first onset", - $params.getClosedLoopControlName(), drools.getRule().getName()); - retract($event); - } - logger.debug("{}: {}: target={}", $params.getClosedLoopControlName(), - drools.getRule().getName(), $event.target); - // - // Now start seeing if we need to process this event - // try { + // + // Check which event this is. + // + ControlLoopEventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event); + // + // Check what kind of event this is + // + if (eventStatus == NEW_EVENT_STATUS.SUBSEQUENT_ONSET) { + // + // We don't care about subsequent onsets + // + logger.info("{}: {}: subsequent onset", + $params.getClosedLoopControlName(), drools.getRule().getName()); + retract($event); + return; + } + if (eventStatus == NEW_EVENT_STATUS.SYNTAX_ERROR) { + // + // Ignore any bad syntax events + // + logger.warn("{}: {}: syntax error", + $params.getClosedLoopControlName(), drools.getRule().getName()); + retract($event); + return; + } + // + // We only want the initial ONSET event in memory, + // all the other events need to be retracted to support + // cleanup and avoid the other rules being fired for this event. + // + if (eventStatus != NEW_EVENT_STATUS.FIRST_ONSET) { + logger.warn("{}: {}: no first onset", + $params.getClosedLoopControlName(), drools.getRule().getName()); + retract($event); + } + + logger.debug("{}: {}: target={}", $params.getClosedLoopControlName(), + drools.getRule().getName(), $event.target); + // + // Now start seeing if we need to process this event + // + // // Check if this is a Final Event // |