Hello,
I am a newbie here working with vCO. I am working on VM deployment workflow that starts with gathering some General information (server contact, email, etc) followed by specific VM Information (i.e. web/application/db as well as environment). The latter (VM information) is input by prompting the user for the type of system they wish to deploy iterating each time based on the number of VMs requested (with a counter - counter = numVMs). I am attempting to pass these information to an attribute of type "array/string" (the input of the type of server is "string") so i can later call the "Clone VM" for each VM input in the array. The rest of the information is passed in the same manner to the array attributes (environment, operating system, etc).
So far i have tried many variations to populate the array but it doesnt work. What this means is that every time i try to update the attribute that holds the VM type array with an array member (array[i] = whateverstring;) I get a "object error". For what i understand it has to do with the string to object type but i'm not 100%. I also tried using the "VcArrayUpdateOperation" object but i'm not sure how it works (i guess there is a specific way of doing this but no concrete examples). Can someone please shed some light on this?
Thanks in advance!
You need to:
Hi,
cam you give us your code examples, that makes it easier to troubleshoot...
In general:
Try to initialize the array with
var myarray = new Array();
Then you can add element to the array with
myarray.push("some string");
Check www.eloquentjavascript.net<http://www.eloquentjavascript.net>; for a good intruduction to JavaScript.
Also check www.vmwarelearning.com/orchestrator<http://www.vmwarelearning.com/orchestrator>; ,I think there is a demo video how to work with arrays in vco available on there.
Cheers
Joerg
Gesendet von meinem LG Mobile
Hello,
Thanks for your reply. This is what I have tried so far (after input from the user interaction object):
Global attributes:
a_vmType - array/string (defines whether it is a Web/Application/Database to set appropriate resources)
a_tempVMType - string //used to bind the input from user interaction
Code1:
var i = counter; //where counter = numVMs requested
var i = counter;
i = i--; //to populate the members of the array starting with "0"
a_vmType[i] = a_tempVMType; //populate the array members
Code1 error: TypeError: Cannot set property "0.0" of null to "Web" (Workflow:TEST_NewVMs / Scriptable task (item2)#4)
--------------------------------------------------------------
Code2:
a_vmType.push(a_tempVMType);
Code2 error: TypeError: Cannot call method "push" of null (Workflow:TEST_NewVMs / Scriptable task (item2)#7)
You need to:
Thanks cdecanini, that did it! Once I initialized the array....booom, started flowing. That's awesome...