Enabling and Disabling Rules

Retired Content

This content and the technology described is outdated and is no longer being maintained. For more information, see Transient Fault Handling.

patterns & practices Developer Center

You can temporarily enable or disable a rule by setting the value of a rule's enabled attribute.

The following example shows a rule that is currently enabled. This rule will be evaluated the next time the rules evaluation process runs.

<rule name="Peak time" description="" rank="10" enabled="true">
  <timetable startTime="14:00:00" duration="00:10:00" 
             startDate="2011-08-15" utcOffset="-04:00">
    <relativeMonthly dayOfWeek="Monday" position="Last"/>
  </timetable>
  <actions>
    <range target="AutoScaling.DemoWebApp" min="3" max="5"/>
  </actions>
</rule>

The following example shows a rule that is currently disabled. This rule will not be evaluated the next time the rules evaluation process runs.

<rule name="Peak time" description="" rank="10" enabled="false">
  <timetable startTime="14:00:00" duration="00:10:00" 
             startDate="2011-08-15" utcOffset="-04:00">
    <relativeMonthly dayOfWeek="Monday" position="Last"/>
  </timetable>
  <actions>
    <range target="AutoScaling.DemoWebApp" min="3" max="5"/>
  </actions>
</rule>

You can change the enabled state of the rule while the Autoscaling Application Block is running by editing the rule definition in your rules store.

Next Topic | Previous Topic | Home

Last built: June 7, 2012