[jboss-svn-commits] JBL Code SVN: r16682 - in labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent: src/org/jboss/soa/esb/samples/quickstart/businessrules and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Nov 19 17:56:28 EST 2007
Author: jeffdelong
Date: 2007-11-19 17:56:28 -0500 (Mon, 19 Nov 2007)
New Revision: 16682
Modified:
labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/.classpath
labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt
labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
Log:
Modified: labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/.classpath
===================================================================
--- labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/.classpath 2007-11-19 22:53:31 UTC (rev 16681)
+++ labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/.classpath 2007-11-19 22:56:28 UTC (rev 16682)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="processDefinition"/>
<classpathentry kind="lib" path="ruleAgent/insurancepolicy.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="DROOLS/Drools"/>
@@ -9,5 +10,7 @@
<classpathentry kind="var" path="ESB_HOME/test-util.jar"/>
<classpathentry kind="var" path="LOG4J"/>
<classpathentry kind="var" path="ESB_LIB/jbossts-common.jar"/>
- <classpathentry kind="var" path="ESB_LIB/jbossall-client.jar"/> <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="var" path="ESB_LIB/jbossall-client.jar"/>
+ <classpathentry kind="lib" path="/shared/workspace/rs/product/services/jbpm/build/jbossesb-jbpm.jar"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
Modified: labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt
===================================================================
--- labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt 2007-11-19 22:53:31 UTC (rev 16681)
+++ labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/readme.txt 2007-11-19 22:56:28 UTC (rev 16682)
@@ -1,9 +1,10 @@
Overview:
=========
- Demonstrates the use of the BusinessRulesProcessor which allows for
- modification of the POJOs attached to an ESB Message. The example uses Rules
- to calculate the priority associated with an inbound order for later routing,
- plus it calculates the discount percentage associated with an order.
+ Demonstrates the use of the BusinessRulesProcessor which uses facts that are
+ POJOs attached to an ESB Message. The example uses Rules to calculate the price
+ of an automobile insurance policy. In particular, this example gets the rules from
+ a rule package that is contained in the file system through the Drools RuleAgent.
+ This rule package can also be retrieved from a URL created by the Drools BRMS.
Make sure you have run simple_cbr, transformation_XML2POJO and fun_cbr
quickstarts as their principles are used in this more complex example.
@@ -15,6 +16,11 @@
A comprehensive description of message transformation can be found in
MessageTransformation.pdf, located in the docs/services folder.
+
+ Notice the brmsdeployedrules.properties in the ruleAgent folder. This points
+ the location of the rule package. It can specify a fully qualified file name,
+ or just the directory (if there is only one package file in it). Modify one
+ of these to match the path of your ESB installation.
To Run standalone mode:
=======================
@@ -37,11 +43,13 @@
What to look at in this Quickstart:
===================================
- Review the 3 different .drl files to see the distinction between business
- rules used for calculation/validation and rules used for routing.
- The customer status is actually set in the jboss-esb.xml via the SetupMessage
- action since it is not provided with the inbound XML. You don't want a
- customer to determine their status. In a real world situation, another
- system would be integrated via an action/service, that first calculates the
- customer's status (frequent flier, volume of previous purchases, etc.)
\ No newline at end of file
+ The SendJMSMessage will send a message with the SampleDriver.xml included as a string.
+ A Transformation service will convert the XML to POJOs (Driver and Policy), and put
+ these objects in the message. The message is then sent to the PolicyPricing service
+ which uses the brmsdeployedrules.property to access the rule package, creates a new
+ stateless session, inserts the Driver and Policy from the message, and executes the
+ rules. The console will show the resulting price of the policy that is calculated
+ from the rules.
+
+
\ No newline at end of file
Modified: labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
===================================================================
--- labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java 2007-11-19 22:53:31 UTC (rev 16681)
+++ labs/jbossesb/workspace/jdelong/ruleservice/product/samples/quickstarts/business_ruleservice_ruleAgent/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java 2007-11-19 22:56:28 UTC (rev 16682)
@@ -29,17 +29,14 @@
import org.jboss.soa.esb.services.rules.Policy;
public class ReviewMessage extends AbstractActionPipelineProcessor {
- //private String input = "Reviewer";
+ private String input = "Sent Notification to:";
public Message process(Message message) throws ActionProcessingException {
Driver driver = (Driver) message.getBody().get("Driver");
Policy policy = (Policy) message.getBody().get("Policy");
System.out.println("{ ================ " + input);
- System.out.println("Driver: " + driver);
System.out.println("Name: " + driver.getName());
- System.out.println("Age: " + driver.getAge());
- System.out.println("PriorClaims: " + driver.getPriorClaims());
System.out.println("Policy Price: " + policy.getBasePrice());
System.out.println("} ================ " + input);
More information about the jboss-svn-commits
mailing list