ririmia
Enthusiast
Enthusiast

Workflows finished execution

Jump to solution

Hello,

There is any built in command or javascript to get the status of an workflow execution?

I need to retrieve all the workflow executions then the output variables for each of them.

I know that can be done with vRO REST API but would be nice to not execute a vRO workflow that will start a API call against the same vRO. 🙂

 

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Jeff_CH
Enthusiast
Enthusiast

This can be done with the Object "WorkflowToken" and then the Method "getOutputParameters"

View solution in original post

2 Replies
Jeff_CH
Enthusiast
Enthusiast

This can be done with the Object "WorkflowToken" and then the Method "getOutputParameters"

View solution in original post

ririmia
Enthusiast
Enthusiast

Thanks Jeff_CH.

You lead me in the right direction.

 

var wfObject = System.getModule("com.vmware.library.workflow").getWorkflowById("98b77dcb-ea88-4e2d-9046-24194ebfea52");
var wfTokens = wfObject.executions; // Array of WorkflowToken

for each (var wfToken in wfTokens){
    var inputParams = wfToken.getInputParameters();
    var value = inputParams.get("parameter name");
    // var value = inputParams.get(inputParams.keys[1]); // if you don't know the name of the parameter
   System.log(value);
}

Instead of getInputParameters(); can be used getOutputParameters();

 

Side note:  Also with some help from Solved: Re: Workflow Output Parameters - VMware Technology Network VMTN

0 Kudos