Modify workflow and set task permissions.


Badge +4

Hi,


I've a requirement where in I need to redirect a task using K2+Sharepoint integration.


I've used the following code.


Connection

con = new Connection();


con.Open(

"localhost");


SourceCode.Workflow.Client.

WorklistItem wli = con.OpenWorklistItem("Serial No", "ASP", false);


wli.Redirect(

"K2:domainnameusername");


This code changes the task in the K2 workflow and it doesn't affect the sharepoint workflow.


So, I manually changed the assignedto user to the new redirected user and the new redirected user is able to act on the task.


But while going to the next activity, an error occurs at the following location


ExecuteForUser(string destination)  -- 


service.ModifyWorkflow(listId, listItemId, workflowInstanceId, modificationID, contextData); This line gets passed.


 


if (!K2.ActivityInstanceDestination.ActivityInstance.SingleInstance)


{


service.SetTaskPermissions(listId, listItemId, taskListId, workflowInstanceId, contextData, K2.ProcessInstance.XmlFields["SPIntegrationData"].Value);


}


The SetTaskPermissions method fails throwing the following error.


Unable to modify workflow: Server was unable to process request. ---> The specified user K2:domainname/username could not be found.


I'm not able to track any information regarding the error.


I'm not sure as to which user is it looking at, the redirected user of K2 or the changed user in sharepoint?


Can anyone give some pointers on this.


SourceCode.Sharepoint.WebServices.K2SPWorkflows service=new SourceCode.Sharepoint.WebServices.K2SPWorkflows();


service.ModifyWorkflow();


service.SetTaskPermissions(); Failing at this point.


What exactly the code sets while calling the above methods. How can I handle the situation?


Your inputs are invaluable!!!


 


Thanks & regards,


Phanibabu Kandala 


 


0 replies

Be the first to reply!

Reply