Samples

Use code samples to learn how to use and extend the APIs provided with ILOG JRules. Samples include source code in Java, JSP, C#, VB, IRL, and/or XML that you can cut and paste directly into your own business rule application.

All samples can be compiled and run using the Samples Console and Samples Server or imported using the Import Wizard and launched directly in Rule Studio.

No sample should take more than 10 minutes to compile and run.

Using the Samples

The samples are designed to illustrate particular features or functions of JRules. They should be used as described in the documentation. Direct use of the projects provided as samples may lead to errors if you do not follow all the steps in the sample documentation.

Samples Accessible from a Console

Samples on the following topics are provided as Ant projects and can be compiled and run using the Samples Console and Samples Server:

The source files of these code samples are available in <InstallDir>/executionserver/samples, <InstallDir>/scenariomanager/samples, and <InstallDir>/teamserver/samples respectively.

For information about how to use the Samples Console, see Samples Server and Console.

Samples Accessible from a Rule Studio Import Wizard

Samples on the following topics can only be opened and run in Rule Studio:

The source files of these code samples are available in <InstallDir>/studio/samples.

You can quickly launch these samples with the Import Samples and Tutorials Wizard.

Reverting to Original State

To revert to the original state:

  1. In the Sample Console, click Stop Server.
  2. In <InstallDir>/shared/tools/jboss/server/jrulessamples/data/derby, remove the folder(s) for the deployed database(s). For example, resdb, rsmdb, and rtsdb.
  3. Unzip the database from the zip files provided.
  4. Remove the following directories:
  5. <InstallDir>/shared/tools/jboss/server/jrulessamples/work/jboss.web/localhost/teamserver
    <InstallDir>/shared/tools/jboss/server/jrulessamples/tmp
  6. Copy <InstallDir>/teamserver/applicationservers/jboss40/jrules-teamserver-JBOSS40.ear to <InstallDir>/shared/tools/jboss/server/jrulessamples/deploy.
  7. Restart the server