change drl line to avoid velocity bug 55/20455/1
authorJorge Hernandez <jh1730@att.com>
Tue, 24 Oct 2017 22:16:31 +0000 (17:16 -0500)
committerJorge Hernandez <jh1730@att.com>
Tue, 24 Oct 2017 22:16:31 +0000 (17:16 -0500)
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 <jh1730@att.com>
controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl

index 65a6011..a299416 100644 (file)
@@ -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)};
     }