Discussion:
[jboss-user] [jBPM] - Group Assignment
roxy1987
2013-01-18 19:29:44 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/792845#792845

--------------------------------------------------------------
Hi,

I tried assigning task to a group. EVerything is good except a couple of issues i am having.

a) When we retrieve a taskSummary object for a group task, we can get to know its userid provided it is not a group task but in case it is a group task, how do we get its group ID? Since a user might be part of various groups, so it becomes important to know to which group the task was assigned.

b) Secondly, I am able to retrieve the task but when I try to claim it, I get the following permission exception :


org.jbpm.task.service.PermissionDeniedException: User '[User:'mary']' does not have permissions to execution operation 'Claim' on task id 1


public static void claimTask(long taskId, String userId)
{
connect();
BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
try
{
// client.release(taskId, "Administrator", responseHandler);
  client.claim(taskId, userId, responseHandler);
  responseHandler.waitTillDone(5000);
}
catch(Exception e)
{
  CustomExceptionHandler.handleException(e);
}
}
 

The code looks like above. I tried to release it from Administrator's queue too. but it did not work may be coz the task is in ready state until it is claimed.

Regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792845#792845]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-18 19:47:11 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/792849#792849

--------------------------------------------------------------
Well I have solved the second part by adding a list of groups to the method claim.


client.getTasksAssignedAsPotentialOwner(userId, groups, "en-UK", summaryHandler);


But still wondering about 1st question.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792849#792849]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2013-01-21 13:19:42 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/793234#793234

--------------------------------------------------------------
Hi roxy1987,

What version of JBPM do you use?

in JBPM5.4, Human Task Service will use UserGroupCallback to get the user's group, so when the userGroupCallback component cannot prove that mary belong to the group in which the task is assigned, you will get that error.

You can give mary membership to the group by editing the roles.properties file or you can override and write your own implementation of userGroupCallback if you get your user and group relation on other place such as database.

if you write your own implementation of userGroupCallback, make sure you tell HumanTaskService to use your component by specifying it on
\jbpm-human-task-war.war\WEB-INF\web.xml
<param-name>user.group.callback.class</param-name>
<param-value>org.jbpm.task.identity.DefaultUserGroupCallbackImpl</param-value>

Regards,
Thomas Setiabudi





--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793234#793234]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-21 13:41:55 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/793242#793242

--------------------------------------------------------------
Thanks for your reply Thomas. I am able to workout the 2nd question. I just need the name of the group to which the task was assigned. Is there no way to get the group id using the taskSummary Object that I have?
I cant find out the information using just the id of the user as it is gonna be assigned to many different groups.

Regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793242#793242]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2013-01-22 00:38:22 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/793375#793375

--------------------------------------------------------------
Hi Roxy1987,

By Default, The TaskSummary object does not have information about the name of the group.

If you are using JBPM5.4, you can look at the query to get content of TaskSummary at
jbpm-human-task-war.war\WEB-INF\classes\META-INF\Taskorm-JPA2.xml


You can try to modify that query, or you can just query the database directly to get the name of the group.



Regards,
Thomas Setiabudi
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793375#793375]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-22 14:27:29 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Group Assignment"

To view the discussion, visit: https://community.jboss.org/message/793538#793538

--------------------------------------------------------------
Yeah well I guess thats what I would need to do. Thanks Thomas. Your help Much appreciated.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793538#793538]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...