Comment faire pour modifier le statut de la tâche de flux de travail sharepoint?

Je suis novice dans la programmation sharepoint. J'ai un code suivant:

SPWorkflowTask  task = some_getter();
task["Status"] = "Canceled";    
task.Update();

et j'en suis SPException:

Microsoft.SharePoint.SPException: "This task is currently locked by a running workflow and cannot be edited."
at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId)
at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents)
at Microsoft.SharePoint.SPListItem.Update()
at mycode

Je crois que je suis en train de faire quelque chose de fondamentalement mauvais. Quelqu'un peut-il m'aider?

OriginalL'auteur Jakub Šturc | 2008-12-16