VMware Cloud Community
MikaelPareChabo
Enthusiast
Enthusiast

Retreiving ExecutionID for another use of the same workflow

Hi,

I've created workflow that is receiving his input from a web form. That web form is giving the values by REST. After the first form, I have a second page (billing information).

What is the best way to retreive the executionID from the started workflow from the first page ? I need to find this executionID to send the billing information in the user interaction of the same workflow. Is there a way to have a return from the started workflow ?

I'm using "PHP".

Reply
0 Kudos
3 Replies
MikaelPareChabo
Enthusiast
Enthusiast

Here is my code:

$service_url = 'https://{vcoserver}:8281/vco/api/workflows/dd759e2a-39fa-4dc3-882a-2488f1f4af01/executions/';
$ch = curl_init($service_url);
curl_setopt($ch,CURLOPT_USERPWD,"USERNAME:PASSWORD");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER, array('Accept: application/xml','Content-Type: application/xml'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$curl_response = curl_exec($ch);
$code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
curl_close($ch);
print_r($curl_response);
echo $code;

I have an error code 200 but no information in my "$curl_response"...

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

The code looks correct to me.

Could you turn verbose mode on by adding the following line?

  curl_setopt($ch, CURLOPT_VERBOSE, 1);

Also, what happens if you invoke a GET request on the same service URL using a browser? Does it return some output?

Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

I don't know curl, but I think if you review my article here: http://bit.ly/restvco , you should be able to get it figured out. The body you get back from a successful workflow execution is expected to be empty - that is normal. The execution ID  you are looking for is in the headers - see my article.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Reply
0 Kudos