Ask a questionAsk a question
 

AnswerVery basic workflow cycles over and over and over

  • Tuesday, June 30, 2009 2:26 PMDave Pyett Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Afternoon all!

    I have created a very basic workflow that runs against a custom list when a item is changed.  This workflow is designed to finalise a change request through a column called Change Status (which cannot be edited by the end users):

    If 'Documented' = No
    Stop workflow and log to history
    Else
    Set Change Status to 'Completed'
    Email assignee with details
    Stop workflow and log to history.

    'Documented' is a simple drop down choice field with Yes|No as the options.

    When I edit an item and select Yes to the Documented field, the workflow kicks in and sends the email.  It then sends another email and another and another............until I manually delete the item by which time, I usually have a hundred or more emails sitting in my inbox.

    I would have thought with the lines (Stop workflow...) it would only ever send 1 email but this is not the case.

    Any ideas?  I'm probably missing something simple here.

    Using: WSS 3.0 and SharePoint Designer 2007
    SharePoint Administrator | SharePoint Fan http://davepyett.wordpress.com - Follow me on twitter: twitter.com/dpyett

Answers

  • Tuesday, June 30, 2009 9:16 PMStunpals Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Could you not set the WF to start on creation and then use the Action - Wait for Field to change on current item? You then set the value you are waiting for. This way the WF starts only one time and your user only gets 1 email.

    • Marked As Answer byDave Pyett Thursday, July 02, 2009 8:55 AM
    •  

All Replies

  • Tuesday, June 30, 2009 2:37 PMDavid Lozzi Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You should have another flag in there to signify you already sent the email. What is occuring is when you change the status to Completed, the workflow fires due to the change. And again, Documented is still == No so it fires again. Maybe do If document == no && status == completed.

    HTH
    David Lozzi
    Delphi Technology Solutions
    Blog  |  LinkedIn | Twitter
  • Tuesday, June 30, 2009 2:37 PMMike Walsh MVPMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is this is an SPD workflow, please say so somewhere.

    It's reasonable to assume this based on the fact that you have WSS 3.0 (which includes only one workflow type) and SPD 2007, but it would be good to have some confirmation of this.

    The Title doesn't say and everytime your write workflow in the text there is no "SPD" before it.


    (Moderator)

    WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
  • Tuesday, June 30, 2009 6:12 PMDavid Mann [MVP]MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is your wf kicking off whenever an item changes?  If so, you have a recursive loop initiated by changing the Status field
  • Tuesday, June 30, 2009 9:16 PMStunpals Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Could you not set the WF to start on creation and then use the Action - Wait for Field to change on current item? You then set the value you are waiting for. This way the WF starts only one time and your user only gets 1 email.

    • Marked As Answer byDave Pyett Thursday, July 02, 2009 8:55 AM
    •  
  • Thursday, July 02, 2009 8:56 AMDave Pyett Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks everyone for your suggestions!

    Indeed I was getting the recursive loop David spoke of a couple of posts earlier and I have marked Stunpals reply as the answer as using his method worked really well for me. 
    SharePoint Administrator | SharePoint Fan http://davepyett.wordpress.com - Follow me on twitter: twitter.com/dpyett