activiti5.14 增長新的特性

一、public interface TaskService : java

/**
   * A shortcut to {@link #claim} with null user in order to unclaim the task
   * @param taskId task to unclaim, cannot be null.
   * @throws ActivitiObjectNotFoundException when the task doesn't exist. 
   */
  void unclaim(String taskId);



void claim(String taskId, String userId) 都很熟悉,就是聲明某個任務。使這個任務只能有 userId能完成這個任務。

怎麼取消這個聲明呢?activiti增長新的特性方法unclaim(); sql

二、本身寫sql來查詢本身的任務和待辦的任務 app

// 已經簽收的或者直接分配到當前人的任務

        StringBuffer asigneeSql = new StringBuffer(" select distinct RES.* from ACT_RU_TASK RES ");
        asigneeSql.append(" inner join ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_ ");
        asigneeSql.append(" WHERE RES.ASSIGNEE_ = #{userId}");
        asigneeSql.append(" and D.KEY_ = #{processDefinitionKey} ");
        asigneeSql.append(" and RES.SUSPENSION_STATE_ = #{suspensionState}");


        // 當前人在候選人或者候選組範圍以內
        StringBuffer needClaimSql = new StringBuffer("select distinct RES1.* from ACT_RU_TASK RES1   ");
        needClaimSql.append(" inner join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES1.ID_ ");
        needClaimSql.append(" inner join ACT_RE_PROCDEF D1 on RES1.PROC_DEF_ID_ = D1.ID_ ");
        needClaimSql.append(" WHERE D1.KEY_ = #{processDefinitionKey} ");
        needClaimSql.append(" and RES1.ASSIGNEE_ is null  ");
        needClaimSql.append(" and I.TYPE_ = 'candidate' ");
        needClaimSql.append(" and ( I.USER_ID_ = #{userId} or ");
        needClaimSql.append("  I.GROUP_ID_ IN (select g.GROUP_ID_ from ACT_ID_MEMBERSHIP g where g.USER_ID_ = #{userId} ) ) ");
        needClaimSql.append(" and RES1.SUSPENSION_STATE_ = #{suspensionState} ");
相關文章
相關標籤/搜索