问题
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):
- Task A
- (pause for 18 hours)
- Task B
Can Step 2 above be configured to do this?
回答1:
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:
- Create a
Scheduledesigned to run every hour between 8am and 5pm - Create a
Polling Stepto see if 18 hours have passed
Creating the Schedule
From Configuration > Schedules, create a new schedule:
- Schedule:
Every Business Hour - Description:
Daily repeating 1 hour between 8am and 5pm
Create the Polling Step
From Templates > Workflows, select your workflow and choose Add a Polling Step:
- Step:
Wait 18 hours - With:
Summary Data - Logic:
format:dateDiff(//*[DecisionStep="Wait 18 hours"]/CreatedDate, "now", "h") >= 18 - Polling:
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.
来源:https://stackoverflow.com/questions/65136927/configure-a-qbo3-workflow-to-pause-for-18-hours