Presentation is loading. Please wait.

Presentation is loading. Please wait.

General Constraints and Event Condition Action Model

Similar presentations


Presentation on theme: "General Constraints and Event Condition Action Model"— Presentation transcript:

1 General Constraints and Event Condition Action Model
1/12/2019 See scm-intranet

2 Objectives To develop an understanding of integrity constraints.
To introduce the Event-Condition-Action Model 1/12/2019 See scm-intranet

3 Fundamental Constraints
The  following are basic integrity constraints which must be considered for a relational schema. Domains (Not) Null Participation conditions Primary keys Referential Integrity (these constraints are not discrete and are closely related to each other) 1/12/2019 See scm-intranet

4 General Constraints In addition there are typically a large number of other constraints. They are often called business rules, or general constraints. 1/12/2019 See scm-intranet

5 e.g. in the Flights example
The departure time at a stopover must be later than the arrival time at the stopover.  Each stopover arrival time must be later than the departure time at the previous stopover in the flight.  The departure time of a flight must be later than the arrival time of a flight.  Each stopover airport must be different from any other airport in the flight In the Doctors example- Dates_of_issue and consultation_dates for any patient must be greater than the date_of_birth. Any doctor must not issue more than 36 prescriptions in one day without authorization.  There must be a minimum of five minutes between each prescription issue.   At least one consultation must be with the patient’s registered doctor. 1/12/2019 See scm-intranet

6 Event-Condition-Action (ECA) Model
Event-database operation, external signal, recursive composition of other events. Condition-query issued on database Also Rules- When an event occurs evaluate all the rules that refer to this event. For each relevant rule evaluate the condition. If the condition is satisfied execute action. Action-user defined program 1/12/2019 See scm-intranet

7 Example: A transaction attempts to insert details of a flight that returns to a previous stopover airport-EVENT Each stopover airport must be different from any other airport in the flight –RULE/CONSTRAINT/CONDITION Reject insert operation, rollback transaction, raise error/exception details- ACTION 1/12/2019 See scm-intranet

8 Problems The model cannot predict 'transitive closure' of events as the logic of action is hidden in application programs. All consequences of an update cannot be predicted because the update itself may cause event(s) which trigger further actions…..which generate events that trigger actions etc…. There could be contradictory rules where there are large numbers and/or cpomplex rules. And the mutual effects of rules may not be predicted. However, this is the common model for implementation of constraints. 1/12/2019 See scm-intranet

9 Summary There are a large number of integrity constraints of different types in any domain of discourse A large proportion of these are ‘general constraints’ not expressed by the data model The implementation mechanism for ‘general constraints’ normally uses the ECA model 1/12/2019 See scm-intranet


Download ppt "General Constraints and Event Condition Action Model"

Similar presentations


Ads by Google