There is no API for sorting the tasks in JBPM. If you want to sort the tasks you can either hit the database directly and sort the tasks in the query or you can write a comparator to sort the retreived tasks.
I feared this answer ;)
Why fear? It is a great opportunity to create something and contribute back. And it is not that difficult...
Ronald, you have told the truth,
rather than go directly on the database to do this thing just for me, I prefer that I give a suggestion and make it for everyone ... I'm using jbpm 3.2.3 and at this moment I'm in difficult to change it, where to start?
(I'm new in the opensource world). My skills are:
DATABASE: OK (pg, oracle, mysql, sqlserver)
HIBERNATE : KO :(
SVN : OK
If you wanted to start somewhere for this, I would first understand Hibernate queries. The Task Management Session uses Hibrernate to make this query.
So, here is the Hibernate Query they use to get tasks for a given user:
select ti from org.jbpm.taskmgmt.exe.TaskInstance as ti where ti.actorId = :actorId and ti.isOpen = true
For the hibernate query, see the source from org.jbpm.db.TaskMgmtSession, which calls a query in org/jbpm/db/hibernate.queries.hbm.xml
You could get the Hibernate session from jBPM, and then create a Query off of it, making your appropriate order by.