Skip to main content
The requirement is: in a workflow, when a user checks a box, the application will search the databse and show several other workflow instances based on certain criteria.

These instances need to be redirected to a certain activity so that they can be completed. Is it possible for the current logged-in user to access other people's work items(redirect)? I suppose K2 will use current logged-in user's criteria but I think K2 can impersonate the Administrator's account to do that.

Is there any related code snipet for this?
Hi lwang,

The easiest way to do this would be to do a web service to call the K2MNG APIs (see GetProcessInstancesAll in K2MNG help file). On the IIS side, you would need to configure your web service to turn off impersonation (i.e. in your web.config, identity impersonate is false) and configure the web service app pool account to have K2 admin rights.

Another method is that you could route all the work items to a particular dummy user, open up a custom worklist (with the dummy user credentials hardcoded in the K2 open connection call). This would allow you to redirect the items off to other people from a central worklist without having to give explicit rights on the K2 server.

I hope this helps.
Cheers,
Johnny.
Thanks. I have not really tried it yet but I think it will work.

I will create a dummy account and add it to the destination of every activity. And later get all the workitems for dummy, do a search and redirect all the found work items to a certain activity to complete them programmactically.

In K2Rom, there is a line of code:
oWorkList = oK2Connection.OpenWorklist("ASP")

We are using Infopath as client in our projects. Will this line be the same form both asp .net and infopath clients? Or can we use this above line for Infopath/sharepoint workflow projects as well, as far as I know, this above line works for asp .net...

Thanks again,
LW
"ASP" is just a word, you can substitute it with any word to separate into different categories.

Reply