aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2017-11-10 17:01:00 -0500
committerJim Hahn <jrh3@att.com>2017-11-11 13:41:28 -0500
commit6fff64a3138d347b961e59c0996d85093c6fa930 (patch)
tree20fa865e6a04e0b01fc9eb9331171a1e9a632a21 /bpmn/MSOCommonBPMN/src
parent23bd47fc28519d8976d8ea95ccbdbb298c5902bb (diff)
Changed parsing code in DoDeleteVfModuleFromVnf
Modified code to use MsoUtils to parse the xml rather than walking the nodes generated by documentBuilder. Added check for missing vfModuleOutputs. Added MsoUtils.getMultNodeObjects() to return real Node objects instead of lazy nodes. Change-Id: I0266502f1e0353c778dce982fa55cf7ce944d91e Issue-Id: SO-333 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy15
1 files changed, 15 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy
index 94b423669d..06992455a2 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy
@@ -59,6 +59,21 @@ class MsoUtils {
}
return nodes
}
+ /**
+ * Note: this uses XmlParser instead of XmlSlurper, thus it is not as
+ * efficient because it instantiates the whole DOM tree.
+ * @param xmlInput
+ * @param element
+ * @return a list of Nodes, or {@code null} if <i>xmlInput</i> is {@code null}
+ */
+ def getMultNodeObjects(xmlInput, element){
+ def nodes=null
+ if(xmlInput!=null){
+ def xml= new XmlParser().parseText(xmlInput)
+ nodes = xml.'**'.findAll{ node-> node.name() == element }
+ }
+ return nodes
+ }
def getNodeText1(xmlInput,element){
def rtn=null
if(xmlInput!=null){