You need to override TaskInstancesGet webscript.(TaskInstancesGet.java) In that file there is a Comparator which is sorting task by DueDate. Here you need to change it to as per your scenario. Ex.if you want latest created workflow comes first then you need to use ContentModel.PROP_CREATED instead of WorkflowModel.PROP_DUE_DATE.
Below Example willr display task by latest.
class WorkflowTaskDueAscComparator implements Comparator<WorkflowTask>
public int compare(WorkflowTask o1, WorkflowTask o2)
Date date1 = (Date)o1.getProperties().get(ContentModel.PROP_CREATED);
Date date2 = (Date)o2.getProperties().get(ContentModel.PROP_CREATED);
long time1 = date1 == null ? Long.MAX_VALUE : date1.getTime();
long time2 = date2 == null ? Long.MAX_VALUE : date2.getTime();