aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates/archetype-cl-amsterdam/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/archetype-cl-amsterdam/src/main/resources')
-rw-r--r--controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl31
1 files changed, 12 insertions, 19 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 d3c95a77b..88bf6141f 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
@@ -39,7 +39,6 @@ import org.onap.policy.controlloop.actor.so.SoActorServiceProvider;
import org.onap.policy.controlloop.actor.cds.CdsActorServiceProvider;
import org.onap.policy.controlloop.actor.cds.CdsActorServiceProvider.CdsActorServiceManager;
import org.onap.policy.controlloop.actor.cds.constants.CdsActorConstants;
-import org.onap.policy.aai.AaiNqResponseWrapper;
import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.appc.Request;
import org.onap.policy.appc.Response;
@@ -797,7 +796,6 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
// NOTE: The environment properties uses "guard.disabled" but the boolean is guardEnabled
boolean guardEnabled = "false".equalsIgnoreCase(PolicyEngineConstants.getManager().getEnvironmentProperty("guard.disabled"));
- boolean cqEnabled = "true".equalsIgnoreCase(PolicyEngineConstants.getManager().getEnvironmentProperty("aai.customQuery"));
if(guardEnabled){
@@ -809,25 +807,20 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
$operation.getTargetEntity(),
$event.getRequestId().toString(),
() -> {
- if (!cqEnabled) {
- AaiNqResponseWrapper resp = $manager.getNqVserverFromAai();
- return(resp == null ? null : resp.countVfModules());
- } else {
- try {
- AaiCqResponse resp_cq = $manager.getCqResponse($event);
- if (resp_cq == null){
- return null;
- } else {
- String custId = $operation.policy.getTarget().getModelCustomizationId();
- String invId = $operation.policy.getTarget().getModelInvariantId();
- String verId = $operation.policy.getTarget().getModelVersionId();
- return resp_cq.getVfModuleCount(custId, invId, verId);
- }
- } catch (Exception e){
- logger.warn("{}: {}", $params.getClosedLoopControlName(), drools.getRule().getName(), e);
+ try {
+ AaiCqResponse resp_cq = $manager.getCqResponse($event);
+ if (resp_cq == null){
+ return null;
+ } else {
+ String custId = $operation.policy.getTarget().getModelCustomizationId();
+ String invId = $operation.policy.getTarget().getModelInvariantId();
+ String verId = $operation.policy.getTarget().getModelVersionId();
+ return resp_cq.getVfModuleCount(custId, invId, verId);
}
- return null;
+ } catch (Exception e){
+ logger.warn("{}: {}", $params.getClosedLoopControlName(), drools.getRule().getName(), e);
}
+ return null;
}));
t.start();
}