I need to be able to show a list of all outstanding user tasks of different types using the REST interface. One way to do this would be to fetch all tasks via the tasks endpoint and then group the tasks, but that could mean fetching thousands of records without needing most of the information.
Is it possible to just fetch the list of user task types available?
I mean different task definitions keys. Sorry for not being clear enough.
Let’s say I have a process called Purchase and it contains only one manual task called AddToBasket. If I start that process, the /task endpoint would give me a reply similar to:
{
"id": "0024e29b-d5ee-11e8-a538-0a0027000002",
"name": "Add to basket",
[... skipping a few properties ...]
"taskDefinitionKey": "AddToBasket"
}
Now, in my use case, I want to query for the count of all such outstanding taskDefinitionKeys, given a particular process definition id.
Does someone know if such an endpoint exists and if not, would a pull request be likely to be excepted for it?
I believe that those methods require me to know the taskDefinitionKey before hand. So for my use case I would also require an endpoint that gives me all taskDefinitionKeys available. Does such an endpoint exist (without having to parse the bpmn definitions)?
To clarify: In the example above I have the taskDefinitionKey AddToBasket. In my client code I want to be able to show the count of outstanding tasks without knowing any of the taskDefinitionKeys that are available in the system.
An example would be if I could get this response from GET /task/count?processDefinitionKey=Purchase:
You mean
Count of tasks group by taskDefinitionKey.
That is unavailable through Rest API. I believe that it is impossible to cover all requested queries in the Rest APIs either because those queries considered uncommon or they may affect the performance badly.
I looked a little bit further into what the Cockpit does (by inspecting the REST calls) and it seems to achieve this goal by calling the statistics endpoint per process: