Policies in WSRR are administered using the Business Space
user interface. Policies can be added, edited, or removed at any time.
Policies are selected based on their PolicySelector property value
and governance state. Policies are valid if they are in the Approved,
Deprecated, or Superseded governance states, and policies in other
governance states are discarded during schedule validation. The Schedule
condition is the only condition that this pattern accepts, and the
routing action is the only action that is accepted by this pattern.
The PolicySelector property value
Policies
are identified in WSRR based on the PolicySelector property value.
The PolicySelector property is a customizable string. For example,
in the sample data provided with this pattern there are two policies,
each with a different PolicySelector value, GID007 and GID008.
Policies
with the same PolicySelector value are considered to be different
versions of the same policy. If multiple policies exist with the same
PolicySelector property value and matching date and time conditions,
the policy selected to use is based on the governance state of the
policy in the following order of precedence:
- Approved governance state
- Superseded governance state
- Deprecated governance state
Where multiple policies have the same PolicySelector value and
same valid governance state, the most recently updated policy is selected.
To
assign the PolicySelector value to a new policy, see Assigning the PolicySelector property for new policies.
The Schedule specification
The Schedule element
describes the schedule requirements for the days and times when the
policy is valid. Here is an example of the policy document schema
for the schedule specification:
<xs:element name="Schedule">
<xs:complexType>
<xs:sequence>
<xs:element name="Daily" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:attribute name="StartTime" type="xs:time" />
<xs:attribute name="StopTime" type="xs:time" />
</xs:complexType>
</xs:element>
<xs:element name="WeekDays" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:attribute name="Days" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="StartDate" type="xs:date" use="optional" />
<xs:attribute name="StopDate" type="xs:date" use="optional" />
</xs:complexType>
</xs:element>
The
Schedule element
is the root element of the schedule specification in the policy document.
If the schedule element is missing, the schedule starts immediately
and continues indefinitely so the policy always applies. If the
Schedule element
is present, the following elements are used for policy validation:
- Daily - Specifies the start time, specified in StartTime
attribute, and stop time, specified in the StopTime attribute, that
the policy applies. If the Daily element is not specified, the policy
applies all day beginning at midnight. If the stop time is before
or equal to the start time, the condition is considered to span midnight
and will still be valid until the stop time that the following morning,
even if the following day is entered as the stop date or is not one
of the valid WeekDays days.
- WeekDays - A String containing the days, from Sunday to
Saturday, that the policy can start to apply. The week days listed
specify the start time of the policy because schedules can run past
midnight. If the WeekDays element is not specified, the policy applies
every day of the week.
- StartDate - Specifies the date that the policy starts to
apply. The date is inclusive; for example, if today is the StartDate
date, the policy applies today. If the StartDate element is not specified,
the current day is used as the StartDate date.
- StopDate - Specifies the date that the policy stops applying.
This element contains the date up to which the policy applies. The
date is exclusive; for example, if today is the StopDate date, the
policy does not apply today. If the stop date is before the start
date, the policy never applies. If there is a StartDate element but
the StopDate element is not specified, the policy applies indefinitely
after the StartDate date.
For more information about policies that span midnight, see the
Policies
that span midnight
section.
Policies that span midnight
The policy spans
a midnight boundary if the policy StopTime time is earlier than, or
equal to, the StartTime time. This means that the policy still applies
until the stop time the following day, even if that day is equal to
the StopDate date or not one of the specified valid WeekDays days.
For example, if a schedule is set to start at 11 p.m. and to run for
2 hours on Wednesdays, the policy will effectively end on Thursday
at 1 a.m.
The following examples are some schedules that span
midnight:
- If a schedule contains <WeekDays Days="Monday"/> and <Daily
StartTime="22:00:00" StopTime="02:00:00"/>, this describes
one interval that starts on Monday night and ends on Tuesday morning
because Monday was specified as the day the policy starts to apply.
This will repeat weekly unless dates are specified.
- The following schedule applies for the last 2 hours of April 1,
and the first 2 hours of April 2 because the StartDate and StopDate
dates have specified that the policy starts on April 1 and stops on
April 2:
<Schedule StartDate="2012-04-01" StopDate="2012-04-02">
<Daily StartTime="22:00:00" StopTime="02:00:00"/>
</Schedule>