VMware Cloud Community
ririmia
Enthusiast
Enthusiast
Jump to solution

Workflows finished execution

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
Jeff_CH
Enthusiast
Enthusiast
Jump to solution

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

View solution in original post

2 Replies
Jeff_CH
Enthusiast
Enthusiast
Jump to solution

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

ririmia
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos