locked
Terminate Activity seems to start workflow over instead of terminate RRS feed

  • Question

  • I have a workflow that is doing some customized approval work as part of the workflow.  I have an IfElse checking after each approval to see if the document has been rejected.  If the document was rejected I have an Email Activity and a Terminate Activity inside the IfElse.

    When I reject a document the email gets sent out saying it was rejected and then im assuming the terminate activity seems to run and then restart the workflow.  I know this because I ran it through the debugger and it jumped back to the beginning of the workflow and the emails that are initially sent out got sent out again.

    I thought the terminate activity completely shut down the workflow?
    Monday, July 20, 2009 3:31 PM

Answers

  • Is this code-based?  What is your "terminate activity"?  In SPD, I use "stop workflow," and it stops the workflow.  If the workflow doesn't stop, then I put "log to history list" actions through the form to see what actions run and which don't.  If your workflow is set to run automatically on edit, then are you changing data in the list item itself with the workflow?  If so, that would cause it to re-run, in which case you have to put a check at the beginning to stop the workflow if it's repeating unnecessarily.
    SharePoint Architect || My Blog
    • Marked as answer by GreenWaterBoy Monday, July 20, 2009 4:46 PM
    Monday, July 20, 2009 4:39 PM

All replies

  • Is this code-based?  What is your "terminate activity"?  In SPD, I use "stop workflow," and it stops the workflow.  If the workflow doesn't stop, then I put "log to history list" actions through the form to see what actions run and which don't.  If your workflow is set to run automatically on edit, then are you changing data in the list item itself with the workflow?  If so, that would cause it to re-run, in which case you have to put a check at the beginning to stop the workflow if it's repeating unnecessarily.
    SharePoint Architect || My Blog
    • Marked as answer by GreenWaterBoy Monday, July 20, 2009 4:46 PM
    Monday, July 20, 2009 4:39 PM
  • Whoops I forgot to mention this is a Visual Studio 2008 project.  So I am using the terminate control/activity or whatever its called that is available in the toolbox.

    I am going to put code at the beginning to block the workflow from running more than once, I was just curious as to why the workflow would start over.

    edit - DOH! I unchecked start workflow when item is changed and now it works properly.  Thanks!
    Monday, July 20, 2009 4:42 PM