cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to retrieve count of Workflow instances

thejk
Explorer
0 Kudos

Hello,

I am trying to get the total count of instances of a certain workflow definition. I am trying this:

var sURL = "/bpmworkflowruntime/rest/v1/workflow-instances/?&definitionId="            + sWorkflowDefinition + "&status=RUNNING,ERRONEOUS,SUSPENDED,
           CANCELED,COMPLETED&$inlinecount=allpages
           &$orderby=startedAt desc";
$.ajax({
	url: sURL,
	method: "GET",
	contentType: "application/json",
	async: false,
	success: function (oResponse, httpStatus, jqXHR) { 
		
	},
	error: function (result) {
				
	}
});

I was expecting to get a "X-Total-Count" header in the response as described in the API documentation. But all I get is this:

Guess I am doing it wrong? Any hints to point me in the right direction?

Thanks,

Jürgen

Accepted Solutions (1)

Accepted Solutions (1)

tobias_breyer
Employee
Employee

Hi Jürgen,

You probably need to whitelist the header in your HTML5 app so that it is not filtered out.

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/df89d9cd06a84905a3a4747f102...

In addition: the way you specify the status is not covered by the REST API documentation. Please specify the parameter 'status' multiple times, with different values, instead of once with a comma-separated list for the value.

Regards,

Tobias

Answers (1)

Answers (1)

thejk
Explorer

Hello Tobias,

Whitelisting was the solution. Works perfect... I also changed the way I specify "status"

Thanks a Lot!

Jürgen