Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 4. Guided decision tables


Guided decision tables are a wizard-led alternative to uploaded decision table spreadsheets for defining business rules in a tabular format. With guided decision tables, you are led by a UI-based wizard in Decision Central that helps you define rule attributes, metadata, conditions, and actions based on specified data objects in your project. After you create your guided decision tables, the rules you defined are compiled into Drools Rule Language (DRL) rules as with all other rule assets.

All data objects related to a guided decision table must be in the same project package as the guided decision table. Assets in the same package are imported by default. After you create the necessary data objects and the guided decision table, you can use the Data Objects tab of the guided decision tables designer to verify that all required data objects are listed or to import other existing data objects by adding a New item.

4.1. Creating a traffic violation guided decision table

Use the Guided Decision Table designer to create the traffic violation guided decision table, which specifies the driver’s specific violation and the resulting fine and points.

Prerequisite

You have created both the Violation and Driver data objects.

Procedure

  1. Log in to Decision Central.
  2. Click Menu Design Projects, then Driver_department_traffic_violations.
  3. Click Add Asset Guided Decision Table, then enter:

    • Guided Decision Table: SpeedViolationRule
    • Package: com.myspace.driver_department_traffic_violations
  4. Select Unique Hit from the Hit Policy menu.
  5. Select Extended entry, values defined in table body in the Table format section.
  6. Click Ok to open the Guided Decision Tables designer.

    Figure 4.1. Guided Decision Tables designer

4.1.1. Inserting Violation Type columns

The Violation Type column contains the violation details such as the the driver’s speed and if the driver was under the influence of drugs or alcohol.

Prerequisite

You have created the traffic violation guided decision table.

Procedure

  1. Click Columns Insert Column and then select Include advanced options.

    Figure 4.2. Column tab

  2. Select Add an Attribute column and click Next.

    Figure 4.3. Add a new column window

  3. Select Ruleflow-group and click Finish.
  4. Expand Attribute columns and enter trafficViolation in the Default value field.

    Figure 4.4. Attribute columns window

  5. Click Insert Column, select Add a Condition Pattern +Create a new Fact Pattern.
  6. Select Violation from the Fact type menu, enter v in the Binding field, and click OK.

    Figure 4.5. Create a new fact pattern window

  7. Select Calculation type Literal value.

    Figure 4.6. Calculation type options

  8. Select Field and then select type from the Field menu.
  9. Select Operator and then equal to from the Operator menu.
  10. Select Value options and enter Speed,Driving while intoxicated,DWI=Driving while under the influence of drugs in the Value list (optional) field.
  11. Select Additional info, enter Violation Type in the Header (description) field, and click Finish.

    Figure 4.7. Violation Type header

  12. Click Insert Column, select Add a Condition Pattern, and select Violation[v] from the Pattern menu.
  13. Select Calculation type Predicate Field and enter actualSpeed-speedLimit > $param.
  14. Select Value options, then select Additional info and enter Speed Limit (MPH) > in the Header (description) field.
  15. Click Finish.

    Figure 4.8. Speed Limit (MPH) > header

  16. Click Insert Column, select Add a Condition Pattern, and select Violation[v] from the Pattern menu.
  17. Select Calculation type Predicate.
  18. Select Field and enter actualSpeed-speedLimit < $param in the Field field.
  19. Select Operator, select Value options, then select Additional info.
  20. Enter Speed Limit (MPH) < in the Header (description) field and click Finish.

    Figure 4.9. Condition columns

4.1.2. Inserting Fine Amount and Points columns

The Fine Amount* and Points columns contain the fines and points based on the corresponding Violation Type field values.

Prerequisite

You have inserted the Violation Type column in to the traffic violation guided decision table.

Procedure

  1. Click Insert Column, select Set the value of a field Pattern, and select Violation[v] from the Pattern menu.
  2. Select Field and then fineAmount from the Field menu.
  3. Select Value options, and then select Additional info, and enter Fine Amount in the Header (description) field.
  4. Select the Update engine with changes option and click Finish.

    Figure 4.10. Fine Amount header

  5. Click Insert Column, select Set the value of a field Pattern, and select Violation[v] from the Pattern menu.
  6. Select Field and then points from the Field menu.
  7. Select Value options, then select Additional info and enter Points in the Header (description) field.
  8. Select the Update engine with changes option and click Finish.

    Figure 4.11. Action columns

4.1.3. Inserting guided decision table rows

After you have created your columns in the guided decision table, you can add rows and define rules within the decision table designer.

Prerequisite

You have created the Violation Type, Fine Amount, and Points columns in the traffic violation guided decision table.

Procedure

  1. Click Editor Insert Append row. Repeat this step to add a total of five table rows.
  2. Fill out the table as shown in the following example:

    Figure 4.12. Populated data fields

  3. Click Save, and then click Save to confirm your changes.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat