cancel
Showing results for 
Search instead for 
Did you mean: 

Why latest() can only be used in combination with key?

croc1
Champ in-the-making
Champ in-the-making
Why Calling latest() can only be used in combination with key(String) and keyLike(String)?
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
You can also call "latest()" without any other criteria, gives you ALL latest process-definitions. If not, it uses grouping by key, and gets the latest for that process-definition key. All other criteria (name) don't identify a process-definition group uniquely and could cause returning of several process-definitins, which defeats the purpose of the "latest" concept.

croc1
Champ in-the-making
Champ in-the-making

<if test="latest">
     and PD.VERSION_ = (select max(VERSION_) from ACT_RE_PROCDEF where KEY_ = PD.KEY_)
</if>
activiti5.9

frederikherema1
Star Contributor
Star Contributor
Okay, so the part of calling latest() with NO other criteria actually doesn't work, can you create a jira-issue for this?

croc1
Champ in-the-making
Champ in-the-making
That said,invok ProcessDefinitionQuery.latestVersion().processDefinitionNameLike("xxx")
it's real working fine?