cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Wait for item update OR time passed

Hi all

 

I am looking for the best way to wait for an item update OR for 7 days to have passed.

 

So in my scenario a task can be set to rejected (SP field = status) - but we want the workflow to allow for that task to be sent back & the workflow restarted again from the beginning, if someone sets the status back to 'lodged' within a 7 day period (of it being rejected).

 

What would be the smartest way of doing this?

 

Thanks

Labels: (1)
0 Kudos
Reply
3 Replies
Highlighted
Not applicable

Re: Wait for item update OR time passed

Sorry I should also say....if the time passes and the status is not set back to 'lodged' we want the workflow to end....

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Wait for item update OR time passed

Hi Tamina,

You can use loop to check the number of days that have passed. Create a number variable. Create a loop with condition untill variable =7. Inside a loop increment the value of this variable by 1 then pause for 1 day. Once pause completes, check the status, if Status="Lodged", set the variable = 7 (to exit the loop). If not, the loop will run again and increment this variable by 1 then pause for another day..so on.

I hope you are using State Machine in this workflow. If the Status is Lodged, then you can move to certain state at the beginning of the workflow, if stays rejected then you can end the workflow.

Hope this helps.

0 Kudos
Reply
Highlighted
Not applicable

Re: Wait for item update OR time passed

Thanks Kapil, that's a really good idea & sounds clever. Though Im still a little lost with the loops & what should go 'inside' them, how they exit....I finally managed to work out that they loop while the condition inside is 'true' (took me a while lol) but I don't understand how they also factor in other steps like your incremental variable and checking the status inside the loop. I guess that's when you drag other actions into the lower section of the loop?

As I couldn't find any videos or screen shots on how loops are best configured, so I ended up using a state machine inside a state machine...the first state machine runs through all the 'Status' options (from lodged through to rejected) and the inner/secondary state machine is doing the looping - checking the date (I have a variable 'today' that runs itself when the job is initially rejected, and a second one that adds 7 days to that date....I think!) and whether the status is updated...with a 30 minute pause between each loop (as the tasks in the list are high value and if sent back around we would want them picked up fairly quickly, while not having a standard 5 minute loop taxing the system).

Is this ok do you think? I understand state machines better than loops at the moment - Im all self taught so far and google/this forum/you tube have been my main guides. For the life of me I couldn't find anything to teach me the ins & outs of nintex loops and how to get the best from them - but the state machines seem to work like a breeze!

Let me know if my way was a bad idea - or if it could be improved

0 Kudos
Reply