Task 5: Deploying your ruleset
You deploy your ruleset to the Rule Execution Server, which contains the rule engine that runs the rules.
About this task
Your rules are verbalized and tested. You must now integrate the rules into the Miniloan application.
You start by creating a deployment configuration that generates a RuleApp archive. The RuleApp contains a ruleset and uses the format that is expected by Rule Execution Server. In the same way that a Java™ class is packaged in a JAR file, a ruleset is packaged in a JAR file that includes everything that is needed to run the ruleset, including the rules and the ruleflow. You deploy the ruleset in this configuration.
After you create the deployment configuration, you call the integration code in the Miniloan web application to run your new business logic in Rule Execution Server.
In this task, you can also test your deployed ruleset by using a hosted transparent decision service (HTDS). After you deploy the RuleApp in Rule Execution Server, you can generate a Web Services Description Language (WSDL) file from your ruleset, and then test it in Rule Designer.
This task takes 15-30 minutes to complete.
Step 1: Creating a deployment configuration
About this task
To deploy the rules from Rule Designer, you must create a deployment configuration.
Procedure
Step 2: Enabling ruleset monitoring
About this task
You set properties to enable the monitoring of the ruleset when it runs.
Procedure
- Select my operation in Configured Decision Operations.
- In the Ruleset Properties, click the plus button to add a property.
- In the Name field, type ruleset.bom.enabled, and in the Value field, type true.
- Click OK to create a new property for the ruleset.
- Repeat steps 1 to 4 to define the properties monitoring.enabled and ruleset.sequential.trace.enabled. Set the values of these properties to true.
- Save the changes. You must save your changes before you can deploy the RuleApp.
Step 3: Deploying the ruleset
About this task
Procedure
- In Ruleset Version Policy, ensure Increment minor version numbers is selected.
- Click the Target Servers tab and click the plus button to define a new target server.
- In the Target Server wizard, ensure Create a Rule Execution Server connection is selected and click Next.
- In the Name field, type Sample server. In the URL field, enter the following address: http://localhost:<PORT>/res. Enter the correct port number in the URL (see Checking the server port number).
- Enter resAdmin as the user name and password.
- Click Test Connection. Check that the connection succeeded, and then click Finish.
- Save your work.
- Open the Overview tab, and click Proceed to RuleApp deployment in the Deployment section.
- Select my operation and verify the deployment summary. Click Next.
- Check the credentials and click Next.
- Check the version summary and click Finish. The Deployment report opens and shows that the deployment was successful.
Step 4: Viewing the deployed RuleApp
About this task
You now view the deployed RuleApp in Rule Execution Server, which is the rule execution environment that has the rule engine. Rule Execution Server handles the management, performance, security, and logging capabilities that are associated with the execution of your rules.
From your application, you access Rule Execution Server by using either web services, Enterprise JavaBeans (EJB), or pure old Java objects (POJO).
Procedure
Step 5: Running the Miniloan web application with rules
About this task
In the Miniloan web application, you can choose whether the business logic that is embedded in the application is pure Java code or coded in a ruleset. The first time that you started the Miniloan application, you did not have the ruleset, so you ran the application by using the Java code. You can now use your deployed ruleset in Rule Execution Server by selecting the Use Rules check box.
The validateWithJRules method of the Miniloan bean validates the rules.
Procedure
(Optional) Step 6: Retrieving the HTDS WSDL file
About this task
You retrieve the Web Services Description Language (WSDL) file for the my_operation ruleset from the Rule Execution Server console.
Procedure
(Optional) Step 7: Testing the HTDS in Rule Designer
About this task
Procedure
Results
Your ruleset is now deployed to Rule Execution Server. You tested the ruleset in the Miniloan web application and as a web service. In the next task, you use Rule Execution Server to monitor and audit the execution of the rules.