| The case study down to the '~~~' line below was developed by Model Systems, Ltd., along with several | other organizations, and has been used by other organizations. That material | may be copied and used freely, if its source is clearly acknowledged. | EU-Rent is a ( fictitious ) car rental company with branches in several countries. It provides typical car rental services: | | * Different types of car are offered, organized into groups. All cars in a group are charged at the same rate | | * Cars may be rented by reservations made in advance, or by 'walk-in' customers on the day of rental | | * Cars are picked up from EU-Rent branches at the start of a rental, and may be returned to different branches. | | * Customers may join the EU-Rent loyalty club, and accumulate points that they can use to pay for rentals | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | This agent program prefills the details of a new reservation with the details of the last reservation by | the same customer. The details can be changed, then the reservation can be made | | If you are logged on as ''author'', the question menu shows the most useful sentences at the top. | | If you are logged on as ''user'', the question menu shows only the most useful sentences. | | Please email comments about this agent program, or about the IBL, to internet.business.logic@gmail.com EU-rent customer this-Cnumber this-name has rental this-Rnumber starting this-date1 this-time1 ending this-date2 this-time2 ================================================================================================================================ C34 Adrian Walker R1405 20030509 1000 20030511 1450 C34 Adrian Walker R1409 20030610 0800 20030611 1450 rental this-Rnumber is for a car this-group with pick up at this-branch1 and return at this-branch2 ============================================================================================================ R1405 group 3 branch 3 branch 3 R1409 group 3 branch 3 branch 3 EU-rent customer this-Cnumber this-name has loyalty club number this-Lnumber and holds this-Pnumber points =========================================================================================================== C33 Jane Watson L105 20 C34 Adrian Walker L119 5 C35 Fred Smith III L120 0 C36 Theo Walker L121 0 EU-rent customer this-Cnumber this-name at this-address this-postcode this-country has drivers licence this-DLnumber ============================================================================================================================== C33 Jane Watson 33 Zeegasse Zurich 12347 Switzerland ABC 463 C34 Adrian Walker PO Box 1412 Bristol CT 06011 USA CT 068293 C35 Fred Smith III 525 Main Street, Podunk, NJ 07276 USA H094832 C36 Theo Walker 55 Mills Street, Bristol, CT 06010 USA CT0495834 EU-rent has a location this-branch ================================== branch 1 branch 2 branch 3 branch 4 car this-car is currently owned by branch this-branch ===================================================== CAR101 branch 1 CAR103 branch 3 CAR102 branch 2 car this-car is in the group this-group ======================================= CAR101 group 1 CAR102 group 2 CAR103 group 3 EU-rent currently owns this-car =============================== CAR101 CAR102 CAR103 CAR105 for demo purposes the current date and time is this-date this-time ================================================================== 20030610 1345 rental number this-Rnumber is assigned this-car ============================================== EU-rent customer this-Cnumber this-name rental this-Rnumber was a bad experience: this-type =================================================================================================== C33 Adrian Walker R1453 car was damaged we have a business rule some-number requiring this-condition =================================================================== 1 each car is owned by one branch car some-car is in the group some-group -------------------------------------- EU-rent has a car group that-group rental number some-Rnumber is assigned some-car --------------------------------------------------- rental number that-Rnumber has a car assigned to it EU-rent currently owns some-car not : that-car is currently rented out car that-car is in the group some-group car that-car is currently owned by branch some-branch ----------------------------------------------------------------------------- car that-car in group that-group is currently available at branch that-branch for demo purposes the current date and time is some-date some-time EU-rent customer some-Cnumber some-name has rental some-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 that-date that-time is between that-date1 that-time1 and that-date2 that-time2 rental number that-Rnumber is assigned some-car --------------------------------------------------------------------------------------------------------------------------- that-car is currently rented out for demo purposes the current date and time is some-date some-time EU-rent customer some-Cnumber some-name has rental some-Rnumber starting that-date some-time1 ending some-date2 some-time2 not : rental number that-Rnumber has a car assigned to it rental that-Rnumber is for a car some-group with pick up at some-branch1 and return at some-branch2 car some-car in group that-group is currently available at branch that-branch1 add : rental number that-Rnumber is assigned that-car --------------------------------------------------------------------------------------------------------------------------- ASSIGN car that-car in group that-group to rental number that-Rnumber for customer that-Cnumber that-name some-date is between some-date1 and some-date2 some-time is between some-time1 and some-time2 ------------------------------------------------------------------------------ that-date that-time is between that-date1 that-time1 and that-date2 that-time2 some-number1 is less than or equal some-number that-number is less than or equal some-number2 ---------------------------------------------------- that-number is between that-number1 and that-number2 EU-rent customer some-Cnumber some-name rental some-Rnumber was a bad experience: this-type -------------------------------------------------------------------------------------------------- EU-rent has had a bad experience with customer that-Cnumber that-name EU-rent customer some-Cnumber some-name has rental some-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 -------------------------------------------------------------------------------------------------------------------------------- EU-rent customer that-Cnumber has a rental ending that-date2 that-time2 EU-rent customer some-Cnumber some-name has rental some-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 R followed by some-number = that-Rnumber --------------------------------------------------------------------------------------------------------------------------- EU-rent customer that-Cnumber that-name has rental that-number EU-rent customer some-Cnumber some-name has rental some-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 max some-number : EU-rent customer some-Cnumber some-name has rental some-number = some-max R followed by that-max = some-Rnumber --------------------------------------------------------------------------------------------------------------------------- the most recent rental by customer that-Cnumber that-name is rental number that-Rnumber the next available customer number is some-Cnumber the next available loyalty club number is some-Lnumber the next available rental number is some-Rnumber add : EU-rent customer that-Cnumber some-name at some-address some-postcode some-country has drivers licence some-DLnumber add : EU-rent customer that-Cnumber that-name has loyalty club number that-Lnumber and holds 0 points add : EU-rent customer that-Cnumber that-name has rental that-Rnumber starting date? time? ending date? time? add : rental that-Rnumber is for a car group? with pick up at branch? and return at branch? -------------------------------------------------------------------------------------------------------------------------- ADD NEW CUSTOMER that-name at that-address that-postcode that-country has drivers licence that-DLnumber EU-rent customer some-Cnumber some-name at some-address some-postcode some-country has drivers licence some-DLnumber EU-rent customer some-Cnumber some-name has loyalty club number some-Lnumber and holds some-Pnumber points del : EU-rent customer that-Cnumber some-name at some-address some-postcode some-country has drivers licence that-DLnumber del : EU-rent customer that-Cnumber that-name has loyalty club number that-Lnumber and holds that-Pnumber points -------------------------------------------------------------------------------------------------------------------------- REMOVE ALL RECORDS for CUSTOMER that-Cnumber the most recent rental by customer some-Cnumber some-name is rental number some-Rnumber EU-rent customer that-Cnumber that-name has rental that-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 rental that-Rnumber is for a car some-group with pick up at some-branch1 and return at some-branch2 del : EU-rent customer that-Cnumber that-name has rental that-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 del : rental that-Rnumber is for a car that-group with pick up at that-branch1 and return at that-branch2 --------------------------------------------------------------------------------------------------------------------------------- CANCEL LAST RESERVATION that-Cnumber that-name rental that-Rnumber car that-group pick up that-branch1 that-date1 that-time1 the most recent rental by customer some-Cnumber some-name is rental number some-Rnumber the next available rental number is some-NewRnumber add : EU-rent customer that-Cnumber that-name has rental that-NewRnumber starting some-date1 some-time1 ending some-date2 some-time2 add : rental that-NewRnumber is for a car that-group with pick up at that-branch1 and return at that-branch2 --------------------------------------------------------------------------------------------------------------------------------- MAKE RESERVATION that-Cnumber car that~group pick up that~branch1 that~date1 that~time1 return some~branch2 that~date2 that~time2 the most recent rental by customer some-Cnumber some-name is rental number some-Rnumber EU-rent customer that-Cnumber that-name has rental that-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 rental that-Rnumber is for a car some-group with pick up at some-branch1 and return at some-branch2 EU-rent customer some-Cnumber some-name at some-address some-postcode some-country has drivers licence some-DLnumber the next available rental number is some-NewRnumber add : EU-rent customer that-Cnumber that-name has rental that-NewRnumber starting some-date1 some-time1 ending some-date2 some-time2 add : rental that-NewRnumber is for a car that-group with pick up at that-branch1 and return at that-branch2 --------------------------------------------------------------------------------------------------------------------------------- MAKE RESERVATION that-Cnumber car that-group pick up that-branch1 that-date1 that-time1 return some-branch2 that-date2 that-time2 EU-rent customer some-Cnumber some-name at some-address some-postcode some-country has drivers licence some-DLnumber C followed by some-number = that-Cnumber ---------------------------------------------------------------------------------------------------------------------- EU-rent has a customer that-number EU-rent customer some-Cnumber some-name has rental some-Rnumber starting some-date1 some-time1 ending some-date2 some-time2 R followed by some-number = that-Rnumber --------------------------------------------------------------------------------------------------------------------------- there is a rental number that-number max some-number : there is a rental number that-number = some-max that-max + 1 = some-max1 R followed by that-max1 = some-Rnumber ------------------------------------------------------ the next available rental number is that-Rnumber EU-rent customer some-Cnumber some-name has loyalty club number some-Lnumber and holds some-Pnumber points L followed by some-number = that-Lnumber --------------------------------------------------------------------------------------------------------- EU-rent has a customer with loyalty club number that-number max some-number : EU-rent has a customer with loyalty club number some-number = some-max that-max + 1 = some-max1 L followed by that-max1 = some-Lnumber ------------------------------------------------------ the next available loyalty club number is that-Lnumber max some-number : EU-rent has a customer that-number = some-max that-max + 1 = some-max1 C followed by that-max1 = some-Cnumber --------------------------------------------------------------- the next available customer number is that-Cnumber we have a business rule 1 requiring some-condition EU-rent currently owns some-car not : that-car is currently owned by a branch --------------------------------------------------------------------- we are in noncompliance with business rule 1 requiring that-condition we have a business rule 1 requiring some-condition car some-car is currently owned by branch some-branch-1 car that-car is currently owned by branch some-branch-2 that-branch-1 is different from that-branch-2 --------------------------------------------------------------------- we are in noncompliance with business rule 1 requiring that-condition car some-car is currently owned by branch some-branch ----------------------------------------------------- that-car is currently owned by a branch EU-rent has a location some-branch-1 EU-rent has a location some-branch-2 not : that-branch-1 is equal that-branch-2 --------------------------------------------- that-branch-1 is different from that-branch-2