cancel
Showing results for 
Search instead for 
Did you mean: 

Can not reassign task to group - bug in JBPMEngine class?

erik_kirs
Champ in-the-making
Champ in-the-making
Hi all!

Using Alfresco SDK 2.1.0 I tried to extend functionality of ReassignTaskDialog to enable task reassignment to users group, not only user.

But following code call crashes with ClassCastException:

List<NodeRef> nodeList  = …..
params.put(WorkflowModel.ASSOC_POOLED_ACTORS, nodeList);
this.workflowService.updateTask(this.taskId, params, null, null);

Exception occures in org.alfresco.repo.workflow.jbpm.JBPMEngine class (row 2006):

if (value instanceof JBPMNodeList[])
{
    JBPMNodeList actors = (JBPMNodeList)value;

Typo?

Best regards, Erik
5 REPLIES 5

giorgio
Champ in-the-making
Champ in-the-making
hi erik, I'm trying to do the same but in vaersion of Alfresco Labs 3, you know if this bug has been fixed? and in any case the code to say where you put him? in the jsp that displays the list of reallocation? or where?

thanks and greetings.

nowhere
Champ in-the-making
Champ in-the-making
I don't understand exactly what is your exception, I did so and it works for me:


Map<QName, Serializable> props= new HashMap<QName, Serializable>();
props1.put(WorkflowModel.ASSOC_POOLED_ACTORS,  (Serializable)pooledNodeRefs);
workflowService.updateTask(task.id, props1, null, null);

Obviously this set pooled actor for your task…I guess this is what you would do with your code.

Also have a look at if it could help you:

http://forums.alfresco.com/en/viewtopic.php?f=34&t=18520

giorgio
Champ in-the-making
Champ in-the-making
I don't understand exactly what is your exception, I did so and it works for me:


Map<QName, Serializable> props= new HashMap<QName, Serializable>();
props1.put(WorkflowModel.ASSOC_POOLED_ACTORS,  (Serializable)pooledNodeRefs);
workflowService.updateTask(task.id, props1, null, null);

Obviously this set pooled actor for your task…I guess this is what you would do with your code.

Also have a look at if it could help you:

http://forums.alfresco.com/en/viewtopic.php?f=34&t=18520


Nowhere hello, get that code can be reassigned a task to a group? The problem I have is this, that Alfresco default will not let me reassign a task to a group only to a user

and if this is the code that makes it possible to assign groups, that file is placed?

greetings

nowhere
Champ in-the-making
Champ in-the-making
Hi giorgio,
IMO, pooled actor and group assignee are a bit different concepts… you car read wiki http://wiki.alfresco.com/wiki/WorkflowAdministration#Pooled_Tasks_.26_Groups or
this interesting tutorial http://ecmarchitect.com/images/articles/alfresco-workflow/advanced-workflow-article.pdf about this.

Maybe you should use bpm:groupAssignee property if what you want is not a pooled task, but I'm facing a similar issue at this moment so I can't help you more than this.

Let me know!

erik_kirs
Champ in-the-making
Champ in-the-making
I don't understand exactly what is your exception, I did so and it works for me:


Map<QName, Serializable> props= new HashMap<QName, Serializable>();
props1.put(WorkflowModel.ASSOC_POOLED_ACTORS,  (Serializable)pooledNodeRefs);
workflowService.updateTask(task.id, props1, null, null);

Obviously this set pooled actor for your task…I guess this is what you would do with your code.

Also have a look at if it could help you:

http://forums.alfresco.com/en/viewtopic.php?f=34&t=18520

Hello,

topic that you point to exactly describes the reason of my exception - there was (or still exists?) inaccuracy in JBPMEngine code:

if (value instanceof JBPMNodeList[])

I worked group assignment around in different way in process definition XML file, but unfortunately have no access to the code to bring an example.