From 1bf858e215f8d0b8cf074bffc81d1c3d1a03fd52 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 20 Jun 2019 10:09:21 -0400 Subject: Set timeout to CL timeout if zero Modified the rules to set the operational timeout to the overall CL timeout if the operational timeout is zero. Added code to check for zero timeout for the overall CL, too. Change-Id: I28d41632f59e9bc2fce953267883d567abc92a49 Issue-ID: POLICY-1859 Signed-off-by: Jim Hahn --- .../src/main/resources/__closedLoopControlName__.drl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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 6a73f8e8f..f28ee173f 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 @@ -451,11 +451,12 @@ rule "${policyName}.EVENT.MANAGER" // // insert operation timeout object // - ControlLoopTimer opTimer = new ControlLoopTimer(); - opTimer.setTimerType("Operation"); - opTimer.setClosedLoopControlName($event.getClosedLoopControlName()); - opTimer.setRequestId($event.getRequestId().toString()); - opTimer.setDelay(operation.getOperationTimeout().toString() + "s"); + ControlLoopTimer opTimer = new ControlLoopTimer(); + opTimer.setTimerType("Operation"); + opTimer.setClosedLoopControlName($event.getClosedLoopControlName()); + opTimer.setRequestId($event.getRequestId().toString()); + Integer timeout = operation.getOperationTimeout(); + opTimer.setDelay(timeout > 0 ? timeout.toString() + "s" : $clTimer.getDelay()); insert(opTimer); // @@ -463,7 +464,7 @@ rule "${policyName}.EVENT.MANAGER" // insert(result.getB()); } else { - logger.debug("The target resource {} is already processing", + logger.debug("The target resource {} is already processing", $event.getAai().get($event.getTarget())); notification = new VirtualControlLoopNotification($event); notification.setNotification(ControlLoopNotificationType.REJECTED); -- cgit 1.2.3-korg