9.2. JBoss BRMS Runtimes

A Drools runtime is a collection of jar files on your file system that represent one specific release of the Drools project jars. While creating a new runtime, you must either point to the release of your choice or create a new runtime on your file system from the jars included in the Drools plug-in. For creating a new runtime, you need to specify a default Drools runtime for your Eclipse workspace, but each individual project can override the default and select the appropriate runtime for that project specifically. You can add as many Drools runtimes as you need. In order to use the JBoss BRMS plug-in with Red Hat JBoss Developer Studio, it is necessary to set up the runtime.

9.2.1. Defining a JBoss BRMS Runtime

Procedure 9.1. Task

  1. Extract the runtime jar files located in the jboss-brms-engine.zip archive of the JBoss BRMS Generic Deployable zip archive (not the EAP6 deployable zip archive) available from Red Hat Customer Portal.
  2. From the JBoss Developer Studio menu, go to WindowPreferences.
    The Preferences dialog opens displaying all your preferences.
  3. Navigate to DroolsInstalled Drools runtimes.
  4. To define a new Drools runtime, click the add button.
    The Drools Runtime dialog opens.
  5. In the Drools Runtime dialog, you have the following options to provide the name for your runtime and the its location on your file system:
    • Use the default JAR files included in the Drools Eclipse plug-in to create a new Drools runtime automatically:
      1. Click the Create a new Drools c runtime ... button.
      2. Browse and select the folder on your file system where you would like this runtime to be created.
        The plug-in automatically copies all required dependencies to the specified folder.
    • Use one specific release of the Drools project,
      1. Create a folder on your file system and copy all the necessary Drools libraries and dependencies into it.
      2. Provide a name for your runtime in the Drools Runtime dialog in the Name field and browse to the location of this folder containing all the required JARs in the Path field.
  6. Click OK.
    The runtime appears in your table of installed Drools runtimes.
  7. Click the checkbox in front of the newly created runtime to make it the default Drools runtime.
    This default Drools runtime will be used as the runtime of all your Drools project that does not have a project-specific runtime selected.
  8. Restart JBoss Developer Studio if you have changed the default runtime to ensure that all the projects that are using the default runtime update their classpath accordingly.

9.2.2. Selecting a Runtime for Your JBoss BRMS Project

Whenever you create a Drools project either by using the New Drools Project wizard or by converting an existing Java project to a Drools project, the Drools plug-in automatically adds all the required JAR files to the classpath of your project.
If you are creating a new Drools project, the plug-in uses the default Drools runtime for that project, unless you specify a project-specific one.

Procedure 9.2. Task

To define a project-specific runtime:
  1. Create a new Drools project and in the final step of the New Drools Project wizard and uncheck the Use default Drools runtime checkbox.
  2. Click the Configure workspace settings ... link.
    The workspace preferences showing the currently installed Drools runtimes opens.
  3. Click Add to add new runtimes.

9.2.3. Changing the Runtime of Your JBoss BRMS Project

Procedure 9.3. Task

To change the runtime of a Drools project:
  1. In the Drools perspective, right-click the project and select Properties.
    The project properties dialog opens.
  2. Navigate and select the Drools category.
  3. Check the Enable project specific settings checkbox and select the appropriate runtime from the drop-down box.
    If you click the Configure workspace settings ... link, the workspace preferences showing the currently installed Drools runtimes opens. You can add new runtimes there if required. If you uncheck the Enable project specific settings checkbox, it uses the default runtime as defined in your global preferences.
  4. Click OK.

9.2.4. Configuring the JBoss BRMS Server

JBoss Developer Studio can be configured to run the Red Hat JBoss BRMS\BPM Suite Server.

Procedure 9.4. Configure the Server

  1. Open the Drools view by selecting WindowOpen PerspectiveOther and select Drools and click OK.
  2. Add the server view by selecting WindowShow ViewOther... and select ServerServers.
  3. Open the server menu by right clicking the Servers panel and select NewServer.
  4. Define the server by selecting JBoss Enterprise MiddlewareJBoss Enterprise Application Platform 6.1+ and clicking Next.
  5. Set the home directory by clicking the Browse button. Navigate to and select the installation directory for JBoss EAP which has JBoss BRMS installed.
  6. Provide a name for the server in the Name field, ensure that the configuration file is set, and click Finish.