This is a sharepoint 2010 custom approval workflow... I am preventing unauthorised person from approving a task. The while activity checks for a flag (_isStateChanged). The flag is set to true inside onApprovalTaskChanged as shown below
private void onApprovalTaskChanged_Invoked(object sender, ExternalDataEventArgs e)
{
if ((onApprovalTaskChanged_AfterProperties.AssignedTo.Equals(e.Identity))
{
_isStateChanged = true;
}
}
Now when i try to approve the task with a user to whom the task was not assigned, the while activity is effectively preventing the remaining activities from getting executed(as required), but the task status is getting updated as 'Completed' with 0 %. How can i set it back to 'Not Started' status.