summaryrefslogtreecommitdiffstats
path: root/ONAP-PDP-REST
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-PDP-REST')
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java9
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/GetDictionaryService.java3
2 files changed, 9 insertions, 3 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java
index c283ff14c..915e3b30f 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java
@@ -80,6 +80,8 @@ public class DecisionPolicyService{
}
Map<String,String> matchingAttributes = null;
Map<String,String> settingsAttributes = null;
+
+ //Get the MATCHING and/or SETTINGS attributes
if (policyParameters.getAttributes()!=null && policyParameters.getAttributes().containsKey(AttributeType.MATCHING) && policyParameters.getAttributes().containsKey(AttributeType.SETTINGS)) {
matchingAttributes = policyParameters.getAttributes().get(AttributeType.MATCHING);
settingsAttributes = policyParameters.getAttributes().get(AttributeType.SETTINGS);
@@ -88,9 +90,10 @@ public class DecisionPolicyService{
}else if(policyParameters.getAttributes()!=null && policyParameters.getAttributes().containsKey(AttributeType.MATCHING) && !policyParameters.getAttributes().containsKey(AttributeType.SETTINGS)){
matchingAttributes = policyParameters.getAttributes().get(AttributeType.MATCHING);
}
- // Create Policy.
- StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyName, policyParameters.getPolicyDescription(), onapName, ruleProvider.toString(), matchingAttributes, settingsAttributes, policyParameters.getDynamicRuleAlgorithmLabels(),
- policyParameters.getDynamicRuleAlgorithmFunctions(), policyParameters.getDynamicRuleAlgorithmField1(), policyParameters.getDynamicRuleAlgorithmField2(), null, null, null, updateFlag, policyScope, 0);
+ // Create StdPAPPolicy object used to send policy data to PAP-REST.
+ StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyName, policyParameters.getPolicyDescription(), onapName, ruleProvider.toString(), matchingAttributes, settingsAttributes,
+ policyParameters.getTreatments(), policyParameters.getDynamicRuleAlgorithmLabels(), policyParameters.getDynamicRuleAlgorithmFunctions(),
+ policyParameters.getDynamicRuleAlgorithmField1(), policyParameters.getDynamicRuleAlgorithmField2(), null, null, null, updateFlag, policyScope, 0);
// Send JSON to PAP.
response = (String) papServices.callPAP(newPAPPolicy, new String[] {"operation="+operation, "apiflag=api", "policyType=Decision"}, policyParameters.getRequestID(), "Decision");
LOGGER.info(message);
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/GetDictionaryService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/GetDictionaryService.java
index 8f88ef7c7..d3628f3c1 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/GetDictionaryService.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/GetDictionaryService.java
@@ -171,6 +171,9 @@ public class GetDictionaryService {
case "Settings":
jsonString = jsonString.replace("settingsDictionaryDatas", "DictionaryDatas");
break;
+ case "RainyDayTreatments":
+ jsonString = jsonString.replace("rainyDayDictionaryDatas", "DictionaryDatas");
+ break;
case "DescriptiveScope":
jsonString = jsonString.replace("descriptiveScopeDictionaryDatas", "DictionaryDatas");
break;