AnsweredAssumed Answered

BUG? - ProcessDefinitionQuery.startableByUser() in ACT 5.10

Question asked by unknown-user on Nov 6, 2012
Latest reply on Nov 8, 2012 by frederikheremans1
Hi all,

The new possibility to query process definitions by users that may start a certain process seems to be limited to users/groups that are managed by Activiti itself.

Once you use a custom user/group manager, using startableByUser() works, if you assign candidate start users.
However, if you only assign a candiate start group (to which the user belongs), the query returns no result.

The reason why that happens is that in selectProcessDefinitionsByQueryCriteria, the Activiti tables are queried without considering external user/group managers.


      <if test="authorizationUserId != null">
        AND (exists (select ID_  from ${prefix} ACT_RU_IDENTITYLINK  IDN where IDN.PROC_DEF_ID_ = RES.ID_ and IDN.USER_ID_ = #{authorizationUserId})
             OR exists (select IDN.ID_  from ${prefix} ACT_RU_IDENTITYLINK  IDN,  ${prefix} ACT_ID_MEMBERSHIP MBMR where IDN.PROC_DEF_ID_ = RES.ID_ and MBMR.USER_ID_ =  #{authorizationUserId} and IDN.GROUP_ID_ = MBMR.GROUP_ID_)