cancel
Showing results for 
Search instead for 
Did you mean: 

about ProcessDefinitionQuery orderByDeploymentId BUG

carson1
Champ in-the-making
Champ in-the-making
Hi!
    In my project, I want to make my  ProcessDefinition list ordered by deploy time, so I use this code below:

    repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc();

    But unexpected results returned, they're ordered incorrectly.

    I use activiti-5.12.1\database\create\activiti.mysql.create.engine.sql to creat db, i noted that the table ACT_RE_PROCDEF with DEPLOYMENT_ID_ varchar(64)  ,  order by this expression will cause my situation. (your deployment_id is auto increased).

    for example, your results is : 908, 890,790,…..,201,1001,102….. 

     look forward to your  reply, thank you !
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
The database orders by ID using string-compare, this is just the way it is. We're sticking to the varchar representation of ID's since we also support UUID's as ID instead of auto-incemented ones.