RuleApp execution code generators

You can use code generators to create ruleset execution code for your Eclipse client projects.

To call a ruleset on Rule Execution Server, you must write execution code to locate a deployed RuleApp that contains the ruleset on an application server.

Decision Server includes a set of generators for you to create execution code, together with the necessary configuration parameters and resources for a new client project.

You can generate different types of client projects, by selecting a wizard from one of the following categories:
  • Client Project for RuleApps: wizards to use with classic rule projects. You associate the client project with a RuleApp project.
  • Client Project for Decision Service: wizards to use with main rule projects and standard rule projects for decision service. You associate the client project with a deployment configuration.
    • Java Project for Rule Execution Server on Java SE: Generates a simple Java project with a main method that demonstrates a ruleset invocation.
    • JUnit Project for Rule Execution Server on Java SE: Generates, for each ruleset, a JUnit test case with one test that can be duplicated to test with another set of parameters.

The Client Project for Decision Service wizards generate the necessary Java code to invoke a particular RuleApp based upon a deployment configuration. The deployment configuration defines the operations or rulesets to use and identifies the target servers to connect to. The client project is generated in only one Rule Execution Server on Java SE target (one folder on the file system). XOM deployment is not supported for Java SE targets, though it can be configured by using the class path.

The following generators are available for use with classic rule projects:
Plain Old Java™ Object (POJO)

Generates a POJO class, together with other utility classes. A build.xml file is also generated to help you to compile and run your generated POJO. RuleApp archives are deployed automatically. If the ruleset archive is modified, export the RuleApp archive in the generated project to replace the existing one, and run the Ant target again. The build.xml file contains targets to deploy and undeploy RuleApp archives, build and run the project, and regenerate the deployment descriptor ra.xml file.

A Java Application with Rules .launch configuration file is also generated. The project name is used to prefix the name of the configuration file.

This generator is available for both wizards: Client Project for RuleApps and Artifacts for RuleApps.

Web service

Generates either a web service class for JDK 7 or a monitored transparent decision service project with the required files and method calls, depending on your selection. A build.xml file is generated to help you deploy your generated web service or monitored transparent decision service and regenerate the deployment descriptor ra.xml file.

To run the generated projects, you need the following software:
  • JDK 7
  • Tomcat 7.0, JBoss, or WebSphere® Application Server 8.5 or 8.5.5
  • JAX-WS 2.1: the required JAR files are provided in the <InstallDir>/executionserver/lib/jaxws directory.

This generator is available in the Client Project for RuleApps wizard. It creates a web service project or a transparent decision service project, and a client project.

You can also extend the provided generators to generate these project components. For more information, see Customizing execution code generators.

Because Operational Decision Manager is divided into modules (executionserver, studio, teamserver), each module contains its own lib directory.

You need to define executionserver.home before importing classpath-executionserver.xml, and engine.lib.dir for classpath-engine.xml. The executionserver.home value is <InstallDir>/executionserver and the engine.lib.dir value is <InstallDir>/executionserver/lib. It is not necessary to define this property when importing classpath-executionserver.xml.

You can find an example of an Ant build file that uses executionserver.j2se.classpath in <InstallDir>/executionserver/samples/j2serulesession/build.xml. That sample shows how to make your packaging and how to use the classpath-executionserver.xml file.

Note:
  • For these generators to run, you must have Rule Execution Server correctly installed. If it is not installed, or if the Eclipse variable ILOG_EXECUTION_SERVER_HOME is not set, or is set incorrectly, an error occurs and you are unable to select a project generator.
  • Rulesets can include references to both Java objects and XML objects.