summaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
diff options
context:
space:
mode:
Diffstat (limited to 'ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java')
-rw-r--r--ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
index a987e9abf..b9d6def5a 100644
--- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
+++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/policycontroller/PolicyCreation.java
@@ -349,7 +349,7 @@ public class PolicyCreation extends AbstractPolicyCreation{
}
}
}
- if(policyData.getRuleAlgorithmschoices().size() > 0){
+ if(policyData.getRuleAlgorithmschoices()!=null && policyData.getRuleAlgorithmschoices().size() > 0){
for(Object attribute : policyData.getRuleAlgorithmschoices()){
if(attribute instanceof LinkedHashMap<?, ?>){
String label = ((LinkedHashMap<?, ?>) attribute).get("id").toString();
@@ -363,7 +363,14 @@ public class PolicyCreation extends AbstractPolicyCreation{
}
}
}
-
+ if(policyData.getRuleProvider()!=null && policyData.getRuleProvider().equals(DecisionPolicy.GUARD_YAML) && policyData.getYamlparams()!=null){
+ attributeMap.put("actor", policyData.getYamlparams().getActor());
+ attributeMap.put("recipe", policyData.getYamlparams().getRecipe());
+ attributeMap.put("limit", policyData.getYamlparams().getLimit());
+ attributeMap.put("timeWindow", policyData.getYamlparams().getTimeWindow());
+ attributeMap.put("guardActiveStart", policyData.getYamlparams().getGuardActiveStart());
+ attributeMap.put("guardActiveEnd", policyData.getYamlparams().getGuardActiveEnd());
+ }
policyData.setDynamicRuleAlgorithmLabels(dynamicRuleAlgorithmLabels);
policyData.setDynamicRuleAlgorithmCombo(dynamicRuleAlgorithmCombo);
policyData.setDynamicRuleAlgorithmField1(dynamicRuleAlgorithmField1);