Skip to main content

I meet a question. i want to redirect the current workitem to another user with "workitem.Redirct(user)".


But after doing that  i found the workitem redirected justnow still in my worklist ,and it also appeared at another user's list.


in this time, when i link the workitem, it will show me "not found the workitem 0".


if the current destination type is "user" it wont happen,but "role".


i think if the destination type is "role",i need to remove the current user from the processinstance destination.then rederict.


but i dont know how to do this with the API.


                                                              Thank you for helps

Was an additional activity instance created?  You can check fairly easily via the the global work list in the workspace under Server > Work List.  If this is the case, have you tried expiring the current activity instance after redirecting?


Thank,sirwally.I found after  i redirected the workitem with a "role" type destination,the workitem.status value changed to allocated.


then i filtered the list,only got the workitems with other value except allocated. in this way,i can get the worklist exclude the worlitem i redirected


i dont know this is the correct solution


But why does it happen only when the destination's type is role?


if the type is user,the workitem redirected wont be in my pending list.


Out or curiosity, what are the details of the destination queue for the activity?  i.e. plan type, number of slots, whether you are synchronizing the users/roles.


When a work item is created for a role, depending on the settings for the destination queue it may evaluate each user in the role and create a workitem for each user.  I believe this is not the case here.  I think you are creating a single workitem for the role, not one for each user in the role.  If this is the case, redirecting the workitem to another user will not remove the workitem for the role, perhaps because there are other users in the role (and if there aren't, it sounds like BP isn't checking if you are the only member and then expiring the work item when you redirect).  What is this the case of the redirectd work item?  I would expect it to be open.  In my experience when a work item assigned to multiple users/roles is opened by one of the users their work item changes to Open status, and all the others become Allocated.  If the open work item is released they all revert back to Available.


If the original work item was assigned to you (as a user) and you redirected it, it makes sense that after redirecting it would disappear from your worklist.


Reply