Dependency on a date and time

About this task

While a flow may trigger at a particular time each day, or each week, you may want a work item within the flow to wait until after a specific time before it can run. For example, the flow Backup may run every night at midnight. However, within that flow, the job Report cannot be submitted until after 6:00 a.m. You can create a time event that tells Report to wait until 6:00 a.m. before it runs.

When you specify a time event for a job within a flow, that job will run once, when the combination of the date and time is true. Even if the flow is still active the next time that date and time combination is true, the time event triggers the job only once.

You can create the following types of dependencies using time events:

  • You can specify a date and time when you want the job to run

  • You can specify a particular frequency, such as daily, weekly or monthly, or at every nth interval, such as every 2 days, every 3 weeks or every 6 months

  • You can specify a particular day of the week or month of the year

  • You can combine calendar expressions to create complex scheduling criteria

    When you create a time event, you point to a particular calendar, which defines the date component of the time event. To use a calendar, that calendar must first be defined.

Procedure

  1. Change to time dependency mode by clicking the Insert Time Event button.
  2. Click in the workspace where you want to insert the time event. The Event Definition dialog box appears.
  3. In the Calendar name field, specify the calendar that resolves to the dates on which you want this job to run.
  4. In the Time zone section, specify the time zone for this time event.
    Note: You can find a list of valid time zone IDs in JS_HOME/JS_VERSION/resources/timezones.properties.
  5. In the Hours and Minutes fields, specify an expression that resolves to the time or times when you want the job to start running. Be sure to specify the time as it appears on a 24-hour clock, where valid values for hours are from 0 to 23.
    Note:

    Do not a time between 2:00 a.m. and 3:00 a.m. on the day that daylight savings time begins (the second Sunday in March), as the flow will not run and any subflows that are scheduled to start after this flow will also not run.

    This is because the 2:00 a.m. to 3:00 a.m. hour is removed to start daylight savings time in North America.

  6. In the Duration of event field, specify the length of time in minutes for which you want this event to be valid. This value, when added to the trigger time of the event, is the time by which this job must be submitted. After this time expires, the job will not be submitted. For example, if a job must run after 5 p.m. but cannot be submitted after 6 p.m., specify 17: 00 in the Time field, and 60 minutes in the Duration of event field.
    Tip:

    If you want to prevent a job from running after a particular time, and the job has a dependency on another event, ensure you use an AND link to combine the two events, not an OR link.

  7. Optional. In the End after ... occurrences field, specify the maximum number of occurrences of this time event before you want it to end.
  8. In the Description field, add any descriptive text that may be helpful for understanding this event. For example, if this event requires special instructions for operations staff, place those instructions here.
  9. Click OK. The time event appears in the workspace, and you can draw the appropriate dependency lines to the job or jobs that are depending on this time.
    Note:

    You can change the text of the label that appears above the file event in the workspace if the label text is too long.