[jboss-svn-commits] JBL Code SVN: r33323 - in labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US: Chapter-Camel/Section-API and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jun 2 22:26:40 EDT 2010


Author: lucazamador
Date: 2010-06-02 22:26:40 -0400 (Wed, 02 Jun 2010)
New Revision: 33323

Added:
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CamelRoutesCreation.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingDroolsCommands.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingOurCamelContext.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-RegisteringKnowledgeSession.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-SendingMessagesExchanges.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/Section-Introduction.xml
Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Chapter-Camel.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Server/Chapter-Server.xml
Log:
JBRULES-2524: Camel/Spring/OSGi integration documentation
- camel documentation ready to be reviewed

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Chapter-Camel.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Chapter-Camel.xml	2010-06-03 01:47:41 UTC (rev 33322)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Chapter-Camel.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -8,163 +8,16 @@
          xmlns:db="http://docbook.org/ns/docbook">
   <title>Apache Camel Integration</title>
 
-  <para></para>
+  <xi:include href="Section-Introduction/Section-Introduction.xml" />
+  
+  <xi:include href="Section-API/Section-CreatingOurCamelContext.xml" />
 
-  <section>
-    <title>Introduction</title>
+  <xi:include href="Section-API/Section-RegisteringKnowledgeSession.xml" />
 
-    <para>The Apache Camel integration allow us interact with a Drools
-    Stateless or Stateful session through a pipeline. It simple works
-    transforming XML commands into executable commands and executing them. The
-    advantage of this integration is that Apache Camel brings the possibility
-    to implement more advanced enterprise integration patterns than a simple
-    transformation pipeline. This integration with Drools allow us to add any
-    of the current Camel components. Using any of the Apache Components you
-    could, for example, execute commands thats come an a JMS queue/Atom
-    Feed/Mina connection/a Mail/etc and send the execution result to any type
-    of supported components. As you can see, this brings a more powerful
-    connection scenario to implement Drools.</para>
+  <xi:include href="Section-API/Section-CamelRoutesCreation.xml" />
 
-    <para></para>
+  <xi:include href="Section-API/Section-CreatingDroolsCommands.xml" />
 
-    <section>
-      <title>Architecture</title>
+  <xi:include href="Section-API/Section-SendingMessagesExchanges.xml" />
 
