VMware Cloud Community
Deva77340
Contributor
Contributor
Jump to solution

How use resource element as file xml in workflow ?

Good afternoon,

In my workflow, I set an attribute parameter with type Resource Element and the value of attribute is a file xml.

And i got a problem to use file xml in my workflow, i would like to use theses informations from file xml to store in variable..

Example : in file xml, i put some information about number VLAN ID, and in my script task, i would like know how is use with myvariable.portgroup[0].spec.vlanId ?

Best Regards.

0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Like this:

var myXml = new XML(resource.getContentAsMimeAttachment().content);

Then you can access to your nodes like this:

myXml.node.subnode

Google for e4X to get the full syntax.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

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

Like this:

var myXml = new XML(resource.getContentAsMimeAttachment().content);

Then you can access to your nodes like this:

myXml.node.subnode

Google for e4X to get the full syntax.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
Deva77340
Contributor
Contributor
Jump to solution

Thank you very much. Finally I understand what do you mean,but  i misunderstood with resource in var myXml = new XML(resource.getContentAsMimeAttachment().content); 

Because i used an another input for ResourceElement., After changing, it's works well !!

0 Kudos