OsCommerce - Universitat Politècnica de Catalunya (UPC)

Transcription

OsCommerce - Universitat Politècnica de Catalunya (UPC)
OsCommerce
CONCEPTUAL SCHEMA
Albert Tort Pugibet
Universitat Politècnica de Catalunya (UPC)
esquemaconceptual
OsCommerce
[ ÍNDEX ]
1
2
SCHEMA PRESENTATION...............................................................2
1.1
THE osCommerce SYSTEM ...................................................................................2
1.2
THE osCommerce CONCEPTUAL SCHEMA .........................................................2
STRUCTURAL SCHEMA ..................................................................4
2.1
INTRODUCTION .....................................................................................................4
2.2
OVERVIEW DIAGRAM ...........................................................................................5
2.3
MAIN DOMAIN CONCEPTS ...................................................................................6
2.4
STORE CONFIGURATION .....................................................................................7
Store Data ...............................................................................................................7
Minimum and maximum values .............................................................................10
Customer details configuration ..............................................................................12
Shipping and Packaging configuration ..................................................................13
Download configuration .........................................................................................14
Stock configuration ................................................................................................15
Payment methods..................................................................................................16
Shipping methods ..................................................................................................18
Languages.............................................................................................................20
Currencies .............................................................................................................22
Location & Taxes ...................................................................................................24
2.5
STORE ADMINISTRATION...................................................................................28
Products ................................................................................................................28
Product attributes and options ...............................................................................32
Product categories.................................................................................................35
Specials .................................................................................................................38
Manufacturers........................................................................................................40
Banners .................................................................................................................42
Newsletters ............................................................................................................45
2.6
CUSTOMERS........................................................................................................48
Customers .............................................................................................................48
2.7
ONLINE CATALOG ...............................................................................................52
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
Reviews .................................................................................................................52
Shopping carts.......................................................................................................54
Orders....................................................................................................................58
3
BEHAVIORAL SCHEMA .................................................................66
3.1
INTRODUCTION ...................................................................................................66
3.2
USE CASE DIAGRAM...........................................................................................66
3.3
USE CASE SPECIFICATION ................................................................................72
Change store data .................................................................................................72
Assign minimum values .........................................................................................73
Assign maximum values ........................................................................................73
Change shown customer details ...........................................................................74
Assign shipping and packaging configuration values ............................................74
Change download configuration values.................................................................75
Change stock configuration values........................................................................75
Install a payment method ......................................................................................76
Uninstall a payment method ..................................................................................77
Change payment method values ...........................................................................77
Install a shipping method .......................................................................................78
Uninstall a shipping method ..................................................................................79
Change shipping method values ...........................................................................79
Add a language .....................................................................................................80
Edit a language......................................................................................................80
Delete a language .................................................................................................81
Set the default language........................................................................................81
Add a currency ......................................................................................................82
Edit a currency.......................................................................................................82
Delete a currency ..................................................................................................82
Update currencies .................................................................................................83
Set the default currency.........................................................................................83
Add a country ........................................................................................................84
Edit a country.........................................................................................................84
Delete a country ....................................................................................................84
Add a zone ............................................................................................................85
Edit a zone.............................................................................................................85
Delete a zone ........................................................................................................86
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
Add a tax zone.......................................................................................................86
Edit a tax zone .......................................................................................................86
Delete a tax zone...................................................................................................87
Add a tax class ......................................................................................................87
Edit a tax class ......................................................................................................87
Delete a tax class ..................................................................................................88
Add a tax rate ........................................................................................................88
Edit a tax rate ........................................................................................................89
Delete a tax rate ....................................................................................................89
Add a product ........................................................................................................89
Add a product option .............................................................................................90
Edit a product option..............................................................................................91
Delete a product option .........................................................................................91
Add a product option value ....................................................................................91
Edit a product option value ....................................................................................92
Delete a product option value ................................................................................92
Add a product attribute ..........................................................................................93
Edit a product attribute ..........................................................................................93
Delete a product attribute ......................................................................................94
Edit a product ........................................................................................................94
Delete a product ....................................................................................................95
Move a product......................................................................................................95
Link a product ........................................................................................................96
Add a product category .........................................................................................96
Edit a product category..........................................................................................96
Move a product category .......................................................................................97
Delete a product category .....................................................................................97
Add a special .........................................................................................................98
Edit a special .........................................................................................................98
Delete a special .....................................................................................................98
Add a manufacturer ...............................................................................................99
Edit a manufacturer ...............................................................................................99
Delete a manufacturer .........................................................................................100
Add a banner .......................................................................................................100
Edit a banner .......................................................................................................100
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
Delete a banner ...................................................................................................101
Add a banner group .............................................................................................101
Edit a banner group .............................................................................................102
Delete a banner group .........................................................................................102
Send an email......................................................................................................102
Create a newsletter .............................................................................................103
Edit a newsletter ..................................................................................................103
Delete a newsletter..............................................................................................104
Lock a newsletter.................................................................................................104
Unlock a newsletter .............................................................................................104
Send a newsletter................................................................................................105
Create a customer ...............................................................................................105
Change password................................................................................................106
Change customer details .....................................................................................106
Administrate address book ..................................................................................106
Administrate subscriptions...................................................................................107
Edit a customer....................................................................................................108
Delete a customer ...............................................................................................108
Open session.......................................................................................................109
Finish session ......................................................................................................109
Log in...................................................................................................................110
LogOut.................................................................................................................110
Change the current language ..............................................................................111
Change the current currency ...............................................................................111
Add a review ........................................................................................................111
Edit a review ........................................................................................................112
Delete a review ....................................................................................................112
Place an order .....................................................................................................113
Cancel an order ...................................................................................................114
Add an order status .............................................................................................115
Edit an order status .............................................................................................115
Delete an order status .........................................................................................116
Change the status of an order .............................................................................116
Set cancelled order status ...................................................................................117
Set default order status .......................................................................................117
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
Show a banner ....................................................................................................117
Click a banner......................................................................................................118
Read a review......................................................................................................118
Download a product.............................................................................................118
Show manufacturer’s web ...................................................................................119
Show products under stock .................................................................................119
Show expected products .....................................................................................119
Show orders of a customer..................................................................................120
Show previous orders ..........................................................................................120
Show best viewed products .................................................................................120
Show best products purchased ...........................................................................121
Show customer’s orders total ..............................................................................121
Online customers.................................................................................................121
Show specials......................................................................................................122
Show products of a category ...............................................................................122
Show products of a manufacturer........................................................................122
Show new products .............................................................................................123
Show reviews of a product ..................................................................................123
Tell to a friend......................................................................................................123
Generate an invoice ............................................................................................124
Generate a packaging slip ...................................................................................124
3.4
EVENTS SPECIFICATION..................................................................................125
AddProductToShoppingCart................................................................................125
AddressBookEntriesMaximumChange ................................................................126
AllowCheckoutStockConfigurationChange ..........................................................127
AllowGuestToTellAFriendChange .......................................................................127
AttributeChange...................................................................................................128
CancelOrder ........................................................................................................128
CheckLevelStockConfigurationChange ...............................................................129
CityMinimumChange ...........................................................................................129
ClickBanner .........................................................................................................130
ClickManufacturer................................................................................................130
CompanyCustomerDetailChange ........................................................................131
CompanyNameMinimumChange.........................................................................131
CountryChange ...................................................................................................132
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
CountryShippingConfigurationChange ................................................................132
CreditCardNumberMinimumChange ...................................................................133
CreditCardOwnerNameMinimumChange ............................................................133
CurrencyStatusChange .......................................................................................134
CustomerStatusChange ......................................................................................134
DateOfBirthCustomerDetailChange.....................................................................135
DateOfBirthMinimumChange...............................................................................135
DaysExpiryDelayDownloadConfigurationChange ...............................................136
DefaultSearchOperatorChange ...........................................................................136
DeleteBanner.......................................................................................................137
DeleteBannerGroup.............................................................................................137
DeleteCategory....................................................................................................138
DeleteCountry......................................................................................................139
DeleteCurrency....................................................................................................140
DeleteCustomer...................................................................................................140
DeleteCustomerAddress .....................................................................................141
DeleteLanguage ..................................................................................................142
DeleteManufacturer .............................................................................................142
DeleteNewsletter .................................................................................................143
DeleteOrderStatus ...............................................................................................144
DeleteProduct ......................................................................................................145
DeleteProductAttribute ........................................................................................145
DeleteProductNotificationSubscription ................................................................146
DeleteProductOption ...........................................................................................146
DeleteProductOptionValue ..................................................................................147
DeleteReview ......................................................................................................148
DeleteSession .....................................................................................................148
DeleteSpecial ......................................................................................................149
DeleteTaxClass ...................................................................................................149
DeleteTaxRate.....................................................................................................150
DeleteTaxZone ....................................................................................................151
DeleteZone ..........................................................................................................151
DisplayCartAfterAddingProductChange ..............................................................152
DisplayPricesWithTaxChange .............................................................................152
EditAuthorizeNetPaymentMethod........................................................................153
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
EditBanner...........................................................................................................154
EditBannerGroup .................................................................................................155
EditCashOnDeliveryPaymentMethod ..................................................................155
EditCategory ........................................................................................................156
EditCheckMoneyPaymentMethod .......................................................................157
EditCountry ..........................................................................................................158
EditCreditCardPaymentMethod ...........................................................................158
EditCurrency ........................................................................................................159
EditCustomer.......................................................................................................160
EditCustomerAddress..........................................................................................161
EditCustomerDetails ............................................................................................163
EditDownloadableAttribute ..................................................................................164
EditFlatRateShippingMethod ...............................................................................165
EditGlobalNotifications ........................................................................................166
EditIPaymentPaymentMethod .............................................................................166
EditLanguage ......................................................................................................167
EditManufacturer .................................................................................................168
EditNewsletter .....................................................................................................169
EditNochexPaymentMethod ................................................................................169
EditOrderStatus ...................................................................................................170
EditPayPalPaymentMethod .................................................................................171
EditPerItemShippingMethod ................................................................................172
EditProduct ..........................................................................................................173
EditProductNotification ........................................................................................174
EditProductOption ...............................................................................................174
EditProductOptionValue ......................................................................................175
EditPSiGatePaymentMethod ...............................................................................176
EditReview...........................................................................................................177
EditSECPaymentMethod .....................................................................................178
EditSpecial...........................................................................................................179
EditTableRateShippingMethod ............................................................................180
EditTaxClass .......................................................................................................181
EditTaxRate .........................................................................................................181
EditTaxZone ........................................................................................................182
EditTwoCheckOutPaymentMethod......................................................................183
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
EditUSPostalServiceShippingMethod..................................................................184
EditZone ..............................................................................................................185
EditZoneRatesShippingMethod ...........................................................................185
EMailAddressChange ..........................................................................................186
EMailAddressMinimumChange ...........................................................................187
EMailFromChange...............................................................................................187
EnableDownloadConfigurationChange ...............................................................188
ExpectedSortFieldChange...................................................................................188
ExpectedSortOrderChange .................................................................................189
FirstNameMinimumChange .................................................................................189
GenderCustomerDetailChange ...........................................................................190
IncrementAndSignAttributeChange .....................................................................190
InstallAuthorizeNetPaymentMethod ....................................................................191
InstallCashOnDeliveryPaymentMethod ...............................................................191
InstallCheckMoneyPaymentMethod ....................................................................192
InstallCreditCardPaymentMethod........................................................................192
InstallFlatRateShippingMethod............................................................................193
InstallIPaymentPaymentMethod ..........................................................................194
InstallNochexPaymentMethod .............................................................................194
InstallPayPalPaymentMethod..............................................................................195
InstallPerItemShippingMethod.............................................................................195
InstallPSiGatePaymentMethod............................................................................196
InstallSECPaymentMethod..................................................................................197
InstallTableRateShippingMethod.........................................................................197
InstallTwoCheckOutPaymentMethod ..................................................................198
InstallUSPostalServiceShippingMethod ..............................................................198
InstallZoneRatesShippingMethod........................................................................199
LastNameMinimumChange .................................................................................200
LinkProduct..........................................................................................................200
LockNewsletter ....................................................................................................201
LogIn....................................................................................................................201
LogOut.................................................................................................................202
NameChange ......................................................................................................203
MaximumNumberDownloadConfigurationChange ..............................................203
MaximumPackageWeightShippingConfigurationChange ....................................204
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
MoveCategory .....................................................................................................204
MoveProduct .......................................................................................................205
NewBanner ..........................................................................................................205
NewBannerGroup ................................................................................................206
NewCategory .......................................................................................................207
NewCountry.........................................................................................................208
NewCurrency .......................................................................................................209
NewCustomer ......................................................................................................210
NewCustomerAddress.........................................................................................212
NewDownloadableProductAttribute .....................................................................214
NewLanguage .....................................................................................................215
NewManufacturer ................................................................................................216
NewNewsletter ....................................................................................................217
NewOrderStatus ..................................................................................................217
NewProduct .........................................................................................................218
NewProductAttribute............................................................................................219
NewProductNotification .......................................................................................220
NewProductNotificationSubscription ...................................................................221
NewProductOption ..............................................................................................222
NewProductOptionValue .....................................................................................223
NewReview..........................................................................................................224
NewSession.........................................................................................................224
NewSpecial..........................................................................................................225
NewTaxClass ......................................................................................................225
NewTaxRate ........................................................................................................226
NewTaxZone .......................................................................................................227
NewZone .............................................................................................................228
OrderConfirmation ...............................................................................................229
OwnerChange .....................................................................................................231
PasswordChange ................................................................................................231
PasswordMinimumChange..................................................................................232
PercentageIncreaseForLargerPackagesShippingConfigurationChange .............232
PostCodeMinimumChange..................................................................................233
PostCodeShippingConfigurationChange .............................................................233
PrimaryCustomerAddressChange .......................................................................234
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
ProductAttributeStatusChange ............................................................................235
ProductDownload ................................................................................................235
ProductOptionAttributeChange............................................................................237
ProductOptionValueAttributeChange ..................................................................237
ProductStatusChange .........................................................................................238
ReadProductInfo..................................................................................................238
ReadReview ........................................................................................................239
ReorderLevelStockConfigurationChange ............................................................239
RestorePreviousShoppingCart ............................................................................240
ReviewTextMinimumChange...............................................................................241
SendExtraOrderEmailChange .............................................................................241
SendNewsletter ...................................................................................................242
SetCancelledOrderStatus ....................................................................................242
SetCurrentCurrency.............................................................................................243
SetCurrentLanguage ...........................................................................................243
SetDefaultCurrency .............................................................................................244
SetDefaultLanguage ............................................................................................245
SetDefaultOrderStatus ........................................................................................245
ShowBanner ........................................................................................................246
ShowBestPurchasedProducts .............................................................................246
ShowBestViewedProducts ..................................................................................247
ShowCustomersOrdersTotal ...............................................................................247
ShowExpectedProducts ......................................................................................248
ShowNewProducts ..............................................................................................249
ShowOnlineCustomers ........................................................................................249
ShowOrdersOfCustomer .....................................................................................250
ShowProductsOfCategory ...................................................................................251
ShowProductsOfManufacturer ............................................................................252
ShowReviewsOfProduct ......................................................................................253
ShowSpecials ......................................................................................................253
ShowUnderStockProducts...................................................................................254
StateCustomerDetailChange ...............................................................................255
StateMinimumChange .........................................................................................255
StatusPaymentMethodChange............................................................................256
StatusShippingMethodChange ............................................................................256
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
esquemaconceptual
OsCommerce
StoreAddressAndPhoneChange .........................................................................257
StreetAddressMinimumChange...........................................................................257
SubstractStockConfigurationChange ..................................................................258
SuburbCustomerDetailChange............................................................................258
SwitchToDefaultLanguageCurrencyChange .......................................................259
TaxDecimalPlacesChange ..................................................................................259
TelephoneMinimumChange ................................................................................260
TypicalPackageTareWeightShippingConfigurationChange.................................260
UnInstallAuthorizeNetPaymentMethod................................................................261
UninstallCashOnDeliveryPaymentMethod...........................................................261
UninstallCheckMoneyPaymentMethod................................................................262
UninstallCreditCartPaymentMethod ....................................................................262
UninstallIPaymentPaymentMethod......................................................................263
UninstallNochexPaymentMethod.........................................................................264
UninstallPayPalPaymentMethod .........................................................................264
UninstallPerItemPaymentMethod ........................................................................265
UninstallPSiGatePaymentMethod .......................................................................265
UninstallSECPaymentMethod .............................................................................266
UninstallTableRatePaymentMethod ....................................................................267
UninstallTwoCheckOutPaymentMethod ..............................................................267
UninstallUSPostalServicePaymentMethod..........................................................268
UninstallZoneRatesShippingMethod ...................................................................268
UninstallFlatRateShippingMethod .......................................................................269
UnlockNewsletter.................................................................................................270
UpdateCurrencyValueChange.............................................................................270
UpdateOrderStatus..............................................................................................271
UpdateShoppingCart ...........................................................................................272
ZoneChange ........................................................................................................273
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
ÍNDEX
SCHEMA
PRESENTATION
conceptualschema
1
OsCommerce
1 SCHEMA PRESENTATION
1.1 THE osCommerce SYSTEM
E-commerce allows people exchanging goods and services with no barriers of time or
distance. Surfing the net, you can easily find online shops where you can buy almost
anything you need, at any time and without leaving home.
Electronic commerce changes the way of business operate. Nowadays, it is possible to start
a 24 hours opened online store with lower costs than traditional establishments. The idea of
small local shops has no sense for e-commerce: online stores are international accessible
since they start operating.
osCommerce is an e-commerce solution available as free software under the GNU General
Public License. osCommerce project was started in March 2000 in Germany and since then,
it has become the base of thousands of online stores around the world.
1.2 THE osCommerce CONCEPTUAL SCHEMA
The main purpose of this work is giving a conceptual schema of the osCommerce system as
a result of a reverse engineering process. This conceptual schema is specified using
standard UML and OCL with some extensions to improve expressivity.
The osCommerce conceptual schema is shown in chapters 2 and 3. It has been made up
using the public documentation of the system (sometimes limited and imprecise),
experimenting as a user with the current version and analysing the database schema.
We publish this work and we make it accessible for the community. It can be a
complementary documentation of the system and a detailed specification of its knowledge
and behaviour. It can be useful for engineers who are going to develop online stores based
on osCommerce and for everyone interested on it.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
2
STRUCTURAL
SCHEMA
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2 STRUCTURAL SCHEMA
2.1 INTRODUCTION
In this chapter we develop the structural schema of the osCommerce information system.
The main purpose of the osCommerce structural schema is providing a description of the
conceptualization of the osCommerce domain.
The structural schema is too large to be presented without partitioning it. For that reason, this
chapter begins with an UML general view diagram with the most important conceptual entity
types and their relationship types.
Afterwards, the whole schema is structured in several more detailed diagrams in order to
make it more understandable. Each diagram corresponds to a part of the whole detailed
schema and groups some related concepts which can be seen as a set of knowledge about
the information system.
Entities which participate in relationships of a structural schema fragment but are full
specified in other conceptual grouping diagrams are drawn without showing their attributes.
Moreover, these “external” entities have a reference which links them to the page where its
complete specification can be found.
Each fragment of the whole structural schema diagram is represented in UML and it is
introduced by a brief textual overview. Derived types and integrity constraints are specified in
OCL. The structural schema specification uses standard UML with some extensions
(specification of derived types and constraints by OCL operations, constant and permanent
stereotypes…) explained in Conceptual Modeling of Information Systems [Oli07] written by
Antoni Olivé.
In addition, a detailed description about the schema fragment and example instantiations of
it, improve comprehension. Some of the example instantiations are inspired from real online
shops based on osCommerce which can be found in the osCommerce website
(www.oscommerce.com). Others are made up from real life experiences.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
4
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.2 OVERVIEW DIAGRAM
The next diagram represents a simplified conceptual schema which gives an overview of the
main concepts in the osCommerce domain. More details about each concept are given in the
next section, where the whole schema is fully specified.
Category
*
Manufacturer
0..1
ProductAttribute
Option
*
*
Review
*
*
Product
1
*
*
*
Attribute
*
1
*
0..1
TaxClass
Value
*
*
OrderLine
1
*
OrderLineAttribute
1
Customer
1..*
1
PaymentMethod
*
1
Order
*
ShippingMethod
*
0..1
*
1
1
1..*
Currency
Zone
1
0..1
*
*
1
Address
*
1
*
1
0..1
Session
*
1
Country
Language
0..1
0..1
ShoppingCart
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
Newsletter
Banner
5
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.3 MAIN DOMAIN CONCEPTS
The products in the store are manufactured by manufacturers, are grouped into categories
and belong to a tax class. Moreover, customers can write reviews of a product.
osCommerce is a multilingual system able to deal with any number of languages. Likewise,
osCommerce allows working with different tax classes and currencies.
Products may have attributes. An attribute is an option/value pair which is used to offer
multiple varieties of a product without needing to create many separate but very similar
products. The price of a product is increased or decreased depending on the chosen
attributes. The price variation produced by an attribute is indicated, for each product, by
product attribute entity types.
Customers have one or more addresses. Each address is located in a country. If the
country has zones (states or provinces) then the address must be located in one of its
zones.
Every use of the online store is conceptually represented by a session. Sessions can be
anonymous or belong to a customer. Moreover, every session has always a current currency
and a current language.
In the context of sessions, users can surfing the online store. Shopping carts contain one or
more selected items (not shown in the figure) each of which is a quantity of a product with a
set of attributes.
When a customer confirms that he wants to buy the contents of his shopping cart the system
generates an order. An order is made by a customer using a payment method.
Furthermore, order prices are expressed in a specified currency and take into account the
shipping costs, according to the chosen shipping method.
An order contains one or more order lines, each of which is a quantity of a product with a
set of attributes.
Finally, osCommerce offers some administration tools like banners, used to customize the
online advertisements in the store, and newsletters, used to send information by email to
customers.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
6
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.4 STORE CONFIGURATION
Store Data
„
Overview
osCommerce keeps general data about the store and some other information which is used
to customize the behaviour of the system.
„
Conceptual Diagram
Store
{<<Constant>>}
Languages 20
Language 1
*
defaultLanguage
Currency
1
defaultCurrency
*
Currencies 22
name : String [0..1]
owner : String [0..1]
eMailAddress : EMail [0..1]
eMailFrom : EMail [0..1]
expectedSortOrder : SortOrder
expectedSortField : SortField
sendExtraOrderEMail : NameEMail [*]
displayCartAfterAddingProduct : Boolean
allowGuestToTellAFriend : Boolean
defaultSearchOperator : Operator
storeAddressAndPhone : String [0..1]
taxDecimalPlaces : Natural
displayPricesWithTax : Boolean
switchToDefaultLanguageCurrency : Boolean
*
*
1 defaultStatus
1
cancelledStatus
OrderStatus
Orders 58
<<enumeration>>
<<enumeration>>
<<enumeration>>
SortOrder
Operator
SortField
ascending
descending
and
or
productName
expectedDate
<<dataType>>
<<dataType>>
NameEMail
EMail
name : String
eMail : EMail
eMail : String
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
7
Location & Taxes 24
0..1
1
Country
1
*
0..1
0..1
Zone
Location & Taxes 24
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Constraints
„
[1] There is only one instance of Store
context Store::alwaysOneInstance: Boolean
body : Store.allInstances() -> size() = 1
[2] The store’s zone is part of the country where the store is located.
context Store::zoneIsPartOfCountry: Boolean
body : self.zone -> notEmpty() implies self.country.zone -> includes (self.zone)
Description
„
There is only one instance of Store which is created and initialized on installation. It stores
the general data of the store and some other customizable properties:
•
Name: The store’s name.
•
Owner: The store owner’s name.
•
Email address: The store’s email address.
•
Email from: The email address used to send emails.
•
Country: The country where the store is located.
•
Zone: The state, zone or province where the store is located.
•
Expected sort order: Specifies how products are listed, either in ascending or
descending order.
•
Expected sort field: Specifies which field is used to sort products.
•
Send extra order e-mail: This is a set of NameEmail entities. It stores the email
addresses where orders will be received. There can be several email addresses for
backups.
•
Display cart after adding a product: Specifies whether the shopping cart will be
shown automatically by the system after adding a product.
•
Allow guest to tell a friend: Specifies whether users can send an e-mail to a friend
with information about the store.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
8
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
•
Default search operator: Specifies which operator is used in searches.
•
Store address and phone: The store owner’s name, phone, and other public
information that will be shown to customers.
•
Tax decimal places: Sets how many decimal places are used in taxes.
•
Display prices with tax: Indicates whether prices are shown with taxes or not.
•
Switch to default language currency: Specifies whether the system automatically
changes the currency when the language is changed.
„
•
Default language: Specifies the language used by default.
•
Default currency: Specifies the currency used by default.
•
Cancelled status: The OrderStatus used to indicate that an order is cancelled.
•
Default status: The OrderStatus assigned when an order is created.
Example
Gaudisc is a classical music online shop based on osCommerce. This is a possible
instantiation of Store for this shop:
gaudisc : Store
spanish : Language
defaultLanguage
euro : Currency
defaultCurrency
cancelado : OrderStatus
cancelledStatus
pendiente : OrderStatus
name = "Gaudisc"
eMailAddress = "[email protected]"
eMailFrom = "[email protected]"
expectedSortField = productName
expectedSortOrder = ascending
sendExtraOrderEMail = "[email protected],
[email protected]"
displayCartAfterAddingProduct = true
allowGuestToTellAFriend = true
defaultSearchOperator = or
storeAddressAndPhone = " C/Historiador Mayans, 7
08026 Barcelona
Tel.934 355 441 "
taxDecimalPlaces = "2"
displayPricesWithTax = false
switchToDefaultLanguageCurrency = false
defaultStatus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
9
spain : Country
barcelona : Zone
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Minimum and maximum values
Overview
„
osCommerce allows defining the minimum and maximum length for some String attributes.
Structural Schema
„
<<utility>>
MinimumValues
firstName : PositiveInteger
lastName : PositiveInteger
dateOfBirth : PositiveInteger
eMailAddress : PositiveInteger
streetAddress : PositiveInteger
companyName : Natural
postCode : PositiveInteger
city : PositiveInteger
state : PositiveInteger
telephoneNumber : PositiveInteger
password : PositiveInteger
creditCardOwnerName : PositiveInteger
creditCardNumber : PositiveInteger
reviewText : Natural
<<utility>>
MaximumValues
addressBookEntries : Natural
Description
„
MinimumValues sets the minimum length of the following customer attributes:
•
First name
•
Last Name
•
Date of birth
•
Email From
•
Street address
•
Company
•
City and postal code
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
10
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
•
State
•
Telephone number
•
Password
•
Owner’s credit card name
•
Credit card number
Moreover, MinimumValues specifies the minimum length of:
•
Product reviews text
Finally, MaximumValues specifies the maximum number of:
•
Address book entries permitted for each customer.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
11
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Customer details configuration
Overview
„
The system allows specifying whether some customer attributes are shown and required
when creating, editing or showing an account.
Structural Schema
„
<<utility>>
CustomerDetails
gender : Boolean
dateOfBirth : Boolean
company : Boolean
suburb : Boolean
state : Boolean
Description
„
CustomersDetails allows configuring whether the following customer attributes are shown or
not:
•
Gender
•
Date of birth
•
Company name
•
Suburb
•
State
Customer attributes which are not shown, are not required when creating or editing an
account, even if they are mandatory customer attributes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
12
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Shipping and Packaging configuration
„
Overview
The system allows setting up some configuration values used in shipping costs calculation.
„
Structural Schema
<<utility>>
ShippingAndPackaging
postCode : PostalCode [0..1]
maximumPackageWeight : Decimal
typicalPackageTareWeight : Decimal
percentageIncreaseForLargerPackages : Decimal
Location & Taxes 24
0..1
1
Country
countryOfOrigin
<<dataType>>
PostalCode
postalCode : String
„
Constraints
[1] The package tare weight must be less than the maximum package weight.
context ShippingAndPackaging::tareIsLessThanMaximumWeight: Boolean
body : self.typicalPackageTareWeight < self.maximumPackageWeight
„
Description
The postal code and the country of origin are used for the system to calculate shipping
quotes in some shipping methods.
Maximum package weight is the maximum weight permitted for a single package.
Package tare weight is the typical weight of shipping box and packing material and it is
added to the weight of products when computing postage. Larger packages increase their
weight as indicated in the percentage increase for larger packages attribute instead of
using the typical package tare weight.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
13
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Download configuration
Overview
„
The system allows customizing the most important general downloadable product properties.
Structural Schema
„
<<utility>>
Download
enableDownload : Boolean
daysExpiryDelay : Natural
maximumNumberOfDownloads : Natural
Description
„
There is a special type of product Option which allows customers downloading it.
The general properties of downloadable products can be customized setting up the following
attributes:
• Enable download: Determines whether it is possible to download products.
•
Expiry delay: Specifies the maximum number of days the downloadable file of a
product will be available.
•
Maximum number of downloads: Sets the maximum number of times the customer
will be able to download the same product.
These values are used as default when creating a downloadable product attribute, although it
can be redefined then.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
14
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Stock configuration
„
Overview
The system allows configuring some options about the stock administration.
„
Structural Schema
<<utility>>
Stock
checkStockLevel : Boolean
substractStock : Boolean
allowCheckout : Boolean
stockReOrderLevel : Natural
„
Description
Checking the stock level can be enabled or disabled by changing the value of check stock
level attribute.
Moreover, it is possible to indicate whether the system has to decrease the stock when a
product is purchased, setting up the attribute subtract stock.
The store owner can allow customers checking out products even if there is insufficient stock
by activating the Boolean attribute allow checkout.
Finally, the attribute stock reorder level specifies the minimum inventory that indicates the
stock needs to be reordered.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
15
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Payment methods
„
Overview
The system allows operating with different payment methods.
„
Structural Schema
Orders 58
Location & Taxes 24
PaymentMethod
OrderStatus 0..1
*
*
status : Status
0..1
TaxZone
Currencies 22
AuthorizeNet
Nochex
CashOnDelivery
CheckMoney
CreditCard
splitCreditCardToMail : EMail
<<enumeration>>
makePayableTo : String
*
Currency
TwoCheckOut
PSiGate
SECPay
IPayment
PayPal
login : String
mode : TransactionMode
merchantNotification : Boolean
merchantID : String
mode : PSiGateMode
type : PSiGateType
creditCardCollection : PSiGateCollection
merchantID : String
mode : SECPayMode
account : Natural
user : String
password : String
eMail : EMail
<<enumeration>>
<<enumeration>>
<<enumeration>>
<<enumeration>>
TransactionMode
TransactionMethod
PSiGateMode
PSiGateType
PSiGateCollection
SECPayMode
test
production
creditCard
eCheck
production
alwaysGood
alwaysDuplicate
alwaysDecline
„
*
eMail : EMail
username : String
key : String
mode : TransactionMode
method : TransactionMethod
notification : Boolean
<<enumeration>>
SpecificCurrencyPaymentMethod
sale
preAuth
postAuth
local
remote
alwaysSuccessful
alwaysFail
production
<<enumeration>>
Status
enabled
disabled
Constraints
[1] There is at least one enabled payment method
context PaymentMethod::AtLeastOneEnabled: Boolean
body : PaymentMethod.allInstances() -> select (pm | pm.status=Status::enabled) -> size() >= 1
„
Description
The system allows customers paying through different payment methods, which can be
enabled or disabled by the store administrator.
Some of the payment methods, like Authorize.net, iPayment, Nochex, PayPal, 2Checkout,
PSiGate or SECPay, involve an external company for credit card processing.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
16
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
There are also a few methods that simply store information for off-line processing.
There are also modules available for handling cash, money order and check payments,
which do not involve an external merchant.
Therefore, all the payment methods have specific information about all the necessary data to
process the payment.
If the payment method has an associated TaxZone, it is only enabled in zones included in
the specified TaxZone.
If the payment method specifies an OrderStatus, the status of the orders paid through it, is
automatically setup to this status.
In addition, some payment methods have a set of associated currencies. In this case,
payment methods are only enabled for operating with these currencies.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
17
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Shipping methods
„
Overview
The system allows operating with different shipping methods.
„
Structural Schema
Location & Taxes 24
*
ShippingMethod
0..1
TaxClass
status : Status
Location & Taxes 24
ZoneRates
TaxZone 0..1
*
SpecificZoneMethod
items : ShippingTableItem [*]
HandlingFeeMethod
handlingFee : Money
*
*
Country
Location & Taxes 24
<<dataType>>
ShippingTableItem
FlatRate
cost : Money
cost : Money
<<dataType>>
TableRate
USPostalService
items : ShippingTableItem [*]
method : ShippingTableMethod
<<enumeration>>
Money
number : Natural
cost : Money
„
PerItem
userID : String
password : String
server : USPSServer
<<enumeration>>
USPSServer
Status
test
production
enabled
disabled
<<enumeration>>
ShippingTableMethod
weight
price
Constraints
[1] There is at least one enabled shipping method.
context ShippingMethod::AtLeastOneEnabled: Boolean
body : ShippingMethod.allInstances() -> select (sm | sm.enabled) -> size() >= 1
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
18
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Description
„
osCommerce allows customizing shipping methods which are available at checkout time.
During the checkout process, the chosen method is used to calculate the final shipping and
packaging costs for the order.
Depending on the selected method, the price can be affected by how many products have
been ordered, how much they weight or other criteria:
•
Flat rate: A single price is used on all orders, regardless of how many items are bought,
how much everything weights, etc…
•
Per Item: A single price is multiplied by the number of items in the customer’s basket. A
flat handling cost may also be added.
•
Table Rate: Table rate charging sets the price for shipping based on the total weight or
the total cost of the products ordered. The weight or price is looked up in a table to find
the matching range, and then that price is applied. This is similar to Flat Rate charging,
but with different levels.
•
United Parcel Service (UPS): The UPS shipping method interacts with the UPS
website to calculate the total price.
•
United States Postal Service (USPS): The USPS shipping method interacts with the
USPS website to calculate the total price.
•
Zone Rates: Zone rates shipping method is similar to Table Rate method. The total
weight of the customer's order is looked up in a table, and that price is used as the
shipping cost.
If the shipping method has an associated TaxClass, it will be applied in the shipping cost.
Specific zone methods can have an associated TaxZone. In this case, the payment method
is only applicable in zones included in the specified TaxZone.
Similarly, the associated countries for Zone Rates method represents the countries where
it is applicable.
Finally, like payment methods, shipping methods can be enabled or disabled as desired.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
19
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Languages
„
Overview
osCommerce is a multilingual system able to deal with any number of languages.
„
Structural Schema
Currencies 22
Language
name : String
code : String
image : File [0..1]
directory : String
sortOrder : Natural
„
*
0..1
defaultCurrency
Currency
Constraints
[1] A language is identified by its name and by its code
context Language::codeAndNameAreUnique: Boolean
body : Language.allInstances() -> isUnique(name) and Language.allInstances() -> isUnique(code)
„
Description
Languages can be added or deleted as desired and are identified by a name and a code.
The directory indicates to the system the name of the directory which contains its
configuration files.
Languages are listed taking into account the sort order number.
A language can have an image, which is used to identify it visually.
Moreover, languages can have a default currency.
If the Store attribute SwitchToDefaultLangaugeCurrency is true, when a language becomes
the current language, its default currency becomes the current currency.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
20
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
„
Examples
l1 : Language
l2 : Language
l3 : Language
l4 : Language
name = "English"
code = "EN"
name = "Deutsch"
code = "DE"
name = "Español"
code = "ES"
name = "Català"
code = "CAT"
defaultCurrency
defaultCurrency
dollar : Currency
euro : Currency
defaultCurrency
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
defaultCurrency
21
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Currencies
„
Overview
osCommerce allows working with different currencies.
„
Structural Schema
Currency
title : String
code : String
symbolLeft : String [0..1]
symbolRight : String [0..1]
decimalPlaces : Natural
value : Decimal
lastUpdate : DateTime [0..1]
status : Status
<<enumeration>>
Status
enabled
disabled
„
Constraints
[1] A currency is identified by its title and by its code.
context Currency::codeAndTitleAreUnique: Boolean
body :
Currency.allInstances() -> isUnique(title) and
Currency.allInstances() -> isUnique(code)
„
Description
Currencies can be added or deleted as desired by the store owner and are identified by a
title and a code. The product's price is multiplied by the attribute value in order to allowing
conversion between currencies.
For example, if the value of Euros is 1.0000 and the value of Dollars is 1.3286, we can
assume that product prices are saved by the system in Euros.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
22
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
If the current currency is changed to Dollars, all the prices will be multiplied by 1.3286 in
order to be expressed in Dollars.
Finally, the status of a currency indicates if the online store can currently operate with it.
„
Examples
osCommerce, by default, allows dealing with two different currencies: Euros and U.S.
Dollars. This is the instantiation of these currencies:
c1 : Currency
c2 : Currency
title = "Euro"
code = "EUR"
decimalPlaces = "2"
value = "1.0000"
symbolRight = "€"
title = "U.S.Dollar"
code = "USD"
decimalPlaces = "2"
symbolLeft = "$"
value = "1.3286"
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
23
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Location & Taxes
„
Overview
In order to supply a flexible use of taxes, product prices are stored tax free. This allows
calculating the final price of products depending on the customer's location and the tax class
applied to it.
„
Structural Schema
Country
Products 28
TaxClass
name : String
isoCode2 : String
isoCode3 : String
name : String
description : String [0..1]
rate : Natural
priority : Natural
description [0..1]
*
*
Zone
„
Product
*
TaxRate
*
1
name : String
code : String
0..1
TaxZone
*
*
name : String
description : String [0..1]
Constraints
[1] A Country is identified either by its name or its ISO codes.
context Country::nameAndCodesAreUnique: Boolean
body :
Country.allInstances() -> isUnique (name) and
Country.allInstances() -> isUnique (isoCode2) and
Country.allInstances() -> isUnique (isoCode3)
[2] A Zone is identified either by its name and country or its code and country.
context Zone::nameAndCountryAndCodeAndCountryAreUnique: Boolean
body :
Zone.allInstances() -> isUnique (Tuple{n:name, c:country}) and
Zone.allInstances() -> isUnique (Tuple{n:code, c:country})
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
24
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[3] A TaxZone is identified by its name.
context TaxZone::nameIsUnique: Boolean
body : TaxZone.allInstances() -> isUnique (name)
[4] A TaxClass is identified by its name
context TaxClass::nameIsUnique: Boolean
body : TaxClass.allInstances() -> isUnique (name)
„
Description
The final price of products is calculated depending on the customer's location and the tax
class applied to a product. In order to be a customizable solution, osCommerce allows
setting up different types of taxes and different tax zones where they can be applied.
Tax Classes identify a particular type of tax.
Tax Zones are required to calculate the appropriate tax rate value based on where the
purchase is coming from and group Zones with the same tax regulation.
Tax Rates specify the tax percentage that is used in a Tax Zone for a TaxClass.
Priorities play an important role in a Tax Class as they state how multiple tax rates in the
same class are treated; either adding each rate together when the priorities are the same, or
compounding the rates together in the defining priority order.
„
Examples
The Value Added Tax (VAT) in the European Union is a general and indirect consumption
tax assessed on the value added to goods and services. Actually, rates are applied vary
between Member States and between certain types of products.
In Spain, for example, there are three types of VAT: general VAT (16%), reduced VAT (7%)
and super-reduced VAT (4%).
The following instantiation allows dealing with the three types of VAT for a Spanish online
store:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
25
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
esptz : TaxZone
name = "Spain"
z1 : Zone
z2 : Zone
name = "Barcelona"
name = "Tarragona"
z3 : Zone
z4 : Zone
name = "Lleida"
name = "Girona"
z5 : Zone
z7 : Zone
name = "Albacete"
name = "Sevilla"
tr1 : TaxRate
priority = "1"
rate = "16%"
description = "VAT 16%"
esptz : TaxZone
tc1 : TaxClass
name = "Spain"
name = "General products"
tr2 : TaxRate
description = "VAT 7%"
priority = "1"
rate = "7%"
tc2 : TaxClass
name = "Reduced products"
tr3 : TaxRate
description = "IVA 4%"
priority = "1"
rate = "4"
tc3 : TaxClass
name = "Super-reduced
products"
Otherwise, customers located in Quebec must pay a federal tax rate of 7% and a
compounded local tax rate of 7.5%.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
26
...
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Note that for a product bought in Quebec, you should pay a 7% and 7.5% compounded tax.
That is, you should add to your product’s price a 15,025% of taxes (1.075 x 0.07 + 0.075 =
0.15025).
The following instantiation allows dealing with Canadian Federal Tax and Quebec Local Tax:
cantz : TaxZone
name = "Canadian
Federal Tax Zone"
z2 : Zone
...
name = "Newfoundland"
z3 : Zone
name = "Ontario"
z4 : Zone
name = "Quebec"
z5 : Zone
name = " Yukon Territory "
quetz : TaxZone
name = "Quebec
Local Tax Zone"
tr1 : TaxRate
priority = "1"
rate = "7%"
description = "Federal Tax 7%"
cantz : TaxZone
tc1 : TaxClass
name = "Canadian
Federal Tax Zone"
name = "Canadian Federal Tax"
tr2 : TaxRate
priority = "2"
rate = "7.5%"
description = "Local Tax 7.5%"
quetz : TaxZone
tc2 : TaxClass
name = "Quebec
Local Tax Zone"
name = "Quebec Local Tax"
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
27
...
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.5 STORE ADMINISTRATION
Products
„
Overview
The system must know the information about the products offered by the online store.
„
Structural Schema
Product
status : ProductStatus
available : DateTime [0..1]
netPrice : Money
/specialNetPrice [0..1]
/grossPrice : Money
quantityOnHand : Integer
/quantityOrdered : Natural
model : String [0..1]
imagePath : String [0..1]
weight : Decimal {<<constant>>}
/added : DateTime
/lastModified : DateTime [0..1]
*
0..1
*
*
Category
Product categories 35
*
*
Language
Languages 20
Manufacturer
ProductInLanguage
name : String
description : String [0..1]
url : URL [0..1]
viewed : Natural
<<enumeration>>
<<dataType>>
<<dataType>>
ProductStatus
Money
URL
inStock
outOfStock
„
Operations
context Product def:
addTaxes(z:Zone, basePrice:Money) : Money =
let appliedTaxRates:Set(TaxRate)=
z.taxZone.taxRate -> select (tr | tr.taxClass = self.taxClass)
in
let priorities:Set(Natural) =
if appliedTaxRate -> isEmpty() then set{}
else appliedTaxRates -> sortedBy(priority).priority -> asSet()
endif
in
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
28
Manufacturers 40
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
if priorities -> isEmpty() then basePrice
else priorities -> iterate (p:Natural; res:Money = 0 |
res +
(((appliedTaxRates -> select (tr | tr.priority = p).rate
-> sum()) / 100)+1)*basePrice)
endif
Derivation Rules
„
[1] Product::grossPrice is the product’s netPrice taking into account the applied taxes.
context Product::grossPrice(): Money
body : self.addTaxes(Store.allInstances() -> any(true).zone, self.netPrice)
[2] Product::specialNetPrice is the special price, if the product is an active special.
context Product::specialNetPrice(): Money
body :
if self.oclIsTypeOf(Special) then
if self.oclAsType(Special).specialStatus=Status::enabled and
self.oclAsType(Special).expiryDate < Now()
then self.oclAsType(Special).specialPrice
else set{}
endif
else set{}
endif
[3] Product::added is the DateTime of product creation.
context Product::added(): DateTime
body : Now()
Constraints
„
[1] A product is identified by a name in a language.
context Language::nameIsUnique(): Boolean
body : self.productInLanguage -> isUnique(name)
Description
„
OsCommerce saves the following information about products:
•
Status: Indicates whether the product is either in stock or out of stock.
•
Available: The date since the product will be available.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
29
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
•
Net price: The product's price without taxes.
•
Gross price: The product's price taking into account the taxes applied in the zone of
the store. Derived attribute.
•
Special net price: If the product has an active special offer, the current product price is
the special price. Otherwise, this attribute is empty. Derived attribute.
•
Quantity on hand: The product’s quantity in stock.
•
Quantity ordered: This attribute is updated by the system and keeps how many
products have been sold.
•
Model: An additional information field for products. It can be used, for example, for
specifying the product model number.
•
Image path: Every product can be associated to an image, which is located in the file
indicated by this attribute.
•
Weight: The product's weight. It is used for calculating the shipping costs in some
shipping methods.
•
Added: The DateTime when the product was created. Derived attribute.
•
Last modified: The last time when the product was modified.
•
Manufacturer: The product’s manufacturer.
•
Category: Products are classified into categories. Therefore, products can belong to
categories. In case that a product is not associated to a category, it is assumed that it
belongs to the top of categories hierarchy.
Moreover, the following attributes of a product can have different values in each language:
•
Name: The name which identifies the product.
•
Description: The product’s description.
•
URL: The web page where founding more information about the product.
•
Times viewed: It is updated by the system and gives information about how many
times the product has been viewed.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
30
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
„
Example
Nowadays, there are some online shops, based on osCommerce, which offers music and
entertainment products, like DVD’s.
The next one is an example instantiation of a film, sold on DVD, which can be found as a
product in some of those shops:
theDaVinciCode : Product
status = inStock
available = "25/10/2006 00:00"
netPrice = "11,95"
grossPrice = "13,86"
quantityOnHand = 130
quantityOrdered = "51"
imagePath = "/images/dvd/davincicode.jpg"
weight = "0,15"
added = "20/10/2006 12:34"
sonyPictures : Manufacturer
dvd : Category
p1 : ProductInLanguage
name = "The Da Vinci Code"
url = "www.sonypictures.com/movies/thedavincicode/"
english : Language
p2 : ProductInLanguage
name = "El código Da Vinci"
url = "www.elcodigodavinci-lapelicula.com"
spanish : Language
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
31
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Product attributes and options
„
Overview
osCommerce allows defining several attributes for each product. Product attributes are used
to offer multiple options of a product without needing to create many separate but very
similar products.
„
Structural Schema
HasOptionName
Option
0..1
*
Products 28
1
*
Product *
Attribute
String
1
ProductAttribute
optionName
valueName
*
0..1
Value
increment : Money
sign : Sign
statuts : Status
HasValueName
Downloadable
filename : File
expiryDays : Natural
maximumDownloadCount : Natural
<<enumeration>>
<<enumeration>>
<<dataType>>
<<dataType>>
Sign
Status
File
Money
plus
minus
„
enabled
disabled
Constraints
[1] In each language, each product option has a unique name.
context Language::optionNameIsUnique(): Boolean
body : self.hasOptionName -> isUnique(optionName)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
32
*
optionLanguage
Language Languages 20
*
valueLanguage
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[2] In each language, each product value has a unique name.
context Language::valueNameIsUnique(): Boolean
body : self.hasOptionValue -> isUnique(valueName)
Description
„
Usually, there are products which are sold in different options.
An attribute is an option/value pair such as, for example, Size/Small, Size/Medium,
Color/Red or Color /Yellow.
Product attributes can be enabled or disabled setting up the attribute status.
Moreover, the “base price” of products goes up or goes down according to the attributes
chosen by the customer. The amount of money incremented or decremented by choosing a
product attribute can be specified by setting up:
•
Sign: The sign of the increment (plus or minus).
•
Increment: The amount of money incremented or decremented.
There is a specific type of product attribute which allows products being downloadable. In
this case, the system requires information about:
•
File Name
•
Expiry days: How many days, since the product was ordered, the download will be
enabled.
•
Maximum downloads: How many times the customer can download the product.
Remember that there are configuration properties which specify a general value for this
downloadable product attributes.
Finally, options and values can have different names in each language.
„
Examples
This is an instantiation of a typical product offered by fashion shops:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
33
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
A T-Shirt which can be bought in two sizes: large or small.
pa1 : ProductAttribute
increment = "5"
sign = plus
large : Value
largeSize : Attribute
size : Option
FashionT-Shirt : Product
smallSize : Attribute
pa2 : ProductAttribute
small : Value
increment = "2"
sign = minus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
34
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Product categories
„
Overview
Products are grouped into categories which are arranged hierarchically.
„
Structural Schema
String
0..1
parent
categoryName
1
Category
imagePath : String [0..1]
child sortOrder : Natural
/added : DateTime {<<constant>>}
*
lastModified : DateTime [0..1]
/subcategories : Natural
/products : Natural
„
Languages 20
0..1
*
Language
HasCategoryName
Operations
context Category def:
allParents() : Set(Category) = self.parent -> union(self.parent.allParents())
„
Derivation Rules
[1] Category::added is the DateTime of category creation.
context Category::added():DateTime
body : Now()
[2] Category::subcategories is the number of subcategories owned by the category.
context Category::subcategories(): Natural
body : self.child -> size()
[3] Category::products is the number of products owned by the category.
context Category::products(): Natural
body : Category.allInstances() -> select(c | c.allParents() -> includes(self)).product -> size()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
35
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Constraints
„
[1] In each language, each category has a unique name.
context Language::categoryNameIsUnique(): Boolean
body : self.hasCategoryName -> isUnique(name)
[2] There are no cycles in category hierarchy.
context Category::isAHierarchy(): Boolean
body : not self.allParents() -> includes(self)
Description
„
OsCommerce groups products into categories which are arranged hierarchically. Categories
are identified by a name in each language and have the following attributes:
•
Image path: Categories can be associated to an image, which is located in the file
specified by this attribute.
•
Sort order: The categories of the same hierarchical level are displayed as indicated by
their sort order. In case that the sort order is the same, these are displayed
alphabetically ordered.
„
•
Added: The DateTime when the category was created. Derived attribute.
•
Last modified: The last time when the category was modified.
•
Subcategories: The quantity of subcategories. Derived attribute.
•
Products: The quantity of products contained in the category.
Examples
L’ Isola dei bambini is an Italian toys shop based on osCommerce.
The following is a real example which shows the instantiation of some product categories
from that shop. There are three categories: Wooden toys, Games and Trains.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
36
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Like products, categories can have different names in each language. In the example, we
assume that there are two languages: Italian and English.
Italian : Language
woodenToys : Category
english : Language
categoryName
categoryName
str4 : String
str1 : String
value = "Giocattoli di legno"
value = "Wooden toys"
Italian : Language
games : Category
english : Language
categoryName
categoryName
str5 : String
str2 : String
value = "Giochi di società"
value = "Games"
Italian : Language
trains : Category
english : Language
categoryName
categoryName
str6 : String
str3 : String
value = "Trenini"
value = "Trains"
Wooden toys are at the top of the categories hierarchy and Games and Trains are
subcategories of wooden toys.
woodenToys : Category
imagePath = "/images/categories/wood.jpg"
sortOrder = "1"
added = "16/12/2003 19:21"
lastModified = "18/12/2003 16:35"
subcategories = "2"
products = "3"
parent
parent
child
child
games : Category
trains : Category
imagePath = "/images/categories/games.jpg"
sortOrder = "1"
added = "16/12/2003 20:01"
subcategories = "0"
products = "2"
imagePath = "/images/categories/trains.jpg"
sortOrder = "2"
added = "17/12/2003 10:35"
subcategories = "0"
products = "1"
fourInARow : Product
PFCAlbert tort
domino : Product
UNIVERSITAT POLITÈCNICA DE CATALUNYA
motorrailTrain : Product
37
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Specials
Overview
„
osCommerce allows offering specials. That is, lower prices for a set of products can be
offered during a specific time period.
Structural Schema
„
Product
Products 28
Special
specialPrice : Money
expiryDate : DateTime [0..1]
/specialAdded : DateTime {<<constant>>}
specialLastModified : DateTime [0..1]
specialStatus : Status
dateStatusChanged : DateTime [0..1]
<<enumeration>>
<<dataType>>
Status
Money
enabled
disabled
Derivation Rules
„
[1] Special::added is the DateTime when the special was created
context Special::added():DateTime
body : Now()
Description
„
Specials are products which are sold, during an interval of time, in a lower price. The
information kept by the system about specials is:
•
Special price: The product’s price during the special offer.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
38
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
•
Expiry date: The date until the special offer is active.
•
Added: The DateTime when the Special was created. Derived attribute.
•
Last modified: The last time when the Special was modified.
•
Status: Specials can be enabled or disabled by setting this attribute.
•
Date status changed: The system updates automatically the last time when the status
of the Special was modified.
„
Examples
Egyptian Jewellery Online is an online shop based on osCommerce. This is an instance
corresponding to one of their special offers:
goldWingedHorusNecklace : Special
status = inStock
available = "25/10/2006 00:00"
netPrice = "1740"
grossPrice = "2018,40"
quantityOnHand = 2
quantityOrdered = "1"
imagePath = "/images/necklaces/gen01.jpg"
weight = "0,15"
added = "20/10/2006 12:34"
specialPrice = "1400"
specialStatus = enabled
specialAdded = "17/02/2007 15:32"
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
39
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Manufacturers
„
Overview
In osCommerce, the products in the store are manufactured by manufacturers.
„
Structural Schema
Manufacturer
name : String
imagePath : String [0..1]
/added : DateTime {<<constant>>}
lastModified : DateTime [0..1]
Languages 20
*
*
Language
ManufacturerInLanguage
<<dataType>>
URL
„
url : URL
urlClicked : Natural
lastClick : DateTime [0..1]
Derivation Rules
[1] Manufacturer::added is the DateTime when the Manufacturer was created.
context Manufacturer::added():DateTime
body : Now()
„
Constraints
[1] A manufacturer is identified by its name
context Manufacturer::nameIsUnique(): Boolean
body : Manufacturer.allInstances() -> isUnique(name)
[2] Each manufacturer must have a URL in each language
context Manufacturer::aURLInEachLanguage(): Boolean
body : self.language ->size() = Language.allInstances() -> size()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
40
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Description
„
OsCommerce keeps the following information about manufacturers:
•
Name: The manufacturer’s name.
•
Image path: Manufacturers can be illustrated by an image, which is located in the file
specified by this attribute.
•
Added: The DateTime when the manufacturer was created. Derived attribute.
•
Last modified: The system updates automatically the last time when the manufacturer
information was modified.
Moreover, for each language, each manufacturer must have a URL, in order to allow
customers to obtain information about it. The system updates automatically how many
times the URL has been clicked and when the last clicked was.
„
Example
Vinoverde is a German wine online shop. This based on osCommerce online store sells
wines of the Penedès guarantee of origin, among others.
This is a real instantiation of one of the manufacturers of this famous wine region, whose
products are sold in the example store:
spanish : Language
ml1 : ManufacturerInLanguage
url = "www.albetinoya.com/cast/index.html"
urlClicked = "5"
lastClick = "14/03/2007"
albetinoya : Manufacturer
name = " Albet i Noya "
imagePath = "/images/penedes/albetinoya"
added = "16/12/2006 12:36"
ml2 : ManufacturerInLanguage
url = " www.albetinoya.com/eng/index.html "
english : Language
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
41
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Banners
„
Overview
osCommerce allows administrating banners published in the online store.
„
Structural Schema
BannerGroup
name : String
1
*
Banner
title : String
url : URL [0..1]
imagePath : String
html : HtmlText [0..1]
expires : Date [0..1]
/added : DateTime {<<constant>>}
scheduled : Date [0..1]
statusChanged : DateTime [0..1]
status : Status
*
*
<<dataType>>
Date
BannerHistory
shown : Natural
clicked : Natural
<<dataType>>
<<dataType>>
<<enumeration>>
HtmlText
URL
Status
enabled
disabled
„
Derivation Rules
[1] Banner::added is the DateTime when the banner was created.
context Banner::added():DateTime
body : Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
42
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Constraints
„
[1] A Banner is identified by its title.
context Banner::titleIsUnique: Boolean
body : Banner.allInstances() -> isUnique(title)
[2] A Banner Group is identified by its name.
context BannerGroup::nameIsUnique: Boolean
body : BannerGroup.allInstances() -> isUnique(name)
Description
„
Banners are images which are shown in the online store. osCommerce allows administrating
the current banners and adding new banners. The system saves the following information
about them:
•
Title: A name which identifies the banner.
•
URL: The URL where a customer is redirected when the banner is clicked.
•
Image path: The file where the banner is located.
•
Size: The banner’s size (width and height).
•
Title: A name which identifies the banner.
•
Html: HTML based banners can be defined by this attribute.
•
Expires: When the expiry date is reached, the banner is automatically disabled.
•
Added: The DateTime when the banner was created. Derived attribute.
•
Scheduled: A future date when the banner is to become active. If no scheduled date is
defined, the banner is automatically published when it is created.
•
Status changed: The system updates automatically the last time when the banner
status was modified.
•
Status: The banner can be enabled or disabled.
Banners grouped into the same BannerGroup are shown iteratively in the same place.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
43
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Moreover, the system maintains historical information about how many times the banner
has been shown or clicked every day.
„
Example
This is a possible instantiation of a banner used as an advertisement during the sales:
bg : BannerGroup
bh1 : BannerHistory
name = "Top banners"
clicked = "2"
shown = "4"
bh2 : BannerHistory
clicked = "1"
shown = "1"
b1 : Banner
d1 : Date
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
title = "SaleAdvertisment"
url = "http://oscommerce/specials.html"
imagePath = "/images/banners/sale.jpg"
status = enabled
added = "18/6/2006 19:32"
44
d2 : Date
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Newsletters
„
Overview
osCommerce allows store owners sending emails and product notifications to customers.
„
Structural Schema
Newsletter
title : String
content : String
/added : DateTime {<<constant>>}
sent : DateTime [0..1]
status : NewsletterStatus
Products 28
ProductNotification
global : Boolean
Product
*
explicitRelatedProduct
*
/ relatedProduct
*
explicitNotifications
*
/ notifications
<<enumeration>>
NewsletterStatus
locked
unlocked
„
Derivation Rules
[1] ProductNotification::notifications is the set of implied products in the notification.
context ProductNotification::notifications():Set(Product)
body :
if self.global then Product.allInstances()
else self.explicitNotifications
endif
[2] ProductNotification::added is the DateTime when the newsletter was created.
context Newsletter::added():DateTime
body : Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
45
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Constraints
„
[1] A Newsletter is identified by its title.
context Newsletter::titleIsUnique: Boolean
body : Newsletter.allInstances() -> isUnique(title)
Description
„
Newsletters are used to send emails to the customers who gave their email address when
they created his account.
The system saves the following information about newsletters:
•
Title: A name which identifies the newsletter.
•
Content: The e-mail's content.
•
Added: The DateTime when the newsletter was created. Derived attribute.
•
Sent: The System sets up, automatically, the date when the newsletter was sent.
•
Status: Newsletters can be locked or unlocked. If a Newsletter is locked, it cannot be
modified by any administrator. Only if the newsletter is locked, it can be sent.
•
Status: The banner can be enabled or disabled.
Newsletters are sent to all the customers who selected to receive newsletters upon creating
their user account.
However, there is a specific type of newsletter, called ProductNotification. This particular
type of newsletter is sent only to customers who selected to be notified about product
updates included in the list of products implied in the notification.
The list of products involved in the notification is represented by the derived association
notifications.
New implied products are specified through the association explicitNotifications.
attribute global is true, all products are implied in the product notification.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
46
If the
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
„
Example
Catalan culture will be the guest of honour at the 2007 Frankfurt Book Fair considered to be
the most important event in the world of publishing.
Imagine that the administrator of an online bookshop wants to send a newsletter to
customers who bought books like L’auca del senyor Esteve or Tirant Lo Blanc, famous
Catalan books, to inform them about this event:
pn1 : ProductNotification
title = "Frankfurt 2007"
content = "Catalan culture will
be the guest of honour at the
2007 Frankfurt Book Fair.
Visit our online catalan books
section."
global = false
added = "23/04/2007 12:00"
status = unlocked
PFCAlbert tort
aucaSenyorEsteve : Product
explicitNotifications
/notifications
tirantLoBlanc : Product
explicitNotifications
/notifications
UNIVERSITAT POLITÈCNICA DE CATALUNYA
47
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.6 CUSTOMERS
Customers
„
Overview
osCommerce keeps information about customers and their addresses, one of which is the
primary address.
„
Structural Schema
Customer
gender : Gender [0..1]
firstName : String
lastName : String
dateOfBirth : Date [0..1]
eMailAddress : EMail
phone : String
fax : String [0..1]
newsletter : Boolean
password : String
/added : DateTime {<<constant>>}
lastModified : DateTime [0..1]
lastLogon : DateTime [0..1]
numberOfLogons : Natural
globalNotifications : Boolean
status : Status
/subscriber *
*
<<dataType>>
Address
gender : Gender
1..* firstName : String
{ordered}
lastName : String
company : String [0..1]
street : String
suburb : String [0..1]
1
postCode : PostalCode
primary city : String
{subsets address}
state : String [0..1]
*
*
primaryAddressCustomer
{<<constant>>}
explicitNotificationsSubscriber
Products 28
*
explicitNotifications
*
/notifications
*
*
{<<constant>>}
0..1
Zone
Location & Taxes 24
Product
*
1
1
Country
Location & Taxes 24
<<enumeration>>
<<enumeration>>
Gender
Status
male
female
PFCAlbert tort
enabled
disabled
UNIVERSITAT POLITÈCNICA DE CATALUNYA
48
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Derivation Rules
„
[1] Customer::notifications is the set of subscriptions to product notifications.
context Customer::notifications():Set(Product)
body :
if self.globalNotifications then Product.allInstances()
else self.explicitNotifications
endif
[2] Customer::added is the DateTime of the customer creation.
context Customer::added():DateTime
body : Now()
Constraints
„
[1] Customers are identified by their email address.
context Customer::eMailIsUnique(): Boolean
body : Customer.allInstances() -> isUnique(eMailAddress)
[2] Addresses have zone if needed.
context Country::addressesHaveZoneIfNeeded(): Boolean
body :
self.zone -> notEmpty() implies self.address -> forAll
(a | a.state = a.zone.name and self = a.zone.country)
Description
„
osCommerce has the following information about Customers :
•
Gender
•
First Name
•
Last Name
•
Date of Birth
•
Email address
•
Phone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
49
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
•
Fax
•
Password
The System also maintains the DateTime of the last modification, the DateTime of the last
logon and the customer’s number of logons. There is a derived attribute (added) which
indicates when the Customer was created.
Additionally, Customers can be subscribed to product notifications. This fact is represented
by the association role explicitNotifications. If the attribute globalNotifications is true, then
the customer will receive notifications for all the products of the store. The derived
association notifications, keeps the active subscriptions to product notifications associated
to the customer, taking into account the explicit notifications and the attribute
globalNotifications.
Customers, in osCommerce, have one or more addresses, one of which is the primary. The
primary address is the default shipping and delivering addresses for the orders placed in the
store.
The status of a customer indicates if the customer is currently active.
osCommerce has the following information about Addresses:
•
Gender
•
First Name
•
Last Name
•
Company
•
Street
•
Suburb
•
Postal Code
•
City
•
State
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
50
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Moreover, Addresses are located in a Country. If the Country has zones, the address must
be located in a zone whose name is the same as the name of the state, and the country of
the zone must be the same as the country of the address.
„
Examples
The following instantiation is an example of a customer with two address book entries. The
customer can choose, for each order, which one is the shipping and the billing address:
addr1 : Address
gender = male
firstName = "Albert"
lastName = "Tort Pugibet"
postCode = "08731"
street = "Serra de Dalt"
city = "Sant Martí Sarroca"
state = "Barcelona"
c1 : Customer
gender = male
firstName = "Albert"
lastName = "Tort Pugibet"
dateOfBirth = "16/12/1984"
eMailAddress = "[email protected]"
phone = "+34 93 899 XX XX"
newsletter = false
password = "p087654"
added = "25/04/2005"
numberOfLogons = "5"
lastLogon = "31/03/2007"
globalNotifications = false
BCN : Zone
ESP : Country
code = "BCN"
name = "Barcelona"
isoCode2 = "ES"
isoCode3 = "ESP"
name = "España"
addr2 : Address
gender = male
firstName = "Antoni"
lastName = "Olivé Ramón"
company = "Universitat
Politècnica de Catalunya"
postCode = "08034"
street = "Jordi Girona"
city = "Barcelona"
state = "Barcelona"
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
51
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
2.7 ONLINE CATALOG
Reviews
„
Overview
In order to allow users reading evaluations of a product, customers can write reviews.
„
Structural Schema
Review
review : String
rating : Rating
/added : DateTime {<<constant>>}
lastModified : DateTime [0..1]
timesRead : Natural
*
*
*
1
1
1
Language
Product
Customer
Languages 20
Products 28
Customers 48
<<enumeration>>
Rating
oneStar
twoStars
threeStars
fourStars
fiveStars
„
Derivation Rules
[1] Review::added is the DateTime of the review creation.
context Review::added():DateTime
body : Now()
„
Description
Reviews are customer evaluations of a product and are written in a language.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
52
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
osCommerce takes into account the following information about reviews:
•
Review: The customer’s opinion about the product.
•
Rating: The rating for the product.
•
Added: The DateTime when the review was created. Derived attribute.
•
Last modified: The system updates automatically the last time when the review
information was modified.
•
Review read: The system updates automatically how many times a review has been
read.
„
Examples
osCommerce is a solution used in some travel and tours online shops. In these online shops,
travel packages are sold as products.
Usually, in this kind of shops, users write reviews about their impression about the hotels
where they stayed during travels.
While they are surfing the online store, customers can read the reviews in order to obtain
more information about products.
rw1 : Review
english : Language
review = "Very easy to find the hotel
near Notting Hill gate. Generally very
polite and helpful people in the area."
rating = fourStars
timesRead = "2"
added = "08/10/2006"
c1 : Customer
hotelcomfort : Product
rw2 : Review
rating = twoStars
review = "Muy bien localizado en
Londres, al lado del mercado de Porto
Bello. És un hotel con una distribución
extraña al ocupar varios edificios lo que
hace que el laberinto de pasillos sea
de lo más divertido.El personal és
distante."
added = "25/01/2007"
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
c2 : Customer
spanish : Language
53
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Shopping carts
„
Overview
Customers can add or remove products from their shopping carts while they are surfing the
online store.
„
Structural Schema
Products 28
Languages 20
Currencies 22
Language
currentLanguage
1
ShoppingCartItem
Currency
1
currentCurrency
1..*
*
*
sessionID : Natural {constant}
expiry : DateTime {constant}
ipAddress : String {constant}
timeEntry : DateTime {constant}
timeLastClick : DateTime [0..1]
lastPageURL : URL [0..1]
1
{redefines session}
0..1
Product
*
Attribute
{<<constant>>}
*
{<<constant>>}
{ordered}
Product attributes
and options 32
{<<constant>>}
0..1
Session
0..1
quantity : PositiveInteger
/added : DateTime {<<constant>>}
/price : Money
*
1
1
0..1
ShoppingCart
{disjoint, complete}
AnonymousShoppingCart
CustomerShoppingCart
0..1
Customer
0..1
1
{<<constant>>}
Customers 48
„
Derivation Rules
[1] ShoppingCartItem::price is the net price for an item taking into account the selected
product attributes.
context ShoppingCartItem::price():Money
body :
let netPriceWithSpecial:Money =
if self.product.specialNetPrice ->notEmpty() then self.product.specialNetPrice
else self.product.netPrice
endif
in
if self.attribute -> isEmpty() then self.product.netPriceWithSpecial
else
self.attribute.productAttribute -> select (pa | pa.product = self.product) -> collect
(if sign = Sign::plus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
54
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
then increment
else –increment
endif) -> sum() + self.product.netPriceWithSpecial
endif
[2] ShoppingCartItem::added is the DateTime when the item was created.
context ShoppingCartItem::added():DateTime
body : Now()
„
Constraints
[1] If a customer shopping cart exists in the context of a session then its customer is the
customer of the session
context CustomerShoppingCart::sameCustomer(): Boolean
body : self.session.customer -> notEmpty() implies self.session.customer = self.customer
[2] The shopping cart item specifies the selected product attributes, which must be a subset
of all the product attributes.
context ShoppingCartItem::productHasTheAttributes(): Boolean
body : self.product.attribute -> includesAll(self.attribute)
[3] The shopping cart item specifies only one attribute per option.
context ShoppingCartItem::onlyOneAttributePerOption(): Boolean
body : self.attribute -> isUnique(option)
[4] Sessions are identified by its sessionID.
context Session::sessionIDIsUnique(): Boolean
body : Session.allInstances() -> isUnique (sessionID)
„
Description
Shopping carts contains the products chosen by customers from the online catalog.
A shopping cart is anonymous until de customer logs in. At this moment, if the customer
didn’t have a previous CustomerShoppingCart, it becomes a CustomerShoppingCart. If the
customer had a previous customer shopping cart, the anonymous shopping cart is removed
from the system and their products are added to the previous CustomerShoppingCart.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
55
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
In summary, if a customer leaves a session with a non-empty customer shopping cart, then
the cart will be automatically restored in his next session.
Anonymous shopping carts can only exist in the context of a session, and they are
automatically removed when its session expires.
A shopping cart contains a sequence of one or more ShoppingCartItem, each of which is a
quantity of a product. If the product has attributes then the shopping cart item specifies the
selected attributes of the product.
Moreover, there is a derived attribute which calculates the net price for the shopping cart
item, taking into account the net price of the product and the increments or decrements of
the attributes. Note that the net price of the product is the special net price if it is an active
special offer.
When an order, corresponding to a shopping cart, is confirmed, the shopping cart is removed
from the system.
„
State Transition Diagram
The state of ShoppingCart entities can be conceptually modelled by using a state transition
diagram.
[CustomerIsLoggedIn and
SessionDoNotHaveAShoppingCart]
AddProductToShoppingCart /
PreviousShoppingCartIsRestored
[CustomerIsNotLoggedIn and
SessionDoNotHaveAShoppingCart]
AddProductToShoppingCart
LogOut
AnonymousShopping Cart
[NoPreviousCustomer
ShoppingCart] LogIn
FinishSession
[Previous
Customer
ShoppingCart]
LogIn /
AnonymousContents
AreAddedToPrevious
CustomerShoppingCart
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
OrderConfirmation
56
CustomerShoppingCart
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
„
Examples
These are two example instantiations of an anonymous shopping cart and a customer
shopping cart in the context of a session.
The first example represents an anonymous shopping cart:
size : Option
small : Value
sci1 : ShoppingCartItem
quantity = "3"
price = "18"
added = "26/02/2007"
catalan : Language
at1 : Attribute
FashionT-Shirt : Product
s1 : Session
asc : AnonymousShoppingCart
sci2 : ShoppingCartItem
euro : Currency
quantity = "1"
hotelcomfort : Product
The second example represents a customer shopping cart which will not disappear when the
session expires. Thanks to it, the shopping cart will be restored when the customer initiates a
new session.
size : Option
small : Value
sci1 : ShoppingCartItem
quantity = "3"
price = "18"
added = "26/02/2007"
at1 : Attribute
FashionT-Shirt : Product
csc : CustomerShoppingCart
sci2 : ShoppingCartItem
quantity = "1"
s1 : Session
PFCAlbert tort
c1 : Customer
UNIVERSITAT POLITÈCNICA DE CATALUNYA
57
hotelcomfort : Product
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
Orders
„
Overview
Orders are the confirmation that a customer wants to buy the contents of his shopping cart.
„
Structural Schema
Customers 48
Customer
Product attributes
and options 32
1
*
1
{<<constant>>}
*
OrderLine
Order
{<<Permanent>>}
Shipping methods 18
ShippingMethod 1
Payment methods 16
PaymentMethod 1
Currencies 22
Currency
1
*
{<<constant>>}
/name : String
/option : String
* /value : String
1
/model : String [0..1]
{<<constant>>}
{<<constant>>}
/price : Money [0..1]
/increment : Money
/sign : Sign
1..* /tax : Decimal
{ordered} /finalPrice : Money
quantity : PositiveInteger
/basePrice : Money
1
*
{<<constant>>}
OrderDownload
Products 28
downloadCount : Natural
1
Product
OrderStatusChange
/added : DateTime {<<constant>>}
comments : String [0..1]
{<<permanent>>}
1..*
OrderStatus *
*
status : Status
OrderStatusInLanguage
name : String
<<enumeration>>
<<enumeration>>
<<dataType>>
Sign
Status
Money
„
enabled
disabled
<<dataType>>
EMail
eMail : String
Operations
context ShippingMethod def:
addTaxes(z:Zone, basePrice:Money) : Money =
let appliedTaxRates:Set(TaxRate)=
z.taxZone.taxRate -> select (tr | tr.taxClass = self.taxClass)
in
let priorities:set(Natural) =
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
{<<constant>>}
OrderLineAttribute
{<<constant>>}
/id : PositiveInteger {<<constant>>}
* /name : String {<<constant>>}
/phone : String [0..1] {<<constant>>}
/eMail : EMail{<<constant>>}
delivery : Address {<<constant>>}
billing : Address {<<constant>>}
* /creditCardType : String [0..1] {<<constant>>}
/creditCardOwner : String [0..1] {<<constant>>}
/creditCardNumber : String [0..1]{<<constant>>}
/creditCardExpires : Date [0..1] {<<constant>>}
/currencyValue : Decimal {<<constant>>}
*
/purchased : DateTime {<<constant>>}
/lastModified : DateTime [0..1]
/total : Money {<<constant>>}
plus
minus
Attribute
58
Language
Languages 20
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
in
if appliedTaxRate -> isEmpty() then set{}
else appliedTaxRate -> sortedBy(priority).priority -> asSet()
endif
if priorities -> isEmpty() then basePrice
else priorities -> iterate (p:Natural; res:Money = 0 |
res +
(((appliedTaxRates -> select (tr | tr.priority = p).rate
-> sum()) / 100)+1)*basePrice
endif
context ShippingMethod def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money = 0
context FlatRate def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money = self.cost
context PerItem def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money =
self.cost*quantity
context TableRate def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money =
if self.method = ShippingTableMethod::weight
then
self.items -> select (i | i.number <= (totalWeight*quantity)) -> sortedBy(number) ->last().cost
else
self.items -> select (i | i.number <= (totalPrice*quantity)) -> sortedBy(number) ->last().cost
endif
context USPostalService def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money =
calculateFromUSPS (self.userID, self.password, self.server, totalWeight, totalPrice, quantity)
context TableRate def:
shippingCosts(totalWeight:Decimal, totalPrice:Money, quantity:PositiveInteger): Money =
if self.method = ShippingTableMethod::weight
then
self.items -> select (i | i.number <= (totalWeight*quantity)) -> sortedBy(number) ->last().cost
endif
„
Derivation Rules
[1] Order::id identifies the order and it is assigned automatically.
context Order::id():PositiveInteger
body :
if Order.allInstances() -> size() = 0 then 0
else Order.allInstances() -> sortedBy(id) -> last().id + 1
endif
[2] Order::primary address of an order is that of its customer.
context Order::primary():Address
body : self.customer.primary
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
59
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[3] Order::eMailAddress of an order is that of its customer.
context Order::eMailAddress():EMail
body : self.customer.eMailAddress
[4] Order::phone of an order is that of its customer.
context Order::phone():String
body : self.customer.phone
[5] Order::purchased is the DateTime when the order was created
context Order::purchased():DateTime
body : Now()
[6] Order::lastModified is the last DateTime when the status order was modified
context Order::lastModified():DateTime
body : self.orderStatusChange -> sortedBy(added) -> last().added
[7] Order::statuts is the current status of the order
context Order::status():OrderStatus
body : self.orderStatusChange -> sortedBy(added) -> last().orderStatus
[8] Order::total gives the total amount of an order
context Order::total():Money
body :
let totalWithoutShippingCosts:Money =
self.orderLine -> collect(finalPrice*quantity) -> sum()
let totalWeight:Decimal =
self.orderLine -> collect(product.weight*quantity) -> sum()
let quantity:PositiveInteger =
self.orderLine.quantity -> sum()
let handlingFee:Money =
if self.shippingMethod.oclIsTypeOf(HandlingFeeMethod)
then
self.shippingMethod.oclAsType(HandlingFeeMethod).handlingFee
else 0
endif
in
let totalWeightIncreased:Decimal =
if totalWeight* (ShippingAndPackaging.percentageIncreaseForLargerPackages/100) >
ShippingAndPackaging.typicalPackageTareWeight
then
totalWeight * (1 +totalWeight*
ShippingAndPackaging.percentageIncreaseForLargerPackages/100)
else totalWeight + ShippingAndPackaging.typicalPackageTareWeight
endif
in
totalWithoutShippingCosts +
self.shippingMethod.shippingCosts
(totalWeightIncreased, totalWithoutShippingCosts, quantity) + handlingFee
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
60
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[9] OrderStatusChange::added is the DateTime when the change is done.
context OrderStatusChange::added():DateTime
body : Now()
[10] OrderLine::name is that of its product in the default language
context OrderLine::name():String
body :
self.product.productInLanguage
->select(pil | pil.language = Store.allInstances() -> any(true).defaultLanguage).name
[11] OrderLine::model is that of its product
context OrderLine::model():String
body : self.product.model
[12] OrderLine::basePrice is the net price of the product without taking into account the
selected attributes.
context OrderLine::basePrice():Money
body :
if self.product.specialNetPrice ->notEmpty()
then self.product.specialNetPrice
else self.product.netPrice
endif
[13] OrderLine::price is the net price of the product with the selected attributes
context OrderLine::price():Money
body :
if self.orderLineAttribute -> isEmpty() then self.basePrice
else
self.orderLineAttribute -> collect
(if sign = Sign::plus then increment
else –increment
endif) -> sum() + self.basePrice
endif
[14] OrderLine::finalPrice is the price of the product with the selected attributes and taking
into account the shipping costs and the taxes
context OrderLine::finalPrice():Money
body :
if self.billing.zone -> notEmpty() then
self.product.addTaxes(self.billing.zone, self.price)
else self.price
endif
[15] OrderLineAttribute::option is the option name in the default language
context OrderLineAttribute::option():String
body :
self.attribute.option.hasOptionName
-> select (hon | hon.optionLanguage = Store.allInstances()
-> any(true).defaultLanguage).optionName
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
61
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[16] OrderLineAttribute::value is the option value in the default language
context OrderLineAttribute::value():String
body :
self.attribute.value.hasValueName
-> select (hvn | hon.valueLanguage = Store.allInstances()
-> any(true).defaultLanguage).valueName
[17] OrderLineAttribute::increment is the increment applied in the product price by the
attribute
context OrderLineAttribute::increment():Money
body :
self.attribute.productAttribute
-> select (pa | pa.product = self.orderLine.product).increment
[18] OrderLineAttribute::sign is the sign of the increment applied in the product price by the
attribute
context OrderLineAttribute::sign():Sign
body :
self.attribute.productAttribute
-> select (pa | pa.product = self.orderLine.product).sign
„
Constraints
[1] A specific zone shipping method with a specific tax zone can only be applied if the
delivery address zone is included in the tax zone.
context Order::ApplicableZoneShippingMethod: Boolean
body :
self.shippingMethod.oclIsTypeOf(SpecificZoneMethod) and
self.shippingMethod.oclAsType(SpecificZoneMethod).taxZone -> notEmpty implies
self.shippingMethod.oclAsType(SpecificZoneMethod).taxZone.zone
-> includes(self.delivery.zone)
[2] The Zone Rates shipping method can only be applied in the specified countries.
context Order::ApplicableZoneRatesShippingMethod: Boolean
body :
self.shippingMethod.oclIsTypeOf(ZoneRates) implies
self.shippingMethod.oclAsType(ZoneRates).country -> includes(self.delivery.country)
[3] Payment methods with a specified tax zone can only be applied in orders with a billing
address located in a zone included in the tax zone.
context Order::ApplicableZonesPaymentMethod: Boolean
body :
self.paymentMethod.taxZone -> notEmpty() implies
self.paymentMethod.taxZone.zone -> includes(self.billing.zone)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
62
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
[4] Payment methods with a specified set of applicable currencies can only be applied if the
current currency is included in that set.
context Order::ApplicableCurrenciesPaymentMethod: Boolean
body :
self.shippingMethod.oclIsTypeOf(SpecificCurrenciesMethod) implies
self.shippingMethod.oclAsType(SpecificCurrenciesMethod).currency
-> includes(self.currency)
[5] Orders are identified by its id
context Order::IDIsUnique: Boolean
body : Order.allInstances() -> isUnique(id)
[6] Order status are identified by its name
context Order::NameIsUnique: Boolean
body : OrderStatus.allInstances() -> isUnique(name)
Description
„
When the customer confirms that he/she wants to buy the contents of his shopping cart, the
system generates an order. Orders have the following information:
•
Id: Identifies an order. It is assigned automatically. Derived Attribute.
•
Billing address
•
Delivery address
•
Email Address: A copy of the customer’s email. Derived Attribute.
•
Phone: A copy of the customer’s phone. Derived Attribute.
•
Purchased: The DateTime when the order was created. Derived Attribute.
•
Last Modified: The last time the order was changed. Derived Attribute.
•
Status: The current status of the order. Derived Attribute.
•
Total: The total price of the order, taking into account the shipping costs and the taxes.
An order is made by a customer during check out process, and can be in different
OrderStatus during time.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
63
conceptualschema
2/ STRUCTURAL SCHEMA
OsCommerce
An order is composed by order lines which represents a quantity of a product. The
information about order lines is:
•
Name: A copy of the product’s name. Derived Attribute.
•
Model: The current status of the order. Derived Attribute.
•
Total: The total price of the order, taking into account the shipping costs and the taxes.
Likewise, order lines can have order line attributes, which represents the product attributes
chosen for an order line product.
Order line attributes which corresponds to downloadable product attributes have an specific
attribute, called downloadCount that maintains how many times the product has been
download by the customer.
„
Example
The Vienna Mozart Orchestra plays concerts in Vienna in the most famous concert halls,
including the Golden Hall in the Musikverein, a well-known building where takes place the
most popular New Year’s concert.
Imagine that we would like to implement a ticket online shop based on the osCommerce
solution. The following would be a possible instantiation of an order:
zubin : Customer
mozartConcert26/05/07 : Product
superiorCategory : Attribute
or : Order
fr : FlatRate
cost = "2"
cd : CashOnDelivery
ola : OrderLineAttribute
id = "15236"
name = "Zubin Metha"
eMail = "[email protected]"
purchased = "31/01/2007 13:43"
total = "227,04"
ol : OrderLine
name = " Mozart Concert
26/05/2007 "
price = "97"
finalPrice = " 112,52 "
quantity = "2"
tax = "16"
basePrice = "55"
euro : Currency
osc : OrderStatusChange
added = "31/01/2007 13:43"
pending : OrderStatus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
64
increment = "42"
option = "category"
sign = plus
value = " superior "
BEHAVIORAL
SCHEMA
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
3 BEHAVIORAL SCHEMA
3.1 INTRODUCTION
In the next sections we develop the behavioral schema of the osCommerce system.
The main purpose of the osCommerce behavioral schema is specifying the valid changes in
the domain state, as well as the actions that the osCommerce system can perform.
Firstly, we show an overview use cases diagram which gives a general view of the most
important functionalities of the system. Include relationships are not shown for clarity.
Afterwards, we specify each use case textually, as an interaction of activities between the
primary actors and the system.
Use cases specification contains the mapping of use cases with the most important events of
the system using textual references. Events of the system are presented alphabetically, in
order to improve search. Each event is represented by an UML diagram, and its effect and
constraints are specified using OCL operations.
3.2 USE CASE DIAGRAM
Change store
data
Change stock
configuration values
Assign minimum
values
Assign maximum
values
Change download
configuration values
System
Administrator
Assign shipping and packaging
configuration values
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
66
Change shown
customer details
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Install a payment method
Uninstall a payment method
Change payment method
values
Install a shipping method
Uninstall a shipping method
Change shipping method
values
Add a language
Edit a language
Delete a language
Set the default language
Add a currency
Edit a currency
Store
Administrator
Delete a currency
Update currencies
Set the default currency
Add a country
Edit a country
Delete a country
Add a zone
Edit a zone
Delete a zone
Add a tax zone
Edit a tax zone
Delete a tax zone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
67
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Add a tax class
Edit a tax class
Delete a tax class
Add a tax rate
Edit a tax rate
Delete a tax rate
Add a product
Add a product option
Edit a product option
Delete a product option
Add a product option value
Edit a product option value
Delete a product option
value
Store
Administrator
Add an attribute
Edit an attribute
Delete an attribute
Add a product attribute
Edit a product attribute
Delete a product attribute
Edit a product
Delete a product
Move a product
Link a product
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
68
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Add a product category
Edit a product category
Move a product category
Delete a product category
Add a special
Edit a special
Delete a special
Add a manufacturer
Edit a manufacturer
Delete a manufacturer
Add a banner
Edit a banner
Store
Administrator
Delete a banner
Add a banner group
Edit a banner group
Delete a banner group
Send an email
Create a newsletter
Edit a newsletter
Delete a newsletter
Lock a newsletter
Unlock a newsletter
Send a newsletter
Edit a customer
Delete a customer
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
69
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Edit a review
Delete a review
Cancel an order
Add an order status
Edit an order status
Delete an order status
Store
Administrator
Change the status of an order
Set cancelled order status
Set default order status
Show products under stock
Show orders of a customer
Show customer’s orders total
Online customers
Generate an invoice
Generate a packaging slip
Show reviews of a product
Show expected products
Show new products
Store
Administrator
Show best viewed products
Show best products purchased
Show products of a category
Show products of a manufacturer
Customer
Show specials
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
70
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Create a customer
Change password
Change customer details
Administrate address book
Administrate subscriptions
Open session
Finish session
LogIn
LogOut
Change the current language
Change the current currency
Add a review
Place and order
Customer
Click a banner
Read a review
Show manufacturer’s web
Tell to a friend
Show previous orders
Download a product
Show a banner
System
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
71
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
3.3 USE CASE SPECIFICATION
Use case
Change store data
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the initial values of the store data.
Main Success Scenario:
1. The system displays the current values of the store data.
2. The system administrator provides a new value for one of the store attributes:
[ÆMameChange]
[ÆOwnerChange]
[ÆEMailAddressChange]
[ÆEMailFromChange]
[ÆExpectedSortOrderChange]
[ÆExpectedSortFieldChange]
[ÆSendExtraOrderChange]
[ÆDisplayCartAfterAddingProductChange]
[ÆAllowGuestToTellAFriendChange]
[ÆDefaultSearchOperatorChange]
[ÆStoreAddressAndPhoneChange]
[ÆTaxDecimalPlacesChange]
[ÆDisplayPricesWithTaxChange]
[ÆSwitchToDefaultLanguageCurrencyChange]
[ÆCountryChange]
[ÆZoneChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new values of the store data.
The system administrator repeats steps 2-5 until he is done.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
72
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Assign minimum values
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the minimum values of some attributes.
Main Success Scenario:
1. The system displays the current minimum values.
2. The system administrator provides a new value for one of the minimum values:
[ÆFirstNameMinimumChange]
[ÆLastNameMinimumChange]
[ÆDateOfBirthMinimumChange]
[ÆEMailAddressMinimumChange]
[ÆStreetAddressMinimumChange]
[ÆCompanyNameMinimumChange]
[ÆPostCodeMinimumChange]
[ÆCityMinimumChange]
[ÆStateMinimumChange]
[ÆTelephoneMinimumChange]
[ÆPasswordMinimumChange]
[ÆCreditCardOwnerNameMinimumChange]
[ÆCreditCardNumberMinimumChange]
[ÆReviewTextMinimumChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current minimum values.
The system administrator repeats steps 2-5 until he is done.
Use case
Assign maximum values
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the maximum number of address book
entries permitted for each customer.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
73
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system displays the current maximum number of address book entries for each customer.
2. The system administrator provides the new maximum value:
[ÆAddressBookEntriesMaximumChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current maximum value.
Use case
Change shown customer details
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change whether some customer attributes are
shown.
Main Success Scenario:
1. The system displays the current values of customer details configuration (shown or not shown).
2. The system administrator provides the new value for one of the customer details:
[ÆGenderCustomerDetailChange]
[ÆDateOfBirthCustomerDetailChange]
[ÆCompanyCustomerDetailChange]
[ÆSuburbCustomerDetailChange]
[ÆStateCustomerDetailChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current values of customer details configuration.
The system administrator repeats steps 2-5 until he is done.
Use case
Assign shipping and packaging configuration values
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the shipping and packaging
configuration values.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
74
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system displays the current shipping and packaging configuration values.
2. The system administrator provides the new value for one of the shipping and packaging
configurable options:
[ÆPostCodeShippingConfigurationChange]
[ÆMaximumPackageWeightShippingConfigurationChange]
[ÆTypicalPackageTareWeightShippingConfigurationChange]
[ÆPercentageIncreaseForLargerPackagesShippingConfigurationChange]
[ÆCountryShippingConfigurationChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current shipping and packaging configuration values.
The system administrator repeats steps 2-5 until he is done.
Use case
Change download configuration values
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the download configuration values.
Main Success Scenario:
1. The system displays the current download configuration values.
2. The system administrator provides the new value for one of the download configuration options:
[ÆEnableDownloadConfigurationChange]
[ÆDaysExpiryDelayDownloadConfigurationChange]
[ÆMaximumNumberDownloadConfigurationChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current download configuration values.
The system administrator repeats steps 2-5 until he is done.
Use case
Change stock configuration values
Primary Actor: System administrator
Precondition: None.
Trigger: The system administrator wants to change the stock configuration values.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
75
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Main Success Scenario:
1. The system displays the current stock configuration values.
2. The system administrator provides the new value for one of the stock configuration options:
[ÆCheckLevelStockConfigurationChange]
[ÆSubstractStockConfigurationChange]
[ÆAllowCheckoutStockConfigurationChange]
[ÆReorderLevelStockConfigurationChange]
3. The system validates that the value is correct.
4. The system saves the new value.
5. The system displays the new current stock configuration values.
The system administrator repeats steps 2-5 until he is done.
Use case
Install a payment method
Primary Actor: Store administrator
Precondition: The payment method is not installed yet.
Trigger: The store administrator wants to install a payment method.
Main Success Scenario:
1. The system shows all the available payment methods and which of they are installed.
2. The store administrator selects a non installed payment method.
3. The store administrator provides the data of the payment method:
[ÆInstallAuthorizeNetPaymentMethod]
[ÆInstallCreditCardPaymentMethod]
[ÆInstallCashOnDeliveryPaymentMethod]
[ÆInstallIPaymentPaymentMethod]
[ÆInstallCheckMoneyPaymentMethod]
[ÆInstallNochexPaymentMethod]
[ÆInstallPayPalPaymentMethod]
[ÆInstallTwoCheckOutPaymentMethod]
[ÆInstallPSiGatePaymentMethod]
[ÆInstallSECPaymentMethod]
4. The system validates that the data is correct.
5. The system uninstalls the new payment method.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
76
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Uninstall a payment method
Primary Actor: Store administrator
Precondition: The payment method is installed.
Trigger: The store administrator wants to uninstall a payment method.
Main Success Scenario:
1. The system shows all the payment methods and which of they are installed.
2. The store administrator selects an installed payment method.
[ÆUninstallAuthorizeNetPaymentMethod]
[ÆUninstallCreditCardPaymentMethod]
[ÆUninstallCashOnDeliveryPaymentMethod]
[ÆUninstallIPaymentPaymentMethod]
[ÆUninstallCheckMoneyPaymentMethod]
[ÆUninstallNochexPaymentMethod]
[ÆUninstallPayPalPaymentMethod]
[ÆUninstallTwoCheckOutPaymentMethod]
[ÆUninstallPSiGatePaymentMethod]
[ÆUninstallSECPaymentMethod]
3. The system uninstalls the selected payment method.
Extensions:
2a. The payment method is used in an existing order:
2a1. The system warns the store administrator that the payment method is used in the
information of existing orders and that is only possible to disable the payment method.
2a2. The system changes the status of the payment method to disabled:
[ÆStatusPaymentMethodChange]
2a3. The use case ends.
Use case
Change payment method values
Primary Actor: System administrator
Precondition: The payment method is installed.
Trigger: The system administrator wants to change the configuration values of an installed
payment method.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
77
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Main Success Scenario:
1. The system displays the installed payment methods.
2. The customer selects an installed payment method.
3. The system displays the current values of the payment method.
4. The system administrator provides the new values for the configurable attributes of the payment
method:
[ÆEditAuthorizeNetPaymentMethod]
[ÆEditCreditCardPaymentMethod]
[ÆEditCashOnDeliveryPaymentMethod]
[ÆEditIPaymentPaymentMethod]
[ÆEditCheckMoneyPaymentMethod]
[ÆEditNochexPaymentMethod]
[ÆEditPayPalPaymentMethod]
[ÆEditTwoCheckOutPaymentMethod]
[ÆEditPSiGatePaymentMethod]
[ÆEditSECPaymentMethod]
5. The system validates that the new values are correct.
6. The system saves the new values.
7. The system displays the new values of the payment method.
Use case
Install a shipping method
Primary Actor: Store administrator
Precondition: The shipping method is not installed yet.
Trigger: The store administrator wants to install a shipping method.
Main Success Scenario:
1. The system shows all the available shipping methods and which of they are installed.
2. The store administrator selects a non installed shipping method.
3. The store administrator provides the data of the shipping method.
[ÆInstallZoneRatesShippingMethod]
[ÆInstallFlatRateShippingMethod]
[ÆInstallPerItemShippingMethod]
[ÆInstallTableRateShippingMethod]
[ÆInstallUSPostalServiceShippingMethod]
4. The system validates that the data is correct.
5. The system creates an instance of the new shipping method.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
78
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Uninstall a shipping method
Primary Actor: Store administrator
Precondition: The shipping method is installed.
Trigger: The store administrator wants to uninstall a shipping method.
Main Success Scenario:
1. The system shows all the available shipping methods and which of they are installed.
2. The store administrator selects an installed shipping method.
[ÆUninstallZoneRatesShippingMethod]
[ÆUnistallFlatRateShippingMethod]
[ÆUninstallPerItemShippingMethod]
[ÆUninstallTableRateShippingMethod]
[ÆUninstallUSPostalServiceShippingMethod]
3. The system deletes the instance of the selected shipping method.
Extensions:
2a. The shipping method is the shipping method used in an existing order:
2a1. The system warns the store administrator that the shipping method is used in the
information of existing orders and that is only possible to disable the shipping method.
2a2. The system changes the enabled attribute of the shipping method to false:
[ÆStatusShippingMethodChange]
2a3. The use case ends.
Use case
Change shipping method values
Primary Actor: System administrator
Precondition: The shipping method is installed.
Trigger: The system administrator wants to change the configuration values of an installed
shipping method.
Main Success Scenario:
1. The system displays the installed shipping methods.
2. The customer selects an installed shipping method.
3. The system displays the current values of the selected shipping method.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
79
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
4. The system administrator provides the new values for the configurable attributes of the shipping
method:
[ÆEditZoneRatesShippingMethod]
[ÆEditFlatRateShippingMethod]
[ÆEditPerItemShippingMethod]
[ÆEditTableRateShippingMethod]
[ÆEditUSPostalServiceShippingMethod]
5. The system validates that the new values are correct.
6. The system saves the new values.
7. The system displays the new values of the shipping method.
Use case
Add a language
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a new language.
Main Success Scenario:
1. The store administrator provides the details of the new language:
[ÆNewLanguage]
2. The system validates that the data is correct.
3. The system saves the new language.
Use case
Edit a language
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a language.
Main Success Scenario:
1. The store administrator selects the language to be edited.
2. The store administrator provides the new details of the selected language:
[ÆEditLanguage]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
80
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a language
Primary Actor: Store administrator
Precondition: There are at least two languages.
Trigger: The store administrator wants to delete a language.
Main Success Scenario:
1. The store administrator selects the language to be deleted.
2. The store administrator confirms that he wants to delete the language:
[ÆDeleteLanguage]
3. The system deletes the language.
Extensions:
2a. The deleted language is the default language of the store.
2a1. The system sets any of the available languages as the default language:
[ÆSetDefaultLanguage]
2b. The deleted language is the current language of any active session.
2b1. The system sets any of the available languages as the current language:
[ÆSetCurrentLanguage]
Use case
Set the default language
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to change the default language.
Main Success Scenario:
1. The store administrator selects the language which will become the default language.
2. The system updates the default language:
[ÆSetDefaultLanguage]
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
81
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Add a currency
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a new currency.
Main Success Scenario:
1. The store administrator provides the details of the new currency:
[ÆNewCurrency]
2. The system validates that the data is correct.
3. The system saves the new currency.
Use case
Edit a currency
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a currency.
Main Success Scenario:
1. The store administrator selects the currency to be edited.
2. The store administrator provides the new details of the selected currency:
[ÆEditCurrency]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a currency
Primary Actor: Store administrator
Precondition: There are at least two currencies.
Trigger: The store administrator wants to delete a currency.
Main Success Scenario:
1. The store administrator selects the currency to be deleted.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
82
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
2. The store administrator confirms that he wants to delete the currency:
[ÆDeleteCurrency]
3. The system deletes the currency.
Extensions:
2a. The deleted currency was the default currency.
2a1. The system sets any of the available currencies as the default currency:
[ÆSetDefaultCurrency]
2b. The deleted currency is the current currency of an active session.
2b1. The system sets any of the available currencies as the current currency:
[ÆSetCurrentCurrency]
2c. The currency is the currency of an order:
2c1. The system changes the status of the currency to disable.
[ÆCurrencyStatusChange]
2c2. The use case ends.
Use case
Update currencies
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to update automatically via Internet the change
values for currencies.
Main Success Scenario:
1. The system connects to the change information server.
2. The value change is automatically updated for all the currencies:
[ÆUpdateCurrencyValueChange]
Use case
Set the default currency
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to change the default currency.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
83
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator selects the currency which will become the default currency.
2. The system updates the default currency:
[ÆSetDefaultCurrency]
Use case
Add a country
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a country.
Main Success Scenario:
1. The store administrator provides the details of the new country:
[ÆNewCountry]
2. The system validates that the data is correct.
3. The system saves the new country.
Use case
Edit a country
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a country.
Main Success Scenario:
1. The store administrator selects the country to be edited.
2. The store administrator provides the new details of the selected country:
[ÆEditCountry]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a country
Primary Actor: Store administrator
Precondition: The country is not the location of any address.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
84
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Trigger: The store administrator wants to delete a country.
Main Success Scenario:
1. The store administrator selects the country to be deleted.
2. The system warns the store administrator of the number of zones which are part of the country to
be deleted.
3. The store administrator confirms that he wants to delete the country and their zones:
[ÆDeleteCountry]
4. The system deletes the country and their zones.
Use case
Add a zone
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a zone.
Main Success Scenario:
1. The store administrator provides the details of the new zone:
[ÆNewZone]
2. The system validates that the data is correct.
3. The system saves the new zone.
Use case
Edit a zone
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a zone.
Main Success Scenario:
1. The store administrator selects the zone to be edited.
2. The store administrator provides the new details of the selected zone:
[ÆEditZone]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
85
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a zone
Primary Actor: Store administrator
Precondition: The zone is not the location of any address.
Trigger: The store administrator wants to delete a zone.
Main Success Scenario:
1. The store administrator selects the zone to be deleted.
2. The store administrator confirms that he wants to delete the zone:
[ÆDeleteZone]
3. The system deletes the zone.
Use case
Add a tax zone
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a tax zone.
Main Success Scenario:
1. The store administrator provides the details of the new tax zone:
[ÆNewTaxZone]
2. The system validates that the data is correct.
3. The system saves the new tax zone.
Use case
Edit a tax zone
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a tax zone.
Main Success Scenario:
1. The store administrator selects the tax zone to be edited.
2. The store administrator provides the new details of the selected tax zone:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
86
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
[ÆEditTaxZone]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a tax zone
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a tax zone.
Main Success Scenario:
1. The store administrator selects the tax zone to be deleted.
2. The store administrator confirms that he wants to delete the tax zone:
[ÆDeleteTaxZone]
3. The system deletes the tax zone and all the associated tax rates.
Use case
Add a tax class
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a tax class.
Main Success Scenario:
1. The store administrator provides the details of the new tax class:
[ÆNewTaxClass]
2. The system validates that the data is correct.
3. The system saves the new tax class.
Use case
Edit a tax class
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a tax class.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
87
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Main Success Scenario:
1. The store administrator selects the tax class to be edited.
2. The store administrator provides the new details of the selected tax class:
[ÆEditTaxClass]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a tax class
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a tax class.
Main Success Scenario:
1. The store administrator selects the tax class to be deleted.
2. The system informs the store administrator about how many products are associated to the deleted
tax class.
3. The store administrator confirms that he wants to delete the tax class:
[ÆDeleteTaxClass]
4. The system deletes the tax class and all the associated tax rates.
Extensions:
2a. The store administrator don’t want to delete the tax class.
2a1. The use case ends.
Use case
Add a tax rate
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a tax rate.
Main Success Scenario:
1. The store administrator provides the details of the new tax rate:
[ÆNewTaxRate]
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
88
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
2. The system validates that the data is correct.
3. The system saves the new tax rate.
Use case
Edit a tax rate
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a tax rate.
Main Success Scenario:
1. The store administrator selects the tax rate to be edited.
2. The store administrator provides the new details of the selected tax rate:
[ÆEditTaxRate]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a tax rate
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a tax rate.
Main Success Scenario:
1. The store administrator selects the tax rate to be deleted.
2. The store administrator confirms that he wants to delete the tax rate:
[ÆDeleteTaxRate]
3. The system deletes the tax rate.
Use case
Add a product
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a product to the store catalog.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
89
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Main Success Scenario:
1. The store administrator selects the product category.
2. The store administrator provides the product data:
[ÆNewProduct]
3. The system validates that the data is correct.
4. The system saves the new product.
5. The store administrator provides a product attribute:
[ÆNewProductAttribute]
6. The system validates that the product attribute is correct.
7. The system saves the new product attribute.
The store administrator repeats steps 5-7 until he is done.
Extensions:
5a. The product does not have product attributes:
5a1. The use case ends.
5b. The product option is new:
5b1. Add a product option.
5c. The product option value is new:
5c1. Add a product option value.
Use case
Add a product option
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a product option to the store catalog.
Main Success Scenario:
1. The store administrator provides the product option data:
[ÆNewProductOption]
2. The system validates that the data is correct.
3. The system saves the new product option.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
90
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Edit a product option
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a product option.
Main Success Scenario:
1. The store administrator selects the product option to be edited.
2. The store administrator provides the new details of the selected product option:
[ÆEditProductOption]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a product option
Primary Actor: Store administrator
Precondition: The product option has not products or values linked to it.
Trigger: The store administrator wants to delete a product option.
Main Success Scenario:
1. The store administrator selects the product option to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the product option:
[ÆDeleteProductOption]
4. The system deletes the product option.
Use case
Add a product option value
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a value to a product option.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
91
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator selects the product option.
2. The store administrator provides the product option value data:
[ÆNewProductOptionValue]
3. The system validates that the data is correct.
4. The system saves the new product option value.
Use case
Edit a product option value
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a product option value.
Main Success Scenario:
1. The store administrator selects the product option value to be edited.
2. The store administrator provides the new details of the selected product option value:
[ÆEditProductOptionValue]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a product option value
Primary Actor: Store administrator
Precondition: The product option value has not products linked to it.
Trigger: The store administrator wants to delete a product option value.
Main Success Scenario:
1. The store administrator selects the product option value to delete.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the product option value:
[ÆDeleteProductOptionValue]
4. The system deletes the product option value.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
92
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Add a product attribute
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to assign an attribute to a product.
Main Success Scenario:
1. The store administrator selects the product.
2. The store administrator provides the attribute and the product attribute data (increment and sign):
[ÆNewProductAttribute]
[ÆNewDownloadableProductAttribute]
3. The system validates that the data is correct.
4. The system saves the new product attribute.
Extensions:
2a. The product option is new:
2a1. Add a product option.
2b. The product option value is new:
2b1. Add a product option value.
Use case
Edit a product attribute
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a product attribute.
Main Success Scenario:
1. The store administrator selects the product attribute to be edited.
2. The store administrator provides the new details for the product attribute:
[ÆAttributeChange]
[ÆIncrementAndSignAttributeChange]
[ÆEditDownloadableAttribute]
3. The system validates that the data is correct.
4. The system saves the changes.
The system repeats steps 2-4 until he is done.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
93
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a product attribute
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a product attribute.
Main Success Scenario:
1. The store administrator selects the product attribute to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the product attribute:
[ÆDeleteProductAttribute]
4. The system deletes the product attribute.
Extensions:
3a. The product attribute is part of an existing order line:
3a1. The system changes the status of the product attribute to disable.
[ÆProductAttributeStatusChange]
3a2. The use case ends
Use case
Edit a product
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a product.
Main Success Scenario:
1. The store administrator selects the product to be edited.
2. The store administrator provides the new values for the attributes of the product:
[ÆEditProduct]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
94
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a product
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a product.
Main Success Scenario:
1. The store administrator selects the product to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the product:
[ÆDeleteProduct]
4. The system deletes the product and their product attributes.
Extensions:
3a. The product is part of an order:
3a1. The system changes the status of the product to disable.
[ÆProductStatusChange]
3a2. The use case ends.
Use case
Move a product
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to change the category of a product.
Main Success Scenario:
1. The store administrator selects the product to be moved.
2. The store administrator indicates the new category of the selected product, if any:
[ÆMoveProduct]
3. The system validates that the data is correct.
4. The system saves the new placement.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
95
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Link a product
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to link a product to another category.
Main Success Scenario:
1. The store administrator selects the product to be linked.
2. The store administrator indicates the new category of the selected product, if any :
[ÆLinkProduct]
3. The system links the product.
Use case
Add a product category
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a category.
Main Success Scenario:
1. The store administrator provides the details of the new product category, including its parent
category, if any:
[ÆNewCategory]
2. The system validates that the data is correct.
3. The system saves the new category.
Use case
Edit a product category
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a category.
Main Success Scenario:
1. The store administrator selects the category to be edited.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
96
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
2. The store administrator provides the new details of the selected category:
[ÆEditCategory]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Move a product category
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to change the placement of a category in the
category hierarchy.
Main Success Scenario:
1. The store administrator selects the category to be moved.
2. The store administrator indicates the new parent category, if any:
[ÆMoveCategory]
3. The system validates that the data is correct.
4. The system saves the new placement.
Use case
Delete a product category
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a category.
Main Success Scenario:
1. The store administrator selects the category to be deleted.
2. The system warns the store administrator of the number of subcategories and products linked to the
category to be deleted.
3. The store administrator confirms that he wants to delete the category:
[ÆDeleteCategory]
4. The system deletes the selected category and its subcategories. The products linked to the deleted
category or its subcategories are removed from the system if they do not participate in any orders.
The system changes the status of the products which participate in orders to out of stock.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
97
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Add a special
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a special.
Main Success Scenario:
1. The store administrator selects the product which will be offered in a special price.
2. The store administrator provides the details of the special:
[ÆNewSpecial]
3. The system validates that the data is correct.
4. The system saves the new special.
Use case
Edit a special
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a special.
Main Success Scenario:
1. The store administrator selects the special to be edited.
2. The store administrator provides the new details of the selected special:
[ÆEditSpecial]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a special
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a special.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
98
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator selects the special to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the special:
[ÆDeleteSpecial]
4. The system deletes the special.
Use case
Add a manufacturer
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a manufacturer.
Main Success Scenario:
1. The store administrator provides the details of the new manufacturer:
[ÆNewManufacturer]
2. The system validates that the data is correct.
3. The system saves the new manufacturer.
Use case
Edit a manufacturer
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a manufacturer.
Main Success Scenario:
1. The store administrator selects the manufacturer to be edited.
2. The store administrator provides the new details of the selected manufacturer:
[ÆEditManufacturer]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
99
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a manufacturer
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a manufacturer.
Main Success Scenario:
1. The store administrator selects the manufacturer to delete.
2. The system warns the store administrator of the number of products linked to the manufacturer to
be deleted.
3. The store administrator confirms that he wants to delete the manufacturer:
[ÆDeleteManufacturer]
4. The system deletes the manufacturer and, if requested, changes the status of the products
manufactured by it to out of stock.
Use case
Add a banner
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a new banner.
Main Success Scenario:
1. The store administrator provides the details of the new banner:
[ÆNewBanner]
2. The system validates that the data is correct.
3. The system saves the new banner.
Use case
Edit a banner
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a banner.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
100
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator selects the banner to be edited.
2. The store administrator provides the new details of the selected banner:
[ÆEditBanner]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a banner
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a banner.
Main Success Scenario:
1. The store administrator selects the banner to be deleted.
2. The store administrator confirms that he wants to delete the banner:
[ÆDeleteBanner]
3. The system deletes the banner.
Use case
Add a banner group
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a new banner group.
Main Success Scenario:
1. The store administrator provides the details of the new banner group:
[ÆNewBannerGroup]
2. The system validates that the data is correct.
3. The system saves the new banner.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
101
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Edit a banner group
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a banner group.
Main Success Scenario:
1. The store administrator selects the banner group to be edited.
2. The store administrator provides the new details of the selected banner group:
[ÆEditBannerGroup]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a banner group
Primary Actor: Store administrator
Precondition: The banner group doesn’t contain any banners.
Trigger: The store administrator wants to delete a banner.
Main Success Scenario:
1. The store administrator selects the banner group to be deleted.
2. The store administrator confirms that he wants to delete the banner group:
[ÆDeleteBannerGroup]
3. The system deletes the banner.
Use case
Send an email
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to send an email to customers.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
102
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator selects the addressee customer, or one of the predefined set of addressee
customers (all the customers or all the newsletter subscribers).
2. The store administrator specifies the sender address.
3. The store administrator provides the subject and the message.
4. The store administrator confirms that he wants to send the email.
5. The system sends the email.
Use case
Create a newsletter
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to create a new newsletter.
Main Success Scenario:
1. The store administrator selects the type of the newsletter (newsletter or product nofitification).
2. The store administrator provides the title and the content of the newsletter:
[ÆNewNewsletter]
[ÆNewProductNotification]
3. The system validates that the data is correct.
4. The system saves the newsletter.
Use case
Edit a newsletter
Primary Actor: Store administrator
Precondition: The newsletter is unlocked.
Trigger: The store administrator wants to edit a newsletter.
Main Success Scenario:
1. The store administrator selects the newsletter to be edited.
2. The store administrator provides the new details of the selected newsletter:
[ÆEditNewsletter]
[ÆEditProductNotification]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
103
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete a newsletter
Primary Actor: Store administrator
Precondition: The newsletter is unlocked.
Trigger: The store administrator wants to delete a newsletter.
Main Success Scenario:
1. The store administrator selects the newsletter to be deleted.
2. The store administrator confirms that he wants to delete the newsletter:
[ÆDeleteNewsletter]
3. The system deletes the newsletter.
Use case
Lock a newsletter
Primary Actor: Store administrator
Precondition: The newsletter is unlocked.
Trigger: The store administrator wants to indicate to the other administrators that a
newsletter is pending to be delivered.
Main Success Scenario:
1. The store administrator selects the newsletter to be locked.
[ÆLockNewsletter]
2. The system saves the change.
Use case
Unlock a newsletter
Primary Actor: Store administrator
Precondition: The newsletter is locked.
Trigger: The store administrator wants to indicate to the other administrators that a
newsletter ceases to be locked.
Main Success Scenario:
1. The store administrator selects the newsletter to be unlocked.
[ÆUnlockNewsletter]
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
104
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
2. The system saves the change.
Use case
Send a newsletter
Primary Actor: Store administrator
Precondition: The newsletter is locked.
Trigger: The store administrator wants to send a newsletter.
Main Success Scenario:
1. The store administrator selects the newsletter which will be sent.
2. The system sends the newsletter to all the newsletter subscribers.
3. The system saves that the newsletter has been sent.
[ÆSendNewsletter]
Extensions:
2a. The newsletter is a product notification.
2a1. The store administrator selects which products are implied in the notification.
2a2. The systems sends the newsletter to customers who are subscribed to some of the
notificated products.
2a3. The use case continues at step 3.
Use case
Create a customer
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to open an account in the store.
Main Success Scenario:
1. The customer provides the required customer data:
[ÆNewCustomer]
2. The system validates the customer data.
3. The system saves the new account.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
105
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Change password
Primary Actor: Customer
Precondition: The customer is logged in.
Trigger: A customer wants to change his password.
Main Success Scenario:
1. The customer provides the old password.
2. The customer provides the new password twice.
[ÆPasswordChange]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Change customer details
Primary Actor: Customer
Precondition: The customer is logged in.
Trigger: A customer wants to change its customer details.
Main Success Scenario:
1. The customer provides the new customer details.
[ÆEditCustomerDetails]
2. The system validates that the data is correct.
3. The system saves the changes.
Use case
Administrate address book
Primary Actor: Customer
Precondition: The customer is logged in and the number of addresses is less than the
maximum number of address entries permitted.
Trigger: A customer wants to view or change the address book.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
106
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system displays the current address book entries of the customer.
2. The customer selects an address book entry to be edited :
[ÆEditCustomerAddress]
3. The system validates that the data is correct.
4. The system saves the changes and displays the new address book.
The customer repeats steps 1-4 until he is done.
Extensions:
2a. The customer doesn’t want to change the address book:
2a1. The use case ends.
2b. The customer wants to add a new address book entry:
2b1. The customer provides the required data:
[ÆNewCustomerAddress]
2b2. The use case continues at step 3.
2c. The customer wants to delete an address book entry:
2c1. The customer selects the address book entry:
[ÆDeleteCustomerAddress]
2c2. The use case continues at step 3.
2d. The customer wants to change the default address book entry:
2d1. The customer selects the new default address book entry:
[ÆPrimaryCustomerAddressChange]
2d2. The use case continues at step 3.
Use case
Administrate subscriptions
Primary Actor: Customer
Precondition: The customer is logged in.
Trigger: A customer wants to view or change their product notification subscriptions.
Main Success Scenario:
1. The system displays the details of the current product notification subscriptions of the customer.
2. The customer adds a new product subscription:
[ÆNewProductNotificationSubscription]
3. The system validates that the data is correct.
4. The system saves the changes and displays the new product notification subscriptions.
The customer repeats steps 1-4 until he is done.
Extensions:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
107
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
2a. The customer doesn’t want to change their product notification subscriptions:
2a1. The use case ends.
2b. The customer wants to be subscribed or unsubscribed to all product notifications:
[Æ EditGlobalNotifications]
2c. The customer wants to delete a product notification subscription:
2c1. The customer selects the product:
[ÆDeleteProductNotificationSubscription]
2c2. The use case continues at step 3.
Use case
Edit a customer
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a customer.
Main Success Scenario:
1. The store administrator selects the customer to be edited.
2. The store administrator provides the new details of the selected customer:
[ÆEditCustomer]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a customer
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a customer.
Main Success Scenario:
1. The store administrator selects the customer to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the customer:
[ÆDeleteCustomer]
4. The system deletes the customer and their addresses, reviews, notification subscriptions and
shopping carts.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
108
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Extensions:
3a. The customer has orders:
3a1. The system changes the status of the customer to disable.
[ÆCustomerStatusChange]
3a2. The system deletes customer's addresses, reviews, notification subscriptions
and shopping carts.
3a3. The use case ends.
Use case
Open session
Primary Actor: Customer
Precondition: None.
Trigger: A customer starts using the system.
Main Success Scenario:
1. The system creates an anonymous session :
[ÆNewSession]
Use case
Finish session
Primary Actor: Customer
Precondition: None.
Trigger: A customer finishes using the system.
Main Success Scenario:
1. The system deletes the current session.
[ÆDeleteSession]
Extensions:
1a. The customer is logged in and the session has a non empty shopping cart.
1a1. The shopping cart is saved.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
109
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Log in
Primary Actor: Customer
Precondition: The customer is not logged in yet.
Trigger: A customer logs in the system.
Main Success Scenario:
1. The customer introduces their identification data.
2. The system validates the identification data.
3. The customer becomes the owner of the current session.
[ÆLogIn]
Extensions:
3a. The customer has a shopping cart from a previous session.
3a1. The previous shopping cart is restored.
[ÆRestorePreviousShoppingCart]
Use case
LogOut
Primary Actor: Customer
Precondition: The customer is logged in.
Trigger: A customer logs out from the system.
Main Success Scenario:
1. The current session becomes anonymous.
[ÆLogOut]
Extensions:
1a. The customer has a non empty shopping cart.
1a1. The shopping cart is saved.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
110
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Change the current language
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to change the current language of the session.
Main Success Scenario:
1. The store administrator selects the language which will become the current language.
2. The system updates the current language.
[ÆSetCurrentLanguage]
Use case
Change the current currency
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to change the current currency of the session.
Main Success Scenario:
1. The store administrator selects the currency which will become the current currency.
2. The system updates the current currency.
[ÆSetCurrentCurrency]
Use case
Add a review
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to write a review of a product.
Main Success Scenario:
1. The customer selects a product.
2. The customer provides the content and the rate of the review:
[ÆNewReview]
3. The system validates that the data is correct.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
111
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
4. The system saves the review.
Extensions:
2a. The customer is not logged in:
2a1. The customer logs in:
[ÆLogIn]
2a2. The use case continues at step 2.
Use case
Edit a review
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit a review.
Main Success Scenario:
1. The store administrator selects the review to be edited.
2. The store administrator provides the modified text and the new rating of the selected review.
[ÆEditReview]
3. The system validates that the data is correct.
4. The system saves the changes.
Use case
Delete a review
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to delete a review.
Main Success Scenario:
1. The store administrator selects the review to be deleted.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to delete the review:
[ÆDeleteReview]
4. The system deletes the review.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
112
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Place an order
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to place and order.
Main Success Scenario:
1. At any time before step 10 the customer logs in:
[ÆLogIn]
The system adds the contents of the anonymous shopping cart to the customer shopping cart.
2. The system displays the contents of the shopping cart.
3. The customer browses the product catalog.
[ÆReadProductInfo]
4. The customer selects a product to buy:
[ÆAddProductToShoppingCart]
5. The system adds the product to the shopping cart.
6. The system displays the contents of the shopping cart.
7. The customer changes the contents of the shopping cart:
[ÆUpdateShoppingCart]
8. The system updates the shopping cart.
9. The system displays the contents of the updated shopping cart.
The customer repeats steps 3,4 and 7 as necessary to build his order.
10. The customer checks out the order.
11. The system shows the shipping address and the available shipping methods.
12. The customer selects the preferred shipping method.
13. The system shows the billing address and the available payment methods.
14. The customer selects the preferred payment method.
15. The system displays a summary of the order.
16. The customer confirms the order:
[ÆOrderConfirmation]
17. The system saves the order.
18. The system sends an email to the customer and to the store extra order emails with the
information about the order.
Extensions:
1a. The customer is new:
1a1. Create customer.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
113
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
5a. The configurable option Display cart after adding a product is disabled
The customer repeats steps 3 and 4 as necessary.
5a1. The customer continues with the checkout procedure at step 9.
16a. The customer wants to change the contents of the shopping cart:
16a1. The customer changes the contents of the shopping cart:
[ÆUpdateShoppingCart]
16a2. The customer continues with the checkout procedure at step 11.
11a, 16a. The customer wants to change the shipping address:
11a1. The system shows the know addresses of the customer.
11a2. The customer selects a different shipping address.
11a3. The customer continues with the checkout procedure at step 11.
13a, 16b. The customer wants to change the billing address:
13a1. The system shows the know addresses of the customer.
13a2. The customer selects a different billing address.
13a3. The customer continues with the checkout procedure at step 13.
16c. The customer wants to change the shipping method:
16c1. The customer selects the new shipping method.
16c2. The customer continues with the checkout procedure at step 13.
16d. The customer wants to change the payment method:
16d1. The customer selects the new payment method.
16d2. The customer continues with the checkout procedure at step 15.
11a2a,16a2a. The customer wants to define a new shipping address:
11a2a1. The customer gives the new address:
[ÆNewCustomerAddress]
11a2a2. The system saves the address.
11a2a3. The customer continues with the checkout procedure at step 11.
13a2a,16b2a. The customer wants to define a new billing address:
13a2a1. The customer gives the new address:
[ÆNewCustomerAddress]
13a2a2. The system saves the address.
13a2a3. The customer continues with the checkout procedure at step 13.
Use case
Cancel an order
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to cancel an order.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
114
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Main Success Scenario:
1. The store administrator selects the order to be cancelled.
2. The system asks for the confirmation of the store administrator.
3. The store administrator confirms that he wants to cancel the order:
[ÆCancelOrder]
4. The system sets the order status to cancelled.
Use case
Add an order status
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to add a new order status.
Main Success Scenario:
1. The store administrator provides the details of the new order status:
[ÆNewOrderStatus]
2. The system validates that the data is correct.
3. The system saves the new order status.
Use case
Edit an order status
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to edit an order status.
Main Success Scenario:
1. The store administrator selects the order status to be edited.
2. The store administrator provides the new details of the selected order status:
[ÆEditOrderStatus]
3. The system validates that the data is correct.
4. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
115
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Delete an order status
Primary Actor: Store administrator
Precondition: The deleted order status is not the current status of any order.
Trigger: The store administrator wants to delete an order status.
Main Success Scenario:
1. The store administrator selects the order status to be deleted.
2. The store administrator confirms that he wants to delete the order status:
[ÆDeleteOrderStatus]
3. The system deletes the order status.
Extensions:
2a. The order status has been an status of an order:
2a1. The system changes the status of the order status to disable.
[ÆProductStatusChange]
2a2. The use case ends.
Use case
Change the status of an order
Primary Actor: Store administrator
Precondition: None.
Trigger: The store administrator wants to change the status of an order.
Main Success Scenario:
1. The system shows the orders and their status.
2. The store administrator selects the order which will be edited.
3. The system shows the applicable order status.
4. The store administrator selects the new status.
[ÆUpdateOrderStatus]
5. The system validates that the data is correct.
6. The system saves the changes.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
116
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Set cancelled order status
Primary Actor: Store administrator
Precondition: The order status is not yet the cancelled status.
Trigger: The store administrator wants to indicate to the system which order status is used
to indicate that an order is cancelled.
Main Success Scenario:
1. The store administrator selects an order status.
2. The system register that the selected order status represents cancelled orders.
[ÆSetCancelledOrderStatus]
Use case
Set default order status
Primary Actor: Store administrator
Precondition: The order status is not yet the default status.
Trigger: The store administrator wants to indicate to the system which order status is assign
when an order is created.
Main Success Scenario:
1. The store administrator selects an order status.
2. The system register that the selected order status is the default order status.
[ÆSetDefaultOrderStatus]
Use case
Show a banner
Primary Actor: System.
Precondition: None.
Trigger: The system shows a banner.
Main Success Scenario:
1. The system shows a banner.
[ÆShowBanner]
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
117
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Use case
Click a banner
Primary Actor: Customer
Precondition: None.
Trigger: The customer clicks on a banner.
Main Success Scenario:
1. The customer clicks on a banner.
[ÆClickBanner]
2. The system redirects the online store to the banner’s web page.
Use case
Read a review
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to read a review of a product.
Main Success Scenario:
1. The system shows a summary of the reviews of the product.
2. The customer selects a review.
[ÆReadReview]
3. The system shows the selected review.
Use case
Download a product
Primary Actor: Customer
Precondition: The customer is logged in.
The customer purchased the product.
Download is enabled by the system.
The download is not expired and the number of download has not been
exceeded.
Trigger: A customer wants to download a purchased product.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
118
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The customer selects the purchased product to be downloaded.
[ÆProductDownload]
2. The system allows the customer downloading the product.
Use case
Show manufacturer’s web
Primary Actor: Customer
Precondition: None.
Trigger: A customer wants to be redirected to the manufacturer’s web page.
Main Success Scenario:
1. The customer selects a manufacturer.
[ÆClickManufacturer]
2. The customer is redirected to the the manufacturer’s web page.
Use case
Show products under stock
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to obtain which products have to be reordered.
Main Success Scenario:
1. The system shows the set of products under stock :
[ÆShowUnderStockProducs]
Use case
Show expected products
Primary Actor: Store administrator, Customer.
Precondition: None.
Trigger: The store administrator or the customer wants to obtain which products will be in
stock soon.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
119
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system shows the set of expected products:
[ÆShowExpectedProducs]
Use case
Show orders of a customer
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to obtain the orders of a customer.
Main Success Scenario:
1. The system shows the list of customers.
2. The store administrator selects a customer.
3. The system shows the orders of the selected customer:
[ÆShowOrdersOfCustomer]
Use case
Show previous orders
Primary Actor: Customer.
Precondition: The customer is logged in.
Trigger: A Customer wants to visualize their orders.
Main Success Scenario:
1. The system shows the previous orders made by the customer:
[ÆShowOrdersOfCustomer]
Use case
Show best viewed products
Primary Actor: Store administrator, Customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize the most viewed
products.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
120
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system shows the products in stock ordered by the number of times which has been visualized
by the customers.
[ÆShowBestViewedProducts]
Use case
Show best products purchased
Primary Actor: Store administrator, Customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize the most purchased
products.
Main Success Scenario:
1. The system shows the products in stock ordered by the number of times which has been purchased
by the customers.
[ÆShowBestPurchasedProducts]
Use case
Show customer’s orders total
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to visualize the total amount of money spent by each
customer in the online store.
Main Success Scenario:
1. The system shows the customers and the total price of their orders.
[ÆShowCustomersOrdersTotal]
Use case
Online customers
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to visualize the customers who are online.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
121
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The system shows the online customers.
[ÆShowOnlineCustomers]
Use case
Show specials
Primary Actor: Store administrator, Customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize products on offer.
Main Success Scenario:
1. The system shows the products on offer.
[ÆShowSpecials]
Use case
Show products of a category
Primary Actor: Store administrator, customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize the products contained in
a category.
Main Success Scenario:
1. The store administrator or the customer selects a category.
2. The system shows the products of the selected category.
[ÆShowProductsOfCategory]
Use case
Show products of a manufacturer
Primary Actor: Store administrator, customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize the products produced
by a manufacturer.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
122
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The store administrator or the customer selects a manufacturer.
2. The system shows the products manufactured by the selected manufacturer.
[ÆShowProductsOfManufacturer]
Use case
Show new products
Primary Actor: Customer.
Precondition: None.
Trigger: The customer wants to visualize the last launched products.
Main Success Scenario:
1. The system shows the last products on sale.
[ÆShowNewProducts]
Use case
Show reviews of a product
Primary Actor: Store administrator, customer.
Precondition: None.
Trigger: The store administrator or the customer wants to visualize the reviews of a product.
Main Success Scenario:
1. The store administrator or the customer selects a product.
2. The system shows the reviews of the selected product
[ÆShowReviewsOfProduct]
Use case
Tell to a friend
Primary Actor: Customer.
Precondition: None.
Trigger: A Customer wants to send the current web page to a friend with a comment by
email.
Main Success Scenario:
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
123
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
1. The customer provides his name, his friend’s name, his friend’s email and the message about the
web page.
2. The system sends the email with a link to the current web page.
Use case
Generate an invoice
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to generate an invoice corresponding to an order.
Main Success Scenario:
1. The store administrator selects the order.
2. The system shows a printable invoice.
Use case
Generate a packaging slip
Primary Actor: Store administrator.
Precondition: None.
Trigger: The store administrator wants to generate a packaging slip of an order.
Main Success Scenario:
1. The store administrator selects the order.
2. The system shows a printable packaging slip.
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
124
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
3.4 EVENTS SPECIFICATION
Event
AddProductToShoppingCart
„
Event diagram
Session
1
SessionEvent
DomainEvent
AddProductToShoppingCart
Attribute
*
1
quantity : PositiveInteger
Product
effect()
„
Initial Integrity Constraints
context AddProductToShoppingCart::AttributesAreFromProduct(): Boolean
body : self.product.attribute -> includesAll(self.attribute)
context AddProductToShoppingCart::AttributesAreOfDifferentOptions(): Boolean
body : self.attribute -> isUnique(option)
„
Effect
context AddProductToShoppingCart::effect()
post ShoppingCartItemIsCreated :
sci.oclIsNew and
sci.oclIsTypeOf(ShoppingCartItem) and
sci.quantity = self.quantity and
sci.product = self.product and
sci.attribute = self.attribute and
if self.session.shoppingCart -> notEmpty() then
--The session has a shopping cart
self.session.shoppingCart.shoppingCartItem -> includes(sci)
else
--The session does not have a shopping cart
if self.session.customer -> isEmpty() then
--The session is Anonymous
sc.oclIsNew() and
sc.oclIsTypeOf(AnonymousShoppingCart) and
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
125
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
self.session.shoppingCart = sc and
sc.shoppingCartItem -> includes(sci)
else
--The customer has logged in
if self.session.customer.customerShoppingCart -> notEmpty() then
--The customer has a previous shopping cart
self.session.shoppingCart = self.session.customer.customerShoppingCart and
self.session.shoppingCart.shoppingCartItem -> includes(sci)
else
--The customer does not have a previous shopping cart
csc.oclIsNew() and
csc.oclIsTypeOf(CustomerShoppingCart) and
self.session.shoppingCart = csc and
csc.shoppingCartItem -> includes(sci)
endif
endif
endif
Event
AddressBookEntriesMaximumChange
„
Event diagram
DomainEvent
AddressBookEntriesMaximumChange
newMaximum : Natural
effect()
„
Effect
context AddressBookEntriesMaximumChange::effect()
post : MaximumValues.addressBookEntries = self.newMaximum
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
126
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
AllowCheckoutStockConfigurationChange
„
Event diagram
DomainEvent
AllowCheckoutStockConfigurationChange
newValue : Boolean
effect()
„
Effect
context AllowCheckoutStockConfigurationChange::effect()
post : Stock.allowCheckout= self.newValue
Event
AllowGuestToTellAFriendChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
AllowGuestToTellAFriendChange
newAllowGuestToTellAFriend : Boolean
effect()
context StoreEvent::myStore():Store
body : Store.allInstances() -> any(true)
„
Effect
context AllowGuestToTellAFriendChange::effect()
post : myStore.allowGuestToTellAFriend = self.newAllowGuestToTellAFriend
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
127
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
AttributeChange
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
1
newValue
Value
„
DomainEvent
AttributeChange
effect()
1
newOption
Effect
context AttributeChange::effect()
post :
self.productAttribute.attribute.value = self.newValue and
self.productAttribute.attribute.option = self.newOption
Event
CancelOrder
„
Event diagram
Order
1
ExistingOrderEvent
DomainEvent
CancelOrder
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
128
Option
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context CancelOrder::effect()
post:
self.order.orderStatusChange -> sortedBy(added) -> last().orderStatus =
Store.allInstances() ->any(true).cancelledStatus
Event
CheckLevelStockConfigurationChange
„
Event diagram
DomainEvent
CheckLevelStockConfigurationChange
newValue : Boolean
effect()
„
Effect
context CheckLevelStockConfigurationChange::effect()
post : Stock.checkStockLevel= self.newValue
Event
CityMinimumChange
„
Event diagram
DomainEvent
CityMinimumChange
newMinimum : PositiveInteger
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
129
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context CityMinimumChange::effect()
post : MinimumValues.city = self.newMinimum
Event
ClickBanner
„
Event diagram
DomainEvent
1
ExistingBannerEvent
ClickBanner
effect()
„
Effect
context ClickBanner::effect()
post :
BannerHistory.allInstances() -> one
(bh | bh.banner = self.banner and
bh.date = Today() and
bh.clicked = [email protected] + 1)
Event
ClickManufacturer
„
Event diagram
Manufacturer
1
ExistingManufacturerEvent
DomainEvent
ClickManufacturer
1
Language
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
130
Banner
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ClickManufacturer::effect()
post :
let manufacturerLanguageRead:ManufacturerInLanguage =
ManufacturerInLanguage.allInstances() -> select
(mil | mil.manufacturer = self.manufacturer and
mil.language = self.language)
in
manufacturerLanguageRead.urlClicked = [email protected] + 1 and
manufacturerLanguageRead.lastClick = Now()
Event
CompanyCustomerDetailChange
„
Event diagram
DomainEvent
CompanyCustomerDetailChange
newValue : Boolean
effect()
„
Effect
context CompanyCustomerDetailChange::effect()
post : CustomerDetails.company = self.newValue
Event
CompanyNameMinimumChange
„
Event diagram
DomainEvent
CompanyNameMinimumChange
newMinimum : Natural
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
131
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context CompanyNameMinimumChange::effect()
post : MinimumValues.companyName = self.newMinimum
Event
CountryChange
„
Event diagram
DomainEvent
StoreEvent
Store
1
/myStore
CountryChange
1
newCountry
effect()
„
Country
Effect
context CountryChange::effect()
post : myStore.country = self.newCountry
Event
CountryShippingConfigurationChange
„
Event diagram
DomainEvent
CountryShippingConfigurationChange
1
effect()
„
Country
newCountryOfOrigin
Effect
context CountryShippingConfigurationChange::effect()
post : ShippingAndPackaging.countryOfOrigin = self.newCountryOfOrigin
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
132
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
CreditCardNumberMinimumChange
„
Event diagram
DomainEvent
CreditCardNumberMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context CreditCardNumberMinimumChange::effect()
post : MinimumValues.creditCardNumber = self.newMinimum
Event
CreditCardOwnerNameMinimumChange
„
Event diagram
DomainEvent
CreditCardOwnerNameMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context CreditCardOwnerNameMinimumChange::effect()
post : MinimumValues.creditCardOwnerName = self.newMinimum
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
133
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
CurrencyStatusChange
„
Event diagram
Currency
1
ExistingCurrencyEvent
DomainEvent
CurrencyStatusChange
newStatus : Status
effect()
„
Effect
context CurrencyStatusChange::effect()
post : self.currency.status = self.newStatus
Event
CustomerStatusChange
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
CustomerStatusChange
newStatus : Status
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
134
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context CustomerStatusChange::effect()
post : self.customer.status = self.newStatus
Event
DateOfBirthCustomerDetailChange
„
Event diagram
DomainEvent
DateOfBirthCustomerDetailChange
newValue : Boolean
effect()
„
Effect
context DateOfBirthCustomerDetailChange::effect()
post : CustomerDetails.dateOfBirth = self.newValue
Event
DateOfBirthMinimumChange
„
Event diagram
DomainEvent
DateOfBirthMinimumChange
newMinimum : PositiveInteger
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
135
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DateOfBirthMinimumChange::effect()
post : MinimumValues.dateOfBirth = self.newMinimum
Event
DaysExpiryDelayDownloadConfigurationChange
„
Event diagram
DomainEvent
DaysExpiryDelayDownloadConfigurationChange
newValue : Natural
effect()
„
Effect
context DaysExpiryDelayDownloadConfigurationChange::effect()
post : Download.daysExpiryDelay= self.newValue
Event
DefaultSearchOperatorChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
DefaultSearchOperatorChange
newDefaultSearchOperator : Operator
effect()
„
Effect
context DefaultSearchOperatorChange::effect()
post : myStore.defaultSearchOperator = self.newDefaultSearchOperator
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
136
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteBanner
„
Event diagram
Banner
1
ExistingBannerEvent
DomainEvent
DeleteBanner
effect()
„
Effect
context DeleteBanner::effect()
post : not [email protected](OclAny)
Event
DeleteBannerGroup
„
Event diagram
BannerGroup
1
ExistingBannerGroupEvent
DomainEvent
DeleteBannerGroup
effect()
„
Initial Integrity Constraints
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
137
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context DeleteBannerGroup::BannerGroupIsEmpty():Boolean
body : self.bannerGroup.banner -> isEmpty()
„
Effect
context DeleteBannerGroup::effect()
post : not [email protected](OclAny)
Event
DeleteCategory
„
Event diagram
Category
1
DomainEvent
ExistingCategoryEvent
DeleteCategory
effect()
„
Effect
context DeleteCategory::effect()
post deleteCategoryAndSubcategories:
not [email protected](OclAny) and
not [email protected]@pre -> forAll(c | c.oclIsKindOf(OclAny))
post deleteProductsOfCategory:
[email protected]@pre -> forAll(p |
if p.orderLine -> notEmpty() then p.status = ProductStatus::outOfStock
else [email protected](OclAny)
endif )
post deleteProductsOfChildCategory:
[email protected]@pre.product@pre -> forAll(p |
if p.orderLine -> notEmpty() then p.status = ProductStatus::outOfStock
else p.oclIsKindOf(OclAny)
endif )
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
138
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteCountry
„
Event diagram
Country
1
ExistingCountryEvent
DomainEvent
DeleteCountry
effect()
„
Initial Integrity Constraints
context DeleteCountry::CountryIsNotALocation():Boolean
body :
Store.allInstances() -> any(true).country <> self.country and
Address.allInstances().country -> excludes(self.country)
„
Effect
context DeleteCountry::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
139
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteCurrency
„
Event diagram
Currency
1
ExistingCurrencyEvent
DomainEvent
DeleteCurrency
effect()
„
Initial Integrity Constraints
context DeleteCurrency::AtLeastTwoCurrencies(): Boolean
body : Currency.allInstances() -> size() >= 2
„
Effect
context DeleteCurrency::effect()
post: not [email protected](OclAny)
Event
DeleteCustomer
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
DeleteCustomer
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
140
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DeleteCustomer::effect()
post deleteCustomer:
not [email protected](OclAny)
post deleteReviewsAndShoppingCart:
not [email protected]@pre -> forAll (r | r.oclIsKindOf(OclAny)) and
[email protected]>notEmpty()
implies
not [email protected]@pre.oclIsKindOf(OclAny))
Event
DeleteCustomerAddress
„
Event diagram
<<dataType>>
Customer
Address
1
1
ExistingAddressEvent
DomainEvent
ExistingCustomerEvent
DeleteCustomerAddress
effect()
„
Initial Integrity Constraints
context DeleteCustomerAddress::AddressOfCustomer(): Boolean
body : self.customer.address -> includes(self.address)
context DeleteCustomerAddress::AtLeastTwoAddresses(): Boolean
body : self.customer.address.size() >= 2
„
Effect
context DeleteCustomerAddress::effect()
post : self.customer.address -> excludes(self.address)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
141
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteLanguage
„
Event diagram
Language
1
ExistingLanguageEvent
DomainEvent
DeleteLanguage
effect()
„
Initial Integrity Constraints
context DeleteLanguage::AtLeastTwoLanguages(): Boolean
body : Language.allInstances() -> size() >= 2
„
Effect
context DeleteLanguage::effect()
post: not [email protected](OclAny)
Event
DeleteManufacturer
„
Event diagram
Manufacturer
1
DomainEvent
ExistingManufacturerEvent
DeleteManufacturer
deleteProds : Boolean
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
142
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DeleteManufacturer::effect()
post deleteManufacturer:
not [email protected](OclAny)
post changeProductsToOutOfStock:
deleteProds implies
[email protected]@pre ->
forAll(status = ProductStatus::outOfStock)
Event
DeleteNewsletter
„
Event diagram
Newsletter
1
ExistingNewsletter
DomainEvent
DeleteNewsletter
effect()
„
Effect
context DeleteNewsletter::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
143
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteOrderStatus
„
Event diagram
OrderStatus
1
ExistingOrderStatusEvent
DomainEvent
DeleteOrderStatus
effect()
„
Initial Integrity Constraints
context DeleteOrderStatus:: IsNotTheCurrentStatusOfAnyOrder(): Boolean
body :
Order.allInstances() -> forAll (o | o.orderStatusChange -> sortedBy(added)
-> last().orderStatus <> self.orderStatus)
„
Effect
context DeleteOrderStatus::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
144
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteProduct
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
DeleteProduct
effect()
„
Effect
context DeleteProduct::effect()
post: not [email protected](OclAny)
Event
DeleteProductAttribute
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
DomainEvent
DeleteProductAttribute
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
145
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DeleteProductAttribute::effect()
post: not [email protected](OclAny)
Event
DeleteProductNotificationSubscription
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
DeleteProductNotificationSubscription
„
1
Product
deletedSubscribedProduct
effect()
Effect
context DeleteProductNotificationSubscription::effect()
post : customer.explicitNotifications -> excludes(self.deletedSubscribedProduct)
Event
DeleteProductOption
„
Event diagram
Option
1
ExistingOptionEvent
DomainEvent
DeleteProductOption
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
146
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context DeleteProductOption::HasNotProductsOrValues():Boolean
body : self.option.value -> isEmpty() and self.option.attribute.product -> isEmpty()
„
Effect
context DeleteProductOption::effect()
post : not [email protected](OclAny)
Event
DeleteProductOptionValue
„
Event diagram
Value
1
ExistingValueEvent
DomainEvent
DeleteProductOptionValue
effect()
„
Initial Integrity Constraints
context DeleteProductOptionValue::HasNotProducts():Boolean
body : self.value.attribute.product -> isEmpty()
„
Effect
context DeleteProductOptionValue::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
147
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteReview
„
Event diagram
Review
1
ExistingReviewEvent
DomainEvent
DeleteReview
effect()
„
Effect
context DeleteReview::effect()
post : not [email protected](OclAny)
Event
DeleteSession
„
Event diagram
Session
1
ExistingSessionEvent
DomainEvent
DeleteSession
effect()
„
Effect
context DeleteSession::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
148
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteSpecial
„
Event diagram
Special
1
ExistingSpecialEvent
DomainEvent
DeleteSpecial
effect()
„
Effect
context DeleteSpecial::effect()
post :
special.oclIsTypeOf(Product) and
not special.oclIsTypeOf(Special)
Event
DeleteTaxClass
„
Event diagram
TaxClass
1
ExistingTaxClassEvent
DomainEvent
DeleteTaxClass
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
149
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DeleteTaxClass::effect()
post deleteTaxClass:
not [email protected](OclAny)
post deleteAssociatedTaxRates:
[email protected]@pre -> forAll(tr | tr.oclIsKindOf(OclAny))
Event
DeleteTaxRate
„
Event diagram
TaxRate
1
ExistingTaxRateEvent
DomainEvent
DeleteTaxRate
effect()
„
Effect
context DeleteTaxRate::effect()
post : not [email protected](OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
150
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
DeleteTaxZone
„
Event diagram
TaxZone
1
ExistingTaxZoneEvent
DomainEvent
DeleteTaxZone
effect()
„
Effect
context DeleteTaxZone::effect()
post deleteTaxZone:
not [email protected](OclAny)
post deleteAssociatedTaxRates:
[email protected]@pre -> forAll(tr | tr.oclIsKindOf(OclAny))
Event
DeleteZone
„
Event diagram
Zone
1
ExistingZoneEvent
DomainEvent
DeleteZone
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
151
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context DeleteZone::ZoneIsNotALocation():Boolean
body : Store.allInstances() -> any(true).zone <> self.zone and
Address.allInstances().zone -> excludes(self.zone)
„
Effect
context DeleteZone::effect()
post : not [email protected](OclAny)
Event
DisplayCartAfterAddingProductChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
DisplayCartAfterAddingProductChange
newDisplayCartAfterAddingProduct : Boolean
effect()
„
Effect
context DisplayCartAfterAddingProductChange::effect()
post : myStore.displayCartAfterAddingProduct = self.newDisplayCartAfterAddingProduct
Event
DisplayPricesWithTaxChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
DisplayPricesWithTaxChange
newDisplayPricesWithTax : Boolean
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
152
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context DisplayPricesWithTaxChange::effect()
post : myStore.displayPricesWithTax = self.newDisplayPricesWithTax
Event
EditAuthorizeNetPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status:Status
EditAuthorizeNetPaymentMethod
newUsername : String
newKey : String
newMode : TransactionMode
newMethod : TransactionMethod
newNotification : Boolean
effect()
„
Initial Integrity Constraints
context EditAuthorizeNetPaymentMethod::PaymentMethodIsInstalled():Boolean
body : AuthorizeNet.allInstances() -> notEmpty()
„
Effect
context EditAuthorizeNetPaymentMethod::effect()
post :
let pm:AuthorizeNet = AuthorizeNet.allInstances() -> any(true)
in
pm.username=self.newUsername and
pm.key=self.newKey and
pm.mode=self.newMode and
pm.method=self.newMethod and
pm.notification=self.newNotification and
pm.orderStatus=self.orderStatus and
pm.status=self.status and
pm.taxZone=self.taxZone
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
153
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
EditBanner
„
Event diagram
Banner
1
ExistingBannerEvent
DomainEvent
EditBanner
newTitle : String
newUrl : URL [0..1]
newImagePath : String
newHtml : HtmlText [0..1]
newExpires : Date [0..1]
newScheduled : Date [0..1]
newStatus : BannerStatus
effect()
„
Effect
context EditBanner::effect()
post :
self.banner.title = self.newTitle and
self.banner.url = self.newUrl and
self.banner.imagePath = self.newImagePath and
self.banner.html = self.newHtml and
self.banner.expires = self.newExpires and
self.banner.scheduled = self.newScheduled and
self.banner.status = self.newStatus
post :
[email protected] <> self.newStatus implies self.banner.statusChanged = Now()
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
154
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
EditBannerGroup
„
Event diagram
BannerGroup
1
ExistingBannerGroupEvent
DomainEvent
EditBannerGroup
newName : String
effect()
„
Effect
context EditBannerGroup::effect()
post : self.bannerGroup.name = self.newName
Event
EditCashOnDeliveryPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
status:Status
EditCashOnDeliveryPaymentMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
155
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context EditCashOnDeliveryPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CashOnDelivery.allInstances() -> notEmpty()
„
Effect
context EditCashOnDeliveryPaymentMethod::effect()
post :
let pm:CashOnDelivery = CashOnDelivery.allInstances() -> any(true) in
pm.orderStatus=self.orderStatus and
pm.status=self.status and
pm.taxZone=self.taxZone
Event
EditCategory
„
Event diagram
String
1
name
Category
Language
HasNewName
*
CategoryNameEvent
1
DomainEvent
EditCategory
Category
„
0..1
parent
imagePath : String [0..1]
sortOrder : Natural
Effect
context EditCategory::effect()
post :
self.category.imagePath = self.imagePath and
self.category.sortOrder = self.sortOrder and
self.category.parent = self.parent and
Language.allInstances() ->
forAll(l|
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
156
ExistingCategoryEvent
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
self.hasNewName->select(language=l).name=
self.category.hasCategoryName->select(language=l).categoryName)
post :
self.category.lastModified = Now()
Event
EditCheckMoneyPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status:Status
EditCheckMoneyPaymentMethod
newMakePayableTo : Natural
effect()
„
Initial Integrity Constraints
context EditCheckMoneyPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CheckMoney.allInstances() -> notEmpty()
„
Effect
context EditCheckMoneyPaymentMethod::effect()
post :
let pm: CheckMoney = CheckMoney.allInstances() -> any(true) in
pm.makePayableTo=self.newMakePayableTo and
pm.orderStatus=self.orderStatus and
pm.status=self.status and
pm.taxZone=self.taxZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
157
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditCountry
„
Event diagram
Country
1
ExistingCountryEvent
DomainEvent
EditCountry
newName : String
newIsoCode2 : String
newIsoCode3 : String
effect()
„
Effect
context EditCountry::effect()
post :
country.name = self.newName and
country.isoCode2 = self.newIsoCode2 and
country.isoCode3 = self.newIsoCode3
Event
EditCreditCardPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
status:Status
EditCreditCardPaymentMethod
newSplitCreditCardToMail : EMail
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
158
0..1
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context EditCreditCardPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CreditCard.allInstances() -> notEmpty()
„
Effect
context EditCreditCardPaymentMethod::effect()
post :
let pm:CreditCard = CreditCard.allInstances() -> any(true) in
pm.splitCreditCardToMail=self.newSplitCreditcardToMail and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
Event
EditCurrency
„
Event diagram
Currency
1
ExistingCurrencyEvent
DomainEvent
EditCurrency
newTitle : String
newCode : String
newSymbolLeft : String [0..1]
newSymbolRight : String [0..1]
newDecimalPlaces : Natural
newValue : Decimal
effect()
„
Effect
context EditCurrency::effect()
post :
currency.title = self.newTitle and
currency.code = self.newCode and
currency.symbolLeft = self.newSymbolLeft and
currency.symbolRight = self.newSymbolRight and
currency.decimalPlaces = self.newDecimalPlaces and
currency.value = self.newValue
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
159
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditCustomer
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
EditCustomer
newGender : Gender [0..1]
newFirstName : String
newLastName : String
newDateOfBirth : Date [0..1]
newEMailAddress : EMail
newPhone : String
newFax : String [0..1]
newNewsletter : Boolean
newPassword : String
newGlobalNotifications : Boolean
effect()
„
Initial Integrity Constraints
context EditCustomer::firstNameRight(): Boolean
body : self.newFirstName.size() >= MinimumValues.firstName
context EditCustomer::lastNameRight(): Boolean
body : self.newLastName.size() >= MinimumValues.lastName
context EditCustomer::dateOfBirthRight(): Boolean
body :
CustomerDetails.dateOfBirth implies
self.newDateOfBirth->notEmpty() and
self.newDateOfBirth.size() >= MinimumValues.dateOfBirth
context EditCustomer::genderRight(): Boolean
body : CustomerDetails.gender implies self.newGender->notEmpty()
context EditCustomer::eMailRight(): Boolean
body : self.newEMailAddress.size() >= MinimumValues.eMailAddress
context EditCustomer::telephoneRight(): Boolean
body : self.newTelephone.size() >= MinimumValues.telephoneNumber
„
Effect
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
160
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context EditCustomer::effect()
post :
customer.gender = self.newGender and
customer.firstName = self.newFirstName and
customer.lastName = self.newLastName and
customer.dateOfBirth = self.newDateOfBirth and
customer.eMailAddress = self.newEMailAddress and
customer.phone = self.newPhone and
customer.fax = self.newFax and
customer.newsletter = self.newNewsletter and
customer.password = self.newPassword and
customer.globalNotifications = self.newGlobalNotifications and
post :
customer.lastModified = Now()
Event
EditCustomerAddress
„
Event diagram
<<dataType>>
Customer
Address
1
1
ExistingAddressEvent
DomainEvent
ExistingCustomerEvent
EditCustomerAddress
newAddress : Address
effect()
„
Initial Integrity Constraints
context EditCustomerAddress::AddressOfCustomer(): Boolean
body : self.customer.address -> includes(self.address)
context EditCustomerAddress::firstNameRight(): Boolean
body : self.newAdress.firstName.size() >= MinimumValues.firstName
context EditCustomerAddress::lastNameRight(): Boolean
body : self. newAdress.lastName.size() >= MinimumValues.lastName
context EditCustomerAddress::genderRight(): Boolean
body : CustomerDetails.gender implies self. newAdress.gender->notEmpty()
context EditCustomerAddress::suburbRight(): Boolean
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
161
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
body : CustomerDetails.suburb implies self. newAdress.suburb->notEmpty()
context EditCustomerAddress::streetAddressRight(): Boolean
body : self.newAdress.street.size() >= MinimumValues.streetAddress
context EditCustomerAddress::companyRight(): Boolean
body :
CustomerDetails.company implies
self.newAdress.company -> notEmpty() and
self.newAdress.company.size() >= MinimumValues.companyName
context EditCustomerAddress::postCodeRight(): Boolean
body : self.newAdress.postCode.size() >= MinimumValues.postCode
context EditCustomerAddress::cityRight(): Boolean
body : self.newAdress.city.size() >= MinimumValues.city
context EditCustomerAddress::stateRight(): Boolean
body :
CustomerDetails.state implies
self.newAdress.state -> notEmpty() and
self.newAdress.state.size() >= MinimumValues.state
context EditCustomerAddress::addressesHaveZoneIfNeeded(): Boolean
body :
self.newAdress.zone -> notEmpty() implies
self.newAdress.state = self.newAdress.zone.name and
self.newAdress.country = self.newAdress.zone.country
„
Effect
context EditCustomerAddress::effect()
post :
self.customer.address -> excludes(self.address) and
self.customer.address ->includes(self.newAddress)
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
162
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
EditCustomerDetails
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
EditCustomerDetails
newGender : Gender [0..1]
newFirstName : String
newLastName : String
newDateOfBirth : Date [0..1]
newEMailAddress : EMail
newPhone : String
newFax : String [0..1]
newNewsletter : Boolean
effect()
„
Initial Integrity Constraints
context EditCustomerDetails::firstNameRight(): Boolean
body : self.newFirstName.size() >= MinimumValues.firstName
context EditCustomerDetails::lastNameRight(): Boolean
body : self.newLastName.size() >= MinimumValues.lastName
context EditCustomerDetails::dateOfBirthRight(): Boolean
body :
CustomerDetails.dateOfBirth implies
self.newDateOfBirth->notEmpty()
self.newDateOfBirth.size() >= MinimumValues.dateOfBirth
context EditCustomerDetails::genderRight(): Boolean
body : CustomerDetails.gender implies self.newGender->notEmpty()
context EditCustomerDetails::eMailRight(): Boolean
body : self.newEMailAddress.size() >= MinimumValues.eMailAddress
context EditCustomerDetails::telephoneRight(): Boolean
body : self.newTelephone.size() >= MinimumValues.telephoneNumber
„
Effect
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
163
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context EditCustomerDetails::effect()
post :
customer.gender = self.newGender and
customer.firstName = self.newFirstName and
customer.lastName = self.newLastName and
customer.dateOfBirth = self.newDateOfBirth and
customer.eMailAddress = self.newEMailAddress and
customer.phone = self.newPhone and
customer.fax = self.newFax and
customer.newsletter = self.newNewsletter
Event
EditDownloadableAttribute
„
Event diagram
Downloadable
1
ExistingDownloadableEvent
DomainEvent
EditDownloadableProductAttribute
newFilename : File
newExpiryDays : Natural
newMaximumDownloadCount : Natural
effect()
„
Effect
context EditDownloadableProductAttribute::effect()
post :
self.downloadable.filename = self.newFilename and
self.downloadable.expiryDays = self.newExpiryDays and
self.downloadable.maximumDownloadCount = self.newMaximumDonwloadCount
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
164
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
EditFlatRateShippingMethod
„
Event diagram
DomainEvent
ShippingMethodEvent
0..1
TaxClass
status : Status
SpecificZoneShippingMethodEvent
0..1
TaxZone
EditFlatRateShippingMethod
newCost : Money
effect()
„
Initial Integrity Constraints
context EditFlatRateShippingMethod::PaymentMethodIsInstalled():Boolean
body : FlatRate.allInstances() -> notEmpty()
„
Effect
context EditFlatRateShippingMethod::effect()
post :
let sm: FlatRate= FlatRate.allInstances() -> any(true) in
sm.cost=self.newCost and
sm.taxZone=self.taxZone and
sm.taxClass=self.taxClass and
sm.status = self.status
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
165
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
EditGlobalNotifications
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
EditGlobalNotifications
newGlobalNotifications : Boolean
effect()
„
Effect
context EditGlobalNotifications::effect()
post : self.customer.globalNotifications = self.newGlobalNotifications
Event
EditIPaymentPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status : Status
EditIPaymentPaymentMethod
newAccount : Natural
newUser : String
newPassword : String
* Currency
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
166
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context EditIPaymentPaymentMethod::PaymentMethodIsInstalled():Boolean
body : IPayment.allInstances() -> notEmpty()
„
Effect
context EditIPaymentPaymentMethod::effect()
post :
let pm:IPayment = IPayment.allInstances() -> any(true) in
pm.account=self.newAccount and
pm.user=self.newUser and
pm.password=self.newPassword and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
Event
EditLanguage
„
Event diagram
Language
1
ExistingLanguageEvent
DomainEvent
EditLanguage
newName : String
newCode : String
0..1
newDefaultCurrency
Currency
effect()
„
Effect
context EditLanguage::effect()
post :
self.language.name = self.newName and
self.language.code = self.newCode and
self.language.defaultCurrency = self.newDefaultCurrency
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
167
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditManufacturer
„
Event diagram
Language
*
HasURL
Manufacturer
1
url
ManufacturerURLEvent
<<dataType>>
URL
1
ExistingManufacturerEvent
DomainEvent
EditManufacturer
name : String
imagePath : String [0..1]
effect()
„
Effect
context EditManufacturer::effect()
post :
self.manufacturer.name = self.name and
self.manufacturer.imagePath = self.imagePath and
Langauge.allInstances() ->
forAll(l|
self.hasURL->select(language=l).url=
self.manufacturer.manufacturerInLanguage->
select(language=l).url)
post :
self.manufacturer.lastModified = Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
168
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditNewsletter
„
Event diagram
Newsletter
1
ExistingNewsletter
DomainEvent
EditNewsletter
newTitle : String
newContent : String
effect()
„
Effect
context EditNewsletter::effect()
post :
newsletter.title = self.newTitle and
newsletter.content = self.newContent
Event
EditNochexPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
status:Status
EditNochexPaymentMethod
newEMail : EMail
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
169
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context EditNochexPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CheckMoney.allInstances() -> notEmpty()
„
Effect
context EditNochexPaymentMethod::effect()
post :
let pm: Nochex = Nochex.allInstances() -> any(true) in
pm.eMail=self.newEMail and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
Event
EditOrderStatus
„
Event diagram
OrderStatus
1
ExistingOrderStatusEvent
DomainEvent
EditOrderStatus
newName : String
effect()
„
Effect
context EditOrderStatus::effect()
post : self.orderStatus.name = self.newName
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
170
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditPayPalPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status:Status
EditPayPalPaymentMethod
newEMail : EMail
* Currency
effect()
„
Initial Integrity Constraints
context EditPayPalPaymentMethod::PaymentMethodIsInstalled():Boolean
body : PayPal.allInstances() -> notEmpty()
„
Effect
context EditPayPalPaymentMethod::effect()
post :
let pm: PayPal = PayPal.allInstances() -> any(true) in
pm.eMail=self.newEMail and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
171
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditPerItemShippingMethod
„
Event diagram
HandlingFeeMethodEvent
DomainEvent
handlingFee : Money
ShippingMethodEvent
SpecificZoneShippingMethodEvent
EditPerItemShippingMethod
newCost : Money
effect()
„
Initial Integrity Constraints
context EditPerItemShippingMethod::PaymentMethodIsInstalled():Boolean
body : PerItem.allInstances() -> notEmpty()
„
Effect
context EditPerItemShippingMethod::effect()
post :
let sm: PerItem= PerItem.allInstances() -> any(true) in
sm.cost=self.newCost and
sm.handlingFee=self.handlingFee and
sm.taxZone=self.taxZone and
sm.taxClass=self.taxClass and
sm.status = self.status
PFCAlbert tort
0..1
TaxClass
status : Status
UNIVERSITAT POLITÈCNICA DE CATALUNYA
172
0..1
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditProduct
„
Event diagram
String
1
name
Product
Language
HasNewProductName
*
1
ProductNameEvent
DomainEvent
ExistingProductEvent
EditProduct
status : ProductStatus
available : DateTime [0..1]
netPrice : Money
quantityOnHand : Integer
model : String [0..1]
imagePath : String [0..1]
weight : Decimal
0..1
*
Category
0..1
TaxClass
effect()
„
Effect
context EditProduct::effect()
post :
self.product.status = self.status and
self.product.available = self.available and
self.product.netPrice = self.netPrice and
self.product.quantityOnHand = self.quantityOnHand and
self.product.model = self.model and
self.product.imagePath = self.imagePath and
self.product.weight = self.weight and
self.product.manufacturer = self.manufacturer and
self.product.category = self.category and
self.product.taxClass = self.taxClass and
Language.allInstances()
-> forAll (l|
self.hasNewProductName -> select(language=l).name =
self.product.productInLanguage->select(language=l).name)
post :
self.product.lastModified = Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
173
Manufacturer
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditProductNotification
„
Event diagram
DomainEvent
EditProductNotification
ProductNotification 1
*
newGlobal : Boolean
newExplicitNotifications
effect()
„
Effect
context EditProductNotification::effect()
post :
self.productNotification.global = self.newGlobal and
self.productNotification.explicitNotifications = self.newExplicitNotifications
Event
EditProductOption
„
Event diagram
String
1
name
Option
Language
*
HasNewOptionName
ProductOptionNameEvent
1
DomainEvent
EditProductOption
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
174
ExistingOptionEvent
Product
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context EditProductOption::effect()
post :
Language.allInstances() ->
forAll (l| self.hasNewOptionName -> select(language=l).name =
option.hasOptionName->select(language=l).optionName)
Event
EditProductOptionValue
„
Event diagram
String
1
name
Value
Language
*
HasNewValueName
ProductValueNameEvent
1
DomainEvent
ExistingValueEvent
EditProductOptionValue
1..*
effect()
„
Effect
context EditProductOptionValue::effect()
post :
Language.allInstances() ->
forAll (l| self.hasNewValueName -> select(language=l).name =
value.hasValueName->select(language=l).valueName) and
self.value.option = self.option
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
175
Option
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditPSiGatePaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status :Status
EditPSiGatePaymentMethod
newMerchantID : String
newMode : PSiGateMode
newType : PSiGateType
newCreditCardCollection : PSiGateCollection
* Currency
effect()
„
Initial Integrity Constraints
context EditPSiGatePaymentMethod::PaymentMethodIsInstalled():Boolean
body : PSiGate.allInstances() -> notEmpty()
„
Effect
context EditPSiGatePaymentMethod::effect()
post :
let pm: PSiGate= PSiGate.allInstances() -> any(true) in
pm.merchantID=self.newMerchantID and
pm.mode=self.newMode and
pm.type=self.newType and
pm.creditCardCollection=self.newCreditCardCollection and
pm.status=self.enabled and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
176
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditReview
„
Event diagram
Review
1
ExistingReviewEvent
DomainEvent
EditReview
newReview : String
newRating : Rating
1
newLanguage
effect()
„
Language
1
newProduct
Product
1
newCustomer
Customer
Effect
context EditReview::effect()
post :
self.review.review = self.newReview and
self.review.rating = self.newRating and
self.review.language = self.newLanguage and
self.review.product = self.newProduct and
self.review.customer = self.newCustomer
post :
self.review.lastModified = Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
177
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditSECPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
status : Status
EditSECPaymentMethod
newMerchantID : String
newMode : SECPayMode
* Currency
effect()
„
Initial Integrity Constraints
context EditSECPaymentMethod::PaymentMethodIsInstalled():Boolean
body : SECPay.allInstances() -> notEmpty()
„
Effect
context EditSECPaymentMethod::effect()
post :
let pm: SECPay= SECPay.allInstances() -> any(true) in
pm.merchantID=self.newMerchantID and
pm.mode=self.newMode and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
178
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditSpecial
„
Event diagram
Special
1
ExistingSpecialEvent
DomainEvent
EditSpecial
newSpecialPrice : Money
newExpiryDate : DateTime [0..1]
newStatus : SpecialStatus
effect()
„
Effect
context EditSpecial::effect()
post :
self.special.specialPrice = self.newSpecialPrice and
self.special.expiryDate = self.newExpiryDate and
self.special.status = self.newStatus
post :
self.special.lastModified = Now()
post :
[email protected] <> self.newStatus implies
self.special.dateStatusChanged = Now()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
179
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditTableRateShippingMethod
„
Event diagram
HandlingFeeMethodEvent
DomainEvent
handlingFee : Money
ShippingMethodEvent
EditTableRateShippingMethod
newItems : ShippingTableItem [*]
newMethod : ShippingTableMethod
effect()
Initial Integrity Constraints
context EditTableRateShippingMethod::PaymentMethodIsInstalled():Boolean
body : TableRate.allInstances() -> notEmpty()
„
Effect
context EditTableRateShippingMethod::effect()
post :
let sm: TableRate= TableRate.allInstances() -> any(true) in
sm.items=self.newItems and
sm.method=self.newMethod and
sm.handlingFee=self.handlingFee and
sm.taxZone=self.taxZone and
sm.taxClass=self.taxClass and
sm.status = self.status
PFCAlbert tort
TaxClass
status : Status
SpecificZoneShippingMethodEvent
„
0..1
UNIVERSITAT POLITÈCNICA DE CATALUNYA
180
0..1
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditTaxClass
„
Event diagram
TaxClass
1
ExistingTaxClassEvent
DomainEvent
EditTaxClass
newName : String
newDescription : String [0..1]
effect()
„
Effect
context EditTaxClass::effect()
post :
self.taxClass.name = self.newName and
self.taxClass.description = self.newDescription
Event
EditTaxRate
„
Event diagram
TaxRate
1
ExistingTaxRateEvent
DomainEvent
EditTaxRate
TaxClass
1
newTaxClass
newRate : Natural
newPriority : Natural
newDescription : String [0..1]
1
newTaxZone
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
181
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context EditTaxRate::effect()
post :
self.taxRate.rate = self.newRate and
self.taxRate.priority = self.newPriority and
self.taxRate.description = self.newDescription and
self.taxRate.taxClass = self.newTaxClass and
self.taxRate.taxZone = self.newTaxZone
Event
EditTaxZone
„
Event diagram
TaxZone
0..1
ExistingTaxZoneEvent
DomainEvent
EditTaxZone
newName : String
newDescription : String [0..1]
*
newZones
effect()
„
Effect
context EditTaxZone::effect()
post :
self.taxZone.name = self.newName and
self.taxZone.description = self.newDescription and
self.taxZone.zone = self.newZones
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
182
Zone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditTwoCheckOutPaymentMethod
„
Event diagram
DomainEvent
OrderStatus
0..1
EditPaymentMethodEvent
0..1
TaxZone
statuts:Status
EditTwoCheckOutPaymentMethod
newLogin : String
newMode : TransactionMode
newMerchantNotification : Boolean
effect()
context EditTwoCheckOutPaymentMethod::PaymentMethodIsInstalled()
body : TwoCheckOut.allInstances() -> notEmpty()
context EditTwoCheckOutPaymentMethod::effect()
post :
let pm: TwoCheckOut = TwoCheckOut.allInstances() -> any(true)
in
pm.login=self.newLogin and
pm.model=self.newMode and
pm.merchantNotification=self.newMerchantNotification and
pm.status=self.status and
pm.orderStatus=self.orderStatus and
pm.taxZone=self.taxZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
183
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditUSPostalServiceShippingMethod
„
Event diagram
HandlingFeeMethodEvent
DomainEvent
handlingFee : Money
ShippingMethodEvent
0..1
SpecificZoneShippingMethodEvent
0..1
EditUSPostalServiceShippingMethod
newUserID : String
newPassword : String
newServer : USPSServer
effect()
„
Initial Integrity Constraints
context EditUSPostalServiceShippingMethod::PaymentMethodIsInstalled():Boolean
body : USPostalService.allInstances() -> notEmpty()
„
Effect
context EditUSPostalServiceShippingMethod::effect()
post :
let sm: USPostalService= USPostalService.allInstances() -> any(true) in
sm.userID=self.newUserID and
sm.password=self.newPassword and
sm.server=self.newServer and
sm.handlingFee=self.handlingFee and
sm.taxZone=self.taxZone and
sm.taxClass=self.taxClass and
sm.status = self.status
PFCAlbert tort
TaxClass
status : Status
UNIVERSITAT POLITÈCNICA DE CATALUNYA
184
TaxZone
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EditZone
„
Event diagram
Zone
1
ExistingZoneEvent
DomainEvent
EditZone
newName : String
newCode : String
effect()
„
Effect
context EditZone::effect()
post :
self.zone.name = self.newName and
self.zone.code = self.newCode
Event
EditZoneRatesShippingMethod
„
Event diagram
DomainEvent
ShippingMethodEvent
0..1
TaxClass
*
Country
status : Status
EditZoneRatesShippingMethod
newItems : ShippingTableItem [*]
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
185
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context EditZoneRatesShippingMethod::PaymentMethodIsInstalled():Boolean
body : ZoneRates.allInstances() -> notEmpty()
„
Effect
context EditZoneRatesShippingMethod::effect()
post :
let sm:ZoneRates= ZoneRates.allInstances() -> any(true) in
sm.items=self.newItems and
sm.country=self.country and
sm.taxClass=self.taxClass and
sm.status=self.status
Event
EMailAddressChange
„
Event diagram
DomainEvent
StoreEvent
1
/myStore
EMailAddressChange
newEmailAddress : EMail [0..1]
effect()
„
Effect
context EMailAddressChange::effect()
post : myStore.eMailAddress = self.newEmailAddress
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
186
Store
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EMailAddressMinimumChange
„
Event diagram
DomainEvent
EMailAddressMinimumChange
newMinimum : Natural
effect()
„
Effect
context EMailAddressMinimumChange::effect()
post : MinimumValues.eMailAddress = self.newMinimum
Event
EMailFromChange
„
Event diagram
DomainEvent
StoreEvent
1
/myStore
EMailFromChange
newEmailFrom : EMail [0..1]
effect()
„
Effect
context EMailFromChange::effect()
post : myStore.eMailFrom = self.newEmailFrom
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
187
Store
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
EnableDownloadConfigurationChange
„
Event diagram
DomainEvent
EnableDownloadConfigurationChange
newValue : Boolean
effect()
„
Effect
context EnableDownloadConfigurationChange::effect()
post : Download.enableDownload= self.newValue
Event
ExpectedSortFieldChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
ExpectedSortFieldChange
newExpectedSortField : SortField
effect()
„
Effect
context ExpectedSortFieldChange::effect()
post : myStore.expectedSortField = self.newExpectedSortField
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
188
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ExpectedSortOrderChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
ExpectedSortOrderChange
newExpectedSortOrder : SortOrder
effect()
„
Effect
context ExpectedSortOrderChange::effect()
post : myStore.expectedSortOrder = self.newExpectedSortOrder
Event
FirstNameMinimumChange
„
Event diagram
DomainEvent
FirstNameMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context FirstNameMinimumChange::effect()
post : MinimumValues.firstName = self.newMinimum
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
189
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
GenderCustomerDetailChange
„
Event diagram
DomainEvent
GenderCustomerDetailChange
newValue : Boolean
effect()
„
Effect
context GenderCustomerDetailChange::effect()
post : CustomerDetails.gender = self.newValue
Event
IncrementAndSignAttributeChange
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
DomainEvent
IncrementAndSignAttributeChange
newIncrement : Money
newSign : Sign
effect()
„
Effect
context IncrementAndSignAttributeChange::effect()
post : self.productAttribute.increment = self.newIncrement and
self.productAttribute.sign = self.newSign
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
190
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
InstallAuthorizeNetPaymentMethod
„
Event diagram
DomainEvent
InstallAuthorizeNetPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallAuthorizeNetPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : AuthorizeNet.allInstances() -> isEmpty()
„
Effect
context InstallAuthorizeNetPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(AuthorizeNet)
Event
InstallCashOnDeliveryPaymentMethod
„
Event diagram
DomainEvent
InstallCashOnDeliveryPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallCashOnDeliveryPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : CashOnDelivery.allInstances() -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
191
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context InstallCashOnDeliveryPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(CashOnDelivery)
Event
InstallCheckMoneyPaymentMethod
„
Event diagram
DomainEvent
InstallCheckMoneyPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallCheckMoneyPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : CheckMoney.allInstances() -> isEmpty()
„
Effect
context InstallCheckMoneyPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(CheckMoney)
Event
InstallCreditCardPaymentMethod
„
Event diagram
DomainEvent
InstallCreditCardPaymentMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
192
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context InstallCreditCardPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : CreditCard.allInstances() -> isEmpty()
„
Effect
context InstallCreditCardPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(CreditCard)
Event
InstallFlatRateShippingMethod
„
Event diagram
DomainEvent
InstallFlatRateShippingMethod
effect()
„
Initial Integrity Constraints
context InstallFlatRateShippingMethod::ShippingMethodIsNotInstalled():Boolean
body : FlatRate.allInstances() -> isEmpty()
„
Effect
context InstallFlatRateShippingMethod::effect()
post : sm.oclIsNew() and sm.oclIsTypeOf(FlatRate)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
193
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
InstallIPaymentPaymentMethod
„
Event diagram
DomainEvent
InstallIPaymentPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallIPaymentPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : IPayment.allInstances() -> isEmpty()
„
Effect
context InstallIPaymentPaymentMethod::PaymentMethodIsNotInstalled()
post : sm.oclIsNew() and sm.oclIsTypeOf(IPayment)
Event
InstallNochexPaymentMethod
„
Event diagram
DomainEvent
InstallNochexPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallNochexPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : Nochex.allInstances() -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
194
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context InstallNochexPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(Nochex)
Event
InstallPayPalPaymentMethod
„
Event diagram
DomainEvent
InstallPayPalPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallPayPalPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : PayPal.allInstances() -> isEmpty()
„
Effect
context InstallPayPalPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(PayPal)
Event
InstallPerItemShippingMethod
„
Event diagram
DomainEvent
InstallPerItemShippingMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
195
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context InstallPerItemShippingMethod::ShippingMethodIsNotInstalled():Boolean
body : PerItem.allInstances() -> isEmpty()
„
Effect
context InstallPerItemShippingMethod::effect()
post : sm.oclIsNew() and sm.oclIsTypeOf(PerItem)
Event
InstallPSiGatePaymentMethod
„
Event diagram
DomainEvent
InstallPSiGatePaymentMethod
effect()
„
Initial Integrity Constraints
context InstallPSiGatePaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : PSiGate.allInstances() -> isEmpty()
„
Effect
context InstallPSiGatePaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(PSiGate)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
196
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
InstallSECPaymentMethod
„
Event diagram
DomainEvent
InstallSECPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallSECPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : SECPay.allInstances() -> isEmpty()
„
Effect
context InstallSECPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(SECPay)
Event
InstallTableRateShippingMethod
„
Event diagram
DomainEvent
InstallTableRateShippingMethod
effect()
„
Initial Integrity Constraints
context InstallTableRateShippingMethod::ShippingMethodIsNotInstalled():Boolean
body : TableRate.allInstances() -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
197
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context InstallTableRateShippingMethod::effect()
post : sm.oclIsNew() and sm.oclIsTypeOf(TableRate)
Event
InstallTwoCheckOutPaymentMethod
„
Event diagram
DomainEvent
InstallTwoCheckOutPaymentMethod
effect()
„
Initial Integrity Constraints
context InstallTwoCheckOutPaymentMethod::PaymentMethodIsNotInstalled():Boolean
body : TwoCheckOut.allInstances() -> isEmpty()
„
Effect
context InstallTwoCheckOutPaymentMethod::effect()
post : pm.oclIsNew() and pm.oclIsTypeOf(TwoCheckOut)
Event
InstallUSPostalServiceShippingMethod
„
Event diagram
DomainEvent
InstallUSPostalServiceShippingMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
198
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context InstallUSPostalServiceShippingMethod::ShippingMethodIsNotInstalled():Boolean
body : USPostalService.allInstances() -> isEmpty()
„
Effect
context InstallUSPostalServiceShippingMethod::effect()
post : sm.oclIsNew() and sm.oclIsTypeOf(USPostalService)
Event
InstallZoneRatesShippingMethod
„
Event diagram
DomainEvent
InstallZoneRatesShippingMethod
effect()
„
Initial Integrity Constraints
context InstallZoneRatesShippingMethod::ShippingMethodIsNotInstalled():Boolean
body : ZoneRates.allInstances() -> isEmpty()
„
Effect
context InstallZoneRatesShippingMethod::effect()
post : sm.oclIsNew() and sm.oclIsTypeOf(ZoneRates)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
199
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
LastNameMinimumChange
„
Event diagram
DomainEvent
LastNameMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context LastNameMinimumChange::effect()
post : MinimumValues.lastName = self.newMinimum
Event
LinkProduct
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
LinkProduct
effect()
„
1
newCategory
Category
Effect
context LinkProduct::effect()
post: self.product.category -> includes(self.newCategory)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
200
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
LockNewsletter
„
Event diagram
Newsletter
1
ExistingNewsletter
DomainEvent
LockNewsletter
effect()
„
Effect
context LockNewsletter::effect()
post : self.newsletter.status = NewsletterStatus::locked
Event
LogIn
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
LogIn
1
Session
effect()
„
Initial Integrity Constraints
context LogIn::CustomerIsNotLoggedIn (): Boolean
body : self.customer.session -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
201
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context LogIn::effect()
post :
self.session.customer = self.customer
post :
self.customer.lastLogon = Now() and
self.customer.numberOfLogons = self.customer.numberOfLogons@pre + 1
Event
LogOut
„
Event diagram
Session
Customer
1
ExistingSessionEvent
1
DomainEvent
ExistingCustomerEvent
Logout
effect()
„
Initial Integrity Constraints
context LogIn::CustomerIstLoggedIn (): Boolean
body : self.session.customer = self.customer
„
Effect
context LogOut::effect()
post : self.session.customer -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
202
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NameChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
NameChange
newName : String [0..1]
effect()
„
Effect
context NameChange::effect()
post : self.myStore.name = self.newName
Event
MaximumNumberDownloadConfigurationChange
„
Event diagram
DomainEvent
MaximumNumberDownloadConfigurationChange
newMaximum : Natural
effect()
„
Effect
context MaximumNumberDownloadConfigurationChange::effect()
post : Download.maximumNumberOfDownloads= self.newMaximum
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
203
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
MaximumPackageWeightShippingConfigurationChange
„
Event diagram
DomainEvent
MaximumPackageWeightShippingConfigurationChange
newMaximum : Natural
effect()
„
Effect
context MaximumPackageWeightShippingConfigurationChange::effect()
post : ShippingAndPackaging.maximumPackageWeight = self.newMaximum
Event
MoveCategory
„
Event diagram
Category
1
ExistingCategoryEvent
DomainEvent
MoveCategory
effect()
„
0..1
Category
newParent
Effect
context MoveCategory::effect()
post : self.category.parent = self.newParent
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
204
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
MoveProduct
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
MoveProduct
effect()
1
oldCategory
Category
1
newCategory
„
Effect
context MoveProduct::effect()
post: self.product.category -> includes(self.newCategory) and
self.product.category -> excludes(self.oldCategory)
Event
NewBanner
„
Event diagram
DomainEvent
NewBanner
title : String
url : URL [0..1]
imagePath : String
html : HtmlText [0..1]
expires : Date [0..1]
scheduled : Date [0..1]
„
Initial Integrity Constraints
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
205
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context NewBanner::bannerDoesNotExist(): Boolean
body : not Banner.allInstances() ->exists (b | b.title= self.title)
„
Effect
context NewBanner::effect()
post :
b.oclIsNew() and
b.oclIsTypeOf(Banner) and
b.title = self.title and
b.url = self.url and
b.imagePath = self.imagePath and
b.html = self.html and
b.expires = self.expires and
b.scheduled = self.scheduled and
b.status = BannerStatus::enabled
Event
NewBannerGroup
„
Event diagram
DomainEvent
NewBannerGroup
name : String
effect()
„
Initial Integrity Constraints
context NewBannerGroup::bannerGroupDoesNotExist(): Boolean
body : not BannerGroup.allInstances() ->exists (bg | bg.name= self.name)
„
Effect
context NewBannerGroup::effect()
post :
bg.oclIsNew() and
bg.oclIsTypeOf(BannerGroup) and
bg.name = self.name
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
206
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewCategory
„
Event diagram
String
1
Language
name
HasNewName
*
CategoryNameEvent
DomainEvent
NewCategory
Category
„
0..1
parent
imagePath : String [0..1]
sortOrder : Natural
effect()
Initial Integrity Constraints
context NewCategory::categoryDoesNotExist(): Boolean
body :
Language.allInstances() -> forAll ( l |
l.hasCategoryName.categoryName ->
excludes(self.hasNewName->select(language=l).name))
„
Effect
context NewCategory::effect()
post :
c.oclIsNew() and
c.oclIsTypeOf(Category) and
c.imagePath = self.imagePath and
c.sortOrder = self.sortOrder and
c.parent = self.parent and
Language.allInstances() ->
forAll (l| self.hasNewName -> select(language=l).name =
c.hasCategoryName->select(language=l).categoryName)
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
207
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewCountry
„
Event diagram
DomainEvent
NewCountry
name : String
isoCode2 : String
isoCode3 : String
effect()
„
Initial Integrity Constraints
context NewCountry::countryDoesNotExist(): Boolean
body :
not Country.allInstances() -> exists(c | c.name=self.name and
c.isoCode2=self.isoCode2 and
c.isoCode3=self.isoCode3)
„
Effect
context NewCountry::effect()
post :
c.oclIsNew() and
c.oclIsTypeOf(Country) and
c.name = self.name and
c.isoCode2 = self.isoCode2 and
c.isoCode3 = self.isoCode3
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
208
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewCurrency
„
Event diagram
DomainEvent
NewCurrency
title : String
code : String
symbolLeft : String [0..1]
symbolRight : String [0..1]
decimalPlaces : Natural
value : Decimal
effect()
„
Initial Integrity Constraints
context NewCurrency::currencyDoesNotExist(): Boolean
body :
not Currency.allInstances() -> exists(c | c.title=self.title and
c.code=self.code)
„
Effect
context NewCurrency::effect()
post :
c.oclIsNew() and
c.oclIsTypeOf(Currency) and
c.title = self.title and
c.code = self.code and
c.symbolLeft = self.symbolLeft and
c.symbolRight = self.symbolRight and
c.decimalPlaces = self.decimalPlaces and
c.value = self.value
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
209
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewCustomer
„
Event diagram
DomainEvent
NewCustomer
eMailAddress : EMail
dateOfBirth : Date [0..1]
phone : String
fax : String [0..1]
primary : Address
newsletter : Boolean
password : String
passwordConfirmation : String
effect()
„
Initial Integrity Constraints
context NewCustomer::customerDoesNotExist(): Boolean
body : not Customer.allInstances() -> exists (c | c.eMailAddress = self.eMailAddress)
context NewCustomer::passwordCorrect(): Boolean
body : password = passwordConfirmation
context NewCustomer::firstNameRight(): Boolean
body : self.primary.firstName.size() >= MinimumValues.firstName
context NewCustomer::lastNameRight(): Boolean
body : self.primary.lastName.size() >= MinimumValues.lastName
context NewCustomer::dateOfBirthRight(): Boolean
body :
CustomerDetails.dateOfBirth implies
self.dateOfBirth -> notEmpty() and
self.dateOfBirth.size() >= MinimumValues.dateOfBirth
context NewCustomer::genderRight(): Boolean
body : CustomerDetails.gender implies self.gender->notEmpty()
context NewCustomer::suburbRight(): Boolean
body : CustomerDetails.suburb implies self.suburb->notEmpty()
context NewCustomer::eMailRight(): Boolean
body : self.eMailAddress.size() >= MinimumValues.eMailAddress
context NewCustomer::streetAddressRight(): Boolean
body : self.primary.street.size() >= MinimumValues.streetAddress
context NewCustomer::companyRight(): Boolean
body :
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
210
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
CustomerDetails.company implies
self.primary.company -> notEmpty() and
self.primary.company.size() >= MinimumValues.companyName
context NewCustomer::postCodeRight(): Boolean
body : self.primary.postCode.size() >= MinimumValues.postCode
context NewCustomer::cityRight(): Boolean
body : self.primary.city.size() >= MinimumValues.city
context NewCustomer::stateRight(): Boolean
body :
CustomerDetails.state implies
self.primary.state -> notEmpty() and
self.primary.state.size() >= MinimumValues.state
context NewCustomer::telephoneRight(): Boolean
body : self.telephone.size() >= MinimumValues.telephoneNumber
context NewCustomer::passwordRight(): Boolean
body : self.password.size() >= MinimumValues.password
„
Effect
context NewCustomer::effect()
post :
c.oclIsNew() and
c.oclIsTypeOf(Customer) and
c.gender = self.primary.gender and
c.firstName = self.primary.firstName and
c.lastName = self.primary.lastName and
c.dateOfBirth = self.dateOfBirth and
c.eMailAddress = self.eMailAddress and
c.phone = self.phone and
c.fax = self.fax and
c.newsletter = self.newsletter and
c.password = self.password and
c.numberOfLogons = 0 and
c.address = Set{primary} and
c.primary = primary
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
211
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewCustomerAddress
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
NewCustomerAddress
0..1
gender : Gender [0..1]
firstName : String
lastName : String
company : String [0..1]
street : String
suburb : String
postCode : PostalCode
city : String
state : String [0..1]
Zone
*
1
1
Country
effect()
„
Initial Integrity Constraints
context NewCustomerAddress::firstNameRight(): Boolean
body : self.primary.firstName.size() >= MinimumValues.firstName
context NewCustomerAddress::lastNameRight(): Boolean
body : self.primary.lastName.size() >= MinimumValues.lastName
context NewCustomerAddress::genderRight(): Boolean
body : CustomerDetails.gender implies self.gender->notEmpty()
context NewCustomerAddress::suburbRight(): Boolean
body : CustomerDetails.suburb implies self.suburb->notEmpty()
context NewCustomerAddress::streetAddressRight(): Boolean
body : self.primary.street.size() >= MinimumValues.streetAddress
context NewCustomerAddress::companyRight(): Boolean
body :
CustomerDetails.company implies
self.primary.company -> notEmpty() and
self.primary.company.size() >= MinimumValues.companyName
context NewCustomerAddress::postCodeRight(): Boolean
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
212
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
body : self.primary.postCode.size() >= MinimumValues.postCode
context NewCustomerAddress::cityRight(): Boolean
body : self.primary.city.size() >= MinimumValues.city
context NewCustomerAddress::stateRight(): Boolean
body :
CustomerDetails.state implies
self.primary.state -> notEmpty() and
self.primary.state.size() >= MinimumValues.state
context NewCustomerAddress::addressesHaveZoneIfNeeded(): Boolean
body :
self.zone -> notEmpty() implies
self.state = self.zone.name and
self.country = self.zone.country
context NewCustomerAddress::numberOfAddressesRight(): Boolean
body : self.customer.address -> size() < MaximumValues.addressBookEntries
„
Effect
context NewCustomerAddress::effect()
post :
Address.allInstances() ->exists (a |
a.gender = self.gender and
a.firstName = self.firstName and
a.lastName = self.lastName and
a.company = self.company and
a.street = self.street and
a.suburb = self.suburb and
a.postCode = self.postCode and
a.city = self.city and
a.state = self.state and
a.zone = self.zone and
a.country = self.country and
self.customer.address -> includes(a))
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
213
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewDownloadableProductAttribute
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
NewProductAttribute
increment : Money
sign : Sign
filename : File
expiryDays : Natural [0..1]
maximumDownloadCount : Natural [0..1]
1
Option
1
Value
effect()
„
Initial Integrity Constraints
context NewDownloadableProductAttribute::productAttributeDoesNotExist(): Boolean
body :
not ProductAttribute.allInstances() -> exists (pa | pa.attribute.option = self.option and
pa.attribute.value = self.value and
pa.product = self.product)
„
Effect
context NewDownloadableProductAttribute::effect()
post :
dpa.oclIsNew() and
dpa.oclIsTypeOf(Downloadable) and
dpa.increment = self.increment and
dpa.sign = self.sign and
dpa.filename = self.filename and
dpa.product = self.product and
dpa.attribute.option=self.option and
dpa.attribute.value=self.value and
if self.expiryDays.notEmpty() then dpa.expiryDays = self.expiryDays
else self.expiryDays = Download.daysExpiryDelay
endif
and
if self.maximumDownloadCount .notEmpty() then
dpa.maximumDownloadCount = self.maximumDownloadCount
else self.maximumDownloadCount = Download.maximumNumberOfDownload
endif
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
214
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewLanguage
„
Event diagram
DomainEvent
NewLanguage
name : String
code : String
0..1
defaultCurrency
Currency
effect()
„
Initial Integrity Constraints
context NewLanguage::languageDoesNotExist(): Boolean
body :
not Language.allInstances() -> exists (l | l.name=self.name and
l.code = self.code)
„
Effect
context NewLanguage::effect()
post :
l.oclIsNew() and
l.oclIsTypeOf(Language) and
l.name = self.name and
l.code = self.code and
l.defaultCurrency = self.defaultCurrency
Event
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
215
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
NewManufacturer
„
Event diagram
Language
*
HasURL
1
url
ManufacturerURLEvent
<<dataType>>
URL
DomainEvent
NewManufacturer
name : String
imagePath : String [0..1]
effect()
„
Initial Integrity Constraints
context NewManufacturer::manufacturerDoesNotExist(): Boolean
body :
not Manufacturer.allInstances() -> exists (m | m.name=self.name)
„
Effect
context NewManufacturer::effect()
post :
m.oclIsNew() and
m.oclIsTypeOf(Manufacturer) and
m.name = self.name and
m.imagePath = self.imagePath and
Language.allInstances() ->
forAll (l|
self.hasURL -> select(language=l).url =
m.manufacturerInLanguage->select(language=l).url)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
216
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewNewsletter
„
Event diagram
DomainEvent
NewNewsletter
title : String
content : String
effect()
„
Initial Integrity Constraints
context NewNewsletter::newsletterDoesNotExist(): Boolean
body : not Newsletter.allInstances() -> exists (n | n.title=self.title)
„
Effect
context NewNewsletter::effect()
post :
n.oclIsNew() and
n.oclIsTypeOf(Newsletter) and
n.title = self.title and
n.content = self.content and
n.status = NewsletterStatus::unlocked
Event
NewOrderStatus
„
Event diagram
DomainEvent
NewOrderStatus
name : String
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
217
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context NewOrderStatus::orderStatusDoesNotExist(): Boolean
body :
not OrderStatus.allInstances() -> exists (os | os.name=self.name)
„
Effect
context NewOrderStatus::effect()
post :
os.oclIsNew() and
os.oclIsTypeOf(OrderStatus) and
os.name = self.name
Event
NewProduct
„
Event diagram
String
1
Language
name
HasNewProductName
*
ProductNameEvent
DomainEvent
NewProduct
„
status : ProductStatus
available : DateTime [0..1]
netPrice : Money
quantityOnHand : Integer
model : String [0..1]
imagePath : String [0..1]
weight : Decimal
0..1
Manufacturer
0..1
Category
effect()
0..1
TaxClass
Initial Integrity Constraints
context NewProduct::productDoesNotExist(): Boolean
body :
Language.allInstances() -> forAll ( l |
l.productInLanguage.name
-> excludes( self.hasNewProductName -> select(language=l).name))
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
218
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context NewProduct::effect()
post :
p.oclIsNew() and
p.oclIsTypeOf(Product) and
p.status = self.status and
p.available = self.available and
p.netPrice = self.netPrice and
p.quantityOnHand = self.quantityOnHand and
p.model = self.model and
p.imagePath = self.imagePath and
p.weight = self.weight and
p.category = Set{self.category} and
p.manufacturer = self.manufacturer and
p.taxClass = self.taxClass and
Language.allInstances() ->
forAll (l|
self.hasNewProductName -> select(language=l).name =
p.productInLanguage->select(language=l).name)
Event
NewProductAttribute
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
NewProductAttribute
1
Option
1
Value
increment : Money
sign : Sign
effect()
„
Initial Integrity Constraints
context NewProductAttribute::productAttributeDoesNotExist(): Boolean
body :
not self.product.productAttribute ->
exists(attribute.value=self.value and
attribute.option = self.option)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
219
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context NewProductAttribute::optionValueIsValid(): Boolean
body : self.option.value -> includes(self.value)
„
Effect
context NewProductAttribute::effect()
post :
pa.oclIsNew() and
pa.oclIsTypeOf(ProductAttribute) and
pa.increment = self.increment and
pa.sign = self.sign and
pa.product = self.product and
pa.attribute.option = self.option and
pa.attribute.value = self.value
Event
NewProductNotification
„
Event diagram
DomainEvent
NewProductNotification
title : String
content : String
global : Boolean
*
explicitNotifications
Product
effect()
„
Initial Integrity Constraints
context NewProductNotification::ProductNotificationDoesNotExist(): Boolean
body : not Newsletter.allInstances() -> exists (n | n.title = self.title)
„
Effect
context NewProductNotification::effect()
post :
n.oclIsNew() and
n.oclIsTypeOf(ProductNotification) and
n.title = self.title and
n.content = self.content and
n.global = self.global and
n.explicitNotifications = self.explicitNotifications and
n.status = self.NewsletterStatus::unlocked
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
220
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewProductNotificationSubscription
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
NewProductNotificationSubscription
effect()
„
1
Product
newSubscribedProduct
Initial Integrity Constraints
context NewProductNotificationSubscription::ProductIsUnsubscribed(): Boolean
body :
not self.customer.globalNotifications and
self.customer.explicitNotifications -> excludes(self.newSubscribedProduct)
„
Effect
context NewProductNotificationSubscription::effect()
post : self.customer.explicitNotifications -> includes(self.newSubscribedProduct)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
221
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewProductOption
„
Event diagram
String
1
Language
*
name
HasNewOptionName
ProductOptionNameEvent
DomainEvent
NewProductOption
effect()
„
Initial Integrity Constraints
context NewProductOption::productOptionDoesNotExist(): Boolean
body :
Language.allInstances() -> forAll ( l |
l.hasOptionName.optionName
-> excludes(self.hasNewOptionName -> select(language=l).name))
„
Effect
context NewProductOption::effect()
post :
po.oclIsNew() and
po.oclIsTypeOf(Option) and
Language.allInstances() ->
forAll (l| self.hasNewOptionName -> select(language=l).name =
po.hasOptionName->select(optionLanguage=l).optionName)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
222
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewProductOptionValue
„
Event diagram
String
1
Language
*
name
HasNewValueName
ProductValueNameEvent
DomainEvent
NewProductOptionValue
1..*
effect()
„
Option
Initial Integrity Constraints
context NewProductOptionValue::optionValueDoesNotExist(): Boolean
body :
Language.allInstances() -> forAll ( l |
l.hasValueName.valueName
-> excludes(self.hasNewValueName -> select(Language=l).name))
„
Effect
context NewProductOptionValue::effect()
post :
pov.oclIsNew() and
pov.oclIsTypeOf(Value) and
Language.allInstances() ->
forAll (l| self.hasNewValueName -> select(language=l).name =
pov.hasValueName->select(valueLanguage=l).valueName) and
pov.option = self.option
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
223
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewReview
„
Event diagram
DomainEvent
NewReview
Language
1
review : String
rating : Rating
effect()
„
Effect
context NewReview::effect()
post :
r.oclIsNew() and
r.oclIsTypeOf(Review) and
r.review = self.review and
r.rating = self.rating and
r.customer = self.customer and
r.product = self.product and
r.language = self.language
Event
NewSession
„
Customer
1
Product
Initial Integrity Constraints
context NewReview::reviewRight(): Boolean
body : self.review.size() >= MinimumValues.reviewText
„
1
Event diagram
DomainEvent
NewSession
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
224
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context NewSession::effect()
post :
s.oclIsNew() and
s.oclIsTypeOf(Session)
Event
NewSpecial
„
Event diagram
DomainEvent
NewSpecial
specialPrice : Money
expiryDate : DateTime [0..1]
status : SpecialStatus
1
Product
effect()
„
Effect
context NewSpecial::effect()
post :
self.product.oclIsTypeOf(Special) and
self.product.oclAsTypeOf(Special).specialPrice=self.specialPrice and
self.product.oclAsTypeOf(Special).expiryDate=self.expiryDate and
self.product.oclAsTypeOf(Special).status=self.status
Event
NewTaxClass
„
Event diagram
DomainEvent
NewTaxClass
name : String
description : String [0..1]
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
225
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context NewTaxClass::TaxClassDoesNotExist(): Boolean
body : not TaxClass.allInstances() -> exists (tc | tc.name = self.name)
„
Effect
context NewTaxClass::effect()
post :
tc.oclIsNew() and
tc.oclIsTypeOf(TaxClass) and
tc.name = self.name and
tc.description = self.description
Event
NewTaxRate
„
Event diagram
DomainEvent
NewTaxRate
TaxClass
1
rate : Natural
priority : Natural
description : String [0..1]
1
TaxZone
effect()
„
Initial Integrity Constraints
context NewTaxRate::TaxRateDoesNotExist(): Boolean
body :
not TaxRate.allInstances() -> exists (tr | tr.taxClass = self.taxClass and
tr.taxZone = self.taxZone)
„
Effect
context NewTaxRate::effect()
post :
tr.oclIsNew() and
tr.oclIsTypeOf(TaxRate) and
tr.rate = self.rate and
tr.priority = self.priority and
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
226
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
tr.description = self.description and
tr.taxClass = self.taxClass and
tr.taxZone = self.taxZone
Event
NewTaxZone
„
Event diagram
DomainEvent
NewTaxZone
name : String
description : String [0..1]
*
Zone
effect()
„
Initial Integrity Constraints
context NewTaxZone::TaxZoneDoesNotExist(): Boolean
body : not TaxZone.allInstances() -> exists (tz | tz.name = self.name)
„
Effect
context NewTaxZone::effect()
post :
tz.oclIsNew() and
tz.oclIsTypeOf(TaxZone) and
tz.name = self.name and
tz.description = self.description and
tz.zone = self.zone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
227
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
NewZone
„
Event diagram
DomainEvent
NewZone
name : String
code : String
1
Country
effect()
„
Initial Integrity Constraints
context NewZone::ZoneDoesNotExist(): Boolean
body :
not Zone.allInstances() -> exists (z | z.name = self.name and z.country = self.country or
z.code = self.code and z.country = self.country)
„
Effect
context NewZone::effect()
post :
z.oclIsNew() and
z.oclIsTypeOf(Zone) and
z.name = self.name and
z.code = self.code and
z.country = self.country
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
228
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
OrderConfirmation
„
Event diagram
DomainEvent
OrderConfirmation
delivery : Address
billing : Address
creditCardType : String [0..1]
creditCardOwner : String [0..1]
creditCardNumber : String [0..1]
creditCardExpires : Date [0..1]
comments : String [0..1]
1 CustomerShoppingCart
shoppingCart
1
ShippingMethod
1
PaymentMethod
1
Currency
effect()
„
Initial Integrity Constraints
context OrderConfirmation::ShippingMethodIsEnabled(): Boolean
body : self.shippingMethod.status= Status::enabled
context OrderConfirmation::PaymentMethodIsEnabled(): Boolean
body : self.paymentMethod.status= Status::enabled
context OrderConfirmation::CurrencyIsEnabled(): Boolean
body : self.currency.status = Status::enabled
context OrderConfirmation::CreditCardDetailsNeeded(): Boolean
body :
self.paymentMethod.oclIsTypeOf(AuthorizeNet) or
self.paymentMethod.oclIsTypeOf(CreditCard) or
self.paymentMethod.oclIsTypeOf(IPayment) or
self.paymentMethod.oclIsTypeOf(TwoCheckOut) or
self.paymentMethod.oclIsTypeOf(PSiGate)
implies
creditCardType.notEmpty() and
creditCardOwner.notEmpty() and
creditCardNumber.notEmpty() and
creditCardExpires.notEmpty()
context OrderConfirmation::StockAllowsOrder(): Boolean
body :
Stock.allowCheckout or
not Stock.checkStockLevel or
self.shoppingCart.shoppingCartItem.product -> forAll (p | p.quantityOnHand > 0)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
229
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context OrderConfirmation::effect()
post theOrderIsCreated:
o.oclIsNew() and
o.oclIsTypeOf(Order) and
o.customer = [email protected]@pre and
o.billing = self.billing and
o.delivery = self.delivery and
o.shippingMethod = self.shippingMethod and
o.paymentMethod = self.paymentMethod and
o.currency = self.currency and
--The initial status of the order is pending
osc.oclIsNew() and
osc.oclIsTypeOf(OrderStatusChange) and
osc.comments = self.comments and
osc.orderStatus = Store.allInstances() -> any(true).defaultStatus and
osc.order = o and
--There is an order line for each shopping cart item
[email protected]@pre->forAll
(i|OrderLine.allInstances() -> one
(ol|ol.order = o and
ol.product = i.product@pre and
ol.quantity = i.quantity@pre and
i.attribute@pre->forAll
(iAtt|OrderLineAttribute.allInstances() -> one
(olAtt|olAtt.orderLine = ol and
olAtt.attribute = iAtt))))
post theShoppingCartIsRemoved:
not [email protected](OclAny)
post updateProductQuantities:
let productsBought:Set(Product) =
[email protected]@pre.product@pre->asSet()
in productsBought -> forAll (p|
let quantityBought:PositiveInteger =
[email protected]@pre->select
(sc | sc.product = p).quantity -> sum()
in
p.quantityOrdered = p.quantityOrdered@pre + quantityBought and
Stock.substractStock implies
p.quantityOnHand = p.quantityOnHand@pre – quantityBought)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
230
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
OwnerChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
OwnerChange
newOwner : String [0..1]
effect()
„
Effect
context OwnerChange::effect()
post : myStore.owner = self.newOwner
Event
PasswordChange
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
PasswordChange
oldPassword : String
newPassword : String
effect()
„
Initial Integrity Constraints
context ChangePassword::passwordRight(): Boolean
body : self.password.size() >= MinimumValues.password
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
231
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
context ChangePassword::OldPasswordIsCorrect(): Boolean
body : [email protected] = self.oldPassword
„
Effect
context ChangePassword::effect()
post : self.customer.password = self.newPassword
Event
PasswordMinimumChange
„
Event diagram
DomainEvent
PasswordMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context PasswordMinimumChange::effect()
post : MinimumValues.password = self.newMinimum
Event
PercentageIncreaseForLargerPackagesShippingConfigurationChange
„
Event diagram
DomainEvent
PercentageIncreaseForLargerPackagesShippingConfigurationChange
newPercentage : Decimal
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
232
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context PercentageIncreaseForLargerPackagesShippingConfigurationChange::effect()
post : ShippingAndPackaging.percentageIncreaseForLargerPackages= self.newPercentage
Event
PostCodeMinimumChange
„
Event diagram
DomainEvent
PostCodeMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context PostCodeMinimumChange::effect()
post : MinimumValues.postCode = self.newMinimum
Event
PostCodeShippingConfigurationChange
„
Event diagram
DomainEvent
PostCodeShippingConfigurationChange
newPostCode : PostalCode [0..1]
effect()
„
Effect
context PostCodeShippingConfigurationChange::effect()
post : ShippingAndPackaging.postCode = self.newPostCode
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
233
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
PrimaryCustomerAddressChange
„
Event diagram
<<dataType>>
Customer
Address
1
1
ExistingAddressEvent
DomainEvent
ExistingCustomerEvent
PrimaryCustomerAddressChange
effect()
„
Initial Integrity Constraints
context PrimaryCustomerAddressChange::AddressOfCustomer(): Boolean
body : self.customer.address -> includes(self.address)
„
Effect
context PrimaryCustomerAddressChange::effect()
post : self.customer.primary = self.address
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
234
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ProductAttributeStatusChange
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
DomainEvent
ProductAttributeStatusChange
newStatus : Status
effect()
„
Effect
context ProductAttributeStatusChange::effect()
post : self.productAttribute.status = self.newStatus
Event
ProductDownload
„
Event diagram
Product
Customer
1
1
ExistingCustomerEvent
DomainEvent
ExistingProductEvent
ProductDownload
1
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
235
Downloadable
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context ProductDownload::DownloadEnabled(): Boolean
body : Download.enableDonwload
context ProductDownload::ProductWasPurchasedByCustomer(): Boolean
body : self.customer.order.orderLine.product -> includes (self.product)
context ProductDownload::DownloadableIsFromProduct(): Boolean
body : self.product.productAttribute -> select(pa | pa.oclIsTypeOf(Downloadable))
-> includes (self.downloadable)
context ProductDownload::DownloadIsNotExpired(): Boolean
body :
let datePurchased:DateTime =
self.customer.order
-> select (o | o.orderLine.product -> includes(self.product))
->sortedBy(purchased)->last().purchased
in
Now() <= datePurchased + self.downloadable.expiryDays
context ProductDownload::DownloadsCountNotExceeded(): Boolean
body :
let DownloadCountFromProduct:Natural =
self.customer.order.orderLine.orderLineAttribute
-> select (ola | ola.oclIsTypeOf(OrderDownload) and ola.orderLine.product = self.product)
-> sortedBy(orderLine.order.purchased)->last().oclAsType(OrderDownload).downloadCount
in
DownloadCountFromProduct < self.downloadable.maximumDownloadCount
„
Effect
context ProductDownload::effect()
post :
let OrderDownloadFromProduct:OrderDownload=
self.customer.order.orderLine.orderLineAttribute
-> select (ola | ola.oclIsTypeOf(OrderDownload) and ola.orderLine.product = self.product)
-> sortedBy(orderLine.order.purchased) -> last()
.oclAsType(OrderDownload)
in
let OldOrderDownloadCount:Integer =
self.customer.order.orderLine.orderLineAttribute@pre
-> select (ola | ola.oclIsTypeOf(OrderDownload) and ola.orderLine.product = self.product)
-> sortedBy(orderLine.order.purchased) -> last()
.oclAsType(OrderDownload).downloadCount
in
OrderDownloadFromProduct.downloadCount = OldOrderDownloadCount +1
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
236
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ProductOptionAttributeChange
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
DomainEvent
ProductOptionAttributeChange
1
Option
effect()
„
Effect
context ProductOptionAttributeChange::effect()
post : productAttribute.attribute.option = self.option
Event
ProductOptionValueAttributeChange
„
Event diagram
ProductAttribute
1
ExistingProductAttributeEvent
DomainEvent
ProductOptionValueAttributeChange
1
effect()
„
Effect
context ProductOptionValueAttributeChange::effect()
post : productAttribute.attribute.value = self.value
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
237
Value
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ProductStatusChange
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
ProductStatusChange
newStatus : ProductStatus
effect()
„
Effect
context ProductStatusChange::effect()
post : self.product.status = self.newStatus
Event
ReadProductInfo
„
Event diagram
Product
1
ExistingProductEvent
DomainEvent
ReadProductInfo
1
Language
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
238
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ReadProductInfo::effect()
post : self.product.productInLanguage->select(pil | pil.language=self.language).viewed =
[email protected]@pre->select(pil | pil.language=self.language).viewed + 1
Event
ReadReview
„
Event diagram
Review
1
ExistingReviewEvent
DomainEvent
ReadReview
effect()
„
Effect
context ReadReview::effect()
post : self.review.timesRead = [email protected] + 1
Event
ReorderLevelStockConfigurationChange
„
Event diagram
DomainEvent
ReorderLevelStockConfigurationChange
newValue : Natural
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
239
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ReorderLevelStockConfigurationChange::effect()
post : Stock.stockReorderLevel = self.newValue
Event
RestorePreviousShoppingCart
„
Event diagram
Customer
1
ExistingCustomerEvent
DomainEvent
RestorePreviousShoppingCart
1
Session
effect()
„
Initial Integrity Constraints
context RestorePreviousShoppingCart::CustomerHasAPreviousShoppingCart(): Boolean
body : self.customer.customerShoppingCart->notEmpty()
„
Effect
context RestorePreviousShoppingCart::effect()
post : self.session.shoppingCart = self.customer.customerShoppingCart
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
240
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ReviewTextMinimumChange
„
Event diagram
DomainEvent
ReviewTextMinimumChange
newMinimum : Natural
effect()
„
Effect
context ReviewTextMinimumChange::effect()
post : MinimumValues.reviewText = self.newMinimum
Event
SendExtraOrderEmailChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
SendExtraOrderEMailChange
newSendExtraOrderEMail : NameEMail [*]
effect()
„
Effect
context SendExtraOrderEmailChange::effect()
post : myStore. sendExtraOrderEmail = self.newSendExtraOrderEmail
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
241
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
SendNewsletter
„
Event diagram
Newsletter
1
ExistingNewsletter
DomainEvent
SendNewsletter
effect()
„
Effect
context SendNewsletter::effect()
post : self.newsletter.sent = Now()
Event
SetCancelledOrderStatus
„
Event diagram
Store
1
/myStore
StoreEvent
DomainEvent
SetCancelledOrderStatus
effect()
„
Effect
context SetCancelledOrderStatus::effect()
post : self.myStore.cancelledStatus = self.orderStatus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
242
1
OrderStatus
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
SetCurrentCurrency
„
Event diagram
Session
1
ExistingSessionEvent
DomainEvent
SetCurrentCurrency
effect()
„
1
newCurrentCurrency
Currency
Effect
context SetCurrentCurrency::effect()
post : self.session.currentCurrency = self.newCurrentCurrency
Event
SetCurrentLanguage
„
Event diagram
Session
1
ExistingSessionEvent
DomainEvent
SetCurrentLanguage
1
newCurrentLanguage
effect()
<<create>>
SetCurrentCurrency
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
243
Language
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ChangeCurrentLanguage::effect()
post :
session.currentLanguage = self.newCurrentLanguage
post :
Store.allInstances() -> any(true).switchToDefaultLanguageCurrency and
self.language.defaultCurrency -> notEmpty()
implies
ccc.oclIsNew() and
ccc.oclIsTypeOf(ChangeCurrentCurrency) and
ccc.session = self.session and
ccc.newCurrentCurrency = self.language.defaultCurrency
Event
SetDefaultCurrency
„
Event diagram
Currency
1
ExistingCurrencyEvent
DomainEvent
SetDefaultCurrency
effect()
„
Effect
context SetDefaultCurrency::effect()
post : Store.allInstances() -> any(true).defaultCurrency = self.currency
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
244
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
SetDefaultLanguage
„
Event diagram
Language
1
ExistingLanguageEvent
DomainEvent
SetDefaultLanguage
effect()
„
Effect
context SetDefaultLanguage::effect()
post : Store.allInstances() -> any(true).defaultLanguage = self.language
Event
SetDefaultOrderStatus
„
Event diagram
Store
1
/myStore
StoreEvent
DomainEvent
SetDefaultOrderStatus
effect()
„
Effect
context SetPendingOrderStatus::effect()
post : self.myStore.defaultStatus = self.orderStatus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
245
1
OrderStatus
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ShowBanner
„
Event diagram
DomainEvent
1
ExistingBannerEvent
Banner
ShowBanner
effect()
„
Effect
context ShowBanner::effect()
post :
BannerHistory.allInstances() -> one
(bh | bh.banner = self.banner and
bh.date = today() and
bh.shown = [email protected] + 1)
Event
ShowBestPurchasedProducts
„
Event diagram
Query
ShowBestPurchasedProducts
answer
1
Language
effect()
„
Effect
context ShowBestPurchasedProducts::effect()
post :
answer =
Product.allInstances()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
246
answer:
Set(TupleType(product:String,
quantity:Natural))
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
-> sortedBy(quantityOrdered)
-> collect (p | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name,
quantity = p.quantityOrdered})->asSet()
Event
ShowBestViewedProducts
„
Event diagram
Query
ShowBestViewedProducts
1
answer
answer:
Set(TupleType(product:String,
quantity:Natural))
Language
effect()
„
Effect
context ShowBestViewedProducts::effect()
post :
answer =
Product.allInstances()
-> sortedBy(timesViewed)
-> collect (p | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name,
timesViewed = p.timesViewed})->asSet
Event
ShowCustomersOrdersTotal
„
Event diagram
Query
ShowCustomersOrdersTotal
answer
answer:
Set(TupleType(name:String,
total:Money))
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
247
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ShowCustomersOrdersTotal::effect()
post :
answer =
Customer.allInstances()
-> collect (c | Tuple {name = c.firstName.concat(c.lastName),
total = c.order.total -> sum()}) -> asSet()
Event
ShowExpectedProducts
„
Event diagram
Query
ShowExpectedProducts
answer
1
answer:
Set(TupleType(product:String,
dateAvailable:DateTime))
Language
effect()
„
Effect
context ShowExpectedProducts::effect()
post :
answer =
Product.allInstances() -> select(p|p.available.notEmpty() and p.available > Now())
-> sortedBy(available)
-> collect (p | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name,
dateAvailable = p.available}) ->asSet()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
248
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ShowNewProducts
„
Event diagram
Query
ShowNewProducts
1
answer
answer:
Set(TupleType(product:String,
added:DateTime))
Language
effect()
„
Effect
context ShowNewProducts::effect()
post :
answer =
Product.allInstances()
-> SortedBy(added)
-> collect (p | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name,
added = p.added})->asSet()
Event
ShowOnlineCustomers
„
Event diagram
Query
ShowOnlineCustomers
answer:Set(String)
answer
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
249
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ShowOnlineCustomers::effect()
post :
answer =
Session.allInstances().customer
-> collect (c | c.firstName.concat(c.lastName))->asSet()
Event
ShowOrdersOfCustomer
„
Event diagram
Customer
1
ExistingCustomerEvent
Query
answer:
Set(TupleType(id:Natural,
total:Money,
status:OrderStatus))
ShowOrdersOfCustomer
answer
effect()
„
Effect
context ShowOrdersOfCustomer::effect()
post :
answer =
self.customer.order
-> collect (o | Tuple {id = o.id,
total = o.total
status = o.orderStatusChange -> sortedBy(added) -> last()})->asSet()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
250
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ShowProductsOfCategory
„
Event diagram
Category
1
ExistingCategoryEvent
Query
answer:Set(String)
ShowProductsOfCategory
answer
1
Language
effect()
„
Effect
context ShowProductsOfCategory::effect()
post :
answer =
Product.allInstances() -> select(p | p.category -> includes(self.category))
-> collect (p | ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name)->asSet()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
251
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ShowProductsOfManufacturer
„
Event diagram
Manufacturer
1
ExistingManufacturerEvent
Query
ShowProductsOfManufacturer
answer
1
Language
answer:Set(String)
effect()
„
Effect
context ShowProductsOfManufacturer::effect()
post :
answer =
Product.allInstances() -> select(p | p.manufacturer=self.manufacturer)
-> collect (p | ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name)->asSet()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
252
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
ShowReviewsOfProduct
„
Event diagram
Product
1
ExistingProductEvent
Query
ShowReviewsOfProduct
1
answer
answer:
Set(TupleType(review:String,
rating:Rating))
Language
effect()
„
Effect
context ShowReviewsOfProduct::effect()
post :
answer =
self.product.review -> select (r | r.language = self.language)
-> collect (r | Tuple {review = r.review
rating= r.rating})->asSet()
Event
ShowSpecials
„
Event diagram
Query
answer:
Set(TupleType(product:String,
oldPrice:Money,
netPrice: Money))
ShowSpecials
answer
1
Language
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
253
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context ShowSpecials::effect()
post :
answer =
Special.allInstances()
-> collect (s | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = s and
pil.language=language).name,
oldPrice = s.netPrice
newPrice = s.specialPrice})->asSet()
Event
ShowUnderStockProducts
„
Event diagram
Query
ShowUnderStockProducts
answer
1
answer:
Set(TupleType(product:String,
quantity:Natural))
Language
effect()
„
Effect
context ShowUnderStockProducts::effect()
post :
answer =
Product.allInstances() -> select(p | p.quantityOnHand < Stock.stockReorderLevel)
-> SortedBy(Store.allInstances()->any(true).sortedBy(expectedSortField)
-> collect (p | Tuple {product = ProductInLanguage.allInstances() ->select
(pil | pil.product = p and
pil.language=language).name,
quantity = p.quantityOnHand}) -> asSet()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
254
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
StateCustomerDetailChange
„
Event diagram
DomainEvent
StateCustomerDetailChange
newValue : Boolean
effect()
„
Effect
context StateCustomerDetailChange::effect()
post : CustomerDetails.state = self.newValue
Event
StateMinimumChange
„
Event diagram
DomainEvent
StateMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context StateMinimumChange::effect()
post : MinimumValues.state = self.newMinimum
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
255
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
StatusPaymentMethodChange
„
Event diagram
PaymentMethod
1
ExistingPaymentMethodEvent
DomainEvent
StatusPaymentMethodChange
newStatus : Status
effect()
„
Effect
context StatusPaymentMethodChange::effect()
post : self.paymentMethod.status = self.newStatus
Event
StatusShippingMethodChange
„
Event diagram
ShippingMethod
1
ExistingShippingMethodEvent
DomainEvent
StatusShippingMethodChange
newStatus : Status
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
256
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context StatusShippingMethodChange::effect()
post : self.shippingMethod.status = self.newStatus
Event
StoreAddressAndPhoneChange
„
Event diagram
DomainEvent
StoreEvent
1
Store
/myStore
StoreAddressAndPhoneChange
newStoreAddressAndPhone : String [0..1]
effect()
„
Effect
context StoreAddressAndPhoneChange::effect()
post : myStore.storeAddressAndPhone = self.newStoreAddressAndPhone
Event
StreetAddressMinimumChange
„
Event diagram
DomainEvent
StreetAddressMinimumChange
newMinimum : PositiveInteger
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
257
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context StreetAddressMinimumChange::effect()
post : MinimumValues.streetAddress = self.newMinimum
Event
SubstractStockConfigurationChange
„
Event diagram
DomainEvent
SubstractStockConfigurationChange
newValue : Boolean
effect()
„
Effect
context SubstractStockConfigurationChange::effect()
post : Stock.substrackStock= self.newValue
Event
SuburbCustomerDetailChange
„
Event diagram
DomainEvent
SuburbCustomerDetailChange
newValue : Boolean
effect()
„
Effect
context SuburbCustomerDetailChange::effect()
post : CustomerDetails.suburb = self.newValue
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
258
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
SwitchToDefaultLanguageCurrencyChange
„
Event diagram
DomainEvent
StoreEvent
Store
1
/myStore
SwitchToDefaultLanguageCurrencyChange
newSwitchToDefaultLanguageCurrency : Boolean
effect()
„
Effect
context SwitchToDefaultLanguageCurrencyChange::effect()
post : myStore.switchToDefaultLanguageCurrency = self.newSwitchToDefaultLanguageCurrency
Event
TaxDecimalPlacesChange
„
Event diagram
DomainEvent
StoreEvent
1
<<Constant>>
/myStore
Store
TaxDecimalPlacesChange
newTaxDecimalPlaces : Natural
effect()
„
Effect
context TaxDecimalPlacesChange::effect()
post : myStore.taxDecimalPlaces = self.newTaxDecimalPlaces
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
259
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
TelephoneMinimumChange
„
Event diagram
DomainEvent
TelephoneMinimumChange
newMinimum : PositiveInteger
effect()
„
Effect
context TelephoneMinimumChange::effect()
post : MinimumValues.telephoneNumber = self.newMinimum
Event
TypicalPackageTareWeightShippingConfigurationChange
„
Event diagram
DomainEvent
TypicalPackageTareWeightShippingConfigurationChange
newValue : Natural
effect()
„
Effect
context TypicalPackageTareWeightShippingConfigurationChange::effect()
post : ShippingAndPackaging.typicalPackageTareWeight = self.newValue
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
260
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
UnInstallAuthorizeNetPaymentMethod
„
Event diagram
DomainEvent
UninstallAuthorizeNetPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallAuthorizeNetPaymentMethod::PaymentMethodIsInstalled():Boolean
body : AuthorizeNet.allInstances() -> notEmpty()
„
Effect
context UninstallAuthorizeNetPaymentMethod::effect()
post : AuthorizeNet.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallCashOnDeliveryPaymentMethod
„
Event diagram
DomainEvent
UninstallCashOnDeliveryPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallCashOnDeliveryPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CashOnDelivery.allInstances() -> notEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
261
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context UninstallCashOnDeliveryPaymentMethod::effect()
post : CashOnDelivery.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallCheckMoneyPaymentMethod
„
Event diagram
DomainEvent
UninstallCheckMoneyPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallCheckMoneyPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CheckMoney.allInstances() -> notEmpty()
„
Effect
context UninstallCheckMoneyPaymentMethod::effect()
post : CheckMoney.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallCreditCartPaymentMethod
„
Event diagram
DomainEvent
UninstallCreditCardPaymentMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
262
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context UninstallCreditCardPaymentMethod::PaymentMethodIsInstalled():Boolean
body : CreditCard.allInstances() -> notEmpty()
„
Effect
context UninstallCreditCardPaymentMethod::effect()
post : CreditCard.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallIPaymentPaymentMethod
„
Event diagram
DomainEvent
UninstallIPaymentPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallIPaymentPaymentMethod::PaymentMethodIsInstalled():Boolean
body : IPayment.allInstances() -> notEmpty()
„
Effect
context UninstallIPaymentPaymentMethod::effect()
post : IPayment.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
263
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
UninstallNochexPaymentMethod
„
Event diagram
DomainEvent
InstallNochexPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallNochexPaymentMethod::PaymentMethodIsInstalled():Boolean
body : Nochex.allInstances() -> notEmpty()
„
Effect
context UninstallNochexPaymentMethod::effect()
post : Nochex.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallPayPalPaymentMethod
„
Event diagram
DomainEvent
UninstallPayPalPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallPayPalPaymentMethod::PaymentMethodIsInstalled():Boolean
body : PayPal.allInstances() -> isEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
264
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context UninstallPayPalPaymentMethod::effect()
post : PayPal.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallPerItemPaymentMethod
„
Event diagram
DomainEvent
UninstallPerItemShippingMethod
effect()
„
Initial Integrity Constraints
context UninstallPerItemShippingMethod::ShippingMethodIsInstalled():Boolean
body : PerItem.allInstances() -> notEmpty()
„
Effect
context UninstallPerItemShippingMethod::effect()
post : PerItem.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallPSiGatePaymentMethod
„
Event diagram
DomainEvent
UninstallPSiGatePaymentMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
265
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context UninstallPSiGatePaymentMethod::PaymentMethodIsInstalled():Boolean
body : PSiGate.allInstances() -> notEmpty()
„
Effect
context UninstallPSiGatePaymentMethod::effect()
post : PSiGate.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallSECPaymentMethod
„
Event diagram
DomainEvent
UninstallSECPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallSECPaymentMethod::PaymentMethodIsInstalled():Boolean
body : SECPay.allInstances() -> notEmpty()
„
Effect
context UninstallSECPaymentMethod::effect()
post : SECPay.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
266
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
UninstallTableRatePaymentMethod
„
Event diagram
DomainEvent
UninstallTableRateShippingMethod
effect()
„
Initial Integrity Constraints
context UninstallTableRateShippingMethod::ShippingMethodIsInstalled():Boolean
body : TableRate.allInstances() -> notEmpty()
„
Effect
context UninstallTableRateShippingMethod::effect()
post : TableRate.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallTwoCheckOutPaymentMethod
„
Event diagram
DomainEvent
UninstallTwoCheckOutPaymentMethod
effect()
„
Initial Integrity Constraints
context UninstallTwoCheckOutPaymentMethod::PaymentMethodIsInstalled():Boolean
body : TwoCheckOut.allInstances() -> notEmpty()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
267
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context UninstallTwoCheckOutPaymentMethod::effect()
post : TwoCheckOut.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallUSPostalServicePaymentMethod
„
Event diagram
DomainEvent
UninstallUSPostalServiceShippingMethod
effect()
„
Initial Integrity Constraints
context UninstallUSPostalServiceShippingMethod::ShippingMethodIsInstalled():Boolean
body : USPostalService.allInstances() -> notEmpty()
„
Effect
context UninstallUSPostalServiceShippingMethod::effect()
post : USPostalService.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallZoneRatesShippingMethod
„
Event diagram
DomainEvent
UninstallZoneRatesShippingMethod
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
268
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Initial Integrity Constraints
context UninstallZoneRatesShippingMethod::ShippingMethodIsInstalled():Boolean
body : ZoneRates.allInstances() -> notEmpty()
„
Effect
context UninstallZoneRatesShippingMethod::effect()
post : ZoneRates.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
Event
UninstallFlatRateShippingMethod
„
Event diagram
DomainEvent
UninstallFlateRateShippingMethod
effect()
„
Initial Integrity Constraints
context UninstallFlatRateShippingMethod::ShippingMethodIsInstalled():Boolean
body : FlatRate.allInstances() -> notEmpty()
„
Effect
context UninstallFlatRateShippingMethod::effect()
post : FlatRate.allInstances() -> any(true)@pre.oclIsKindOf(OclAny)
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
269
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
UnlockNewsletter
„
Event diagram
Newsletter
1
ExistingNewsletter
DomainEvent
UnlockNewsletter
effect()
„
Effect
context UnlockNewsletter::effect()
post : self.newsletter.status = NewsletterStatus::unlocked
Event
UpdateCurrencyValueChange
„
Event diagram
Currency
1
ExistingCurrencyEvent
DomainEvent
UpdateCurrencyValueChange
newValue : Decimal
effect()
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
270
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
„
Effect
context UpdateCurrencyValueChange::effect()
post : self.currency.value = self.newValue
post : self.currency.lastUpdated = Now()
Event
UpdateOrderStatus
„
Event diagram
Order
1
ExistingOrderEvent
DomainEvent
UpdateOrderStatus
comments : String [0..1]
1 OrderStatus
newOrderStatus
effect()
„
Effect
context ChangeOrderStatus::effect()
post :
osc.oclIsNew() and
osc.oclIsTypeOf(OrderStatusChange) and
osc.comments = self.comments and
osc.order = self.order and
osc.orderStatus = self.newOrderStatus
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
271
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
Event
UpdateShoppingCart
„
Event diagram
Session
1
SessionEvent
ActionRequest
DomainEvent
ExistingShoppingCartItem
RemoveProduct
UpdateShoppingCart
effect()
<<dataType>>
LineChange
remove : Boolean
quantity : PositiveInteger
1..*
effect()
{ordered}
ChangeQuantity
quantity : PositiveInteger
effect()
„
Initial Integrity Constraints
context UpdateShoppingCart::complete(): Boolean
body : self.lineChange->size() = self.session.shoppingCart.shoppingCartItem->size()
„
Effect
context RemoveProduct::effect()
post : not [email protected](OclAny)
context ChangeQuantity::effect()
post : self.shoppingCartItem.quantity = self.quantity
context UpdateShoppingCart::effect()
post :
self.lineChange ->forAll
(lc|let cartItem:ShoppingCartItem =
self.shoppingCart.shoppingCartItem->
at(lineChange->indexOf(lc))
in
(lc.remove or lc.quantity <> cartItem.quantity)
implies
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
272
1
ShoppingCartItem
esquemaconceptual
3/ BEHAVIORAL SCHEMA
OsCommerce
if lc.remove then
rp.oclIsNew and
rp.oclIsTypeOf(RemoveProduct) and
rp.shoppingCartItem = cartItem
else
cq.oclIsNew() and
cq.oclIsTypeOf(ChangeQuantity) and
cq.shoppingCartItem = cartItem and
cq.quantity = quantity
endif )
Event
ZoneChange
„
Event diagram
DomainEvent
StoreEvent
1
/myStore
ZoneChange
effect()
„
1
newZone
Zone
Effect
context ZoneChange::effect()
post : myStore.zone = self.newZone
PFCAlbert tort
UNIVERSITAT POLITÈCNICA DE CATALUNYA
273
Store