VMware Cloud Community
mcssschaefer
Enthusiast
Enthusiast

WebService / Workflow ID / find

Hi guys,

First question: Is it possible to see the" workflow id " in the orchestrator gui? I don't want to call "getWorkflowWithName" every time I search a specific workflow. At the moment I have a little app to do this, but that's annoying.

Second question: The "find" function (WebService) has a parameter "query" but Iam not sure in which format i must pass the string (nothing seems to work), so I have to crawl the whole response (array) for a specific machine name.

i.e.

my $myElementsfindResponse = $interface->find({
        type =>  "VC:VirtualMachine", # string
        query =>  "", # string
        username =>  $username, # string
        password =>  $password, # string
      },,
);
die $myElementsfindResponse if not $myElementsfindResponse;

[... Crawl Array...]

Thanks in advance,

Stephan

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
9 Replies
robrtb12
Enthusiast
Enthusiast

Hello,

I can help with the first question...

I too wrote a little console app that listed all the workflow names & IDs. I used this until I found something quicker inside the Client.

  • Open a blank workflow in edit mode
  • On the left select "Action & Workflow"
  • Drag "Schedule workflow" to the grid
  • A "Choose workflow" dialog box will open
  • Search for and Select your workflow you wish to get its ID
  • Click the "Scripting" tab
  • You ID will be listed:
    • var workflowToLaunch = Server.getWorkflowWithId("80808080808080808080808080808080AA838080035010826414364b80d250da8");

Hope this helps

igorstoyanov
VMware Employee
VMware Employee

Actually, it turned out that there is an easier workaround to get the workflow id:

1) Select the workflow for which you want to see the ID
2) Press Ctrl + C (Cmd + C on Mac)
3) Paste the result somewhere (notepad) and you can see that the result will contain the name and the id of the workflow

Regards,

Igor.

P.S. Thanks to Danail for discovering this.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
Reply
0 Kudos
tschoergez
Leadership
Leadership

Hi Igor!

Great! That's a very useful and time-saving hint! Thanks for posting it, and it should be noted in the next version of the development guide...

Regards,

Joerg

Reply
0 Kudos
dvatov
VMware Employee
VMware Employee

Regarding the query format it should start with 'xpath:' and followed by a valid xpath expression over the returned set of objects. As a limitation tree search is not allowed. For example to search for a virtual machine with specific name use this expression 'xpath:name = \'myvmname\''

Reply
0 Kudos
brianwatrous
VMware Employee
VMware Employee

Thanks for all the preceding tips, but...

Given a workflow object, is there a way to programatically get that workflow's Id? I expected there to be a property in the workflow object called id, but there is no such property.

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

In a workflow try workflow.rootWorkflow.id

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

Or if you have a wf workflow attribute : wf.id

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
brianwatrous
VMware Employee
VMware Employee

Christophe Decanini wrote:

Or if you have a wf workflow attribute : wf.id

That's what I assumed the code would be, but before I typed in the code, I checked the API Explorer. The API Explorer doc for the workflow object doesn't list a property called "id". Went with the doc instead of my intuition.

Bolstered by your post, I did a "wf.id" in my workflow, and it worked as expected.

Thanks, Christophe.

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

The API doc, unfortunately is missing a few things. Sometimes such properties were designed first for internal use and were made available later in the scripting without being documented. You can open a PR for this if you want to have it updated.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos