Share via


PublicSchedulerType

Applies To: Operations Manager 2007 R2

PublicSchedulerType complex data type is used to define schedule data, usually in the context of data source module types that function as schedulers and output System.TriggerData data.

Schema Definition

<xsd:complexType name="PublicSchedulerType">
  <xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="1">
      <xsd:element name="SimpleReccuringSchedule">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Interval">
              <xsd:complexType>
                <xsd:simpleContent>
                  <xsd:extension base="xsd:int">
                    <xsd:attribute name="Unit" use="optional" default="Seconds" type="IntervalUnitsType"/>
                  </xsd:extension>
                </xsd:simpleContent>
              </xsd:complexType>
            </xsd:element>
            <xsd:choice minOccurs="0" maxOccurs="1">
              <xsd:element name="SyncTime" type="xsd:string"/>
              <xsd:element name="SpreadInitializationOverInterval">
                <xsd:complexType>
                  <xsd:simpleContent>
                    <xsd:extension base="xsd:int">
                      <xsd:attribute name="Unit" use="optional" default="Seconds">
                        <xsd:simpleType>
                          <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="Seconds"/>
                            <xsd:enumeration value="Minutes"/>
                            <xsd:enumeration value="Hours"/>
                            <xsd:enumeration value="Days"/>
                          </xsd:restriction>
                        </xsd:simpleType>
                      </xsd:attribute>
                    </xsd:extension>
                  </xsd:simpleContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="WeeklySchedule">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Windows">
              <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="unbounded">
                  <xsd:choice>
                    <xsd:element name="MultipleDays">
                      <xsd:complexType>
                        <xsd:sequence>
                          <xsd:element name="Start" type="xsd:string"/>
                          <xsd:element name="StartDayOfWeekMask" type="xsd:int"/>
                          <xsd:element name="End" type="xsd:string"/>
                          <xsd:element name="EndDayOfWeekMask" type="xsd:int"/>
                        </xsd:sequence>
                      </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="Daily">
                      <xsd:complexType>
                        <xsd:sequence>
                          <xsd:element name="Start" type="xsd:string"/>
                          <xsd:element name="End" type="xsd:string"/>
                          <xsd:element name="DaysOfWeekMask" type="xsd:int"/>
                        </xsd:sequence>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:choice>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:choice>
    <xsd:element name="ExcludeDates">
      <xsd:complexType>
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
          <xsd:element name="DayInterval">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="Start" type="xsd:string"/>
                <xsd:element name="End" type="xsd:string"/>
                <xsd:element name="Description" type="xsd:string"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:sequence>
</xsd:complexType>

Remarks

Simple Recurring Schedule

A simple schedule specifies a unit of time (seconds, by default) and a recurring interval to execute on. The scheduler outputs a data item the first time it is initialized (the first time the workflow loads, after the health service restarts, or after exiting maintenance mode) and then outputs data items at the specified frequency.

The following XML sample is a configuration for a simple recurring schedule that executes every 30 seconds:

<Scheduler>
  <SimpleRecurringSchedule>
    <Interval Unit="Seconds">30</Interval>
    <SyncTime/>
  </SimpleRecurringSchedule>
  <ExcludeDates/>
</Scheduler>

The Unit attribute is optional, and if it is excluded, the module would use seconds by default in the following example:

<Scheduler>
  <SimpleRecurringSchedule>
    <Interval>30</Interval>
    <SyncTime/>
  </SimpleReccuringSchedule>
  <ExcludeDates/>
</Scheduler>

The allowed values for the unit attributes are as follows:

  • Seconds

  • Minutes

  • Hours

  • Days

Simple Synchronized Recurring Schedule

The simple recurring schedule can be extended by adding a synchronization time. Specifying a synchronization time forces the module to output a data item at the specified time, and it executes on that frequency based on that synchronization point.

The following XML sample shows the module configured to run every 15 minutes and synchronize at 13:00. The synchronization time is specified by using a 24-hour format.

<Scheduler>
  <SimpleRecurringSchedule>
    <Interval Unit="Minutes">15</Interval>
    <SyncTime>13:00</SyncTime>
  </SimpleReccuringSchedule>
  <ExcludeDates/>
</Scheduler>

The module does not have to wait until the synchronization time for the first output. When it is initialized, the full schedule is calculated, and the module is output at the next closest time. For example, if the preceding configuration was used and the workflow was initialized at 12:16, the first data item would be output at 12:30 because this is on the required schedule.

Weekly Schedule

A weekly schedule can be used to trigger the data item output at specific times during the day. Multiple sets of trigger points can be added as required.

