aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/rules-test
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-08-01 14:12:40 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-08-01 14:14:14 +0100
commit2e39e09b57e1d9484a5e0475653a1b4e7a1ec5b1 (patch)
tree1c350f0dffc7c7ce65fd42d3df16c346d64f781b /controlloop/common/rules-test
parent24a68dcd259ab23b102fa99b44edfc3a5994446c (diff)
Fix Drools-Apps executing policies
- hibernate dependencies were causing conflicts; updated to latest hibernate-core with all the required deps. - adjusted some variables to be correctly read by properties parser. - added STDOUT option to logback.xml to be able to get logs from controllers/features when using docker logs command. Issue-ID: POLICY-4955 Change-Id: I254502e75332070c7d32f555927dc30c4bbb49a5 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'controlloop/common/rules-test')
-rw-r--r--controlloop/common/rules-test/src/test/resources/rulesTest.drl35
1 files changed, 16 insertions, 19 deletions
diff --git a/controlloop/common/rules-test/src/test/resources/rulesTest.drl b/controlloop/common/rules-test/src/test/resources/rulesTest.drl
index a1a89714a..31c4f66e7 100644
--- a/controlloop/common/rules-test/src/test/resources/rulesTest.drl
+++ b/controlloop/common/rules-test/src/test/resources/rulesTest.drl
@@ -40,7 +40,7 @@ import org.onap.policy.drools.system.PolicyEngineConstants;
rule "STARTED"
when
then
- System.out.println(drools.getRule().getName());
+ System.out.println(drools.getRule().getName());
end
/*
@@ -52,10 +52,9 @@ rule "INSERT.PARAMS"
when
$params : ControlLoopParams()
then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: {} : TOSCA-POLICY=[{}]", $params.getClosedLoopControlName(), $params.getPolicyName() + "."
- + drools.getRule().getName(), $params.getToscaPolicy());
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: {} : TOSCA-POLICY=[{}]", $params.getClosedLoopControlName(), $params.getPolicyName() + "."
+ + drools.getRule().getName(), $params.getToscaPolicy());
end
/*
@@ -67,16 +66,15 @@ rule "NEW.TOSCA.POLICY"
when
$policy : ToscaPolicy()
then
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(),
+ $policy.getType(), $policy.getTypeVersion(), $policy.getName(),
+ $policy.getVersion(), $policy);
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(),
- $policy.getType(), $policy.getTypeVersion(), $policy.getName(),
- $policy.getVersion(), $policy);
-
- ControlLoopParams params = ControlLoopUtils.toControlLoopParams($policy);
- if (params != null) {
- insert(params);
- }
+ ControlLoopParams params = ControlLoopUtils.toControlLoopParams($policy);
+ if (params != null) {
+ insert(params);
+ }
end
/*
@@ -87,10 +85,9 @@ rule "REMOVE.PARAMS"
$params : ControlLoopParams( $policyName : getPolicyName(), $policyVersion : getPolicyVersion() )
not ( ToscaPolicy( getName() == $policyName, getVersion() == $policyVersion ) )
then
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: [{}|{}|{}]", drools.getRule().getName(),
+ $params.getPolicyScope(), $params.getPolicyName(), $params.getPolicyVersion());
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: [{}|{}|{}]", drools.getRule().getName(),
- $params.getPolicyScope(), $params.getPolicyName(), $params.getPolicyVersion());
-
- retract($params);
+ retract($params);
end