I'm using the WorkflowService JAVA API to write a web service that returns a list of workflow instances matching a set of criterias. The response is displayed in an aikau page using traditional paginated list components.
I note that WorkflowService has a method "getWorflows" accepting 'maxItems' and 'skipCount' as parameters for pagination, but no 'sortBy' criteria (how to build a paginated list without being able to sort the results ?).
- What is the default sortOrder internally used by 'getWorflows' method ?
- Is there any way to change this sortOrder using public API ?
Using the Alfresco API you cannot sort the workflows. You'd have to circumvent it and use Activiti API directly (which of course is not recommended by Alfresco). The default sort order is by process instance duration, so the time that the workflow has been running, but only if a maxItems higher than 0 has been specified.
I am not an Alfresco Engineer, so I can't give a reliable / official answer. But considering that Alfresco is considering to move the workflow engine completely out of the Repository at some point in the future, I would not bet on it. It has also been this way for years, so you'd have to find an extremely influential, paying customer to convince Alfresco to change it now....