0

enter image description here

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.

1

I solved this issue in other way. When the task is created I setup an unique permission for this task like this:

HybridDictionary permsCollection = new HybridDictionary();
permsCollection.Add(taskProperties.AssignedTo, SPRoleType.Contributor);
createTask.SpecialPermissions = permsCollection;
  • thanks! let me try this, i have multiple sharepoint groups and these tasks are assigned to one these groups based on the flow. I assume your solution works in that case also... – Shankar Feb 2 '12 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.