Hello
I am working on an automation scenario where I need a workflow in VCO A to start another workflow in VCO B using the VCO REST Plugin (1.0.2) on VCO 5.1.1.
I have done this successfully while creating a REST Host and a REST Operation using the appropriate workflows. However for my approach this is much to static and I need to create REST operations on the fly. I have peeked at the Plugin workflows and try to do the same in my workflow.
However I am stuck with the "Connection pool shut down" error when trying to execute the actual POST request.
My approach is to store the REST Host object as a static attribute with the VCO configuration and retrieve it from there. I can run GET operations without any problems directly with the host, i.e.
restRequest = restHost.createRequest(restType, restUrl, restContent);
restResponse = restRequest.execute();
My problem is actually running a POST operation. I have prepared the content in XML format, i.e.
<execution-context xmlns="http://www.vmware.com/vco">
<parameters>
<parameter name="param1" type="string">
<string>value1</string>
</parameter>
<parameter name="param2" type="string">
<string>value2</string>
</parameter>
</parameters>
</execution-context>
and use the content type "application/xml". Earlier in my code I run a GET request to retrieve my target workflow ID for creating a Url like this:
/workflows/98c3b8ee-9569-4940-acc1-b8fbc2e64649/executions/
This is code I am using to perform the POST while creating a REST operation when needed and deleting it afterwards.
var restOperation = new RESTOperation(System.nextUUID());
restOperation.method = restType;
restOperation.urlTemplate = restUrl;
restOperation.defaultContentType = restContentType;
restHost.addOperation(restOperation);
RESTHostManager.updateHost(restHost);
var inputParameters = [];
var restRequest = restOperation.createRequest(inputParameters, restContent);
restRequest.contentType = restContentType;
var restResponse = restRequest.execute();
restHost.removeOperation(restOperation.id);
RESTHostManager.updateHost(restHost);
My code fails when invoking the restRequest.execute throwing: 'InternalError: Connection pool shut down'. Has somebody else tried a similar scenario or has an idea what I may be missing?
Thanks,
Bernd