[jboss-svn-commits] JBL Code SVN: r12431 - in labs/jbossesb/trunk/product/samples/quickstarts: business_rules_service and 10 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jun 9 11:52:20 EDT 2007


Author: burrsutter
Date: 2007-06-09 11:52:20 -0400 (Sat, 09 Jun 2007)
New Revision: 12431

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRules.drl
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRulesDiscount.drl
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyRoutingRules.drl
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/SampleOrder.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/deployment.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbm-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/Customer.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderHeader.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderItem.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/
   labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
Log:
Initial check-in of this transformation, BRP and CBR example

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRules.drl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRules.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRules.drl	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,43 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+import org.jboss.soa.esb.dvdstore.Customer;
+
+global java.util.List destinations;
+
+
+
+rule "Logging"
+when 
+   order: OrderHeader()
+   customer: Customer()
+then
+   System.out.println("Customer Status: " + customer.getStatus());
+   System.out.println("Order Total: " + order.getTotalAmount());
+end
+
+rule "Customer Platinum Status"
+ when
+   customer: Customer(status > 50)
+   order: OrderHeader(totalAmount > 50)
+ then
+   System.out.println("Platinum Customer - High Priority");
+   order.setOrderPriority(3);
+end 
+
+rule "Customer Gold Status"
+ when
+   customer: Customer(status > 10, status <= 50)
+   order: OrderHeader(totalAmount > 25)
+ then
+   System.out.println("Gold Customer - Medium Priority ");
+   order.setOrderPriority(2);
+end 
+
+
+
+   
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRulesDiscount.drl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRulesDiscount.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyBusinessRulesDiscount.drl	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,46 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+import org.jboss.soa.esb.dvdstore.Customer;
+
+global java.util.List destinations;
+
+
+
+rule "Logging"
+salience 10
+when 
+   order: OrderHeader()
+   customer: Customer()
+then
+   System.out.println("Customer Status: " + customer.getStatus());
+   System.out.println("Order Total: " + order.getTotalAmount());
+end
+
+rule "Customer Platinum Status"
+salience 20
+ when
+   customer: Customer(status > 50)
+   order: OrderHeader(orderPriority == 3)
+ then
+   System.out.println("Platinum Customer - High Priority - Higher discount");
+   order.setOrderDiscount(8.5);
+end 
+
+rule "Customer Gold Status"
+salience 20
+ when
+   customer: Customer(status > 10, status <= 50)
+   order: OrderHeader(orderPriority == 2)
+ then
+   System.out.println("Gold Customer - Medium Priority - discount ");
+   order.setOrderDiscount(3.4);
+end 
+
+
+
+   
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyRoutingRules.drl
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyRoutingRules.drl	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/MyRoutingRules.drl	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,40 @@
+#created on: Oct 30, 2006
+package com.jboss.soa.esb.routing.cbr
+
+#list any import classes here.
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+
+#declare any global variables here
+global java.util.List destinations;
+
+
+rule "Highest Priority Orders"
+	
+	when
+		OrderHeader( orderPriority == 3 )
+	then
+		System.out.println("HIGHEST PRIORITY");
+		destinations.add("SuperSpecialCustomerService");
+		
+end
+
+rule "Medium Priority Orders"
+	
+	when
+		OrderHeader( orderPriority == 2 )
+	then 
+		System.out.println("Medium Priority");
+		destinations.add("SpecialCustomerService");
+end
+
+rule "Low Priority Orders"
+	
+	when
+		OrderHeader( orderPriority == 1 )
+	then 
+		System.out.println("Low Priority");
+		destinations.add("RegularCustomerService");
+end
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/SampleOrder.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/SampleOrder.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/SampleOrder.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,12 @@
+<Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" 
+netAmount="59.97" totalAmount="64.92" tax="4.95">
+	<Customer userName="user1" firstName="Harry" lastName="Fletcher" state="SD"/>
+	<OrderLines>
+		<OrderLine position="1" quantity="1">
+			<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+		</OrderLine>
+		<OrderLine position="2" quantity="1">
+			<Product productId="299" title="Pulp Fiction" price="29.99"/>
+		</OrderLine>
+	</OrderLines>
+</Order>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/build.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,46 @@
+<project name="Quickstart_business_rules_service" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+		
+	<property name="additional.deploys" value="FunCBRRules-XPath.drl"/>
+
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+	
+	
+  <target name="runtest" depends="compile"
+	description="willl receive JMS message to tigger the actions in the ESB">
+     <echo>Runs Test JMS Sender</echo>
+     <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.businessrules.test.SendJMSMessage" failonerror="true">
+		<classpath refid="exec-classpath" />
+     </java>
+  </target>  
+	
+  <target name="receiveBlue" depends="compile">
+	 <echo>Runs Test JMS Receiver</echo>
+	 <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.businessrules.test.ReceiveJMSMessage" failonerror="true">
+	  	<arg value="queue/quickstart_Fun_CBR_Blue_Alert"/>
+		<classpath refid="exec-classpath" />
+	 </java>
+  </target>  
+	
+  <target name="receiveRed" depends="compile">
+	 <echo>Runs Test JMS Receiver</echo>
+	 <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.businessrules.test.ReceiveJMSMessage" failonerror="true">
+	   	<arg value="queue/quickstart_Fun_CBR_Red_Alert"/>
+		<classpath refid="exec-classpath" />
+	 </java>
+   </target>  
+	
+  <target name="receiveGreen" depends="compile">
+	 <echo>Runs Test JMS Receiver</echo>
+	 <java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.businessrules.test.ReceiveJMSMessage" failonerror="true">
+	   	<arg value="queue/quickstart_Fun_CBR_Green_Alert"/>
+		<classpath refid="exec-classpath" />
+	 </java>
+   </target> 
+	
+</project>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/deployment.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbossesb-deployment>
+  <depends>jboss.esb:deployment=jbrules.esb</depends>
+  <depends>jboss.esb:deployment=smooks.esb</depends>
+</jbossesb-deployment>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbm-queue-service.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.messaging.destination:service=Queue,name=quickstart_Business_Rules_Request_GW"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.messaging.destination:service=Queue,name=quickstart_Business_Rules_Request_ESB"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.messaging.destination:service=Queue,name=quickstart_Business_Rules_ConciergeManager"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.messaging.destination:service=Queue,name=quickstart_Business_Rules_DistributionManager"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.messaging.destination:service=Queue,name=quickstart_Business_Rules_BasicShipping"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  </server>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jboss-esb.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,137 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+	xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+		<jms-provider name="JBossMQ"
+			connection-factory="ConnectionFactory"
+			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+			jndi-URL="localhost">
+			<jms-bus busid="quickstartGwChannel">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_Business_Rules_Request_GW" />
+			</jms-bus>
+			<jms-bus busid="quickstartEsbChannel">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_Business_Rules_Request_ESB" />
+			</jms-bus>
+			<jms-bus busid="Business_Rules_ConciergeManager">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_Business_Rules_ConciergeManager" />
+			</jms-bus>
+			<jms-bus busid="Business_Rules_DistributionManager">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_Business_Rules_DistributionManager" />
+			</jms-bus>
+			<jms-bus busid="Business_Rules_BasicShipping">
+				<jms-message-filter dest-type="QUEUE"
+					dest-name="queue/quickstart_Business_Rules_BasicShipping" />
+			</jms-bus>
+		</jms-provider>
+	</providers>
+
+	<services>
+
+		<service category="Business_RulesServices"
+			name="Business_Rules_Service" description="">
+			<listeners>
+				<!-- Gateway -->
+				<jms-listener name="TheGateway"
+					busidref="quickstartGwChannel" maxThreads="1" is-gateway="true" />
+				<jms-listener name="TheESBChannel"
+					busidref="quickstartEsbChannel" maxThreads="1">
+				</jms-listener>
+			</listeners>
+			<actions>
+				<!--  
+					<action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
+					<property name="message" value="Message before transformation" />
+					</action>
+				-->
+			     
+				<action name="transform"
+					class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+					<property name="resource-config"
+						value="/smooks-res.xml" />
+				</action>
+
+				<action name="fixUpMessage"
+					class="org.jboss.soa.esb.samples.quickstart.businessrules.SetupMessage">
+					<property name="status" value="60" /><!--  status was not in order XML -->
+				</action>
+				
+				<!--  Use the BRP to calculate the order priority -->
+				<action
+					class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+					name="BRP">
+					<property name="ruleSet"
+						value="MyBusinessRules.drl" />
+					<property name="ruleReload" value="true" />
+					<property name="object-paths">
+						<object-path path="body.TheOrderHeader" />
+						<object-path path="body.TheCustomer" />
+					</property>
+				</action>
+
+				<action name="reviewMessage"
+					class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
+					<property name="stuff" value="After Order Priority"/>
+			     </action>
+
+				<!--  Use the BRP to calculate the order discount -->
+				<action
+					class="org.jboss.soa.esb.actions.BusinessRulesProcessor"
+					name="BRP">
+					<property name="ruleSet"
+						value="MyBusinessRulesDiscount.drl" />
+					<property name="ruleReload" value="true" />
+					<property name="object-paths">
+						<object-path path="body.TheOrderHeader" />
+						<object-path path="body.TheCustomer" />
+					</property>
+				</action>
+
+				<action name="reviewMessage"
+					class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
+					<property name="stuff" value="After Order Discount"/>
+			     </action>
+
+
+				<!--  Use the CBR to route the "scored" order to the appropriate service team -->
+				<action
+					class="org.jboss.soa.esb.actions.ContentBasedRouter"
+					name="ContentBasedRouter">
+					<property name="ruleSet" value="MyRoutingRules.drl" />
+					<property name="ruleReload" value="true" />
+					<property name="destinations">
+						<route-to
+							destination-name="SuperSpecialCustomerService"
+							service-category="ConciergeManager" service-name="ConciergeService" />
+						<route-to
+							destination-name="SpecialCustomerService"
+							service-category="DistributionManager" service-name="DistributionService" />
+						<route-to
+							destination-name="RegularCustomerService"
+							service-category="BasicShipping" service-name="ShipperService" />
+					</property>
+				</action>
+			</actions>
+		</service>
+		<!-- Add in the 3 services -->
+		<service category="ConciergeManager"
+			name="ConciergeService" description="">
+			<listeners>
+				<jms-listener name="TheESBChannel"
+					busidref="Business_Rules_ConciergeManager" maxThreads="1">
+				</jms-listener>
+			</listeners>
+			<actions>
+			  	<action name="reviewMessage"
+					class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
+					<property name="stuff" value="Concierge"/>
+			     </action>
+			</actions>
+		</service>
+		
+	</services>
+</jbossesb>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jbossesb-properties.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., and others contributors as indicated 
+  by the @authors tag. All rights reserved. 
+  See the copyright.txt in the distribution for a
+  full listing of individual contributors. 
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU Lesser General Public License, v. 2.1.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jndi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/jndi.properties	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/juddi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/juddi.properties	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/log4j.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.milyn">
+      <priority value="ERROR"/>
+   </category>
+
+   <category name="quickstarts">
+      <priority value="WARN"/>
+   </category>
+   
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/readme.txt	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/readme.txt	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,24 @@
+Description:
+ 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.
+
+Prereqs:
+ First make sure you have run simple_cbr, transformation_XML2POJO and fun_cbr quickstarts as their
+ principles are used in this more complex example.
+ 
+Notes:
+ - To test:
+  -- startup the ESB Server
+  -- ant deploy-jms-dests
+  -- ant run (terminal window 1)
+  -- ant runtest (terminal window 2)
+ - Only runs via standalone bootstrapper (ant run), NOT with a .esb archive (ant deploy)
+ - Only has queue declarations for JBoss Messaging, NOT JBossMQ
+ - 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

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/smooks-res.xml	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
+
+    <!-- Populate the OrderHeader -->
+	<resource-config selector="order">
+        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+        <param name="beanId">orderHeader</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderHeader</param>
+        <param name="bindings">
+            <binding property="orderId" selector="Order @orderId" />
+            <binding property="orderDate" selector="Order @orderDate" type="LongDate"/>
+            <binding property="statusCode" selector="Order @statusCode" type="Integer" />
+            <binding property="netAmount" selector="Order @netAmount" type="Double" />
+            <binding property="totalAmount" selector="Order @totalAmount" type="Double" />
+            <binding property="tax" selector="Order @tax" type="Double" />
+        </param>
+    </resource-config>
+
+    <!-- Populate the Customer -->
+    <resource-config selector="order customer">
+        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+		<param name="beanId">customer</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.Customer</param>
+        <param name="bindings">
+            <binding property="userName" selector="order customer @userName" />
+            <binding property="firstName" selector="order customer @firstName" />
+            <binding property="lastName" selector="order customer @lastName" />
+            <binding property="state" selector="order customer @state" />
+        </param>
+	</resource-config>
+
+    <!-- Populate the OrderItem list -->
+	<resource-config selector="order orderlines orderline">
+        <resource>org.milyn.javabean.ProcessingPhaseBeanPopulator</resource>
+		<param name="beanId">orderItem</param>
+		<param name="beanClass">org.jboss.soa.esb.dvdstore.OrderItem</param>
+		<param name="addToList">true</param>
+        <param name="bindings">
+            <binding property="position"  selector="order orderlines orderline @position" type="Integer" />
+            <binding property="quantity"  selector="order orderlines orderline @quantity" type="Integer" />
+            <binding property="productId" selector="order orderlines orderline product @productId" />
+            <binding property="title"     selector="order orderlines orderline product @title" />
+            <binding property="price"     selector="order orderlines orderline product @price" type="Double" />
+        </param>
+	</resource-config>
+
+	<resource-config selector="order orderlines orderline">
+        <resource>/org/jboss/soa/esb/dvdstore/orderitem.st</resource>
+	</resource-config>
+
+    <resource-config selector="decoder:LongDate">
+        <resource>org.milyn.javabean.decoders.CalendarDecoder</resource>
+        <param name="format">EEE MMM dd HH:mm:ss z yyyy</param>
+    </resource-config>
+    
+</smooks-resource-list>

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/Customer.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/Customer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/Customer.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.dvdstore;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Customer {
+
+	// <Customer userName="user1" firstName="Harry" lastName="Potter" state="SD"/>
+	private String userName;
+	private String firstName;
+	private String lastName;
+	private String state;
+	private int status;
+	
+	/**
+	 * @return Returns the firstName.
+	 */
+	public String getFirstName() {
+		return firstName;
+	}
+	/**
+	 * @param firstName The firstName to set.
+	 */
+	public void setFirstName(String firstName) {
+		//System.out.println("**** firstName: " + firstName);
+		this.firstName = firstName;
+	}
+	/**
+	 * @return Returns the lastName.
+	 */
+	public String getLastName() {
+		return lastName;
+	}
+	/**
+	 * @param lastName The lastName to set.
+	 */
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+	/**
+	 * @return Returns the state.
+	 */
+	public String getState() {
+		return state;
+	}
+	/**
+	 * @param state The state to set.
+	 */
+	public void setState(String state) {
+		this.state = state;
+	}
+	/**
+	 * @return Returns the userName.
+	 */
+	public String getUserName() {
+		return userName;
+	}
+	/**
+	 * @param userName The userName to set.
+	 */
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return userName + "," + firstName + "," + lastName + "," + state + "," + status;
+	}
+	
+	public int getStatus() {
+		return status;
+  }
+  public void setStatus(int status) {
+  	 this.status = status;
+  }
+
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/DVDStoreAction.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.dvdstore;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * DVD Store action.
+ * <p/>
+ * This action uses bean value objects that were prepopulated by Smooks in an earlier action on the pipline.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DVDStoreAction extends AbstractActionPipelineProcessor {
+
+	public DVDStoreAction(ConfigTree configTree) {
+		
+	}
+	
+	public Message process(Message message) throws ActionProcessingException {
+		HashMap beanHash = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
+		
+		StringBuffer results = new StringBuffer();		
+		if(beanHash != null) {
+			OrderHeader header = (OrderHeader) beanHash.get("orderHeader");
+			Customer customer = (Customer) beanHash.get("customer");
+			List orderItems = (List) beanHash.get("orderItemList");
+			results.append("Demonstrates Smooks ability to rip the XML into Objects\n");
+			results.append("********* DVDStoreAction - Order Value Objects Populated *********\n");
+			results.append("Header: " + header + "\n");
+			results.append("Customer: " + customer + "\n");
+			if(orderItems != null) {
+				results.append("Order Items (" + orderItems.size() + "):\n");
+				for(int i = 0; i < orderItems.size(); i++) {
+					results.append("\t" + i + ": " + orderItems.get(i) + "\n");
+				}
+			}
+			results.append("\n****************************************************************** ");
+		} else {
+			results.append("\n*** No beanhash found!");
+		}
+		
+		// Take this "parsed" output and make it a new message
+		message.getBody().setByteArray(results.toString().getBytes());
+		return message;
+	}
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderHeader.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderHeader.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderHeader.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.dvdstore;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+import java.util.Calendar;
+
+public class OrderHeader {
+	
+	// <Order orderId="1" orderDate="Wed Nov 15 13:45:28 EST 2006" statusCode="0" netAmount="59.97" totalAmount="64.92" tax="4.95">
+	private String orderId;
+	private Calendar orderDate;
+	private int statusCode;
+	private double netAmount;
+	private double totalAmount;
+	private double tax;
+	private int orderPriority = 1;
+	private double orderDiscount;
+	
+	/**
+	 * @return Returns the netAmount.
+	 */
+	public double getNetAmount() {
+		return netAmount;
+	}
+	/**
+	 * @param netAmount The netAmount to set.
+	 */
+	public void setNetAmount(double netAmount) {
+		// System.out.println("**** netAmount: " + netAmount);
+		this.netAmount = netAmount;
+	}
+	/**
+	 * @return Returns the orderDate.
+	 */
+	public Calendar getOrderDate() {
+		return orderDate;
+	}
+	/**
+	 * @param orderDate The orderDate to set.
+	 */
+	public void setOrderDate(Calendar orderDate) {
+		this.orderDate = orderDate;
+	}
+	/**
+	 * @return Returns the orderId.
+	 */
+	public String getOrderId() {
+		return orderId;
+	}
+	/**
+	 * @param orderId The orderId to set.
+	 */
+	public void setOrderId(String orderId) {
+		this.orderId = orderId;
+	}
+	/**
+	 * @return Returns the statusCode.
+	 */
+	public int getStatusCode() {
+		return statusCode;
+	}
+	/**
+	 * @param statusCode The statusCode to set.
+	 */
+	public void setStatusCode(int statusCode) {
+		this.statusCode = statusCode;
+	}
+	/**
+	 * @return Returns the tax.
+	 */
+	public double getTax() {
+		return tax;
+	}
+	/**
+	 * @param tax The tax to set.
+	 */
+	public void setTax(double tax) {
+		this.tax = tax;
+	}
+	/**
+	 * @return Returns the totalAmount.
+	 */
+	public double getTotalAmount() {
+		return totalAmount;
+	}
+	/**
+	 * @param totalAmount The totalAmount to set.
+	 */
+	public void setTotalAmount(double totalAmount) {
+		this.totalAmount = totalAmount;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return orderId + ", " + orderDate + ", " + statusCode + ", " + netAmount + ", " + totalAmount + ", " + tax + ", ";
+	}
+	
+	public int getOrderPriority() {
+  	  return this.orderPriority;
+    }
+	
+	public void setOrderPriority(int orderPriority) {
+		this.orderPriority = orderPriority;
+    }
+	
+	public double getOrderDiscount() {
+		return this.orderDiscount;
+	}
+	
+	public void setOrderDiscount(double orderDiscount) {
+		this.orderDiscount = orderDiscount;
+	}
+	
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderItem.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderItem.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/OrderItem.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.esb.dvdstore;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OrderItem {
+
+	// <OrderLine position="1" quantity="1">
+	// 		<Product productId="364" title="The 40-Year-Old Virgin " price="29.98"/>
+	// </OrderLine>
+	private int position;
+	private int quantity;
+	private String productId;
+	private String title;
+	private double price;
+	
+	/**
+	 * @return Returns the position.
+	 */
+	public int getPosition() {
+		return position;
+	}
+	/**
+	 * @param position The position to set.
+	 */
+	public void setPosition(int position) {
+		//System.out.println("**** position: " + position);
+		this.position = position;
+	}
+	/**
+	 * @return Returns the price.
+	 */
+	public double getPrice() {
+		return price;
+	}
+	/**
+	 * @param price The price to set.
+	 */
+	public void setPrice(double price) {
+		//System.out.println("**** price: " + price);
+		this.price = price;
+	}
+	/**
+	 * @return Returns the productId.
+	 */
+	public String getProductId() {
+		return productId;
+	}
+	/**
+	 * @param productId The productId to set.
+	 */
+	public void setProductId(String productId) {
+		this.productId = productId;
+	}
+	/**
+	 * @return Returns the quantity.
+	 */
+	public int getQuantity() {
+		return quantity;
+	}
+	/**
+	 * @param quantity The quantity to set.
+	 */
+	public void setQuantity(int quantity) {
+		this.quantity = quantity;
+	}
+	/**
+	 * @return Returns the title.
+	 */
+	public String getTitle() {
+		return title;
+	}
+	/**
+	 * @param title The title to set.
+	 */
+	public void setTitle(String title) {
+		this.title = title;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return position + "," + quantity + "," + productId + "," + title + "," + price;
+		
+	}
+}

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/dvdstore/orderitem.st	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,7 @@
+		<order-item>
+			<index>$orderItem.position$</index>
+			<quantity>$orderItem.quantity$</quantity>
+			<product>$orderItem.productId$</product>
+			<title>$orderItem.title$</title>
+			<price>$orderItem.price$</price>
+		</order-item>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/ReviewMessage.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.businessrules;
+
+import java.util.HashMap;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.dvdstore.Customer;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+
+public class ReviewMessage extends AbstractActionPipelineProcessor {
+	private String input = "Reviewer";
+	
+	public Message process(Message message) throws ActionProcessingException {
+		
+		OrderHeader order = (OrderHeader) message.getBody().get("TheOrderHeader");
+		Customer customer = (Customer) message.getBody().get("TheCustomer");	
+		System.out.println("{ ================ " + input);		
+		System.out.println("Customer: " + customer);
+		System.out.println("Order Priority: " + order.getOrderPriority());
+		System.out.println("Order Discount: " + order.getOrderDiscount());
+		System.out.println("Order Total: " + order.getTotalAmount());
+		System.out.println("} ================ " + input);
+		// System.out.println("Order: " + order);
+	
+		return message;
+	}
+	
+	public ReviewMessage(ConfigTree configTree) {
+		input = configTree.getAttribute("stuff");
+	}
+	
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/SetupMessage.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.businessrules;
+
+import java.util.HashMap;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.dvdstore.Customer;
+import org.jboss.soa.esb.dvdstore.OrderHeader;
+import org.apache.log4j.Logger;
+
+public class SetupMessage extends AbstractActionPipelineProcessor {
+	private Logger logger = Logger.getLogger(SetupMessage.class);
+	private int status = 0;
+	
+	public Message process(Message message) throws ActionProcessingException {
+		HashMap transformedBeans = (HashMap) message.getBody().get("EXTRACTED_BEANS_HASH");
+		if(transformedBeans != null) {
+			OrderHeader header = (OrderHeader) transformedBeans.get("orderHeader");
+			Customer customer = (Customer) transformedBeans.get("customer");	
+			customer.setStatus(status); // demo purposes, passed in from the jboss-esb.xml
+			message.getBody().add("TheOrderHeader",header);
+			message.getBody().add("TheCustomer",customer);			
+			logger.info("Moved the transformed Order Header and Customer");
+		}
+		return message;
+	}
+	
+	public SetupMessage(ConfigTree configTree) {
+		status = Integer.parseInt(configTree.getAttribute("status"));
+	}
+	
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/business_rules_service/src/org/jboss/soa/esb/samples/quickstart/businessrules/test/SendJMSMessage.java	2007-06-09 15:52:20 UTC (rev 12431)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.businessrules.test;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.JMSException;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueSession;
+import javax.jms.QueueSender;
+import javax.jms.ObjectMessage;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class SendJMSMessage {
+    QueueConnection conn;
+    QueueSession session;
+    Queue que;
+    
+    
+    public void setupConnection() throws JMSException, NamingException
+    {
+    	InitialContext iniCtx = new InitialContext();
+    	Object tmp = iniCtx.lookup("ConnectionFactory");
+    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+    	conn = qcf.createQueueConnection();
+    	que = (Queue) iniCtx.lookup("queue/quickstart_Business_Rules_Request_GW");
+    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+    	conn.start();
+    	System.out.println("Connection Started");
+    }
+    
+    public void stop() throws JMSException 
+    { 
+        conn.stop();
+        session.close();
+        conn.close();
+    }
+    
+    public void sendAMessage(String msg) throws JMSException {
+    	
+        QueueSender send = session.createSender(que);        
+        ObjectMessage tm = session.createObjectMessage(msg);        
+        send.send(tm);        
+        send.close();
+    }
+    public String readAsciiFile(String fileName) throws IOException {
+		  FileReader fr = null;
+		  char[] thechars = null;
+
+		  try {
+			  File thefile = new File( fileName );
+			  fr = new FileReader( thefile );
+			  int size = (int) thefile.length();
+			  thechars = new char[size];
+		
+			  int count, index = 0;
+		
+			  // 	read in the bytes from the input stream
+			  while( ( count = fr.read( thechars, index, size ) ) > 0 ) {
+				  size -= count;
+				  index += count;
+			  }
+			} catch(Exception e) {	
+				System.out.println(e);
+			}
+			finally {
+				if( fr != null )
+		        fr.close();
+			}
+			return new String(thechars);
+
+    } // readAsciiFile
+    
+    public static void main(String args[]) throws Exception
+    {        	    	
+    	SendJMSMessage sm = new SendJMSMessage();
+    	sm.setupConnection();
+    	String fileContent = sm.readAsciiFile("SampleOrder.xml");
+    	System.out.println("---------------------------------------------");
+    	System.out.println(fileContent);
+    	System.out.println("---------------------------------------------");
+    	sm.sendAMessage(fileContent); 
+    	sm.stop();
+    	
+    }
+    
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list