Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

XML Node output from action

$
0
0

I'm building a lot of workflows invoking REST operations against NSX and other API's that uses XML for the request body, and I wanted to programmatically build the XML from an XMLManager document then convert to string to invoke against the API. The problem I'm running into is that if I run the code to build the object via a function in a scriptable task, it works fine... but if I take the same code and turn it into an action (with a return type set to ANY), the resulting variable in my scripting task is always set to null.. which is frustrating. What am I doing wrong?!

 

Inputs would be document (the XML document, type is set to ANY), parent (the root node for the new XML node, also set to type of ANY)... nodeName is a string input, as is nodeText.

 

Code looks like this:

var newNode = document.createElement(nodeName);
parent.appendChild(newNode);
if (nodeText!= null){
var newTxt = doc.createTextNode(nodeText);
newNode.appendChild(newTxt);
}
return newNode;

 

Any help would be greatly appreciated!!!


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>