第6章 Guided rules


Guided rules are business rules that you create in a UI-based guided rules designer in Business Central that leads you through the rule-creation process. The guided rules designer provides fields and options for acceptable input based on the data objects for the rule being defined. The guided rules that you define are compiled into Drools Rule Language (DRL) rules as with all other rule assets.

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

6.1. Defining Business Rules

Define business rules in Red Hat Process Automation Manager using the Guided Rule wizard.

Related information

For more information about Guided business rules, see Designing a decision service using guided rules.

6.1.1. Creating the Validate Down Payment guided rule

Procedure

  1. Log in to Business Central and click Menu Design Projects, then Mortgage Process.
  2. Click Add Asset Guided Rule, then enter:

    • Guided Rule: Validate Down Payment
    • Package: com.myspace.mortgage_app
  3. Click Ok to open the Guided Rule Editor.

6.1.2. Defining the Validate Down Payment guided rule conditions

The conditions that you specify in this section are used to determine whether of not the down payment meets the specified requirements.

Procedure

  1. Click 6176 next to the WHEN label to open the Add a condition to the rule window. Then, select Application…​ and click Ok.
  2. Click the There is an Application label and select Any of (Or) from Multiple field constraints.
  3. Click the There is an Application [app] with: any of the following: label , then select downpayment from Add a restriction on a field.
  4. Click --- please choose ---, then select equal to.

  5. Click 6191 , select Literal value, and enter 0.

  6. Click the There is an Application [app] with: any of the following: label, then from the Add a restriction on a field select downpayment.
  7. Click --- please choose ---, then select greater than or equal to.
  8. Click 6191 , then click Expression editor.
  9. From the Choose…​ menu, select app.
  10. From the Choose…​ menu, select downpayment.

6.1.3. Defining the error conditions

You must define the conditions and results of the data that is received and processed. In this section, you will define the following two conditions:

  • ValidationErrorDO
  • retractValidationErr

6.1.3.1. Defining the ValidationErrorDO

Specify the error message that will be presented to the loan applicant.

Procedure

  1. Click 6176 next to the THEN label. Select Insert fact ValidationErrorDO, and click Ok.
  2. Click the Insert ValidationErrorDO label and select error from the Add field pull-down menu.
  3. Click 6191 , then click Literal value.
  4. In the error field, enter: Down payment cannot be 0, greater than, or equal to the property sale price..

  5. Click 6176 next to the THEN label. Select Add free form DRL and click Ok.
  6. Enter the following in the Add free form DRL…​ text box:

    System.out.println("Executed Rule: " + drools.getRule().getName() );
    Copy to Clipboard Toggle word wrap
  7. Click (show options…​).
  8. Click 6176 next to the (options) label to open the Add an option to the rule window.
  9. Select ruleflow-group from the Attribute drop-down menu and enter validation in the ruleflow-group field.

6.1.3.2. Defining the retractValidationErr

Define the error trigger details.

Procedure

  1. Click 6176 next to the WHEN label to open the Add a condition to the rule window. Then, select ValidationErrorDO and click Ok.
  2. Click There is a ValidationErrorDO to open the Modify constraints for ValidationErrorDO window, enter vdo in the variable name field, and click Set.
  3. Click 6176 next to the THEN label. Select Delete vdo, and click Ok.
  4. Click (show options).
  5. Enter error in the ruleflow-group field.

  6. Click Save, then click Save to confirm your changes.
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat