As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Use the TaskService.createTaskQuery() to generate your list, but you will need to iterate over this list to sort by specific process variables.
Greg