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.
[... Crawl Array...]
Thanks in advance,
Stephan
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.
Hope this helps
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.
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
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\''
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.
In a workflow try workflow.rootWorkflow.id
Or if you have a wf workflow attribute : wf.id
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.
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.