Introduction


This section covers the innards of the BRMS - it is not neccesary to use this if you are integrating or an end user of the BRMS application. However, JBoss Rules is open source, so build instructions form part of the manual.

You may want to build from source if you want to re-use components, or embed the application in your own.

Design

Building from source

This section will go over the steps you will need to take to build various components. Mostly this is automated, but the manual process is described for thoroughness.

Modules

There are 2 modules: drools-repository (back end) and drools-jbrms (front end and rules integration). The drools-jbrms module depends on the drools-repository module, as well as other components.

Working with Maven 2

Maven 2 is used as the underlying build system. To get started, you will need to check out the WHOLE of the source tree for JBoss Rules. This includes the other modules, and the top level lib and repository directories (which are needed by the build). As the BRMS build is part of the main drools build.

Initially, you should go into the root of the jboss-rules checked out source tree, and run mvn install to install all the components for the inter project depedencies. If the build is broken (no ! say it isn't so !) you can use the flag -Dmaven.test.skip=true to prevent failing unit tests from preventing the build.

As the BRMS depends on drools-repository (which is the back end version storage subsystem), you then go into the drools-repository directory, and run "mvn install" to make it available. Finally, you can go into the drools-jbrms directory and run "mvn test" to check it all works, or "mvn package" to generate the web application (as well as run the tests). You should now be good to go !

Working with GWT

The GUI widgets for the web front end are developed with GWT (google web toolkit). If you need to make changes to or build the GUI, you will need to download GWT seperately. Once GWT is downloaded, you can modify the build.properties file in the drools-jbrms directory to point to where you installed GWT. Once you have this, you can use the ant tasks to build the GWT components, as well as launch GWT in debug/hosted mode should you desire. If you run the build, it will update the webapp directory in the project with the new "compiled" artifacts (GWT does not use JSP, only html and javascript at runtime).

Debugging, Editing and running with Eclipse

Each module has a ready to go and up to date eclipse project configuration, so you can just import them into your eclipse workspace. These projects are generated by maven (mvn eclipse:eclipse to refresh them). They have been manually modified to have project dependencies (means you can step through code when debugging).

Some environment variables are required in eclipse (Window->Preferences->Java->Build path->Classpath variables): the M2_REPO, as normal, to point to where maven downloads shared dependencies. GWT_HOME should point to where you installed GWT. GWT_DEV must point to the platform specific "dev" jar that ships with the version of GWT you have.

How you launch from eclipse: you can launch unit test, as normal (in which case you only need M2_REPO setup - you don't even need to download GWT seperately) - OR, you can launch it in "hosted mode" using the GWT browser, which is great for debugging (from GUI to back end, you can step through code, and make changes on the fly and simply hit refresh). There is a JBRMS.launch file in in the drools-jbrms directory. This should allow Eclipse to launch the JBRMS in debug mode - open the Run dialog (Run->Run), and then choose "JBRMS" from the list. Launching this will open a new window, with the BRMS in debug mode, ready to go.

Downloading and debugging the BRMS with GWT is optional, and if you are only working on non GUI issues, you can skip this step.

Re-usable components

Versioning and Storage