From: Jorge Hernandez Date: Tue, 24 Oct 2017 22:16:31 +0000 (-0500) Subject: change drl line to avoid velocity bug X-Git-Tag: v1.1.0~17 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=7e3ace91847ec5aaccfeeff638a8d2d9b17e45fc;p=policy%2Fdrools-applications.git change drl line to avoid velocity bug generating a control loop project from archetype (but not from junits) runs into velocity parse failures as specified in ticket. The existing .drl code for the line that fails the parsing has been slightly modified to bypass this problem. In addition a logging statement has been added to the catch. Change-Id: I3eec82c9b710cc9d2a13dc68032a8a6074016b40 Issue-ID: POLICY-376 Signed-off-by: Jorge Hernandez --- 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 65a601188..a29941607 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 @@ -522,13 +522,17 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED" request = $operation.startOperation($event); } catch (AAIException e) { - //We got an exception, retract everything for this current operation - $operation.setOperationHasException(e.getMessage()); + String msg = e.getMessage(); + logger.warn("{}: {}: operation={}: AAI failure: {}", + $params.getClosedLoopControlName(), drools.getRule().getName(), + $operation, msg, e); + $operation.setOperationHasException(msg); retract($opTimer); retract($operation); caughtException = true; } - //Having the modify statement in the catch clause doesn't work for whatever reason + + // Having the modify statement in the catch clause doesn't work for whatever reason if (caughtException) { modify($manager) {finishOperation($operation)}; }