Hi,
I want to achieve the delegate functionality from UI.
Can someone explain what each parameter of OpenWorklistItem mean. In fact there are 6 overloaded methods.
connection.OpenWorklistItem(workListItem.SerialNumber);
connection.OpenWorklistItem(workListItem.SerialNumber, "asp");
connection.OpenWorklistItem(workListItem.SerialNumber, "asp", false);
I've used the following code to delegate.
SourceCode.Workflow.Client.WorklistItem wli = connection.OpenWorklistItem(workListItem.SerialNumber, "asp", false);
SourceCode.Workflow.Client.Destination dest = new SourceCode.Workflow.Client.Destination();
dest.DestinationType = SourceCode.Workflow.Client.DestinationType.User;
dest.Name = "K2:DomainNameUsername";
dest.AllowedActions.Add("Approve");
dest.AllowedActions.Add("Reject");
wli.Delegate(dest);
I want the Delegate functionality to be able to Open the work list item to the DestinationUser i.e. the final delgated user to whom the task is delegated.
After delegation, is the worklistitem available to the delegated user, how to check this out? What should be exact status in the workspace?
I've tried several options, but when I try to action the task from the UI (here the UI is sharepoint), it throws an exception in the system generated code i.e.,
private void ExecuteForUser(string destination)
{
service.ModifyWorkflow(listId, listItemId, workflowInstanceId, modificationID, contextData); // this line passes.
if (!K2.ActivityInstanceDestination.ActivityInstance.SingleInstance)
{
service.SetTaskPermissions(listId, listItemId, taskListId, workflowInstanceId, contextData, K2.ProcessInstance.XmlFieldsi"SPIntegrationData"].Value); // this line fails.
}
}
Exception: “Unable to modify workflow: Server was unable to process request. ---> The specified user K2:DomainNameUserName could not be found. (Username is the delegated user)”. I'm completely struck here and unable to move forward. If I cross this line my custom code will get executed and everything goes fine I guess.
Is it looking for this user anywhere within the workflow in a specified format?
I've been trying this for some time now. I've posted seveal posts.
Can someone kindly explain this is detail.
Any pointers to this would be of great help.
Please comment whether this can be done or not? Its really urgent.
Thanks & regards,
Phanibabu Kandala