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

Listing properties of any object/scriptable class?

$
0
0

This feels like a dumb question and I am certain I am missing something obvious.

I want to be able enumerate properties for any object I pass through.  Sometimes it's quick and easy to do this within a scriptable task.

The problem is, the way I would do this in JS simply doesn't work in vCO.

 

Say I have an input parameter of type VirtualMachine assigned as 'inputVM'.

 

I'd do something like this in standard JS:

for(var x in inputVM) {
 if(inputVM.hasOwnProperty(x)) {   System.log("The property name is: " + x + ", and the value is: " + inputVM[x] )
 }
}

 

But, running that exact bit of code in my task just returns this as an error:

TypeError: Invalid iterator value (Workflow:List Properties / Scriptable task (item1)#10208)

 

If I run a typeof on the inputVM, it says its a function, which is a type of Object anyway.

 

Can someone help with a quick and simple solution?  Is it because the inputVM is a scriptable class in vCO that the normal way doesn't work?


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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