Unable to handle date change when pausing until date
質問
I need a workflow to assign a task on EndDate
. Initially I just tried this with a simple Pause until date
, but this cannot handle date changes (the rest of the workflow is not actioned if someone changes the date we are waiting until).
I followed this answer and ended up with this bit of workflow:
I can see that the end date really is being updated in my WorkFlow History
, and the workflow is recognising the new date:
However, when the new EndDate
arrives, I do not receive any emails and no tasks are assigned to me.
Why is this happening, and how can I handle a date change when pausing a workflow until some date?
解決
You might try logging the output of Current Item:EndTime
to the workflow history list. It may be that the comparison still holds true that Current Item:Endtime > Today
and so the loop is continuing.
You could wait and see if the task gets assigned once that comparison is false and you break out of the loop. Another option would be to set a boolean variable to test against instead of the date field. Then after the pause statement you could compare the Current Item:EndTime <= Today
and set the boolean variable to false which would cause you to fall out of the loop.