Symptoms
Please note that we are able to list the delegated tasks for the user "Out of Office". but this user can't list the available actions "Current worklistitem actions" on this task. Kindly advice.
We are using this method to get Current worklistitem actions by logged in user,
But we have an issue to get actions in case worklistitem was delegated from another (out of office) user.
public WorklistItem GetWorkItem(string SerialNumber)
{
String K2server = ConfigurationManager.AppSettingss"K2Server"]
String IdentityName = HttpContext.Current.User.Identity.Name
SourceCode.Workflow.Client.Connection K2Connection = new SourceCode.Workflow.Client.Connection()
K2Connection.Open(K2server)
K2Connection.ImpersonateUser(IdentityName)
WorklistItem wliTask = K2Connection.OpenWorklistItem(SerialNumber)
return wliTask
}
var actions = GetWorkItem(QueryStringg"SN"]).Actions
Diagnoses
Delegated Tasks can be seen by the OpenSharedWorklistItem(sharedUser, managedUser, serialNumber) function.
Shared user is the Original OOF user not the replacemnt for him.
Resolution
Resolution:
"
Please read up on this topic here:
http://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.6.9/default.htm_Working_with_Worklists_modified_by_Out_of_Office.html?TocPath=Runtime%20APIs%20and%20Services|Workflow|Workflow%20Client%20API|Workflow%20Client%20API%20Samples|_____6
Then Kindly implement the following code:
if((sharedUser != string.Empty) andand (managedUser == string.Empty))
{
worklistItem = conn.OpenSharedWorklistItem(sharedUser, managedUser, serialNumber)
}
in http://old.k2underground.com/blogs/johnny/archive/2009/02/26/out-of-office-feature-in-0807-and-the-sourcecode-workflow-client-apis.aspx
Shared user is the Original OOF user not the replacemnt for him.
kindly see the following and read point 1 very carefully:
1) SharedUser – This indicates the original user of the work item. The way to check this is to compare the identity of the user to the work item’s AllocatedUser property. If it does not match the identity of the work list user, then the work item is a shared work item. So you could use this check condition before appending the SharedUser tag to the URL that you launch the work item.
sURL = oWorkItem.Data (oWorkItem.AllocatedUser.ToLower() == oConn.User.FQN.ToLower() ? "" : "andSharedUser=" oWorkItem.AllocatedUser.Replace(@"", @"""))
2) ManagedUser – Not OOF related but this applies when you have access to your subordinate’s work list (as defined in Active Directory). This indicates the managed user work list that you are working with. When opening a managed user’s work list, you would specify an additional criteria in the WorklistCriteria object.
worklistCriteria.ManagedUser = "K2:"
Now once this is done, you also need to append the ManagedUser parameter to the URL as well. This will allow you to open up the managed user’s work item correctly.
"