6 Replies Latest reply on Dec 21, 2015 2:24 PM by Arif Mohammed

    Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final

    Arif Mohammed Newbie

      Hi,

       

        Earlier I was using jBPM 6.1.0.Final and there was no issue in retrieving group specific tasks for which there is no actual owner. However when I upgraded to jBPM6.3.0.Final the same code which was working in 6.1.0.Final is now returning me the empty list. In earlier release it used to return all the tasks for the given group whether it has an actual owner or not (of course with given status).

       

      Following is the code

       

      RuntimeEngine engine = runtimeManager.getRuntimeEngine(EmptyContext.get());
      TaskService taskService = engine.getTaskService();
      InternalTaskService internalService = (InternalTaskService)taskService;
      List<String> groupIds = new ArrayList<String>();
      groupIds.add("1");
      List<Status> sts = new ArrayList<Status>();
      ts.add(Status.Reserved);
      sts.add(Status.InProgress);
      sts.add(Status.Completed);
      List<TaskSummary> list = internalService.getTasksAssignedAsPotentialOwnerByStatusByGroup(null, groupIds,sts);
      

       

      If this internal API is changed between these 2 releases, is there any other alternate way of retrieving the group specific tasks for which there is no actual owner

        • 1. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
          jimmy001 Apprentice

          What I think is that you have the following problem:

          The task is in status "ready", if there is no owner and you do not filter for these.

           

          Add the line

          sts.add(Status.Ready);

          • 2. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
            Arif Mohammed Newbie

            No thats not true, the status of the task is InProgress. Let me give you the data in the tables.

             

            select id,status,processinstance_id,actualowner_id,taskinitiator_id,createdby_id from task where processinstanceid in (100, 200);
            
            Result
            ------
            ID        STATUS        PROCESSINSTANCEID     ACTUALOWNER_ID   TASKINITIATOR_ID   CREATEDBY_ID
            21        InProgress    100                   ARIF             ARIF               ARIF
            22        InProgress    200                   DAVID            DAVID              DAVID        
            

             

            And now the data in peopleassignments_potowners table

             

            select * from peopleassignments_potowners;
            
            Result
            ------
            
            task_id   entity_id
            21        681
            21        ARIF
            22        681
            22        DAVID
            

             

            I have a custom class which implements UserGroupCallback which is incharge of mapping users to groups in my company by querying into our companies DB.

            So for the group called "681" there are 2 users "ARIF" and "DAVID"

            And the group called "682" is having 1 user "ABRAHAM"

             

            If user ARIF wants to find the tasks specific to his group (681) then he should be able to get the tasks 21 and 22

            If user ABRAHAM wants to find the task specific to his group(682) he should not get none.

            • 3. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
              Maciej Swiderski Master

              Arif,

               

              this change of behavior was caused by bug that allowed to see tasks already claimed by other users than the actual owner. This was considered as security issue and thus of high priority. And if you include your user id in the method call instead of null it will all work perfectly fine - meaning you will see tasks owned by your and assigned to your group that are still available to be claimed.

               

              List<TaskSummary> list = internalService.getTasksAssignedAsPotentialOwnerByStatusByGroup("ARIF", groupIds,sts); 

               

              HTH

              • 4. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
                Arif Mohammed Novice

                But I want to see and claim the tasks that are assigned to other users(Including InProgress tasks) within my group forcefully. How can I achieve this ?

                 

                Let's say I as an user "ARIF" left the organization and some other user say "DAVID" from my group should be able to perform the following actions.

                 

                1) Should be able to see all the tasks in all states assigned to all users within his group (In the above case DAVID is interested in looking into the tasks assigned to ARIF)

                2) Assign the above found tasks to himself (In the above case tasks assigned to ARIF should be forcefully assigned to DAVID)

                 

                   If somehow DAVID can at least see the tasks assigned to ARIF (though none of the operations can be performed) then I think we can do step-2 as an Administrator

                • 5. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
                  Maciej Swiderski Master

                  that's clearly a task for business admin that can then reassign it and should not be seen as regular users as it exposes security problem

                   

                  HTH

                  • 6. Re: Unable to retrieve group specific tasks if there is no actual owner in jBPM6.3.0.Final
                    Arif Mohammed Newbie

                    I understood that second step is admin task. But atleast other users from the same group should be able to see the tasks, though they can not perform any action on them. We have built an application where the users should know about other users InProgress tasks. Is there any other alternative way of doing this may be to write our our queries by integrating our own Taskorm.xml