Samples > Rule Team Server Business Rule Management Extensions > How to Tune Permission Management

This sample shows how to plug a custom session controller in Rule Team Server, in order to tune permission management. The session controller defines the behavior of Rule Team Server when committing or deleting an element, computing the possible values for a feature, and so on.

In this sample, we define a custom session controller to change the following behaviors:

Key Features

The Session controller is the key feature of this sample.

Installing this Sample

To install this sample:

  1. In the Samples Console locate the teamserver > permissiontuning 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 package the compiled code inside the Rule Team Server EAR.
  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. This command changes the controller property in Rule Team Server to the class of the customized session controller: permissiontuning.WorkflowSessionController.

Running this Sample

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

To open and run the sample:

  1. Open a web browser and enter the following URL to access Rule Team Server: http://localhost:8080/teamserver/.
  2. Sign in to Rule Team Server using the following details:
  3. Username: rtsUser1
    Password: rtsUser1
  4. Click the Home tab and set loanvalidation-rules as the current project.
  5. Click the Explore tab.
  6. Edit a rule with a status of New (for example: eligibility > checkCreditScore).
  7. Change the status of the rule to Defined, and then click Finish.
  8. Edit the rule again. Note that you can no longer select New for the Status property.
  9. Change the status of the rule to Deployable, and then click Finish.
  10. Notice that Edit in the toolbar is deactivated. This is because the customized session controller prevents rules with a status of Deployable from being edited by normal users.
    If you click the Explore tab and try to edit the rule from the Rules list, an error message is displayed explaining why you cannot edit the rule.
  11. Sign out, and then sign in again as the administrator:
  12. Username: rtsAdmin
    Password: rtsAdmin
  13. In the Home tab, make sure loanvalidation-rules is the current project.
  14. Locate the rule you just edited and notice that since you are now signed in as the administrator, you can edit the deployable rule.

Source Files

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

WorkflowSessionController.java - The customized session controller.

Highlights

The WorkflowSessionController we define inherits from the default session controller IlrDefaultSessionController and overrides two methods:

Rebuilding this Sample

To rebuild this sample, execute the build command to compile the code.

Related Tasks

Customizing Rule Team Server
Implementing the Session Controller