- public String expandConfigBody(String ruleContents, Map<String, String> brmsParamBody) {
-
- Set<String> keySet= new HashSet<>();
-
- Map<String,String> copyMap=new HashMap<>();
- copyMap.putAll(brmsParamBody);
- copyMap.put("policyName", policyName.substring(0, policyName.replace(".xml", "").lastIndexOf(".")));
- copyMap.put("policyScope", policyAdapter.getDomainDir());
- copyMap.put("policyVersion",policyAdapter.getHighestVersion().toString());
- copyMap.put("unique", ("p"+policyName+UUID.randomUUID().toString()).replaceAll("[^A-Za-z0-9]", ""));
-
- //Finding all the keys in the Map data-structure.
- keySet= copyMap.keySet();
- Iterator<String> iterator = keySet.iterator();
- Pattern p;
- Matcher m;
- while(iterator.hasNext()) {
- //Converting the first character of the key into a lower case.
- String input= iterator.next();
- String output = Character.toLowerCase(input.charAt(0)) +
- (input.length() > 1 ? input.substring(1) : "");
- //Searching for a pattern in the String using the key.
- p=Pattern.compile("\\$\\{"+output+"\\}");
- m=p.matcher(ruleContents);
- //Replacing the value with the inputs provided by the user in the editor.
- String finalInput = copyMap.get(input);
- if(finalInput.contains("$")){
- finalInput = finalInput.replace("$", "\\$");
- }
- ruleContents=m.replaceAll(finalInput);
+ public String expandConfigBody(String ruleContents, Map<String, String> brmsParamBody) {
+
+ Map<String,String> copyMap=new HashMap<>();
+ copyMap.putAll(brmsParamBody);
+ copyMap.put("policyName", policyName.substring(0, policyName.replace(".xml", "").lastIndexOf(".")));
+ copyMap.put("policyScope", policyAdapter.getDomainDir());
+ copyMap.put("policyVersion",policyAdapter.getHighestVersion().toString());
+ copyMap.put("unique", ("p"+policyName+UUID.randomUUID().toString()).replaceAll("[^A-Za-z0-9]", ""));
+
+ //Finding all the keys in the Map data-structure.
+ Iterator<String> iterator = copyMap.keySet().iterator();
+ Pattern p;
+ Matcher m;
+ while(iterator.hasNext()) {
+ //Converting the first character of the key into a lower case.
+ String input= iterator.next();
+ String output = Character.toLowerCase(input.charAt(0)) +
+ (input.length() > 1 ? input.substring(1) : "");
+ //Searching for a pattern in the String using the key.
+ p=Pattern.compile("\\$\\{"+output+"\\}");
+ m=p.matcher(ruleContents);
+ //Replacing the value with the inputs provided by the user in the editor.
+ String finalInput = copyMap.get(input);
+ if(finalInput.contains("$")){
+ finalInput = finalInput.replace("$", "\\$");