Azure, Open Source and ...

How to get the name of the user changing a Task in a Custom workflow code

I was asked by one of my colleagues on how to have access to the name of the user who is modifying a task programmatically within the Workflow code. Every time a task gets modified by a user (SPTaskProperties.AssignedTo) the OnTaskChanged activity populates the OnTaskChanged.ExecutorProperty and the name of the user can be retrieved by referencing this property.

SPWorkflowActivationProperties.Web.CurrentUser.Name has “System Account” as value as by design all custom Workflow instances (Implemented by Visual Studio 2005/2008) run under that account.

Next post: Setting Workflow related properties in MOSS/WSS 3.0 using stsadm.exe