ScheduledRules Element (ADF)

Provides a location for all subscription scheduled rule definitions for one subscription class.

Syntax

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <ScheduledRules>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Optional once per SubscriptionClass element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

SubscriptionClass Element (ADF)

Child elements

ScheduledRule Element (ADF)

Remarks

The ScheduledRules element contains one or more scheduled rules for the subscription class. Scheduled rules contain the notification generation rules for scheduled subscriptions.

Example

The following example shows a ScheduledRules element with two scheduled rules. The first scheduled rule creates notifications and updates chronicle data. The second scheduled rule archives subscription information.

<ScheduledRules>
    <ScheduledRule>
        <RuleName>StockSubScheduledRule</RuleName>
        <Action>
        -- Generate Notifications
        INSERT INTO ScheduledNotifications
        ( SubscriberId, DeviceName, SubscriberLocale,
          StockSymbol, StockPrice )
        SELECT S.SubscriberId, S.DeviceName, 
            S.SubscriberLocale, C.StockSymbol, C.StockPrice
        FROM StockSubscriptions S JOIN StockEventChron C
        ON S.StockSymbol = C.StockSymbol 
        WHERE S.StockTriggerPrice &lt;= C.StockHighPrice 
        GROUP BY S.StockSymbol, C.StockHighPrice
        -- Maintain the subscription chronicle
        INSERT StockSubscriptionChron
        (SubscriberId, StockSymbol, StockPrice)
        SELECT S.SubscriberId, S.StockSymbol, C.StockHighPrice
        FROM StockSubscriptions S JOIN StockEventChron C
        ON S.StockSymbol = C.StockSymbol
        </Action>
        <ActionTimeout>P0DT00H00M45S</ActionTimeout>
    </ScheduledRule>
    <ScheduledRule>
        <RuleName>StockSubArchiveRule</RuleName>
        <Action>
        -- Maintain an archive table
        INSERT StockSubscriptionArchive
        (SubscriberId, StockSymbol, StockPrice, ArchiveDate)
        SELECT S.SubscriberId, S.StockSymbol, S.StockPrice, GETDATE()
        FROM StockSubscriptionsChron S
        </Action>
        <ActionTimeout>P0DT00H01M00S</ActionTimeout>
    </ScheduledRule>
</ScheduledRules> 

See Also

Reference

Application Definition File Reference

Other Resources

Defining Scheduled Rules
Updating Instances and Applications

Help and Information

Getting SQL Server 2005 Assistance