X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fcontroller%2FCreatePolicyController.java;h=bca63eb0f379d88f74c954bc4daedf2756df2e75;hp=9a31d7f720149a793354892f0978a5a6cba58bb8;hb=7e547eaa55920dfbc9691eab33bb728395b50cf2;hpb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1 diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java index 9a31d7f72..bca63eb0f 100644 --- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreatePolicyController.java @@ -106,7 +106,7 @@ public class CreatePolicyController extends RestrictedBaseController{ while (iterMatch.hasNext()) { MatchType match = iterMatch.next(); // - // Under the match we have attributevalue and + // Under the match we have attribute value and // attributeDesignator. So,finally down to the actual attribute. // AttributeValueType attributeValue = match.getAttributeValue(); @@ -114,25 +114,23 @@ public class CreatePolicyController extends RestrictedBaseController{ AttributeDesignatorType designator = match.getAttributeDesignator(); String attributeId = designator.getAttributeId(); // First match in the target is EcompName, so set that value. - if (index == 1) { + if (attributeId.equals("ECOMPName")) { policyAdapter.setEcompName(value); } - if (index == 2){ + if (attributeId.equals("RiskType")){ policyAdapter.setRiskType(value); } - - if (index == 3){ + if (attributeId.equals("RiskLevel")){ policyAdapter.setRiskLevel(value); } - - if (index == 4){ + if (attributeId.equals("guard")){ policyAdapter.setGuard(value); } - if (index == 5 && !value.contains("NA")){ + if (attributeId.equals("TTLDate") && !value.contains("NA")){ String newDate = convertDate(value, true); policyAdapter.setTtlDate(newDate); } - if (index == 6){ + if (attributeId.equals("ConfigName")){ policyAdapter.setConfigName(value); } // After Ecomp and Config it is optional to have attributes, so