1 / 14

Event and Rule Model for ERF

Event and Rule Model for ERF. Architecture Group ERF Project CECORD. Contents. Computational models of rules and events Event model Event examples Rule model Rule example UML diagram of the rule model. Computational Model of Events and Rules. Event s

carnig
Download Presentation

Event and Rule Model for ERF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Event and Rule Model for ERF Architecture Group ERF Project CECORD

  2. Contents • Computational models of rules and events • Event model • Event examples • Rule model • Rule example • UML diagram of the rule model

  3. Computational Model of Events and Rules • Events • Representation of ocurrences of interest • e.g., Raise in water level • Defined by means of classes • Each event is treated as a distributed object

  4. Computational Model of Events and Rules (cont’d.) • Event set • All events are kept in a set • “Time to live” • Each event has a life time in the event set • Events might need to be alive for long periods of time • Method ts( ) – give the life time in the set, from its entrance to the set until the invocation of the method.

  5. Computational Model of Events and Rules (cont’d.) • ¿When is a rule triggered ? • Each rule is triggered when the following two conditions are satisfied: • there exist enough events in the set to satisfy the event expression • e.g.A rule that needs two types of events, E1 and E2, is triggered when two events e1 (of type E1) and e2 (of type E2) enter the set • no action or alternative action has been taken by the rule for those events

  6. Computational Model of Events and Rules (cont’d.) • ¿When is a rule triggered ?(cont’d.) • Event patterns • Simple • Occurrence of one event of a particular type triggers the rule • Composite events • Occurrence of varios events of different types triggers the rule if the pattern is satisfied • ¿How many times can a rule action or alternative action taken ? • Each time for each possible combination of events in the set that satisfy the event pattern

  7. Computational Model of Events and Rules (cont’d.) • An event dies when: • it is removed from the set by some client of the system, or • when its time to live (ttl) expires

  8. Event model (in Java) package erf; class Event extends DistributedObject { //event attributes private TimeStamp daytime; //event day-time (when it was produced) public int ttl; //time-to-live public Objectproducer; //who produced (posted) the event //event methods //constructor public Event(TimeStamp daytime, int ttl, Object producer); //return the time the event was produced public TimeStamp t( ); //return the time the event has in the event set public Integerts( ); //get the name of the class of event producer public String getProducerClass( ); //get producer object of the class DistributedObjectClass public Object getProducer( ); //return true if event is dead (time to live expired) public boolean isDead( ) //create a event public post( ); }

  9. Examples of events • ************************************** • // Class GageLevelReport definition • Class GageLevelReport extends Event • { • double level; //gage water level • int loc; //gage location • } • ************************************* • ************************************** • //Class StationReport definition • Class StationReport extends Event • { • double cfs; //water flow in cubic feets per second • int loc; //station location • } • **************************************

  10. Rule Model • Syntax of rule language [ package <package_spec>] rule <rule_id> [ priority <priority_no> ] on <trigger_events> [ use <usage_specification> ] [ if <condition> then <actions> [else <alt_actions>] ] [ do <actions>]

  11. Rule Model (cont’d.) • Syntax of the rule language (cont’d) • <rule_id> - rule’s unique identifier • <package_spec> - package structure to which the rule belongs • <priority_no> - rule priority • <trigger_events> - event expression • <usage_specification> - distributed objects used by the rule during its execution

  12. Modelo de reglas(cont.) • Syntax of the rule language (cont’d) • <condition> - conditional expression of the rule • <actions> - actions to take if the condition is true • < alt_actions> - actions to take if the condition is false

  13. Rule examples • RTFAS Project (A.A.A.) package AAA rule 3-1-4 priority 5 on GageLevelReport glr1 if glr1.level >  = level value for risk alert then PosibleRiskAlert.post (glr1.loc); package AAA rule 3-5-1 on GageLevelReport glr1 >> GageLevelReport glr2 if (glr2.t( ) – glr1.t( ) <= 15) && (glr2.level – glr1.level >= 0.75) && (glr2.loc == glr1.loc) then EventInProcess.post(glr1.loc);

  14. Rule examples (cont’d.) • RTFAS Project (A.A.A.) (cont’d.) package AAA rule 3-5-2 on {GageLevelReport [ (ts( ) <= 15) && ( level >= 0.50 && level <= 0.75) ] } S1 && {GageLevelReport [ ts( ) <= 15]} S2 if |S1| / |S2| > 0.5 then EventInProcess. Post( );

More Related