Get wrong information back when have REST API request for process-instance HISTORY

Hi,

when I use the REST API and I include in the post, the businessKey and activityIdIn, it does not return the correct results. When I do the same request for present processes - not history, it does work.

It also works if I base it on processInstanceId.

So, something like this:

127.0.0.1:8080/engine-rest/history/process-instance?firstResult=0&maxResults=50&sortBy=startTime&sortOrder=desc

with POST:

{“businessKey”: “#TU191224000254”,“activityIdIn”:[“Task_T1”],“firstResult”:0,“maxResults”:50,“sortBy”:“businessKey”,“sortOrder”:“desc”,“processDefinitionId”:“basic-test-id:59:9089ea33-224f-11ui-bc17-321c7c709fa0”}

Will return with a different businessKey and not return empty because the businessKey never was in that activity.

Instead of businessKey, if I send “processInstanceId” - it does work ok. It also works if looking for running processes.

Any ideas why? is this a known bug?

Thanks!

What version of Camunda are you using?
So you have a process instance with businessKey = x waiting at a specific activity with an id = y

So you’re saying when you query for the the businessKey and the activityid it returns nothing?

I am running an older version of Camunda (v7.9.0), what I am saying is that when I send a specific businessKey with an activityId that should not exist - I get a result with state=Active - even though it does not exist.

This issue only exists when using REST API.

I haven’t heard of this happening before - can you replicate it 7.12.0?

We didn’t upgrade yet in our test env - we will be doing that in the near future, so I will need to wait for upgrade. Is there anyway to test this case, its pretty easy to test, I have the link just need to replace with different id’s.

Should be very straightforward.
Download the new version here
Start is up locally
Deploy a process via the modeler
Then test the REST API using postman (or whatever rest client you want)

It shouldn’t require you to change anything in your current test environment. you can do it all locally.