此内容没有您所选择的语言版本。

Chapter 7. Hello World business rule


Since BPMS comes with BRMS integrated, this chapter provides an introduction to how business rules work and integrate into BPMS.
You will add a new Task, a Business Rule Task, to the HelloWorld process, which will fire (check) a business rule of a particular business rule group.
Note that this is a very simple integration case and in production you might need to use a more advanced concept and techniques, such as decision tables. For more information on business rules and BRMS refer to the Red Hat JBoss BRMS User Guide

7.1. Creating the business rule

Business rules are defined as when-then statements: when something is true, then something happens (for example, when the person is older than 18, they can access the particular content). Business rules are stored in DRL files.
To define the helloworldrule business rule in the HelloWorld project, do the following:
  1. In Project Explorer, select the helloworld organizational unit, the helloworldrepo repository, the HelloWorld project, and the default package.

    Note

    Make sure to select the default package. Selection of an incorrect package causes the deployment to fail.
  2. Create the DRL file:
    1. On the perspective menu, click New Item DRL file.
    2. In the Create new dialog box, define the resource name as helloworldrule and check that the destination path is default://master@helloworldrepo/HelloWorld/src/main/resources.
    3. Click OK.
  3. In the displayed DRL editor with the helloworldrule.drl file, define the rule:
    rule "helloworldrule"
    ruleflow-group "helloworldgroup"
    when 
    then
    	System.out.println("Hello World!");
    end
    
    Copy to Clipboard Toggle word wrap
    This rule does not define any when condition, that is, it will always be true when fired (called to execute) and the Hello World! phrase will be printed.
  4. Click Save.
  5. A Save this item prompt is displayed. Enter the Check-in comment and click Save.

    Note

    The check-in comment would be a short description of the kind of change you made and has to be entered every time an asset is saved.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat