none
Stopping and restarting workflows when changes occur RRS feed

  • Question

  • Hello there,

    We are using Sharepoint 2010 with a task list that is sending out email notifications to the assigned user.  Essentially once a task is created we assign a due date, warning date, escalation date and are sending out email notifications once we time elapses to match the dates listed.

    Attached below is a partial extract of the workflow:

    IF Current Item: Status = Completed

    stop and log

    Else Pause Until Current Item: Due Date

    IF Current Item: Status = Completed

    stop and log

    then Email Current Item: Assigned To

    then Pause until Current Item: Escalation date

    The workflow repeats itself a few times by mirroring the logic above for warning, due date and escalation date which is working mostly fine unless you make changes.  The problem I’m running into is while the “Start Workflow automatically when an item is change is ticked”, if there are any changes to the due date the workflow uses the original dates and not the new changed dates if we have granted an extension for example. 

    What I am trying to achieve hopefully should not be too complex.  As if the dates do not change the full sequence is correct.  When a change occurs, I figure we need to essentially start again with the new dates.  I’m not exactly sure what to do in how to achieve this.    

    We have to grant extensions a bit and rarely we need to do a second extension for various reasons and would always like to use the most current dates rather than the original dates.  If anyone can help that would be much appreciated.

    Regards Shane.


     

     

    Thursday, December 3, 2015 3:20 AM

Answers

  • Sounds like you're talking about having the workflow keep checking the date to see if it's today, you can't do that either. That's still a looping workflow.

    cameron rautmann

    Monday, December 7, 2015 1:13 PM
  • "But I guess I've learned that you can't make changes to a workflow in progress." - You can using either OOB approval workflow or using another workflow which updates the due dates in the list. 

    Cameron is right for your latest question about if due date= today. 

    To check if Due Date = today, workflow has to be run everyday to calculate "today" field. Remember once the workflow is in progress all the values will remain the same as when the workflow started. For example if you start the workflow today which is 12/07/2015, workflow will have the "today" field to be 12/07/2015 tomorrow, day after that and so on.

    That being said, If you want to run the workflow everyday to check if Due Date= Today, start the workflow everyday by a timer job or task scheduler. There are many links on the internet. 

    Also if you liked the idea of OOB approval workflow, you can update the due date field of all the outstanding task at once. Try testing the approval workflow and remove all the emails you don't need and modify the email that gets sent out to the assignee and the remainder email.



    Monday, December 7, 2015 2:34 PM

All replies

  • Hi Scoricco- it sounds simple, but it's not. There's no way to make the first workflow stop and start a new one. Basically what you're asking to do is a continuous loop, which isn't possible. Also, you can't have two workflows running on the same item. What you're thinking is that a workflow will start on an item creation, then again on an item change. It can't happen on the same item, it's one or the other.

    cameron rautmann

    Thursday, December 3, 2015 4:11 PM
  • Howdy,

    What would you propose can be done then? 

    Thursday, December 3, 2015 11:06 PM
  • The only workaround I can think of is to have another list and copy the item to it. Then have another workflow on that list for changes to the date. Or use an alert on the item to notify users of changes. 


    cameron rautmann

    Friday, December 4, 2015 12:55 PM
  • I second Cameron. 

    You will not be able to update the Due Date for your workflow which is in progress already. 

    However if you use a approval workflow which creates a task for each assignee in Task list, you will be able to update the due date for the task list. Also with approval workflow upon task expiration, a reminder email will be automatically sent to the user. You can escalate the task to the assignee manager as well after few days with couple of lines of code.

    Please let us know if this works for you or if you need help in achieving this.

    Thanks



    • Edited by ViviSP Friday, December 4, 2015 3:13 PM
    Friday, December 4, 2015 3:13 PM
  • Hmm.  You would think that it would be pretty simple.  But I guess I've learned that you can't make changes to a workflow in progress.

    Would something like this work:

    Have the workflow check to see if Due date = today.  If so, continue.  If not, stop the workflow and send me an email.  Whilst I should be already aware of the change.  By me making a change to a stopped item should make it start it again from the beginning?

    Sunday, December 6, 2015 11:16 PM
  • Sounds like you're talking about having the workflow keep checking the date to see if it's today, you can't do that either. That's still a looping workflow.

    cameron rautmann

    Monday, December 7, 2015 1:13 PM
  • "But I guess I've learned that you can't make changes to a workflow in progress." - You can using either OOB approval workflow or using another workflow which updates the due dates in the list. 

    Cameron is right for your latest question about if due date= today. 

    To check if Due Date = today, workflow has to be run everyday to calculate "today" field. Remember once the workflow is in progress all the values will remain the same as when the workflow started. For example if you start the workflow today which is 12/07/2015, workflow will have the "today" field to be 12/07/2015 tomorrow, day after that and so on.

    That being said, If you want to run the workflow everyday to check if Due Date= Today, start the workflow everyday by a timer job or task scheduler. There are many links on the internet. 

    Also if you liked the idea of OOB approval workflow, you can update the due date field of all the outstanding task at once. Try testing the approval workflow and remove all the emails you don't need and modify the email that gets sent out to the assignee and the remainder email.



    Monday, December 7, 2015 2:34 PM