From 7e3ace91847ec5aaccfeeff638a8d2d9b17e45fc Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Tue, 24 Oct 2017 17:16:31 -0500 Subject: 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 --- .../src/main/resources/__closedLoopControlName__.drl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'controlloop/templates/archetype-cl-amsterdam') 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)}; } -- cgit 1.2.3-korg