VMware Cloud Community
FTVDaniel
Contributor
Contributor
Jump to solution

Orchestrator, use of XML object as attributes

Hello

I want to use xml objects as attribute on workflows to create actions for adding a node for example

for this I need to create  parameters of type void or xmlnode according to the documentation

http://www.vroapi.com/Class/XML/5.5.1/XMLDocument

vRO API Explorer by Dr Ruurd and Flores of ITQ

but in configuring attribute on workflow xmlnode and void types does not exist

I have tried any type

but when loading the xml to an attribute

XMLDocument = XMLManager.loadDocument(XMLin,false);

it gives me an error 

[2017-03-13 12:16:39.207] [I] Cannot create XMLDocument object : java.lang.NullPointerException

is the only solution  to pass string values ? and to have to reload all the objects in each modules of the workflow?

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

XML plug-in objects like XMLNode, etc. are scripting objects without finders, that's why you cannot create an attribute of this type.

XMLDocument is an scripting object name so it is better not to use it as a variable on the left side of XMLDocument = XMLManager.loadDocument(XMLin,false);

What's the value of XMLin? Does it point to a valid file name that you have enough permissions to read?

BTW, sometimes XML-related stuff can be handled more easily using E4X instead of XML plug-in (google for E4X to see how to process XML with it).

View solution in original post

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

XML plug-in objects like XMLNode, etc. are scripting objects without finders, that's why you cannot create an attribute of this type.

XMLDocument is an scripting object name so it is better not to use it as a variable on the left side of XMLDocument = XMLManager.loadDocument(XMLin,false);

What's the value of XMLin? Does it point to a valid file name that you have enough permissions to read?

BTW, sometimes XML-related stuff can be handled more easily using E4X instead of XML plug-in (google for E4X to see how to process XML with it).

0 Kudos
FTVDaniel
Contributor
Contributor
Jump to solution

thank Ilian

yes xmlin is a valid path and the command works in a fonction in  a script block

as you say it does not work if I replace the fonction by an other script block or an action transfering the object by attributes

so I andertood that if I want to create an action I have to transfer only the string values  to recreate the object in the action and return the string results

I have seen the E4X but the xml plugin is quite easy to use for appending nodes so it works find for me

0 Kudos