GUI customization sample details

You use the Decision Center Business console to run this sample.

Running this sample

This sample shows you how to customize features in the Business console.

To see the customization for an administrator:

  1. Log in to the Business console (see Opening Decision Center on the sample server). Enter Paul as the username and password.
  2. Open the Library tab. Click the Loan Validation Service box anywhere but the name, and select the main branch.
  3. Click the new button My Admin Button. A dialog displays metrics on the decision service.
  4. Click the new tab My Admin Tab. The tab displays the same metrics on the decision service.
  5. Click the Decision Artifacts tab. Expand the Loan Validation Scoring computation package, and edit the rule neverBankruptcy (accept any default settings if prompted).
  6. Click the button My Info. A dialog displays information on the rule.
  7. Close the dialog and cancel the editing session. Click main in the breadcrumbs.
  8. Click the Decision Artifacts tab and make sure that the operations are displayed. To display them, click Types and select Operations.
  9. Expand the Operations folder under Loan Validation Scoring to edit the scoring operation.
  10. Click the button My Operation Info. A dialog displays information on the operation.
  11. Close the dialog, and cancel the editing session. Click main in the breadcrumbs.
  12. Click the tab Deployments and edit the test deployment configuration.
  13. Click the Targets tab and select the Decision Service Execution server. Save the test deployment configuration.
  14. Click the name of the test deployment configuration.
  15. Click the Custom Deploy button in the toolbar. A dialog shows the status of the deployment.
  16. Close the dialog and log out of the Business console.

To see the customization for a non-administrative user:

  1. Open the Business console at http://localhost:<PORT>/decisioncenter. The port number can be 9090. It might differ on your computer.
  2. Log in by using Bea as the username and password.
  3. Open the Library tab. Click the Loan Validation Service box anywhere but the name, and then select the main branch.
  4. Click the new button My Button. A dialog displays some metrics on the decision service. The dialog content is different from the content that is provided for the administrator.
  5. Close the dialog and then click the new tab My Tab. The tab displays the same metrics on the decision service. The tab content is different from the content that is provided for the administrator.
  6. Log out of the Business console.

Rebuilding this sample

To rebuild this sample:

  1. Open the Samples Console.
  2. In the Samples Commands view, expand Samples Commands > Decision Center > GUI customization.
  3. Double-click build to compile the code.
  4. Double-click repack to repackage the Decision Center application.
  5. Double-click deploy.
Note:

To restore the sample server to its initial state, click the Restore Server button in the Sample Server view in the Samples Console.

How this sample works

This sample defines one extension point for a new tab, and two extension points for new buttons.

Each extension is described in a script file that defines the custom code as a Dojo class, and uses custom CSS and images.

A custom Spring controller is defined to serve HTTP requests. It gets the required data from the server side by using the Decision Center API.

Source files

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

The extensions are declared in /teamserver/samples/businesscustomui/src/resources/com/ibm/rules/decisioncenter/web/preferences.properties.

The extensions are defined in <InstallDir>/teamserver/samples/businesscustomui/src/resources/extensions:
  • The Javascript files are located in this directory.
  • The corresponding CSS files are in the CSS directory.
  • The corresponding images are in the images directory.
  • The corresponding HTML files are in the templates directory.

The Java™ custom controller is defined in <InstallDir>/teamserver/samples/businesscustomui/src/java/com/ibm/rules/decisioncenter/web/ext/CustomController.java.

The Extutils class defines a static method that gets the Decision Center session from the HTTP request.

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.