Pause According to the Current Time
Set up a pause task to temporarily stop an orchestration process from running according to the time on the system clock.
If the current time is.
-
Before 1:10:10 PM. Pause all fulfillment lines until 1:10:10 PM of the current day, then release them.
-
On or after 1:10:10 PM. Pause all fulfillment lines until 1:10:10 PM of the next day, then release them.
Here's the rule.
Note
Code |
Description |
---|---|
|
Declare the Header variable, then store attributes of the order header that the orchestration process is currently processing into this variable. |
|
Declare the |
|
Create a new variable named SAC and set it to the SacResult type in the DooSeededOrchestrationRules method. |
|
Set the value of the sacResult object on the order header to the value that SAC contains. |
|
Specify the type of pause as a timer. |
|
Declare the |
|
Set the hours of the Note that the rule uses a 24 hour clock. |
|
Set the minutes of the |
|
Set the seconds of the
|
|
Store the value of the |
|
If the value in the |
|
set the value of The getAdjustedDate function adds the value of the
second parameter as the number of days to the first parameter, which
is |
|
Store the value of the |
Let's consider an example. Assume the current time is 12:00:00, noon.
Code |
Example Value |
---|---|
|
Timestamp equals 12:00:00, using format HH:MM:SS on a 24 hour clock.
|
|
|
|
|
|
|
|
|
|
waitDateTime equals 13:10:10. |
|
The rule doesn't proceed to the Then clause of this If statement. Instead, the rule pauses all fulfillment lines until 13:10:10 PM of the current day, then releases them. |
Assume the current time is 14:00:00, or 2 PM.
Code |
Example Value |
---|---|
|
Timestamp equals 14:00:00, using format HH:MM:SS on a 24 hour clock.
|
|
|
|
|
|
|
|
|
|
waitDateTime equals 13:10:10. |
|
The rule proceeds to the Then clause of this If statement. |
|
|
|
waitDateTime equals 13:10:10 plus 1 day. The rule pauses all fulfillment lines until 13:10:10 PM of the next day, then releases them. |