Hi,

I'm having major problems reassigning tasks from one user to another.  I have the following setup with a new task being created, passed to the management team and then assigned to a contractor for the work to be done.

New Task --> Assign Contractor --> Contractor carry out work.

My problem is that once assigned to the management team I cannot reassign the task to a contractor.  I've been able to use the following code in the first assignment to programatically assign a number of users, but this fails in the second attempt to assign a contractor.

import java.util.ArrayList;

a = new ArrayList();

a.add("jack"); // one username

return a;

Am I misunderstanding the process in that once assigned to a user (Accepted) I cannot change change this?

Any help gratefully received as I'm about to purchase 50+ licenses and this is turning into a showstopper for scrapping this system and using an alternative BPM tool.

Hugh

  • No labels

2 Comments

  1. Hi Hugh,

    Not sure if this is what you're after, but if you're attempting to programmatically reassign a task from one person to another, it's possible to use a Beanshell tool to invoke the appropriate Java API e.g.

    WorkflowManager.assignmentReassign(String processDefId, String processId, String activityId, String username, String replaceUser)
    

    I'm not too clear on how the second attempt is being made, maybe you could share more about your app or process design and we could help provide more suggestions.

    Thanks!

    Best Regards,
    Julian

  2. Thanks Julian.

    The first assignment is carried out through a beanshell script which allows me to check this is working.  Admin2 is a fake name but the beanshell tool adds it okay and works as expected.  This also works with all the other types of assignments and will (in the live server) assign to a group. 

    But for testing, the beanshell added both Paul and Admin2 to prove I had control.
    The problem I now have is that if Paul picks up the case and assigns it to a contractor, it does't change the list of Pending, meaning only Paul can pick the case up.
    I've attempted to set this assignment through a number of ways:

    • User/Group/Department - Even using the standard methods does not change the list of pending (assignment)
    • Variable - Assigned using a workflow variable linked to a group code, Username or department code.  None appear to change the assigned users or appear in the contractors inbox.
    • Beanshell - Using the code in my original post does not change the List of Pending and the task remains assigned to the individual who picks the case up at the point of assigning contractor.

    I'll try your code in the bean shell.  

    Here is the process.