diff options
author | 2019-06-20 10:09:21 -0400 | |
---|---|---|
committer | 2019-06-20 11:00:24 -0400 | |
commit | 1bf858e215f8d0b8cf074bffc81d1c3d1a03fd52 (patch) | |
tree | d43a6f8c5587d17148d82fc35b2e6e2d34134bd2 /controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources | |
parent | d4704a70405cae2f6d9cb32ca30828db14be01b7 (diff) |
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 <jrh3@att.com>
Diffstat (limited to 'controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources')
-rw-r--r-- | controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl | 13 |
1 files changed, 7 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 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); |