Data sources for BOM domains sample details
You use the Decision Center Business console to update the domain values, and see the results of the sample.
Running this sample
To run this sample:
- In your web browser, log in to the Decision
Center Business console at
http://localhost:<PORT>/decisioncenter. Use the following credentials:
User name: Paul
Password: Paul
- Open the Library tab, and click the bomdomainpopulate-rules decision service.
- Click .
- Click the folder, and then click the CurrencyRestriction rule.
- Click the Edit button
. - In the condition part of the rule, place your cursor in front of Australian
Dollar and click Ctrl-Space to display the possible values for the currency.
You see the values “Australian Dollar”, “Euro”, and “US Dollar”.
- Click Cancel to stop editing.
- Click main in the breadcrumbs to return to the decision service view, and then switch to the Model tab.
- Expand the trade.CurrencyType domain. You see the changes that are suggested for this domain.
- Select the domain, and click Apply Changes.
- Click OK.
- Return to the Decision Artifacts tab.
- Edit the same rule, and check the currency values.Note:
The editor displays the following warning: 'Australian Dollar' is deprecated.
Decision Center removes Australian Dollar, and adds three new currencies to the domain: Pound, JP Yen, and PRC RMB.
Rebuilding this sample
- In the Samples Commands view, navigate to .
- Double-click clean.
- Double-click build. This command builds the custom JARs.
- Double-click repack. This command repackages the teamserver application to include the custom JARs.
- Double-click deploy. This command deploys the repackaged application.
How this sample works
The project bomdomainpopulate already has a BOM that contains dynamic domains. If you installed Rule Designer, you can import and browse the BOM Domain populate sample and navigate to the CurrencyType class (see Sample: Data sources for BOM domains).
The class custom properties contain a definition for the domainValueProviderName property. The value of this property registers the BOM domain value provider in Decision Center.
You must declare a mapping between the BOM domain value provider identifier and the implementation class to the Decision Center. Use the set-config-param command to declare the mapping. The command registers the key teamserver.derbyDataBaseDomainProvider to the fully qualified name of the BOM domain value provider class serverbompopulate.DomainValueProvider.
The repack Ant target in the build.xml file uses the repackage-war Decision Center Ant task to rebuild the teamserver application to include the custom JARs that contain the BOM domain value provider.
Source files
DomainValueProvider.java: The implementation of the IlrBOMDomainValueProvider interface. It provides the domain values, verbalization, conversion, and uses the DomainHelper class.
DomainHelper.java: The class provides a helper for a dedicated fully qualified class of the BOM that is responsible for providing the values.
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.