Lab 8 - Create rule flow

Lab Goal

To create a rule flow process for each time item added to shopping cart for retail web shop

Create new rule flow

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

Create new rule flow

A rule flow is a business process that contains only rule tasks, but allows you to order the flow of rule execution. Get started by clicking on ADD ASSET -> BUSINESS PROCESS for pop-up:
  • BUSINESS PROCESS: PriceProcess
  • PACKAGE: DEFAULT
  • Click on +OK to create business process

Create rule flow

The process designer has a single start node we are going to design a 5 step process applying rules:
  1. Apply Cart Promotion
  2. Total Shopping Cart Items
  3. Calculate Shipping
  4. Apply Shipping Promotions
  5. Total Shopping Cart

Create rule flow

Drag and drop the first start node from the panel on the left (green circle). You can use this Object Library to drag-and-drop tasks, but easier to click a node and use mini-icons:
  • click on the start node
  • click on mini-icon of task right of selected node
  • automatically adds a transition and a task node

Create rule flow

Continue to click a node and use the mini-icons:
  • repeat for 5 task nodes
  • then click on mini-icon of end node (hover shows 'Create End')

Create rule flow

Finishing configuration of the node as a business rule task:
  • click on each task, using mini-icon bottom left select 'business rule'
  • task node now has 'rule' icon marking it in top left corner
  • repeat for 5 task nodes

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS
  • (Note: ignore warnings in Alerts panel for now...)

Create rule flow

Now we need to name each rule task:
  • select the first 'Task' rule node
  • double click on the text 'Task' to open editor box
  • fill in name: 'Apply Cart Promotions' and click check mark

Create rule flow

Now complete the naming for rest of the rule tasks:
  • Total Shopping Cart Items
  • Calculate Shipping
  • Apply Shipping Promotions
  • Total Shopping Cart
  • (Note: to adjust your view, zoom is at bottom right)

Create rule flow

At this point we need to associate a rule set with each task. This is done by assigning a 'Ruleflow Group' to each rule task:
  • click on rule task 'Apply Cart Promotions'
  • on far right, click 'Diagram properties' button to open right pane
  • this is the properties editor for the selected element in the designer

Create rule flow

Now assign a 'Ruleflow Group' to each rule task:
  • click on 'Implementation/Execution to open the right pane
  • select Rule Flow Group: promo-cart-rules in menu
  • click on SAVE to finalize the changes

Create rule flow

Set the following business rule tasks 'Rule Flow Group' fields select from menu listings:
  • Total Shopping Cart Items = 'pricing-rules'
  • Calculate Shipping = 'shipping-rules'
  • Apply Shipping Promotions = 'promo-rules'
  • Total Shopping Cart = 'total-rules'

Don't forget to save

  • Click SAVE or SAVE WITH COMMENTS:
  • (Note: Alerts can be cleared and refreshed to show no more errors)

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 8:
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 9 - Create test scenarios