Skip to main content

I have the following function setup in a script :

 

JSONObject getVmwareApiOutput(String apiUrl, String vCenterSessionToken){
ExecuteSuperProcess getVmwareApi = new ExecuteSuperProcess();
getVmwareApi.processBlock = WorkflowElement.parse("<processBlock>pbGetVmwareApi</processBlock>");
getVmwareApi.inputs = WorkflowElement.parse("<inputs><url>" + apiUrl + "</url><vmware-api-session-id>" + vCenterSessionToken + "</vmware-api-session-id></inputs>");
getVmwareApi.execute(workflow);
JSONObject vmWareApiOutput = new JSONObject(xpath:{/workflow/variables/restCallOutPut}.replace(""","").replace("]",""));
return vmWareApiOutput;
}

 

This works fine the first time I call the script.

But subsequents calls result in the following:

 

9908 ExecuteSuperProcess     : Search vCenters for Virtual Machines (scrSearchForVirtualMachine)] process block for super process id s9321], has already completed
9908 ExecuteSuperProcess     : Search vCenters for Virtual Machines (scrSearchForVirtualMachine)] process block for super process id e9321], has already completed
9908 ExecuteSuperProcess     : Search vCenters for Virtual Machines (scrSearchForVirtualMachine)] process block for super process id o9321], has already completed

So, are you trying to call the ExecuteProcessBlock multiple times within the same Script?

Can you see if you can design it so that you are inside a ForEach block or something that can call the ExecuteProcessBlock in each iteration so we don’t try to re-use the same process step id?

Another option to test is make the ProcessBlock of separate workflow and see if that works better being called multiple times within the same script.

 

 

 


So, are you trying to call the ExecuteProcessBlock multiple times within the same Script?

Correct. I want to use it to call http client and save the output. This was a lot easier by just calling a process block.

Can you see if you can design it so that you are inside a ForEach block or something that can call the ExecuteProcessBlock in each iteration so we don’t try to re-use the same process step id?

It would be really tricky.

Another option to test is make the ProcessBlock of separate workflow and see if that works better being called multiple times within the same script.

 

 

That might be the “nuke it from orbit” option. 

 


Reply