다음을 통해 공유


EventRule Element (ADF)

Provides the definition of a single subscription event rule.

구문

<SubscriptionClasses>
    <SubscriptionClass>
        ...
        <EventRules>
            <EventRule>

Element Characteristics

Characteristic Description

Data type

None.

Default value

None.

Occurrence

Required once or more per EventRules element.

Updates

Can be added and deleted when updating the application.

Element Relationships

Relationship Elements

Parent element

EventRules Element (ADF)

Child elements

RuleName Element for EventRule (ADF)

Action Element for EventRule (ADF)

OR

ConditionAction Element (ADF)

ActionTimeout Element for EventRule (ADF)

EventClassName Element for EventRule (ADF)

주의

An EventRule element can contain either an Action element or a ConditionAction element, not both.

The following example shows an EventRule element that uses an Action. The rule creates event-driven notifications, and also loads notification data into the StockSubscriptionChron table. It is executed whenever an event batch containing events of the StockEvents class is processed. This rule is permitted one minute to complete successfully.

<EventRule>
    <RuleName>StockSubscriptionEventRule</RuleName>
    <Action>
    -- Generate notifications from event and chronicle data
    INSERT INTO StockNotifications 
    ( SubscriberId, DeviceName, SubscriberLocale,
      StockSymbol, StockPrice )
    SELECT S.SubscriberId, S.DeviceName, 
        S.SubscriberLocale, E.StockSymbol, E.StockPrice
    FROM StockSubscriptions S JOIN StockEvents E
    ON S.StockSymbol = E.StockSymbol
    JOIN StockEventChron C
    ON S.StockSymbol = C.StockSymbol
    WHERE S.StockTriggerPrice &lt;= E.StockPrice
    AND S.StockTriggerPrice &gt; C.StockHighPrice
    -- Update subscription chronicle
    INSERT StockSubscriptionChron
      (SubscriberId, StockSymbol, StockPrice)
    SELECT S.SubscriberId, S.StockSymbol, E.StockPrice
    FROM StockSubscriptions S JOIN StockEvents E
    ON S.StockSymbol = E.StockSymbol
    </Action>
    <ActionTimeout>P0DT00H01M00S</ActionTimeout>
    <EventClassName>StockEvents</EventClassName>
</EventRule>

참고 항목

참조

Application Definition File Reference

관련 자료

이벤트 규칙 정의
인스턴스 및 응용 프로그램 업데이트

도움말 및 정보

SQL Server 2005 지원 받기