'UpdateTask' Activity Problem!!!
Hellow.
I want to update a task created by the CreateTask activity, when the activity is changed. I have the following function, which is run when the Task list item is Edited:
privatevoid onTaskChanged1_Invoked(object sender,ExternalDataEventArgs e){SPWeb mySite =newSPSite(workflowProperties.SiteId).OpenWeb(workflowProperties.WebId);SPList myList = mySite.Lists[workflowProperties.TaskListId];SPListItem myTask = myList.GetItemById(TaskBeforeProperties.TaskItemId);SPUser myUser = mySite.AllUsers[e.Identity];myTask[
"Assigned To"] = myUser;myTask.Update();
}
Everything seems okay, but when I call myTask.Update(), I get the following exception:
Error: Task is Currently locked by other workflow.
Later I Knew that I can Use 'Update Task' Activity to Update theAssignedTo Field like this:
private
void onTask1Update(object sender,EventArgs e){
(senderasUpdateTask).TaskProperties.AssignedTo ="MOSS\administrator";
}
But this code Blocks the Workflow and Give the Same error I mentioned Above, when i want to modify the workflow task from my sharepoint site, and do not reflect changes on task.
Please Help me to know how update the task Assignedto Field, I don't know if it a possible BUG in 'Updatetask' activity.
Thanks

