locked
Automatically complete overdue tasks RRS feed

  • Question

  • Dear all,

    I'm trying to build a workflow that automatically finishes an overdue Task after a reminder was sent to the task owner.

    I tried to accomplish this by using a “conditioned activity group”, which has one activity-sequence with an onTaskChanged event handler and a while loop in it and another sequence looping until the due date is reached. If the due date is reached, the Task field “percent completed” is changed to 100% correctly, however the onTaskChanged within the other sequence of the CAG is not fired. Because of this issue, the sequence in the CAG containing the onTaskChanged event, will not complete, which freezes the workflow.

    I tried changing the percent complete using an update Task activity, an “SPWorkflowTask.AlterTask” and many things more. Unfortunately, I was not able to solve this problem.

    Has anybody ideas regarding how this issue can be solved?

    Thanks in advance!

    manuel

     

    Wednesday, October 5, 2011 9:51 AM

Answers

  • Hi manuel,

    To achieve the requirement, I recommend you to use timer jobs in this situation, set the timer job to run at a specific time every day, loop through the tasks, if due date is reached, then modify the status to make the task completed.

    Here is article about how to create custom timer jobs in Windows SharePoint Services 3.0, you can refer to it for more information:
    http://msdn.microsoft.com/en-us/library/cc406686(v=office.12).aspx

    Thanks,
    Qiao


    Friday, October 7, 2011 10:10 AM
    Moderator
  • Hi,

    If you are using loop in workflow, workflow always in running state till it reaches the end point of workflow. I think Custom timer job suites your need.

    To perform any task on specific schedule sharepoint workflow is not the option. Sharepoint provides Timer Jobs.

    Timer jobs are scoped to webapplication level only.

    Please follow below links to implement custom timer job.

    http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx

    Tuesday, October 11, 2011 12:21 PM
  • Hi,

    thanks a lot for your replies. I already thought of using a separate timer job in order to solve this problem.

    In the end, however, I was able to solve this problem by using a Listen activity, surrounded by a while loop. One branch of this activity listener includes the OnTaskChanged event listener, the second one the delay activity.

    It seems to work really well.

    Yours,

    Manuel

     

     

    Tuesday, October 11, 2011 2:21 PM

All replies

  • Hi manuel,

    To achieve the requirement, I recommend you to use timer jobs in this situation, set the timer job to run at a specific time every day, loop through the tasks, if due date is reached, then modify the status to make the task completed.

    Here is article about how to create custom timer jobs in Windows SharePoint Services 3.0, you can refer to it for more information:
    http://msdn.microsoft.com/en-us/library/cc406686(v=office.12).aspx

    Thanks,
    Qiao


    Friday, October 7, 2011 10:10 AM
    Moderator
  • Hi,

    If you are using loop in workflow, workflow always in running state till it reaches the end point of workflow. I think Custom timer job suites your need.

    To perform any task on specific schedule sharepoint workflow is not the option. Sharepoint provides Timer Jobs.

    Timer jobs are scoped to webapplication level only.

    Please follow below links to implement custom timer job.

    http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx

    Tuesday, October 11, 2011 12:21 PM
  • Hi,

    thanks a lot for your replies. I already thought of using a separate timer job in order to solve this problem.

    In the end, however, I was able to solve this problem by using a Listen activity, surrounded by a while loop. One branch of this activity listener includes the OnTaskChanged event listener, the second one the delay activity.

    It seems to work really well.

    Yours,

    Manuel

     

     

    Tuesday, October 11, 2011 2:21 PM