Perfumery Example Application


Perfumery is an example application for the Cibet control framework. Don't look too much on layout of the GUI and the sense of business processes. The essential is the integration of the Cibet control framework and the Cibet business processes of listing archives and releasing / rejecting dual control actions.

Perfumery is a simple Tapestry application for the purchase department of a perfumery shop. The major domain objects and their relations are depicted in the following figure:

Perfumery class model

The shop sells perfumes. Perfumes have a selling price and a type attribute. The purchase department buys perfumes from suppliers. These have a name, an address and offers with purchase prices. The suppliers must not offer each perfume. The user can send orders to suppliers in order to purchase perfumes. An order can have several order items.

The application is multi-tenant. Users Hugo, Harry and Herman are from company Goudlas. Users Amy, Anne and Arabella are from company Rives Yocher. The two companies have different perfumes in their shops and they have their own suppliers. Password authentication is not required for log in.

The following business cases can be executed:

  • Display the shops perfumes
  • Display Suppliers and their offers
  • Create a new Supplier
  • Edit a supplier
  • Delete a supplier
  • Display outstanding orders
  • Create a new order

The create and delete supplier business cases are executed in a Java SE service, the update supplier and create new order are executed in a Java EE service. This is designed in this way to demonstrate that Cibet is able to work both in Java SE and Java EE environments.

In the configure menu item, Cibet control schemes can be configured. The following Cibet actions can be controlled:

  • INSERT: Supplier entity
  • UPDATE: Supplier
  • DELETE: Supplier
  • PERSIST: Supplier
  • INVOKE: Create a new order

The Supplier entity has an associated list of Offer objects which in turn has a dependency to a Perfume object. Controlling Supplier entities demonstrates that Cibet is able to control also complex object structures.

The business case of creating an order consists of creating an Order entity in the database and sending an order file to the supplier. It is not a good idea to control INSERT Order with FOUR-EYES scheme because the order file would be sent instantaneously even if the Order is set under dual control. Therefore the invocation of the business process must be controlled in this case.


The source of the example application can be downloaded here.

It is packed as a Maven project. You can just import it into your development environment. The database scripts can be found in the src/main/install folder. Adjust the scripts if another database than Derby is used. Change the database connection parameters in file src/main/resources/ and src/main/resources/META-INF/persistence.xml.

Execute mvn install to create the application. Deploy the perfumery.war file in your application server. It has been tested in Jetty and Tomcat application servers. With Tomcat is is necessary to copy javaee-api-5.0.2.jar into the lib directory. This library can be found in the local repository of the downloaded Maven files or in perfumery.war archive.

Start the application with http://your domain/perfumery