Redirect another person's job when I am not his/her manager.


Badge +1
I'm using 'redirect' method on the K2ROM.worklistitem object. It obviously works fine when I'm accessing my own worklist. How can I redirect the job of another person while I am not his/her manager set in Active Directory? Moreover, I want the job to disappear from that person's worklist as well.

I'm acting as an admin who can manage all jobs in case that the owner of that job is not around and needs to get that job done asap. I know it's the security for K2 not to access other people's worklist but hope there's a way to do what I'd like.

Thanks so much.....

14 replies

Badge +8
The K2 service manager has functionality that allows a K2.net administrator to redirect worklist items from one user to another. Have a look at the 'manage worklist' feature in the K2 service manager.

You can also reference the K2MNG component in code if you want to create your own front-end for this redirect functionality.
Badge +1
I tried RedirectWorklistItem in K2 Manager and it worked perfectly. Thanks!
Badge +4
icon-quote.gifNeilM:
The K2 service manager has functionality that allows a K2.net administrator to redirect worklist items from one user to another. Have a look at the 'manage worklist' feature in the K2 service manager.

You can also reference the K2MNG component in code if you want to create your own front-end for this redirect functionality.


So if a person is assigned Administrator role for a K2 process in K2 service manager, he can access and REDIRECT worklists even if the workliksts do not belong to him or the people he manages?

I tried that before in K2 Service Manager. I set myself as Administrator. I could see all the instances of a process. But it looked like that I still could not see worklists of other people when I tried to redirect a worklist. May be I was wrong. I will verify it again next week.

Also, using K2.Rom, I can list the worklists of a person and the people he manages programmatically. And I think K2.Rom includes a method for Redirect worklist too. But it cannot list the worklists of other people.

I have a scenario like the person who originates this question. We need a person serving as an Admin to redirect/reassign tasks. If the original assignee doesn't respond in two days, the task should be reassigned to another person by the Admin, who won't the managers of the people to assign tasks at all.

So if I want to redirect programmactically, K2MNG helps?
Badge +11
Admin rights on process level will NOT allow you to redirect worklist items of users not managed by yourself.

The mere fact that you are able to log in to and open K2.net Service Manager, means that either no Administration security is set up on your K2.net Server OR that the account you use to open K2.net Service Manager is set up as an Administrator of K2.net Server.

You need this Administration rights on K2.net Server (not on processes) to be able to redirect worklist items of any user.

Open K2.net Service Manager. Expand the tree in the left-hand pane until you see a 'Worklist' node. Select this and double-click on the 'Manage Worklists' icon in the right-hand pane. From here, you would be able to redirect worklist items of any user.

If you do need to do this through code by referencing K2MNG.dll, the only important thing to remember, is to pass the credentials of an Administrative user to the Login method of K2MNG.

Hope this helps,
Ockert
Badge +8
If the original assignee doesn't respond in two days, the task should be reassigned to another person by the Admin

Also have a look at the new 'redirect escalation' template that was released recently. This will allow you to configure an escalation on an activity that will redirect the task to another destination user/group/manager etc. after a certain interval.

You can obtain it from here:
http://portal.k2workflow.com/downloads/product.aspx
(you will need a K2.net Partner and Customer Portal account to log in with)
Badge +4
I downloaded the new patch and am able to redirect the task to another person when escalated.

Thanks.
Badge +4
So suppose, I use the new template as said above and re-direct the workitem to another person after the workitem is escalated after not being responded to in say, 2 days.

Is it possible to know or set this item as 'Escalated'? Because, I want to do the re-direct progrmmatically using K2.Rom workitem.Redirect and it would be necessary to distinguish an 'Escalated' item from normal one.

If there is a property ready to use, that is nice. Or I might be able to use an activity datafield for that. But I am not sure whether the activity will still be the same activity after being redirected.
Badge +9
Hi Coen,

Referencing K2ROM from within a K2.net Process is not a recommended practice, also note that K2.net Studio does not allow you to add K2ROM as a reference.
Badge +4
I think surely we can refer to and use K2.ROM in a Visual Studio project. We can open a connection and get worklist.... I do it for several customized web pages.

I am trying to redirect an escalated workitem programmatically in a customized web page here. It would be nice to know whether or not a workitem is an escalated one so that it can be distinguished from non-escalated ones??

Of course, I am doing this in Visual Studio not K2 studio.
Badge +11
Sure you can reference K2ROM in Visual Studio Solution - just not in K2.net Studio Solution. Just remember that the K2ROM will ONLY allow you to redirect worklist items assigned to yourself or the users managed by yourself. If you need to redirect other user's worklist items, you'll have to use K2MNG.

Do you make use of the 'Redirect Escalation' component? If so, I don't really see why you would want to redirect items from a custom web page as well.

K2.net Server does not keep track of Escalated/Redirected items by setting some flag. You'll have to declare a process or activity level variable to keep track of this yourself.

Hope this helps,
Ockert
Badge +4
HI Ockert,
Thanks for the help.

What I need to do is: redirect tasks to an administrative assistant after they are escalated. The admin uses a customized web page to do re-assignments.

I tried to use an activity datafield to mark "escalated" but activity datafield is not available in the K2 studio escalation context. So I used a process data field. Something strange happens-I reset the field back to "false" after reassigning the task in the web page, I checked the field value in the trace of the web page, it was set to "false" as supposed but when I checked it in the K2 workspace report--data audit, the value is still "true", which is set by K2 escalation event earlier when the redirection to the admin happens.
Badge +6
Hi Coen,

You are saying that you set the 'Escalated' field back to 'False' AFTER reassigning the task. At this stage the code would have already run on the K2 Server and you would thus not have access to change the datafield - The taskitem would not belong to the adminnistrative user any more.

"Something strange happens-I reset the field back to "false" after reassigning the task in the web page..."

I suggest you make sure to set the 'Escalated' field to 'False' BEFORE you call the Redirect() method.

Hope this helps because I cannot see why the datafield would not be set.

Regards,
Conrad
Badge +4
I check it again.
The following is the code:

foreach(SourceCode.K2ROM.WorklistItem oWorkListItem in oWList)
{
if (oWorkListItem.SerialNumber.ToString().Trim().ToUpper() != this.SN.ToUpper())
continue;

SourceCode.K2ROM.ProcessInstance process = oWorkListItem.ProcessInstance;

foreach(SourceCode.K2ROM.DataField oDataField in process.DataFields)
{
if(oDataField.Name == "IsEscalated")
{
oDataField.Value = "False";
}
}
this.sAMAccount = this.ddlManager.SelectedValue;
oWorkListItem.Redirect(this.sAMAccount);
break;
}
this.connection.Close();

So I reset it to "False" before redirecting. And I verified that the value has been set to "False" as supposed.

But in the workspace report, it is still "True", which is set by K2 Escalation Event earlier. I am wondering what going wrong.
Badge +11
Try to do a process.Update() after you've set the datafield value.

Hope this helps,
Ockert

Reply