Obtaining vRO Workflow State and Result with PowervRO
In the previous episode we looked at how to invoke a vRO workflow with PowerShell, via PowervRO and the Invoke-vROWorkflow function. Once you have kicked the workflow off you are likely to then want to find out the state of the workflow, when it has finished and any output from the workflow. Here’s how to do this via PowervRO.
Check the Workflow State:
First of all, we need to identify which execution of a particular workflow we want to check the state of. In GUI terms this means “which one of these?”:
Typically, we will want to look at the active one, i.e. the most recent. We can find that as follows:
You can see there is a State property which gives a basic indication of what’s going on. We can find out more details with Get-vROWorkflowExecutionState:
Get the Workflow Result
If the workflow has Output parameters set we can retrieve the results with Get-vROWorkflowExecutionResult. In this example the workflow will generate a random number and include it as an output:
We simply pipe the output of Get-vROWorkflowExecution into Get-vROWorkflowResult :-)