REST: can not query for not canceled activity instances

The doc for REST API POST /history/activity-instance describes the query parameter cancel as follows:

canceled Only include canceled activity instances. Value may only be true, as false is the default behavior.

So how can I ask the engine to return only those activity instances that are not canceled? Why is there not a "canceled": false to achieve this?

I think the query parameter canceled shall not take the value of false to mean not defined. A distinction should be made between true, false and undefined.

Hey @Yuan_HOng,

Currently, it is not possible to query for activity instances that are not in a certain state (started, ending, canceled etc.). You can perform multiple queries for the “not canceled” states.

I agree with you, the docs might need further explanation on what happens when the value is not set. Would you like to make a contribution and change it?

Best Regards,
Nikola

Hi, Nikoka,

I would do the doc update. But you said:

You can perform multiple queries for the “not canceled” states.

Can you explain how? The only way I see is to not set the canceled parameter and then in the client code filter out the canceled ones.

Best Regards,
Hong Yuan

Hi @Yuan_HOng,

Sorry for the delayed response. It’s great that you want to contribute, thank you. :slight_smile:

As you said, one way is to filter out the canceled activity instances on the client side.

Another way, if you don’t mind the increased number of REST API calls, would be to send multiple HTTP requests to the REST API, asking seperately for each state and then joining the results on the client side.

Best,
Nikola