Rule Designer provides code generators in client projects to execute a specified ruleset. If the provided generators do not match your needs when your RuleApp is deployed on both test and production platforms, you can customize a generator or write the execution code in your own client project.
After you have defined and developed business rules, the next step is to create a client application. The client application must call Rule Execution Server and locate the ruleset that you deployed. To call a deployed ruleset, you must use the public API to start a rule session from your client application. A Client project for RuleApps is a predefined project for Eclipse that contains execution code to call rulesets contained in a RuleApp on Rule Execution Server. These clients can be Java™ applets running in a web browser or Java technology-based programs. You choose the code generator that best matches your needs. Alternatively, you can write the execution code in your own client project using the appropriate rule session factory.
Code generators are provided for simple Java models (POJO) and for web services. The following table lists the code generation templates that you can use to integrate the calling code into your application.
Code generator | Target users | Purpose |
---|---|---|
POJO generator | For Java EE experts or performance-sensitive users. | Highly customizable. See Customizing execution code generators. |
Web service generator (compatible with JDK 6) | For non-developers who want to author rules and make them available as executable web services. | To generate a web decision service or a monitored transparent decision service. This generator is particularly suited to Service-Oriented Architecture (SOA) or Business Process Management (BPM) projects that use an XML-centric data model. The Rule Execution Server console can make rulesets that process XML or Java types automatically available as web services. Such implementation relies on SOAP with Attachments API for Java (SAAJ) so that the code can run on any SAAJ-compliant platform. |
Web service JAX-WS 2.1.1 generator | For forward-looking, standards-based users | JAX-WS 2.1.1 RI is provided in the distribution and can be deployed to Tomcat 7.0. Java types are serialized and deserialized through the standard JAXB APIs. |
Service Component Architecture (SCA) generator | To generate an SCA archive based on a RuleApp project and export it to Rational® Application Developer. See Generating an SCA archive for Rational Application Developer. |
The following diagram illustrates the code generation options.
The following figure shows the decision pathway: choose a code generator for your client project or write the execution code yourself.
You can use a number of features to check the results of your execution. Decision Validation Services provides a way for you to test your results against an expected result in a controlled and measurable way. For more information, see Testing with Decision Validation Services.
To debug a Client Project for RuleApps, use the debug launch configuration for a remote Java application for rules.