diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-05-05 09:47:07 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2017-05-05 09:50:09 -0500 |
commit | b96b87daf71d368fe0d07b851564b53b0c7c71f9 (patch) | |
tree | fdc11f5e703dac1c3e63c9f9bf97ddbc3f701fd1 /archetype-closedloop-demo-rules | |
parent | dbac49e583b3a31291e806077d5c80c4b3cbe287 (diff) |
[POLICY-11] Archetype based testing updates
1. Support for basic queries.
2. Updates to 1.1.0-SNAPSHOT
Change-Id: If68709177ae020ae7aabb1a33eed8ef5bd00a4ab
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'archetype-closedloop-demo-rules')
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 |