Check the oldest task time on the portal?

1
0
-1

Can I get via API the time that the oldest task is waiting to be performed?

1 answer

1
+2
-1
This one is the BEST answer!

You can do the following call to the REST API to retrieve an array with a single element that is the oldest pending task: http://localhost:8080/bonita/API/bpm/humanTask?p=0&c=1&f=state=ready&o=reachedStateDate%20ASC

  • humanTask REST resource will provide information only on task that requires human action (services tasks don't wait for a user to be performed).
  • p=0: the first page of result (Bonita API are paginated)
  • c=1: only one result on the first page: we only want the oldest pending task
  • f=state=ready: a filter in the search for task. We filter based on the state attribute value. ready state indicate for a human task that Engine waiting for user action to execute the task. See at the bottom of this documentation page for all possible states.
  • o=reachedStateDate%20ASC: we sort the results of the search request based on the date at which the task was reached oldest first. This way the only result we choose to get will be the oldest task.

You can achieve similar result with the Java API searchHumanTaskInstances.

Notifications