Symptoms
Error processing a worklist item
Diagnoses
Hi, we are using ASPX page like form in our activities inside K2 process.
Everything work good with exception of the next codeline:
SourceCode.Workflow.Client.WorklistItem.Actionsn"Task Completed"].Execute()
This codeline is executed good if the user k2Service is loged into the IE, k2Service is our user to control K2 but if we logged with other user we receive a error and the executed is interrupted.
The idea of this codeline is complete the activity.
Resolution
When using an Integrated K2 connection string with the SourceCode.HostClientAPI and SourceCode.Workflow.Client in a custom web application, usually the application pool account will be used to connect to the K2 Server unless configured otherwise. As such, one way of connecting to the K2 Server to retrieve the worklist and action a worklist item as the user currently logged in, is to:
- use the "ImpersonateUser" method and "RevertUser" method of the Connection class (the web application pool account will use K2 impersonation to connect as and perform action as the current user running the page) as per:
http://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.6.9/default.htm_Working_with_a_Process.html?TocPath=Runtime%20APIs%20and%20Services|Workflow|Workflow%20Client%20API|Workflow%20Client%20API%20Samples|_____2
- usually this involves giving the application pool account "Impersonate" rights on the K2 server
- configuring the web application to use only "Anonymous Authentication" and "Windows Authentication" as per:
If you would like additional guideline with using the K2 APIs, I would also like to recommend K2 Remote Services. K2 Remote Services is an additional service offering which can be engaged, for an additional fee. K2 Remote Services gives customers K2 consulting expertise on an ad hoc, as-needed basis. Time may be scheduled in one-hour increments and charged through Premier support credits. K2 Remote Services is provided by phone, web conference or email.