diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/groovy')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy | 15 |
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){
|