How are StartTimeRange and EndTimeRange used in the Remedy Business Time command Application-Bus-Time2-Assoc-Get-Next-Window?
In the Application-Bus-Time2-Assoc-Get-Next-Window command, the StartTimeRange and EndTimeRange specify the times to look for a potential window start time. So, if the command locates a window of sufficient duration that starts between StartTimeRange and EndTimeRange, it will select that window. The window does not have to end before the EndTimeRange, it just has to start before then.
Usage for this command is:
Application-Bus-Time2-Assoc-Get-Next-Window “<StartTimeRange>” “<EndTimeRange>” “<Duration>” “<WindowFlag>” [“<BusinessTimeSegmentName1>” “<BusinessTimeSegmentName2>” . . . [-e "EntityID1" "EntityID2" . . . ]]
So, for example, if the command is used for a with a time segment that spans 6 hours between 6 am and noon on Saturday. If the StartTimeRange is Saturday at 4 am and the EndTimeRange is 10 am and the duration is 6 hours, the command will look for a 6 hour window that starts between 4 am and 10 am. The first (and only) window it will find in the time segment specified is the one that starts at 6 am. This will give it a 6 hour window in the time segment specified (6 am to 12 pm), even if that window ends after the EndTimeRange. It satisfies the command because it start between the times specified.
But if the StartTimeRange is Saturday at 8 am and the EndTimeRange is 2 pm, the command will not be able to find a 6 hour window that starts between 8 am and 2 pm. That's because there is only four hours left of the associated time segment (between 8 am and noon).
The following log snippets show using the using the command as in the examples above.
In the first case it finds a window start time
<ACTL> Process: Application-Bus-Time2-Assoc-Get-Next-Window "1249196400" "1249225200" 28800 0 "ID0050569A648C7-ptSgTGDDSwtHcL" <ACTL> zWindowStartTime (536870920) = 1249210800
In the second case it does not.
<ACTL> Process: Application-Bus-Time2-Assoc-Get-Next-Window "1249225200" "1249250400" 25200 0 "ID0050569A648C7-ptSgTGDDSwtHcL" <ACTL> zWindowStartTime (536870920) = ""