Lab 7 - Create guided decision table

Lab Goal

To create a guided decision table for shipping pricing for retail web shop

Create new decision table

  • Now let's create a new decision table
  • First have to return to Asset view
  • Click on retail-webshop project in bread crumb menu at top

Create new decision table

  • Click on ADD ASSET -> GUIDED DECISION TABLE for pop-up
  • GUIDED DECISION TABLE: Shipping Rules
  • PACKAGE: default
  • Fill as shown, click on +OK to create rule:

Create decision table

Presented with wizard to setup decision table in Summary view:
  • Fields: Name, Path, Table Format, and Hit Policy

Create decision table

Click on NEXT button to got to Imports, used to add data types:
  • add ShoppingCart data type by moving to right using arrows

Create decision table

Now we need to add facts to help define our column constraints, click NEXT for Add Fact Patterns:
  • select ShoppingCart and add to 'Chosen Patterns'
  • select 'Chosen Patterns' to add Binding for this: '$sc', ignore 'From Entry Point'

Create decision table

Click NEXT, we add constraints on our shopping cart facts:
  • need a column for total shipping bottom to top range
  • select $sc.ShoppingCart to see 'Available fields'
  • select 'cartItemTotal:Double', use arrow to add to 'Conditions'
  • note: condition is red, as needs to be defined yet...

Create decision table

To finish, must define conditions:
  • select 'cartItemTotal' to bring up fields to edit at bottom
  • fill in 'Column header (description):' 'Total >='
  • select 'Operator:' 'greater than or equal to'

Create decision table

Now complete the same again for the 'Total <' column:
  • add and select another 'cartItemTotal ' to bring up fields to edit at bottom
  • fill in 'Column header (description): ' 'Total <'
  • select 'Operator:' 'less than'

Create decision table

Next adding an action to update facts. We will be updating the ShoppingCart shippingTotal in the last column of the table:
  • select '$sc:ShoppingCart' to view 'Available fields'
  • select 'shippingTotal:Double' field
  • add to 'Chosen fields' with arrow button
  • note: red item shows definitions are not complete yet...

Create decision table

Select 'shippingTotal' in 'Chosen fields to expose definitions:
  • add 'Column header (description):' 'Shipping Total'
  • the rest of the fields can be left empty

Create decision table

Click on NEXT, leave 'Add Actions to insert Facts' alone, not needed:

Create decision table

Click on NEXT to view 'Columns to expand view:
  • View 'Columns to expand' to ensure box checked
  • click 'Finish' button to display empty decision table

Create decision table

The wizard setup has completed to start a decision table:

Create decision table

Click on top level menu button 'Insert' to drop down entry 'Add column':
  • click box 'Include avanced options'
  • select 'Add an Attribute column' from list
  • click on NEXT and select 'no-loop'
  • click 'FINISH'

Create decision table

Repeat 'Add new Attribute column':
  • click box 'Include avanced options'
  • select 'Add an Attribute column' from list
  • click on NEXT and select 'ruleflow-group
  • click 'FINISH'

Create decision table

Validate attribute additions:
  • click on 'Columns' tab at top of decision table
  • select 'Attribute columns' from list
  • note 'no-loop' and 'ruleflow-group entries waiting to be filled

Create decision table

Finalize attributes:
  • no-loop: check box and check hide column
  • ruleflow-group: 'shipping-rules'
  • click on 'Model' tab at top of decision table to finish

Create decision table

Using 'Insert' drop down 'Append row' to add empty rows to table:
  • add 5 empty rows to table
  • the empty table should look like below

Create decision table

Update all rows by clicking on cells to add values as shown:

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:

Validate project builds:

Click on breadcrumb 'retail-webshop' to return to asset view:
  • click 'Build' button at top
  • note green validation of build

Lab results...

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 7:
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 8 - Create rule flow