Reputation: 2247
I have two tasks in a qbo3 Workflow that need to be performed at least 18 hours apart, but only during business hours (8am to 5pm):
Can Step 2 above be configured to do this?
Upvotes: 0
Views: 21
Reputation: 2247
You should use a Polling Step
to do this. Polling steps run on a schedule, and evaluate data conditions until the condition is true. To meet your requirement:
Schedule
designed to run every hour between 8am and 5pmPolling Step
to see if 18 hours have passedFrom Configuration > Schedules
, create a new schedule:
Every Business Hour
Daily repeating 1 hour between 8am and 5pm
From Templates > Workflows
, select your workflow and choose Add a Polling Step
:
Wait 18 hours
Summary Data
format:dateDiff(//*[DecisionStep="Wait 18 hours"]/CreatedDate, "now", "h") >= 18
Every Business Hour
The key to this functionality is the format:dateDiff()
function, which is calculates the hours between the CreatedDate
of the Wait 18 hours
step and now
.
If we've passed the 18 hour mark, the Wait 18 hours
will be marked complete, and any steps dependent on the Wait 18 hours
step will be started.
If we've not yet passed the 18 hour mark, the Every Business Hour
schedule will queue the step to be evaluated again in an hour. If this hour happens to be after business hours, the schedule will advance the next run date to the following morning @ 8am.
Upvotes: 0