Samples > Rule Team Server Authoring Extensions > How to Populate a BOM Domain from a Data Source in Rule Team Server

This sample shows how to plug a custom BOM domain value provider inside Rule Team Server. The same customization is available in Rule Studio (see the sample How to Populate a BOM Domain from a Data Source).

Key Features

Key features include:

Installing this Sample

To install this sample through the Samples Console:

  1. Go to the Samples Console and locate the teamserver > serverbompopulate sample.
  2. Check that the Samples Server is started. For information on how to start and stop the Samples Server, see Stopping and Restarting the Samples Server from the Samples Console.
  3. Execute the repack command to compile and repackage the application into a new deployable ear file.
  4. Execute the deploy command to deploy the new EAR.
  5. Wait for the Java EE application to start before continuing. (The server trace displays the message: [EARDeployer] Started J2EE application.)
  6. Execute the set-config-param command to register the domain provider class.

Running this Sample

This sample can only be opened and run in the Samples Console.

To open and run the sample:

  1. Sign in to Rule Team Server: http://localhost:8080/teamserver.
  2. Username: rtsAdmin
    Password: rtsAdmin
  3. Switch to the bomdomainpopulate-rules project.
  4. In the Explore tab, browse the CheckCurrency package.
  5. Edit the rule CurrencyRestriction.
  6. In Step 2, in the condition part of the rule, check the possible values of currency.
  7. You should see the options "Australian Dollar", "Euro" and "US Dollar".
  8. Cancel editing the rule and switch to the Configure tab.
  9. Click Reload Dynamic Domains.
  10. The following message is displayed: The dynamic domains were successfully reloaded
  11. Click OK.
  12. Edit the same rule, and check the currency values.
  13. Three new currencies are available in the list of options ("Pound", "JP Yen" and "PRC RMB"). The option "Australian Dollar" has been removed.

Source Files

This sample is located in <InstallDir>/teamserver/samples/serverbompopulate.

Highlights

Highlights of this sample are as follows.

Setting Business Object Model Custom Properties

For the purpose of this sample, the project bompopulate-rules already has a BOM that contains dynamic domains. If you have installed Rule Studio, you can import and browse the BOM Domain populate sample and navigate to the CurrencyType class.

In the class custom properties, a domainValueProviderName property is defined. The value of this property will be used to register the domain value provider in Rule Team Server.

Registering the BOM Domain Value Provider Class

A mapping between the BOM domain value provider identifier and the implementation class needs to be declared to Rule Team Server. This is done by the set-config-param command, which registers the key teamserver.derbyDataBaseDomainProvider to the fully qualified name of the BOM domain value provider class serverbompopulate.DomainValueProvider.

Application packaging

A new application containing custom JARs needs to be built and deployed. The BOM domain value provider needs to be packaged into the WAR. To do this, use the repackage-ear Ant command.

Rebuilding this Sample

To rebuild this sample to restore it to its original state:

  1. Execute the clean command.
  2. Execute the build command.

Related Concepts

Custom BOM Value Types
Value Provider

Related Tasks

Customizing Rule Team Server
Integrating Dynamic Domains into Rule Team Server

Related Samples and Tutorials

How to Populate a BOM Domain from a Data Source