Lab 3 - Create a domain model

Lab Goal

To create a new domain model with the Decision Manager data modeling tooling

Create new domain model

  • Open MENU at the top and select:
    • DESIGN -> PROJECT

Open retail web shop project

  • Select the RETAIL-WEBSHOP project

Add new asset

  • Open new assets view:
    • click on ADD ASSET button

Add new data object

  • Select new data object from list:
    • click on DATA OBJECT

Create product object

  • Create Product
    • Fill out pop-up as shown and click on OK button:

Create product object

  • Add label Product to general properties and click SAVE:

Create product object

  • Add the first property 'name' to product object by clicking on +ADD FIELD button to open pop-up editor:

Create product object

  • Fill out fields for name property as shown
  • Click on CREATE button to add field to object

Create product object

  • Product object should look like the following:

Create product object

  • Now add ITEMID as shown using +ADD FIELD button:

Create product object

  • Now add DESC and PRICE as shown using +ADD FIELD button:

Create product object

  • Be sure to SAVE your work by clicking button top right
  • Optionally add a comment and click SAVE WITH COMMMENTS drop-down in menu
  • Finished Product object in our domain model for now...

Create promo event object

  • To add PromoEvent object, first have to return to Asset view
  • Click on retail-webshop project in bread crumb menu at top
  • (Returning to Asset view can be done at any time)

Create promo event object

  • Click on ADD ASSET -> DATA OBJECT to open data modeling pop-up and create PromoEvent object as shown:

Create promo event object

  • Add label PromoEvent to general properties and click SAVE:

Create promo event object

  • PromoEvent is an EVENT, so we need to add that to it's ROLE
  • Click the top right Drools&jBPM button to open the editor

Create promo event object

  • Select EVENT from the drop down menu in ROLE as shown
  • Click on SAVE button:

Create promo event object

  • Using +ADD FIELD button, add field properties to complete EventPromo object as shown:

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:

Create shoppingcart object

  • To add ShoppingCart object, first have to return to Asset view
  • Click on retail-webshop project in bread crumb menu at top
  • (Returning to Asset view can be done at any time)

Create shoppingcart object

  • Click on ADD ASSET -> DATA OBJECT to open data modeling pop-up and create ShoppingCart object as shown:

Create shoppingcart object

  • Add label ShoppingCart to general properties and click SAVE:

Create shoppingcart object

  • Using +ADD FIELD button, add field properties to complete ShoppingCart object as shown:

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:

Shoppingcartitem object

  • To add ShoppingCartItem object, first have to return to Asset view
  • Click on retail-webshop project in bread crumb menu at top
  • (Returning to Asset view can be done at any time)

Shoppingcartitem object

  • Click on ADD ASSET -> DATA OBJECT to open data modeling pop-up and create ShoppingCartItem object as shown:

Shoppingcartitem object

  • Add label ShoppingCartItem and click SAVE:

Shoppingcartitem object

  • Using +ADD FIELD button, add field properties to complete ShoppingCartItem object as shown:
  • Note: shoppingCart is Type ShoppingCart object

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:

Update shoppingcart object

  • We need to add a field to the ShoppingCart object, first have to return to Asset view
  • Click on retail-webshop project in bread crumb menu at top
  • (Returning to Asset view can be done at any time)

Update shoppingcart object

  • Click on ShoppingCart object to open the asset
  • Click on +Add Field button to add ShoppingCartItemList as a field to the ShoppingCart
  • Type: ShoppingCartItem (from the drop-down menu)
  • Complete the properites for field and be sure to check the List
  • Click on Create buttong to complete as shown:

Update shoppingcart object

  • Your ShoppingCart object should look like this now:

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:

Browse data model

  • Another way to work with the data objects; open the side menu
  • Click on the left most arrow '>' to expand the side menu
  • Click on DATA OBJECTS to open menu, note the lock indicates working on SHOPPINGCART data object:

Lab Completed

What you should see...

  • Click on retail-web shop project (use bread crumb menu at the top) for assets view, this ends lab 3:
Eric D. Schabell
Portfolio Architect Director
@ericschabell
http://schabell.org
More Red Hat Decision Manager Workshops

Red Hat Decision Manager Articles

Red Hat Decision Manager Demos

Decision Manager Workshop

Up next...

Lab 4 - Create a domain specific language (DSL)