This content has been marked as final.
Show 2 replies
-
1. Re: how to get ordered (by created date) task instances?
brittm Jul 20, 2005 2:17 PM (in response to kukeltje)The most direct way to get your tasks in order is in a TreeSet with a custom Comparator. Use code similar to the following in your JSP/Bean
TreeSet tasks = new TreeSet( new Comparator() { public int compare(Object a, Object b) { TaskInstance ta = (TaskInstance)a; TaskInstance tb = (TaskInstance)b; java.util.Date startDateA = ta.getCreate(); java.util.Date startDateB = tb.getCreate(); return startDateA.compareTo(startDateB); } } ); tasks.addAll(taskMgmtSession.findTaskInstances(actor));
That's all there is to it.
-Britt -
2. Re: how to get ordered (by created date) task instances?
kukeltje Jul 21, 2005 8:38 AM (in response to kukeltje)Exactely.
My reply to your other thread was:
Then you make sure it is ALWAYS ordered by create date. Not everyone wants that. Sometimes you only want task for a certain state, or ordered by priority. I therefor think it should not be in solved by selecting it in the database but in the ui.