diff options
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 | 15 |
1 files changed, 5 insertions, 10 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 3dc984dd2..c3bd446c7 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 @@ -515,7 +515,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED" $params.getClosedLoopControlName(), drools.getRule().getName(), $event, $manager, $operation, $lock); - Object request = $operation.getOperationRequest(); + Object request = $operation.startOperation($event); if (request != null) { logger.debug("{}: {}: starting operation ..", @@ -592,18 +592,13 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED" logger.info("{}: {}: event={} manager={} operation={} lock={}", $params.getClosedLoopControlName(), drools.getRule().getName(), $event, $manager, $operation, $lock); - - // - // We are starting the operation but the actor won't be contacted until Guard is queried and permitted. - // - $operation.startOperation($event); // // Sending notification that we are about to query Guard ("DB write - start operation") // VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event); notification.notification = ControlLoopNotificationType.OPERATION; - notification.message = $operation.getOperationMessage(); + notification.message = "Sending guard query for " + $operation.policy.getActor() + " " + $operation.policy.getRecipe(); notification.history = $operation.getHistory(); notification.from = "policy"; notification.policyName = drools.getRule().getName(); @@ -663,7 +658,7 @@ rule "${policyName}.GUARD.RESPONSE" //we will permit the operation if there was no Guard for it - if("Indeterminate".equals($guardResponse.result)){ + if("Indeterminate".equalsIgnoreCase($guardResponse.result)){ $guardResponse.result = "Permit"; } @@ -672,7 +667,7 @@ rule "${policyName}.GUARD.RESPONSE" // VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event); notification.notification = ControlLoopNotificationType.OPERATION; - notification.message = $operation.getOperationMessage($guardResponse.result); + notification.message = "Guard result for " + $operation.policy.getActor() + " " + $operation.policy.getRecipe() + " is " + $guardResponse.result; notification.history = $operation.getHistory(); notification.from = "policy"; notification.policyName = drools.getRule().getName(); @@ -935,7 +930,7 @@ rule "${policyName}.SO.RESPONSE" $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.closedLoopControlName, onset.requestID == $event.requestID ) $opTimer : OperationTimer( closedLoopControlName == $event.closedLoopControlName, requestID == $event.requestID.toString() ) $lock : TargetLock (requestID == $event.requestID) - $response : SOResponse( request.requestId == $event.requestID.toString() ) + $response : SOResponse( requestReferences.requestId.toString() == $event.requestID.toString() ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); |