Show Table of Contents
5.2. 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:
- In Project Explorer, select the
helloworldorganizational unit, thehelloworldreporepository, theHelloWorldproject, and the default package.Note
Make sure to select the default package. Selection of an incorrect package causes the deployment to fail. - Create the DRL file:
- On the perspective menu, click → .
- In the Create new dialog box, define the resource name as
helloworldruleand check that the destination path isdefault://master@helloworldrepo/HelloWorld/src/main/resources. - Click .
- In the displayed DRL editor with the
helloworldrule.drlfile, define the rule:rule "helloworldrule" ruleflow-group "helloworldgroup" when then System.out.println("Hello World!"); endThis rule does not define any when condition, that is, it will always be true when fired (called to execute) and theHello World!phrase will be printed. - Click .
- 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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.