hands‐on‐decision‐automation‐2 - DigiBP/digibp.github.io GitHub Wiki

Pizza Service – Side Dish Decision Automation

This hands-on extends the existing Pizza Service BPMN workflow with a DMN decision that recommends an included side dish based on the pizza type and season. The five videos show how to adapt the BPMN process and forms, create a DRD with two decision tables, and deploy and test the solution in CIB seven.

Contents

1. BPMN and Forms

Watch the hands-on video 📹

Extend the Pizza Service workflow with a Business Rule Task called Recommend included side dish on the successful order path, before Bake pizza. Configure the DMN decision reference (side-dish), binding (latest), result variable (sideDish), and result mapping (singleEntry). Update the order form to collect pizzaType and season, and show the resulting sideDish in the pizza form as a read-only field. Important: Use the decision ID side-dish, not the definitions ID pizza-service-side-dish.

2. DMN DRD

Watch the hands-on video 📹

Create a DMN Decision Requirements Diagram (DRD) named Pizza Service Side Dish, with the definitions ID pizza-service-side-dish. Add two decisions: Pizza style, based on the input Pizza type, and Side dish, based on Pizza style and Season. Connect the input data and decisions as shown.

Pizza Service DRD

3. Decision Table Pizza Style

Watch the hands-on video 📹

Configure the first decision table to classify the selected pizza as vegetarian or meat-based. Use pizzaType as the input expression and pizzaStyle as the output name (type string). Enter these allowed values:

Pizza type – input values:

"Margherita","Funghi","Prosciutto","Diavola"

Pizza style – output values:

"Vegetarian","Meat"

Create four rules: Margherita and Funghi are vegetarian; Prosciutto and Diavola contain meat.

Pizza style decision table

4. Decision Table Side Dish

Watch the hands-on video 📹

Configure the final decision table with input expressions season and pizzaStyle, and output name sideDish (type string). Set the decision ID to side-dish, which must match the BPMN Business Rule Task.

Season – input values:

"Spring","Summer","Autumn","Winter"

Pizza style – input values:

"Vegetarian","Meat"

Side dish – output values:

"Tomato soup","Green salad","Mushroom salad","Roasted vegetables","Mixed salad"

Define the rules as follows (an empty pizza-style input matches both styles):

Season Pizza style Side dish
"Spring","Summer" (empty) "Mixed salad"
"Autumn" "Vegetarian" "Mushroom salad"
"Autumn" "Meat" "Roasted vegetables"
"Winter" "Vegetarian" "Tomato soup"
"Winter" "Meat" "Green salad"

Side dish decision table

5. Deployment and Testing

Watch the hands-on video 📹

Deploy the DMN model and the updated BPMN process, then start a new Pizza Service instance. Select a pizza type and season in the order form, complete the task, and check the recommended side dish in Bake pizza. For example, Funghi in Autumn produces Mushroom salad. Use Cockpit to inspect the executed decisions and their input/output values.