aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.properties2
-rw-r--r--archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.rest.json4
-rw-r--r--archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/resources/ControlLoopDemo__closedLoopControlName__.drl111
-rw-r--r--packages/basex/src/files/bin/create-closed-loop-demo.sh8
4 files changed, 91 insertions, 34 deletions
diff --git a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.properties b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.properties
index 4bbcca8ae..5cbe5f682 100644
--- a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.properties
+++ b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.properties
@@ -44,6 +44,6 @@ ueb.sink.topics.${appcTopic}.apiSecret=${appcApiSecret}
ueb.sink.topics.${appcTopic}.events=org.openecomp.policy.appc.Response
ueb.sink.topics.${appcTopic}.events.custom.gson=org.openecomp.policy.appc.util.Serialization,gsonPretty
-rules.groupId=org.openecomp.policy.apps
+rules.groupId=org.openecomp.policy.drools-applications
rules.artifactId=vfwsim
rules.version=${dependenciesVersion}
diff --git a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.rest.json b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.rest.json
index 3a475dab2..23840c48b 100644
--- a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.rest.json
+++ b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/config/vFWsim-controller.rest.json
@@ -25,7 +25,7 @@
"ueb.sink.topics.${appcTopic}.events": "org.openecomp.policy.appc.Response",
"ueb.sink.topics.${appcTopic}.events.custom.gson": "org.openecomp.policy.appc.util.Serialization,gsonPretty",
- "rules.groupId": "org.openecomp.policy.apps",
+ "rules.groupId": "org.openecomp.policy.drools-applications",
"rules.artifactId": "vfwsim",
"rules.version": "${dependenciesVersion}"
-}
+} \ No newline at end of file
diff --git a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/resources/ControlLoopDemo__closedLoopControlName__.drl b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/resources/ControlLoopDemo__closedLoopControlName__.drl
index 5008df7f1..90a4f4b89 100644
--- a/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/resources/ControlLoopDemo__closedLoopControlName__.drl
+++ b/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/src/main/resources/ControlLoopDemo__closedLoopControlName__.drl
@@ -101,32 +101,34 @@ end
/*
*
* Called once and only once to insert the parameters into working memory for this Closed Loop policy.
-* (Comment SETUP rule out for the first ECOMP opensource release since policy BRMS_GW already puts a Params fact in there)
+* NOTE: If this file is to be used as a template to be used with the policy BRMS GW, please comment out this line
+* as the BRMS_GW already generates a SETUP rule
*
-*
-*rule "${policyName}.SETUP"
-* when
-* then
-* System.out.println("rule SETUP is triggered.");
-* Params params = new Params();
-* params.setClosedLoopControlName("${closedLoopControlName}");
-* params.setActor("${actor}");
-* params.setAaiURL("${aaiURL}");
-* params.setAaiUsername("${aaiUsername}");
-* params.setAaiPassword("${aaiPassword}");
-* params.setMsoURL("${msoURL}");
-* params.setMsoUsername("${msoUsername}");
-* params.setMsoPassword("${msoPassword}");
-* params.setAaiNamedQueryUUID("${aaiNamedQueryUUID}");
-* params.setAaiPatternMatch(${aaiPatternMatch});
-* params.setNotificationTopic("${notificationTopic}");
-* params.setAppcTopic("${appcTopic}");
-* //
-* // This stays in memory as long as the rule is alive and running
-* //
-* insert(params);
-*end
*/
+rule "${policyName}.SETUP"
+ when
+ then
+ System.out.println("rule SETUP is triggered.");
+ Params params = new Params();
+ params.setClosedLoopControlName("${closedLoopControlName}");
+ params.setActor("${actor}");
+ params.setAaiURL("${aaiURL}");
+ params.setAaiUsername("${aaiUsername}");
+ params.setAaiPassword("${aaiPassword}");
+ params.setMsoURL("${msoURL}");
+ params.setMsoUsername("${msoUsername}");
+ params.setMsoPassword("${msoPassword}");
+ params.setAaiNamedQueryUUID("${aaiNamedQueryUUID}");
+ params.setAaiPatternMatch(${aaiPatternMatch});
+ params.setNotificationTopic("${notificationTopic}");
+ params.setAppcTopic("${appcTopic}");
+ //
+ // This stays in memory as long as the rule is alive and running
+ //
+ insert(params);
+end
+
+
/*
*
* This rule responds to DCAE Events
@@ -1116,6 +1118,61 @@ rule "${policyName}.MSO.RESPONSE"
retract($response);
retract($event);
retract($manager);
- }
-
-end
+ }
+end
+
+
+query "eventsQuery"
+ events : VirtualControlLoopEvent()
+end
+
+query "paramsQuery"
+ param : Params()
+end
+
+query "onsetsQuery"
+ onsets : VirtualControlLoopEvent(closedLoopEventStatus == ControlLoopEventStatus.ONSET)
+end
+
+/*
+*
+* Queries
+*
+*/
+
+/*
+*
+* Queries
+*
+*/
+query "${policyName}.QUERY.PARAMS"
+ param : Params()
+end
+
+query "${policyName}.QUERY.EVENTS"
+ event : VirtualControlLoopEvent()
+end
+
+query "${policyName}.QUERY.MANAGERS"
+ manager : EventManager()
+end
+
+query "${policyName}.QUERY.OPERATIONS"
+ manager : ControlLoopOperationWrapper()
+end
+
+query "${policyName}.QUERY.APPC.REQUEST"
+ appcRequest : Request()
+end
+
+query "${policyName}.QUERY.APPC.RESPONSE"
+ appcResponse : Response()
+end
+
+query "${policyName}.QUERY.MSO.REQUEST"
+ msoRequest : MSORequest()
+end
+
+query "${policyName}.QUERY.MSO.RESPONSE"
+ msoResponse : MSOResponse()
+end \ No newline at end of file
diff --git a/packages/basex/src/files/bin/create-closed-loop-demo.sh b/packages/basex/src/files/bin/create-closed-loop-demo.sh
index bb6c92e34..3cd191f03 100644
--- a/packages/basex/src/files/bin/create-closed-loop-demo.sh
+++ b/packages/basex/src/files/bin/create-closed-loop-demo.sh
@@ -29,7 +29,7 @@ echo
GROUPID="org.openecomp.policy.demo.rules"
ARTIFACTID="closed-loop-demo-rules"
-VERSION="1.0.0-SNAPSHOT"
+VERSION="1.1.0-SNAPSHOT"
PACKAGE="org.openecomp.policy.demo.rules"
CLOSEDLOOPCONTROLNAME="CL-FRWL-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8"
POLICYSCOPE="service=test;resource=FRWL;type=configuration"
@@ -52,7 +52,7 @@ AAIURL="http://localhost:7676/aai/test"
AAIUSERNAME="policy"
AAIPASSWORD="policy"
AAINAMEDQUERYUUID=d925ed73-8231-4d02-9545-db4e101fffff
-AAIPATTERNMATCH=true
+AAIPATTERNMATCH=1
MSOURL="http://localhost:7677/mso/test"
MSOUSERNAME="policy"
MSOPASSWORD="policy"
@@ -82,7 +82,7 @@ read -e -i "${AAIURL}" -p "Closed Loop AAI URL> " AAIURL
read -e -i "${AAIUSERNAME}" -p "Closed Loop AAI Username> " AAIUSERNAME
read -e -i "${AAIPASSWORD}" -p "Closed Loop AAI Password> " AAIPASSWORD
read -e -i "${AAINAMEDQUERYUUID}" -p "Closed Loop AAI Named Query UUID> " AAINAMEDQUERYUUID
-read -e -i "${AAIPATTERNMATCH}" -p "Closed Loop AAI Pattern Match ('true' or 'false')> " AAINAMEDQUERYUUID
+read -e -i "${AAIPATTERNMATCH}" -p "Closed Loop AAI Pattern Match (1 for vFW, otherwise vDNS)> " AAIPATTERNMATCH
read -e -i "${MSOURL}" -p "Closed Loop MSO URL> " MSOURL
read -e -i "${MSOUSERNAME}" -p "Closed Loop MSO Username> " MSOUSERNAME
read -e -i "${MSOPASSWORD}" -p "Closed Loop MSO Password> " MSOPASSWORD
@@ -122,7 +122,7 @@ if [ -z "${NOTIFICATIONAPIKEY}" ]; then NOTIFICATIONAPIKEY="NULL"; fi
if [ -z "${NOTIFICATIONAPISECRET}" ]; then NOTIFICATIONAPISECRET="NULL"; fi
if [[ "$VERSION" == *-SNAPSHOT ]]; then
- DEPENDENCIES_VERSION="1.0.0-SNAPSHOT"
+ DEPENDENCIES_VERSION="1.1.0-SNAPSHOT"
else
DEPENDENCIES_VERSION="${VERSION}"
fi