The interface : "org.jbpm.api.TaskQuery" allows to make queries to the existing Tasks.
It allows to list the Tasks corresponding to a certain filter.
Currently, the only way to get the number of Tasks corresponding to this filter is to get the list, then get the size of this list.
That means that for the equivalent of a "count" in the DB, we have to retrieve the whole list. (which is not optimized).
Maybe adding a .count() method in addition of the .list() method would be interesting.