'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:

privatevoid onTask1Update(object sender,EventArgs e)
{
(sender
asUpdateTask).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

[2689 byte] By [ylopez] at [2008-2-12]
# 1
I found the problem and Now everything is working Fine ...!!! Thanks.
ylopez at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 2

I'm guessing that your problem might have been that you needed a double slash in the domain and username (e.g. ="Domain\\User"; )

You do also have to use the updateTask activity to update your activity. I spent ages trying to figure out why I couldn't update a task in the 'onTaskChanged' event activity. It seems that there are event handlers on the task ListItem that will reject updates unless they are done using the 'update' steps.

AndyBurns at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 3
I've got a little bit another problem with UpdateTask Activity...

I'm trying to reassign the task by using UpdateTask activity after OnChageTask activity and it works, BUT MOSS shows me the error page with "Task update was not accepted." error message. Anyone have some ideas, maybe there is a better way of task reassignment ? Several days of googling have brought no results and if you could send me a working example you would save my life (mssemyonov_amp_yahoo.com).

Maxim at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 4

I have the same problem with the UpdateTask action - The message "Task update was not accepted" but the task updated with Workflow Propertuies provided

1gin at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 5

I have found the solution:

I have created new SPWorkflowPropertis object and put into his ExtendedProperties only properties which I want change (early I tried to reuse AfterProperties from OnTaskChanged)

1gin at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...

SharePoint Products and Technologies

Site Classified