VMware Cloud Community
Kagome
Enthusiast
Enthusiast

Presentation: "Select value as" for an own object?

Hello,

I'm looking for a way to get the "Select value as" for an own object. (or any other solution)

e.g.

If we deploy VM's we have to add in a database a "customer" who is using the VM.

To add the entry to a database and so on is no problem - but i want it "nice" to select the customer in the orchestrator client.

So i can query a database, get all Customers (Name, Street, City, State, whatever) and put it in an array of Customer-Object.

In the Presentation i would like to have it like if i use a Array of VC:VirtualMachine Object and define the input-paramater as "Select value as" - so i can sort the objects by Name, can search and so on ....

0 Kudos
3 Replies
iiliev
VMware Employee
VMware Employee

Hi,

It seems this can be achieved using dynamic types. So you need to define a dynamic namespace, then a dynamic type within this namespace (eg. dynamic type 'Customer' having Name, Street, City, etc. as dynamic properties), and then implement the logic for Customer's binding workflows (find all customers, find a customer by id, etc.).

Kagome
Enthusiast
Enthusiast

Hello,

thank you for the hint.

It seems to be right direction ... but maybe I'm to tired or stupid ...

how can i access / create this new dynamic typ in a scriptable element and fill the custom properties?

I used the workflow "Define Namespace" to create a namespace "de.mycompany"

After that i created a Type "Customer" with Custom Property "Name", "Street" using  the workflow "Define Type".

After that i tried to fill / use that new dynamic Type:

var myCustomer = new DynamicTypesDynamicObjectCustomer();

myCustomer.Name = "Testname";

didn't work ...

also

var myCustomer = DynamicTypesManager.getObject("de.mycompany", "Customer", null); //Parameters:  namespace, type, id

myCustomer.setProperty("Name", "Testname");

didn't work.

0 Kudos
iiliev
VMware Employee
VMware Employee

DynamicTypesManager.getObject() is the correct way to fetch an instance of some dynamic type. Note that the 3rd parameter (id) should not be null.

What do you mean by 'didn't work'? Did you get some specific error, or just an invalid/null object? Could you show the scripting code of your dynamic type's binding workflows, especially the code of 'find all' and 'find by id' workflows?

0 Kudos