From 50be587b3604c958faa438cd587364da8f49d9a7 Mon Sep 17 00:00:00 2001 From: jhh Date: Sun, 14 Apr 2019 21:41:14 -0500 Subject: Modify dependencies to avoid enabled features fail The drl change is only partial just to recognize Tosca policies. Change-Id: I5d3b8071394a9ea14638170e04d74e4c6b4ad028 Issue-ID: POLICY-1642 Signed-off-by: jhh --- .../common/feature-controlloop-management/pom.xml | 16 ++++++++++++++++ controlloop/common/feature-controlloop-trans/pom.xml | 2 +- .../src/main/resources/__closedLoopControlName__.drl | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/controlloop/common/feature-controlloop-management/pom.xml b/controlloop/common/feature-controlloop-management/pom.xml index 40e37beff..84fbe485e 100644 --- a/controlloop/common/feature-controlloop-management/pom.xml +++ b/controlloop/common/feature-controlloop-management/pom.xml @@ -87,7 +87,9 @@ false false runtime + provided false + org.glassfish.hk2.external,org.glassfish.hk2 @@ -135,6 +137,16 @@ org.onap.policy.models.policy-models-interactions.model-impl aai ${policy.models.version} + + + commons-lang3 + org.apache.commons + + + jcl-over-slf4j + org.slf4j + + org.onap.policy.models.policy-models-interactions.model-impl @@ -187,6 +199,10 @@ guava com.google.guava + + commons-lang3 + org.apache.commons + diff --git a/controlloop/common/feature-controlloop-trans/pom.xml b/controlloop/common/feature-controlloop-trans/pom.xml index 4d9080616..915636e6b 100644 --- a/controlloop/common/feature-controlloop-trans/pom.xml +++ b/controlloop/common/feature-controlloop-trans/pom.xml @@ -106,7 +106,6 @@ true - true warning @@ -128,6 +127,7 @@ org.onap.policy.models.policy-models-interactions.model-impl events ${policy.models.version} + provided org.onap.policy.common diff --git a/controlloop/templates/archetype-cl-usecases/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-usecases/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index 77edee1e7..8dcc79866 100644 --- a/controlloop/templates/archetype-cl-usecases/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-usecases/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -64,6 +64,7 @@ import org.onap.policy.guard.PolicyGuardRequest; import org.onap.policy.guard.PolicyGuardResponse; import org.onap.policy.guard.PolicyGuardXacmlRequestAttributes; import org.onap.policy.guard.PolicyGuardXacmlHelper; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; @@ -108,6 +109,22 @@ rule "INSERT.PARAMS" + drools.getRule().getName(), $params.getControlLoopYaml()); end +/* +* +* Called when a Tosca Policy fact is present. +* +*/ +rule "NEW TOSCA POLICY" + when + $policy : ToscaPolicy() + then + + Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); + logger.info("{}:{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(), + $policy.getType(), $policy.getTypeVersion(), $policy.getName(), $policy.getVersion(), + $policy); +end + /* * * This rule responds to DCAE Events where there is no manager yet. Either it is -- cgit 1.2.3-korg