VMware Cloud Community
chrisxhartmann
Contributor
Contributor

Limit selections in presentation layer based on other presentation layer selections

Hi,

I am creating a workflow for use in a public cloud environment. On the presentation layer of the workflow I have a drop down where the customer the VM is being provisioned for can be selected. On another screen of the presentation layer there is the ability to select the portgroup for NICs being added to the VM. However, I want to be able to limit this selection based on the customer selected, but I don't know how I can achieve this?

As a little background, the customer selection is tied to an action that performs a lookup of a table in a SQL database. As well as the customer name, there is also a prefix that is tied to the portgroup names so it is this I would need to be able to reference against port groups. Is this actually possible from the presentation layer?

Thanks,

Chris.

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi Chris,

Yes, it is possible. You need to implement a scripting action taking an input of type string and returning an Array/VC:DistributedVirtualPortgroup (assuming that is the type of portgroups you want to select in the presentation). Then you need to implement the action code that will compute the list of valid portgroups for the customer name the action gets as an input.

Then, in the second input field presentation you need to add a property "Predefined list of elements" and bind it to a call to your scripting action. Property's value should look something like:

GetAction("com.my.actions","getPortgroupsPerCustomer").call( #customer )

where:

  #customer - references the first presentation field where you select the customer

  getPortgroupsPerCustomer - the name of your scripting action

com.my.actions - the sample category name of your scripting action

0 Kudos