-      <para>&lt;insert cool architecture graphic here&gt;</para>
-
-      <para></para>
-    </section>
-
-    <section>
-      <title>Introduction to drools-grid</title>
-
-      <para>Camel integration is coupled with another drools module called:
-      drools-grid. This module allow us to interact with Drools sessions
-      independent of the JVM location. At this moment we can use two
-      implementations:</para>
-
-      <table>
-        <title>drools-grid implementations</title>
-
-        <tgroup cols="2">
-          <tbody>
-            <row>
-              <entry>Local</entry>
-
-              <entry>used when the drools session's and client's are in the
-              same JVM.</entry>
-            </row>
-
-            <row>
-              <entry>Remote</entry>
-
-              <entry>used when you've drools session's on a remote JVM. At
-              this moment is the only implementation is using Apache Min, but
-              we're going to add HornetQ support in the next release.</entry>
-            </row>
-          </tbody>
-        </tgroup>
-      </table>
-
-      <para></para>
-
-      <para>Drools Grid is embedded inside the Drools Camel component, so
-      don't worry about more implementation information because this should be
-      enough. With this information we can start to configure our Camel
-      Context.</para>
-
-      <para></para>
-    </section>
-  </section>
-
-  <section>
-    <title>Creating our Camel Context</title>
-
-    <para>We need to create our own CamelContext to start. The first thing
-    that we should do is create and register the grid node that we are going
-    to use inside the CamelContext. In the most common cases we need to
-    implement the Local grid connection. The next step after the
-    LocalConnection creation is get a new ExecutionNode and register this
-    inside the CamelContext.</para>
-
-    <programlisting>
-    LocalConnection connection = new LocalConnection();
-    ExecutionNode node = connection.getExecutionNode();
-    node.setId("sm");
-    Context jndiContext = new JndiContext();
-    jndiContext.bind("sm", node);
-    CamelContext camelContext = new DefaultCamelContext(jndiContext);
-    </programlisting>
-
-    <para>After all this code now we have a properly configured CamelContext
-    with all the configuration to use the DroolsComponent. But isn't ready yet
-    to execute Drools, there're another steps left to reach that.</para>
-  </section>
-
-  <section>
-    <title>Registering our KnowledgeSession</title>
-
-    <para>Once you've your CamelContext configured is necesary register all
-    the KnowledgeSession's that you are going to use inside the
-    ExecutionNode.</para>
-
-    <programlisting>
-       node.get(DirectoryLookupFactoryService.class).register("ksession1", ksession);
-    </programlisting>
-
-    <para></para>
-  </section>
-
-  <section>
-    <title>Camel Routes creation</title>
-
-    <para>This is the most powerful feature of this integration because Camel
-    bring us a very large Components library that we can use to create our
-    pipelines. In this section</para>
-
-    <note>
-      <para>A Camel Component is a factory of Endpoint instances</para>
-    </note>
-
-    <para>The declaration of a Drools Endpoint need a few parameters, that we
-    can see next:</para>
-
-    <para>drools:{0}/{1}?dataFormat={2}</para>
-
-    <para>{0} : Execution Node identifier that was registered in the
-    CamelContext</para>
-
-    <para>{1} : Knowledge Session identifier that was registered in the
-    Execution Node with identifier {0}</para>
-
-    <para>{2} : XML command transformer that is going to be used. At this
-    moment we have two implementations: drools-xstream &amp;
-    drools-jaxb</para>
-
-    <para></para>
-
-    <para>The most important thing in this section is know how create your
-    Drools Endpoint, so what is best that having a example:
-    
-    <programlisting>
-    RouteBuilder rb = new RouteBuilder() { 
-    	public void configure() throws Exception {
-   			from("direct:with-session-xstream").to("drools:sm/ksession1?dataFormat=drools-xstream");
-    } };
-    camelContext.addRoutes(rb);
-    </programlisting>
-    </para>
-  </section>
-
-  <section>
-    <title>Executing commands with JAXB</title>
-
-    <para></para>
-  </section>
-
-  <section>
-    <title>Executing commands with XStream</title>
-
-    <para></para>
-  </section>
 </chapter>

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CamelRoutesCreation.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CamelRoutesCreation.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CamelRoutesCreation.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+
+    <title>Camel Routes creation</title>
+
+    <para>This is the most powerful feature of this integration because Camel
+    bring us a very large Components library that we can use to create our
+    pipelines. In this section</para>
+
+    <note>
+      <para>A Camel Component is a factory of Endpoint instances</para>
+    </note>
+
+    <para>The declaration of a Drools Endpoint need a few parameters, that we
+    can see next:</para>
+
+    <para>drools:{0}/{1}?dataFormat={2}</para>
+
+    <para>{0} : Execution Node identifier that was registered in the
+    CamelContext</para>
+
+    <para>{1} : Knowledge Session identifier that was registered in the
+    Execution Node with identifier {0}</para>
+
+    <para>{2} : XML command transformer that is going to be used. At this
+    moment we have two implementations: drools-xstream &amp;
+    drools-jaxb</para>
+
+    <para></para>
+
+    <para>The most important thing in this section is know how create your
+    Drools Endpoint, so what is best that having a example:</para>
+
+    <para><programlisting>RouteBuilder rb = new RouteBuilder() { 
+   public void configure() throws Exception {
+      from("direct:with-session-xstream").to("drools:sm/ksession1?dataFormat=drools-xstream");
+   }
+};
+camelContext.addRoutes(rb);</programlisting></para>
+
+    <para></para>
+
+    <para>In this example we created a simple route with a Direct Endpoint as
+    the input and a Drools Endpoint as the output. A Direct input allow us to
+    send the commands directly to the next endpoint in the route, invocating
+    their consumer, and which will process the XML command.</para>
+
+    <note>
+       When you send a XML command to a route, the format must be equal to the dataFormat transformer used in the route creation. 
+    </note>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CamelRoutesCreation.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingDroolsCommands.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingDroolsCommands.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingDroolsCommands.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+
+    <title>Creating Drools Commands</title>
+
+    <para>The next step is create our commands to be converted to XML. All our
+    commands must be added in a BatchExecutionCommand object because the
+    lookup is a required parameter in the XML format. The lookup parameter
+    must be the KnowledgeSession identifier in which we want to execute the
+    commands.</para>
+
+    <para></para>
+
+    <para><programlisting>BatchExecutionCommand cmd = new BatchExecutionCommand();
+cmd.setLookup("ksession1");
+cmd.getCommands().add(new InsertObjectCommand(new Person("lucaz", 25), "person1"));
+cmd.getCommands().add(new InsertObjectCommand(new Person("hadrian", 25), "person2"));
+cmd.getCommands().add(new InsertObjectCommand(new Person("baunax", 21), "person3"));
+cmd.getCommands().add(new FireAllRulesCommand());</programlisting></para>
+
+    <para>At this moment, the supported commands are:</para>
+
+    <itemizedlist>
+      <listitem>
+         AbortWorkItemCommand 
+      </listitem>
+
+      <listitem>
+         CompleteWorkItemCommand 
+      </listitem>
+
+      <listitem>
+         FireAllRulesCommand 
+      </listitem>
+
+      <listitem>
+         GetGlobalCommand 
+      </listitem>
+
+      <listitem>
+         InsertObjectCommand 
+      </listitem>
+
+      <listitem>
+         RetractCommand 
+      </listitem>
+
+      <listitem>
+         ModifyCommand 
+      </listitem>
+
+      <listitem>
+         InsertElementsCommand 
+      </listitem>
+
+      <listitem>
+         QueryCommand 
+      </listitem>
+
+      <listitem>
+         SetGlobalCommand 
+      </listitem>
+
+      <listitem>
+         SignalEventCommand 
+      </listitem>
+
+      <listitem>
+         StartProcessCommand 
+      </listitem>
+    </itemizedlist>
+
+    <para></para>
+
+    <para>In the next sections you will see how to marshall/unmarshall the
+    commands to XML to XStream and JAXB</para>
+
+    <para></para>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingDroolsCommands.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingOurCamelContext.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingOurCamelContext.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingOurCamelContext.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+
+    <title>Creating our Camel Context</title>
+
+    <para>We need to create our own CamelContext to start. The first thing
+    that we should do is create and register the grid node that we are going
+    to use inside the CamelContext. In the most common cases we use the Local grid connection. 
+    The next step after the LocalConnection creation is get a new ExecutionNode and register this
+    inside the CamelContext.</para>
+
+    <programlisting>LocalConnection connection = new LocalConnection();
+ExecutionNode node = connection.getExecutionNode();
+node.setId("sm");
+Context jndiContext = new JndiContext();
+jndiContext.bind("sm", node);
+CamelContext camelContext = new DefaultCamelContext(jndiContext);</programlisting>
+
+    <para>After all this code now we have a properly configured CamelContext
+    with all the configuration to use the DroolsComponent. But isn't ready yet
+    to execute Drools, there're another steps left to reach that.</para>
+
+    <para></para>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-CreatingOurCamelContext.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-RegisteringKnowledgeSession.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-RegisteringKnowledgeSession.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-RegisteringKnowledgeSession.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+ 
+    <title>Registering our KnowledgeSession</title>
+
+    <para>Once you have your CamelContext configured is necesary register all
+    the KnowledgeSession's that you are going to use inside the
+    ExecutionNode.</para>
+
+    <programlisting>node.get(DirectoryLookupFactoryService.class).register("ksession1", ksession);    </programlisting>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-RegisteringKnowledgeSession.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-SendingMessagesExchanges.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-SendingMessagesExchanges.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-SendingMessagesExchanges.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+
+    <title>Sending messages exchanges</title>
+
+    <para>To send messages to the Camel Endpoints we need to create a <link
+    xlink:href="http://camel.apache.org/producertemplate.html">ProducerTemplate</link></para>
+
+    <para><programlisting>ProducerTemplate template = camelContext.createProducerTemplate();</programlisting></para>
+
+    <para>Once you have this you can start to send message exchange to your
+    route:</para>
+
+    <para><programlisting>String xml = "&lt;xml&gt;example&lt;/xml&gt;";
+template.requestBody("direct:with-session-xstream", xml);</programlisting></para>
+
+    <note>
+      <para>When we use commands created with JAXB we need to use a special
+      method to send the JaxbContext to our route. This will be more detailed
+      in the next section</para>
+    </note>
+
+    <para></para>
+
+    <section>
+      <title>Using XStream</title>
+
+      <para>To create XML commands with XStream we use the
+      BatchExecutionHelper. The steps are the nexts:</para>
+
+      <orderedlist>
+        <listitem>
+          <para>BatchExecutionCommand marshalling</para>
+
+          <para>String xml =
+          BatchExecutionHelper.newXStreamMarshaller().toXML(batchExecutionCommand);</para>
+        </listitem>
+
+        <listitem>
+          <para>Sending the commands through the ProducerTemplate</para>
+
+          <para>String xmlOutput = new
+          String((byte[])template.requestBody("direct:test-with-session",
+          xml)</para>
+        </listitem>
+
+        <listitem>
+          <para>Converting the Drools Endpoint XML response to
+          ExecutionResults</para>
+
+          <para>ExecutionResults result = (ExecutionResults)
+          BatchExecutionHelper.newXStreamMarshaller().fromXML(xmlOutput);</para>
+        </listitem>
+      </orderedlist>
+
+      <para></para>
+    </section>
+
+    <section>
+      <title>Using JAXB</title>
+
+      <para>JAXB is more powerful because allow us to define our model on a
+      XSD file, and with this isn't necesary to copy/duplicate our model jar
+      file using drools-camel in a remote enviroment, or even create a Java
+      model in our project. In this case we need to send the JAXBContext with
+      our XML command.</para>
+
+      <para>Once you have created your JAXBContext, and even you can use the
+      XSD files in a KnowledgeBuilder to represent the model, you need to
+      convert this to XML.</para>
+
+      <para>Note: in this snippet code we are going to use a POJO Java model
+      and a XSD to duplicate the same model representation.</para>
+
+      <orderedlist>
+        <listitem>
+          <para>JAXBContext creation:</para>
+
+          <para>Here we are adding our XSD model definition to our
+          KnowledgeBuilder and storing the classNames in a array.</para>
+
+          <para><programlisting>Options xjcOpts = new Options();
+xjcOpts.setSchemaLanguage( Language.XMLSCHEMA );
+String classNames[] = null;
+try {
+   classNames = KnowledgeBuilderHelper.addXsdModel(ResourceFactory.newClassPathResource("person.xsd", getClass()),
+                                                   kbuilder,
+                                                   xjcOpts,
+                                                   "xsd");
+}
+catch (IOException e) {
+   LOG.error("Errors while adding xsd model.", kbuilder.getErrors());
+}</programlisting>Then you need to add your rules/processes in the kbuilder
+          and create your KnowledgeBase. That steps are the sames that you can
+          read in the Drools Expert documentation. Finally, we are going to
+          create the JAXBContext</para>
+
+          <para><programlisting>try {
+   jaxbContext = KnowledgeBuilderHelper.newJAXBContext(allClasses.toArray(new String[allClasses.size()]), kbase);
+}
+catch (Exception e) {
+   LOG.info("Errors while creating JAXB Context.", e);
+    throw new RuntimeException(e);
+}</programlisting></para>
+        </listitem>
+
+        <listitem>
+          <para>BatchExecutionCommand marshalling <programlisting>StringWriter xmlReq = new StringWriter();
+Marshaller marshaller = jaxbContext.createMarshaller();
+marshaller.setProperty("jaxb.formatted.output", true);
+marshaller.marshal(batchExecutionCommand, xmlReq);</programlisting></para>
+        </listitem>
+
+        <listitem>
+          <para>Sending the commands through the ProducerTemplate</para>
+
+          <para>In this step we need to use another ProducerTemplate method
+          called requestBodyAndHeader() because the Drools Component needs to
+          know wich JAXBContext must use to unmarshall the XML.</para>
+
+          <para><programlisting>String xml = xmlReq.toString();
+byte[] xmlOutput = (byte[]) template.requestBodyAndHeader("direct:test-with-session", xmlReq.toString(), "jaxb-context", jaxbContext);</programlisting></para>
+        </listitem>
+
+        <listitem>
+          <para>Converting the Drools Endpoint XML response to
+          ExecutionResults</para>
+
+          <para>And the final step is convert the XML output to a
+          ExecutionResults</para>
+
+          <para><programlisting>ExecutionResults resp = (ExecutionResults) jaxbContext.createUnmarshaller().unmarshal(new ByteArrayInputStream(xmlOutput));</programlisting></para>
+
+          <para></para>
+        </listitem>
+      </orderedlist>
+
+      <para></para>
+
+      <note>
+        The XML output convertion is not required, but is recommended to have a more legible response output.
+      </note>
+
+      <para></para>
+    </section>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-API/Section-SendingMessagesExchanges.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/Section-Introduction.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/Section-Introduction.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/Section-Introduction.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section version="5.0" xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:svg="http://www.w3.org/2000/svg"
+         xmlns:m="http://www.w3.org/1998/Math/MathML"
+         xmlns:html="http://www.w3.org/1999/xhtml"
+         xmlns:db="http://docbook.org/ns/docbook">
+    <title>Introduction</title>
+
+    <para>The Apache Camel integration allow us interact with a Drools
+    Stateless or Stateful session through a pipeline. It simple works
+    transforming XML commands into executable commands and executing them. The
+    advantage of this integration is that Apache Camel brings the possibility
+    to implement more advanced enterprise integration patterns than a simple
+    transformation pipeline. This integration with Drools allow us to add any
+    of the current Camel components. Using any of the Apache Components you
+    could, for example, execute commands thats come an a JMS queue/Atom
+    Feed/Mina connection/a Mail/etc and send the execution result to any type
+    of supported components. As you can see, this brings a more powerful
+    connection scenario to implement Drools.</para>
+
+    <para></para>
+
+    <section>
+      <title>Architecture</title>
+
+      <para>&lt;insert architecture graphic here&gt;</para>
+
+      <para></para>
+    </section>
+
+    <section>
+      <title>Introduction to drools-grid</title>
+
+      <para>Camel integration is coupled with another drools module called:
+      drools-grid. This module allow us to interact with Drools sessions
+      independent of the JVM location. At this moment we can use two
+      implementations:</para>
+
+      <table>
+        <title>drools-grid implementations</title>
+
+        <tgroup cols="2">
+          <tbody>
+            <row>
+              <entry>Local</entry>
+
+              <entry>used when the drools session's and client's are in the
+              same JVM.</entry>
+            </row>
+
+            <row>
+              <entry>Remote</entry>
+
+              <entry>used when you've drools session's on a remote JVM. At
+              this moment is the only implementation is using Apache Min, but
+              we're going to add HornetQ support in the next release.</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </table>
+
+      <para></para>
+
+      <para>Drools Grid is embedded inside the Drools Camel component, so
+      don't worry about more implementation information because this should be
+      enough. With this information we can start to configure our Camel
+      Context.</para>
+
+      <para></para>
+    </section>
+
+</section>


Property changes on: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Camel/Section-Introduction/Section-Introduction.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Server/Chapter-Server.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Server/Chapter-Server.xml	2010-06-03 01:47:41 UTC (rev 33322)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Server/Chapter-Server.xml	2010-06-03 02:26:40 UTC (rev 33323)
@@ -8,6 +8,4 @@
          xmlns:db="http://docbook.org/ns/docbook">
   <title>Drools Execution Server</title>
 
-  <para>TODO</para>
-
 </chapter>



More information about the jboss-svn-commits mailing list