Have you tried populating the Presentation field Predefined List of Values? I don't know if that works for traditional tree-pick types.
What I would actually suggest is having the XaaS blueprint be a wrapper for your standard workflows. It's presentation should present the user a dropdown (or multi-picker if array) of machine names as strings. The user selects that and submits the request, where the wrapper workflow logic looks up the VC:VirtualMachine and passes it to your business logic workflow.
You will use the presentation fields to present the user a list of machine names from within their business group or any other criteria you want. Additionally since you are not using objects your presentation will be exponentially faster and you can even add filter boxes.
Thanks Steve, that's kind of what I had in mind, I think the main things I am struggling with are:
- The proper way to detect the tenant/business group of the user that's creating the request.
- Building a list of machines that are either owned by the user OR sit within the users tenant/business group
I quickly put together a workflow/xaas blueprint that should help you get started.
Unpack the attached ZIP and go into vRO and Import Package from Folder, selecting the folder vmtn.ownerOrBusGroupVMs and clicking Import.
You will then want to import the XaaS Blueprint xaas_blueprint.json using the vRA API. Alternatively you can make the XaaS blueprint yourself from the workflow, however you will need to make two adjustments (also true if you refresh the form or borrow the logic):
- The field businessGroupName must be bound to the field value Request Info -> Business Group -> Name
- The field Machines must be a dual list to properly support the filter and remembering existing selections
Once in the workflow you will obviously need to match up the selected machine names with their VC:VirtualMachine objects to call your existing workflow.
You can alter the PAGE_SIZE variable in the getVirtualMachineNames action as you see fit for performance. I just remembered you may also want to sort the results by whatever criteria you desire.
Hope this helps.
ownerOrBusGroupVMs.zip 15.4 K
Thanks so much Steve, I'll give it a whirl and let you know how it goes!