| Samples > Rule Team Server Business Rule Management Extensions > How to Implement Rule Governance in Rule Team Server |
How to Implement Rule Governance in Rule Team Server |
PREVIOUS NEXT |
This sample shows how to use permissions to define a workflow, repackage Rule Team Server with the configuration file, and generate smart views.
When managing rule changes in Rule Team Server, it is useful to control the rule change workflow (life cycle).
The sample contains:
Users can only see rules with a status relevant to their role, and can only change a rule's status to values authorized for their role. The following diagram shows a typical workflow between roles, and is the workflow used in this sample.
The roles in this sample have been defined as follows:
This sample generates RSS data whenever the status changes. It makes the RSS data available from the web server, and then invites interested users to subscribe to the RSS feed using an RSS reader tool.
Key features of this sample include:
To install this sample:
teamserver > serverrulegovernance sample.
run command to package the compiled code inside the Rule Team Server EAR.
Rule Team Server Governance sample sucessfully installed....BUILD SUCCESSFUL
Executing the run command customizes and redeploys the Rule Team Server application. In addition, the loanvalidation-rules are modified as follows:
All this information is retrieved from a configuration file and set using the Rule Team Server API.
The workflow management is now in place.
This sample can only be opened and run in the Samples Console.
Before running the sample, please note the following:
autUser is an author user, whose job is to write rules
revUser is a reviewer user, whose job is to review defined rules written by autUser
tesUser is a tester user, whose job is to test reviewed rules
depUser is a deployer user, whose job is to deploy rules
admUser is an administrator user, whose job is to administrate the project
This exercise demonstrates how to look at the current security settings for any of the user roles. Here, we select the author role.
To view the current project security settings:
http://localhost:8080/teamserver/.
loanvalidation-rules as the Project in use.
This exercise demonstrates how each user role processes rules at each stage of the rule life cycle. You will be asked to sign in as an author, a reviewer, a tester, a deployer, and an administrator.
To sign in as an author:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
To sign in as a reviewer with defined status:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
documentation property when the status of the rule is defined, deprecated, or inactive.
To sign in as a tester:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
To sign in as a deployer:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
To sign in as a reviewer with deployed rule status:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
By moving through each role, you have managed the complete rule approval life cycle.
This sample also uses a special role: the administrator.
To sign in as the administrator:
http://localhost:8080/teamserver/
loanvalidation-rules as the Project in use.
This exercise demonstrates the controls that are in place to restrict the actions that an author role can perform.
To control query actions:
http://localhost:8080/teamserver/.
loanvalidation-rules as the Project in use.
Cannot apply actions : You cannot update this element : approval
The sample generates RSS data whenever the status value changes, and makes it available from the web server. A URL pointing to the updated rule is attached to the RSS data so that the user can edit the rule directly.
To display the RSS data, open your browser and enter the following URL:
http://localhost:8080/teamserver/RSSRawProvider.jsp?project=loanvalidation-rules
The URL is built partially with information coming from the serverrulegovernance/data/server.properties file.
You can use any RSS reader to subscribe to the RSS feeds. To view loanvalidation-rules, configure it to point to http://localhost:8080/teamserver/RSSRawProvider.jsp?project=loanvalidation-rules.
For example, when using Internet Explorer 7, you get RSS data such as the following:
This sample is located in: <InstallDir>/teamserver/samples/serverrulegovernance. It contains the following source files:
Class |
Description |
|---|---|
Installer.java |
Installs the needed configuration in Rule Team Server |
PermissionHelper.java |
Loads the defined permissions and sets them in Rule Team Server |
SecurityHelper.java |
Adds groups to Rule Team Server and sets the security on the project |
Role.java |
Represents the roles defined in the configuration file ( data/configuration.properties) |
ApplicationException.java |
A common exception |
Constants.java |
Constants used through the sample |
Utilities.java |
Utilities class for IO and Rule Team Server model navigation |
LifeCycleConfiguration.java |
The interface defining the contract for rule governance handlers |
LifeCycleConfigurationDefaultImpl.java |
The default class implementing the rule governance |
NotificationListener.java |
The interface defining the contract for status modification handler |
WorkflowSessionController.java |
The Rule Team Server custom controller. This is the core class. |
AbstractPropertyListener.java |
An abstract class helper when reading the configuration file |
AuthorizedValues.java |
A class that wraps context authorized values |
PermissionManager.java |
Manages the permissions |
SmartViewManager.java |
Manages the technical smart views |
StatusPropertyManager.java |
Manages the value the status property takes |
StatusValuesManager.java |
Manages the values that a status can take |
SynonymManager.java |
Manages aliases in the configuration file |
TransitionManager.java |
Manages available status transitions |
UserManager.java |
Manages users |
Item.java |
Contains event data when a status is modified |
NotificationListenerDefaultImpl.java |
The default implementation handler consuming item |
RSSChannel.java |
An RSS channel helper |
RSSRawProvider.jsp |
Convenient JSP helper returning to RSS Reader the RSS data corresponding to status modification event items |
In this sample, we manage the rule life cycle of the loanvalidation-rules project. The data used for controlling the life cycle is read from the serverrulegovernance/data/configuration.properties file.
To customize the Rule Team Server EAR and deploy it to the application server:
set-extensions and upload-messages of the build.xml.
set-extensions target is used to modify the Rule Team Server model. In order to manage rule life cycle, we have added the status and commenttstatus properties to the model. See the <INSTALL_DIR>\teamserver\samples\serverrulegovernance\data\model\extensionModel.brmx and extensionModel.brdx files.
upload-messages target is used to add a label to these properties, displayed in the UI when editing the status or the statuscomment. See the file:
deploy command of the build.xml.
To configure the target project by executing the run.install command of build.xml:
newGroup, reviewedGroup, THE_STATUS_VALUEGroup) defined in the configuration file.
Find all business rules such that the status of each business rule is THE_STATUS_VALUE.
THE_STATUS_VALUEGroup.
data/permission/ROLE_NAME.permissions.
When you start using Rule Team Server, the CustomController class is loaded and it reads the configuration file.
The controller is now ready to manage the rule life cycle, processed as follows.
IlrSessionController.checkUpdate(IlrElementHandle handle, IlrElementDetails details, EStructuralFeature feature) is called by Rule Team Server. The property is read only when this method throws an IlrPermissionException, otherwise it is editable. The list of possible values for the status are returned by the getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature) method.
IlrSessionController.checkUpdate(IlrElementHandle handle, IlrElementDetails details, EStructuralFeature feature). For each property, the method verifies whether or not the property can be updated. This authorization depends on the user role and on the current status of the rule.
IlrSessionController.onCommitElement(IlrCommitableObject cobject) is called. This method prepares a modification event. If the user entered a comment, the comment is appended to the rule's comment history.
IlrSessionController.elementCommitted(IlrCommitableObject cobject,IlrElementHandle newHandle). This method records the modification event if a rule's status has been modified, and releases the event otherwise. The default implementation of a modification event consumer is an RSS feeder (NotificationListenerDefaultImpl class). This class translates a modification event into RSS entries.
IlrSessionController.checkDelete(IlrElementHandle element). The controller verifies that the Delete operation is authorized. This authorization depends on the user role and on the rule's current status. If the user is not authorized to delete, an IlrPermissionException is thrown.
To rebuild the sample, you need to compile the sample and modify the configuration file. You can also customize the sample.
To compile the sample, execute the build command in the Samples Console.
To modify the configuration file:
serverrulegovernance/data/configuration.properties.
run.printprofile command to print the application server roles configuration.
\shared\tools\jboss\server\jrulessamples\conf\roles.properties.
run command to redeploy and reconfigure Rule Team Server.
To customize the sample:
roles = administrator;author;reviewer;deployer;tester
roles = administrator;author;reviewer;deployer;tester;newrole
run.generatepermission command to generate default permission templates for all defined roles.
<INSTALL_DIR>/teamserver/samples/serverrulegovernance/newpermissions/newrole.permissions to:
/teamserver/samples/serverrulegovernance/newpermissions directory.
newrole.permission file, as needed.
status.property.BusinessRule.status.values = new;defined ...
BusinessRule.delete.newrole = *
BusinessRule.delete.reviewer = inactive;newstatus
BusinessRule.update.*.newrole = *
BusinessRule.update.*.newrole = new
BusinessRule.update.XXXXX.newrole = newstatus
transition.BusinessRule.status.initial...' to: transition.BusinessRule.status.initial = newstatus
ransition.BusinessRule.status.newrole.new = new;defined;newstatus
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |