summaryrefslogtreecommitdiffstats
path: root/archetype-closedloop-demo-rules
diff options
context:
space:
mode:
Diffstat (limited to 'archetype-closedloop-demo-rules')
-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
3 files changed, 87 insertions, 30 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