The following XML sample shows the module configured to execute at 1:00 on Monday:

<Scheduler>
  <WeeklySchedule>
    <Windows>
      <Daily>
        <Start>01:00</Start>
        <End>01:00</End>
        <DaysOfWeekMask>2</DaysOfWeekMask>
      </Daily>
    </Windows>
  </WeeklySchedule>
  <ExcludeDates/>
</Scheduler>

The DaysOfWeekMask element represents the days that the module should trigger output. A single day or multiple days can be specified according to the values listed in the following table.

Day Value

Sunday

1

Monday

2

Tuesday

4

Wednesday

8

Thursday

16

Friday

32

Saturday

64

To specify a single day, enter the enumerator value for that day directly into the DaysOfWeekMask configuration element.

To specify multiple days, add the enumerator values for the days together. For example, for Monday, Wednesday, and Friday, specify 42 (2+8+32).

You can specify multiple days and times to execute on by using the weekly schedule. Any number of daily elements can be added to the configuration.

The following XML sample shows a schedule that is configured to run once a day at 1:00 on Monday, Wednesday, and Friday, and at 3:00 on Tuesday and Thursday:

<Scheduler>
  <WeeklySchedule>
    <Windows>
      <Daily>
        <Start>01:00</Start>
        <End>01:00</End>
        <DaysOfWeekMask>42</DaysOfWeekMask>
      </Daily>
      <Daily>
        <Start>03:00</Start>
        <End>03:00</End>
        <DaysOfWeekMask>20</DaysOfWeekMask>
      </Daily>
    </Windows>
  </WeeklySchedule>
  <ExcludeDates/>
</Scheduler>

Excluding Specific Dates

You can exclude specific dates when you are using either the simple recurring schedule or the weekly schedule. Specify individual days by using the ExcludeDates configuration. You can add any number of date ranges, but a date range must be contiguous (for example, February 2 to February 4).

Do not specify the year when you enter the date. You can specify a single date by setting the start and end date to be the same date. Optionally, you can use the Description element to describe why the exclusion has been made. The supplied description is shown in the configuration user interface for the module.

The following XML sample shows a simple schedule with a single day (January 12) excluded:

<Scheduler>
  <SimpleReccuringSchedule>
    <Interval Unit="Minutes">15</Interval>
  </SimpleReccuringSchedule>
  <ExcludeDates>
    <DayInterval>
      <Start>01/12</Start>
      <End>01/12</End>
      <Description/>
    </DayInterval>
  </ExcludeDates>
</Scheduler>

The following XML sample is more complex, with multiple date ranges excluded and a weekly schedule set:

<Scheduler>
  <WeeklySchedule>
    <Windows>
      <Daily>
        <Start>14:00</Start>
        <End>14:00</End>
        <DaysOfWeekMask>42</DaysOfWeekMask>
      </Daily>
    </Windows>
  </WeeklySchedule>
  <ExcludeDates>
    <DayInterval>
      <Start>02/02</Start>
      <End>02/05</End>
      <Description />
    </DayInterval>
    <DayInterval>
      <Start>12/01</Start>
      <End>12/01</End>
      <Description />
    </DayInterval>
  </ExcludeDates>
</Scheduler>

Example

The following XML sample shows a rule that runs on a five-minute schedule and executes a script. The script logs an event to the Operations Manager event log on when the script completes.

<Rule ID="Microsoft.Samples.ExecuteTestScript" Enabled="true" Target="Microsoft.Samples.ApplicationX" >
  <Category>Custom</Category>
  <DataSources>
    <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
      <Scheduler>
        <SimpleReccuringSchedule>
          <Interval Unit="Minutes">5</Interval>
        </SimpleReccuringSchedule>
        <ExcludeDates/>
      </Scheduler>
    </DataSource>
  </DataSources>
  <WriteActions>
    <WriteAction ID="Script" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
      <ScriptName>Microsoft.Samples.LogOpsMgrEvent.vbs</ScriptName>
      <Arguments/>
      <ScriptBody>
        Option Explicit
        Dim OMAPI
        Set OMAPI = CreateObject("MOM.ScriptAPI")
        Call OMAPI.LogScriptEvent("Microsoft.Samples.LogOpsMgrEvent",101,0,"Script Executed")
      </ScriptBody>
      <TimeoutSeconds>30</TimeoutSeconds>
    </WriteAction>
  </WriteActions>
</Rule>

Information

   

Schema Type

System.ExpressionEvaluatorSchema

Library

System.Library