Rule model property extensions sample details
The steps describe running the sample in the Business console.
Running the sample
- To check the properties in existing artifacts:
-
You start by checking the properties in the existing classes. These properties were added to the artifacts in the rule project in the sample database. You look at properties in Loan Validation Service, but they are the same in all decision services.
- Log in to the Business console. Use Bea as the username and password (see Opening Decision Center on the sample server).
- Click the Loan Validation Service box, and not its name, and click main to open the main branch.
- Expand Loan Validation Scoring, and click the computation rule folder.
- Click . You see a new property, Customer Names. This property is empty because you did not specify a default value.
- Close the Details dialog.
- Click . You see the new property RF Status. It contains the default value that you set.
- Close the Details dialog.
- To check the properties in the new My Rule rule class:
-
- In the computation package preview pane, click the Plus button
and select New instance of My Rule. - Enter a name for your rule and click Create.
- On the rule editor page, click Details.
- On the Properties tab, scroll to the end of the page to see all the new properties. Use the
drop-down menu to set the Keys value:

- On the Extended tab, use the arrow to set the Index value, and use the drop-down menu to set the
Geography value:

- On the Truth Value tab, use the slider to set the value to 45:

- Close the Details dialog. You do not need to save the rule.
- In the computation package preview pane, click the Plus button
Rebuilding this sample
To rebuild this sample:
- Open the Samples Console (see Running samples from the Samples Console).
- In the Samples Commands view, expand .
- Double-click restore to reset the database to its original state.
How this sample works
In this sample, you use the Ant tasks to extend the business rule model and add the new property editors. In the build.xml file, the deploy task calls three subtasks:
-
repack: Repackages the Decision Center application with the new editor description. -
set-extensions: Extends the rule model. -
upload-messages: Adds NL-enabled messages for the new property names. en_US.properties is provided in the sample.
The model extensions that are sent to the database are done automatically:
-
Generation of an SQL script that carries schema modifications according to the new model.
-
Execution of the SQL script with the database.
The new property editors are described in script files that define the custom code as Dojo classes, and use custom cascading style sheets (CSS). The deploy task deploys to the repackaged application to the sample server.
Source files
The source files for this sample are in the following directory:
- <InstallDir>/teamserver/samples/dcextendedbrm
The model extension files are in the <InstallDir>/teamserver/samples/dcextendedbrm/src/resources/model directory:
- customPropertiesExtension.brmx: Describes the model.
- customPropertiesExtension.brdx: Describes the associated data.
- customPropertiesExtensionMessages.properties: Describes the messages for the en_US locale.
The extensions to the GUI are declared in the <InstallDir>/teamserver/samples/dcextendedbrm/src/resources/com/ibm/rules/decisioncenter/web/preferences.properties. directory. They use the templates described in the HTML files in the <InstallDir>/teamserver/samples/dcextendedbrm/src/resources/extensions/templates directory.
You can also view and modify the sample source files in Rule Designer. To import the sample into your workspace, click the Import projects link in the Samples and Tutorials view.