Code snippet : Find a workflow by name
vCenter Orchestrator references workflows by ID and allows to have multiple workflows with the same name. If the workflows you are calling have a unique name you can write a vCO wrapper to find a workflow by name with the following code.
Input: wfName (string)
Output: wfByName (Workflow)
|
|
The interesting part is the second parameter of the findAllForType method : it is a query running on the server side, hence making the find a lot quicker than getting all the workflows and iterating through them to get the ones with the matching name.