diff options
author | 2017-10-24 22:00:08 -0500 | |
---|---|---|
committer | 2017-10-25 09:29:41 -0500 | |
commit | 85b1ada7cc0883aa8b86ea6e11bf86719e1cc10e (patch) | |
tree | 86f4712aa717e1fa5e510c345f887b3e0c11f6c8 /controlloop/templates/archetype-cl-amsterdam/src/main | |
parent | 7e3ace91847ec5aaccfeeff638a8d2d9b17e45fc (diff) |
Fix Source/Target Lock
The locking of the target is now taken care of when
the operation manager is initialized. This allows us
to keep the template flow the same and to ensure that
for vFW we will not lock the source if it is not intended
to be the target. NOTE: This will have to be revised in
the future if policy chaining will support having
different targets specified for each policy in the chain.
Additional work was done for hardening the APPC model code
to make sure exceptions are caught and we gracefully end
processing the event with memory clean up and a final failure
notification sent.
Issue-Id: POLICY-367
Change-Id: Ic796d95eb5400067744492f810dd8069ba6241b3
Signed-off-by: Daniel Cruz <dc443y@att.com>
Signed-off-by: daniel <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/archetype-cl-amsterdam/src/main')
-rw-r--r-- | controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl | 21 |
1 files changed, 15 insertions, 6 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 a29941607..2f8d86127 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 @@ -485,13 +485,23 @@ rule "${policyName}.EVENT.MANAGER" } } } catch (Exception e) { - logger.warn("{}: {}: unexpected", + logger.warn("{}: {}: unexpected", $params.getClosedLoopControlName(), drools.getRule().getName(), e); - // - // TODO should we abort if we get an exception? - // + VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event); + notification.notification = ControlLoopNotificationType.FINAL_FAILURE; + notification.message = e.getMessage(); + notification.from = "policy"; + notification.policyName = drools.getRule().getName(); + notification.policyScope = "${policyScope}"; + notification.policyVersion = "${policyVersion}"; + + PolicyEngine.manager.deliver("POLICY-CL-MGT", notification); + + retract($event); + retract($manager); + retract($clTimer); } end @@ -651,8 +661,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED" $event.closedLoopControlName, $operation.policy.getActor().toString(), $operation.policy.getRecipe(), - $manager.getTargetInstance($operation.policy), - //$event.target, + $operation.getTargetEntity(), $event.requestID.toString() )); t.start(); |