[jboss-svn-commits] JBL Code SVN: r33426 - in labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands: Section-Commands and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jun 9 16:23:59 EDT 2010
Author: lucazamador
Date: 2010-06-09 16:23:58 -0400 (Wed, 09 Jun 2010)
New Revision: 33426
Modified:
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-API/Section-API.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-AbortWorkItemCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-BatchExecutionCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-Commands.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-CompleteWorkItemCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-FireAllRulesCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetGlobalCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectsCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertElementsCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertObjectCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-ModifyCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-QueryCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-RetractCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SetGlobalCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SignalEventCommand.xml
labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-StartProcessCommand.xml
Log:
JBRULES-2542: Drools Commands documentation
- added JAXB api & XML examples
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-API/Section-API.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-API/Section-API.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-API/Section-API.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -6,64 +6,121 @@
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>API</title>
- <title>API</title>
+ <para>XML marshalling/unmarshalling of the Drools Commands have to use
+ special classes that are going to be described in the next sections.</para>
- <para>XML marshalling/unmarshalling of the Drools Commands have to use
- special classes that are going to be described in the next
- sections.</para>
+ <section>
+ <title>XStream</title>
- <section>
- <title>XStream</title>
+ <para>To use the XStream commands marshaller you need to use the
+ DroolsHelperProvider to obtain a XStream instance. We need to use this
+ because has the commands converters registered.</para>
- <para>To use the XStream commands marshaller you need to use the
- DroolsHelperProvider to obtain a XStream instance. We need to use this
- because has the commands converters registered.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Marshalling</para>
- <itemizedlist>
- <listitem>
- <para>Marshalling</para>
+ <para>BatchExecutionHelperProviderImpl.newXStreamMarshaller().toXML(command);</para>
+ </listitem>
- <para>BatchExecutionHelperProviderImpl.newXStreamMarshaller().toXML(command);</para>
- </listitem>
+ <listitem>
+ <para>Unmarshalling</para>
- <listitem>
- <para>Unmarshalling</para>
+ <para>BatchExecutionHelperProviderImpl.newXStreamMarshaller().fromXML(xml)</para>
+ </listitem>
+ </itemizedlist>
- <para>BatchExecutionHelperProviderImpl.newXStreamMarshaller().fromXML(xml)</para>
- </listitem>
- </itemizedlist>
+ <para></para>
+ </section>
+ <section>
+ <title>JSON</title>
+
+ <para>JSON API to marshalling/unmarshalling is similar to XStream
+ API:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Marshalling</para>
+
+ <para>BatchExecutionHelper.newJSonMarshaller().toXML(command);</para>
+ </listitem>
+
+ <listitem>
+ <para>Unmarshalling</para>
+
+ <para>BatchExecutionHelper.newJSonMarshaller().fromXML(xml)</para>
+ </listitem>
+ </itemizedlist>
+
+ <para></para>
+ </section>
+
+ <section>
+ <title>JAXB</title>
+
+ <para>Using JAXB there are two options, you can define your model in a XSD
+ file or you can have a POJO model. In both cases you need to get a
+ JAXBContext that have your classes recognized, and it's why you need to
+ use Drools Helper classes. Once you have the JAXBContext you need to
+ create the Unmarshaller/Marshaller as you needs.</para>
+
+ <para></para>
+
+ <section>
+ <title>Using a XSD file to define the model</title>
+
+ <para>With your model defined in a XSD file you need to have a
+ KnowledgeBase that has your XSD model added as a resource.</para>
+
+ <para>To do this, the XSD file must be added as a XSD ResourceType into
+ the KnowledgeBuilder. Finally you can create the JAXBContext using the
+ KnowledgeBase created with the KnowledgeBuilder</para>
+
<para></para>
+
+ <para><programlisting>Options xjcOpts = new Options();
+xjcOpts.setSchemaLanguage(Language.XMLSCHEMA);
+JaxbConfiguration jaxbConfiguration = KnowledgeBuilderFactory.newJaxbConfiguration( xjcOpts, "xsd" );
+kbuilder.add(ResourceFactory.newClassPathResource("person.xsd", getClass()), ResourceType.XSD, jaxbConfiguration);
+KnowledgeBase kbase = kbuilder.newKnowledgeBase();
+
+List<String> classesName = new ArrayList<String>();
+classesName.add("org.drools.test.Person");
+
+JAXBContext jaxbContext = KnowledgeBuilderHelper.newJAXBContext(classesName.toArray(new String[classesName.size()]), kbase);</programlisting></para>
</section>
<section>
- <title>JSON</title>
+ <title>Using a POJO model</title>
- <para>The JSON API are similar to the XStream, you only need to know the
- next:</para>
+ <para>In this case you need to use DroolsJaxbContextHelper to create the
+ JAXBContext, this class has two parameters:</para>
- <itemizedlist>
+ <para></para>
+
+ <orderedlist>
<listitem>
- <para>Marshalling</para>
-
- <para>BatchExecutionHelper.newJSonMarshaller().toXML(command);</para>
+ <para>classNames: A List with the cannonical name of the classes
+ that you want to use in the marshalling/unmarshalling
+ process.</para>
</listitem>
<listitem>
- <para>Unmarshalling</para>
-
- <para>BatchExecutionHelper.newJSonMarshaller().fromXML(xml)</para>
+ <para>properties: JAXB custom properties</para>
</listitem>
- </itemizedlist>
+ </orderedlist>
<para></para>
- </section>
- <section>
- <title>JAXB</title>
+ <para><programlisting>List<String> classNames = new ArrayList<String>();
+classNames.add("org.drools.test.Person");
+JAXBContext jaxbContext = DroolsJaxbContextHelper.createDroolsJaxbContext(classNames, null);
+Marshaller marshaller = jaxbContext.createMarshaller();</programlisting></para>
- <para>TODO</para>
+ <para></para>
</section>
-
+ </section>
</section>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-AbortWorkItemCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-AbortWorkItemCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-AbortWorkItemCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -43,7 +43,6 @@
<entry>true</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -54,8 +53,7 @@
command.setLookup("ksession1");
AbortWorkItemCommand abortWorkItemCommand = new AbortWorkItemCommand();
abortWorkItemCommand.setWorkItemId(1001);
-command.getCommands().add(abortWorkItemCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(abortWorkItemCommand);</programlisting></para>
<para></para>
</listitem>
@@ -85,7 +83,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <abort-work-item id="1001"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-BatchExecutionCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-BatchExecutionCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-BatchExecutionCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -52,7 +52,6 @@
<entry>false</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -64,8 +63,7 @@
InsertObjectCommand insertObjectCommand = new InsertObjectCommand(new Person("john", 25));
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
command.getCommands().add(insertObjectCommand);
-command.getCommands().add(fireAllRulesCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(fireAllRulesCommand);</programlisting></para>
<para></para>
</listitem>
@@ -101,7 +99,16 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <insert>
+ <object xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>25</age>
+ <name>john</name>
+ </object>
+ </insert>
+ <fire-all-rules max="-1"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-Commands.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-Commands.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-Commands.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -72,8 +72,6 @@
</listitem>
</itemizedlist>
- <para></para>
-
<para><note>
In the next snippets code we are going to use a POJO org.drools.test.Person that have two fields
@@ -90,34 +88,68 @@
</note></para>
+ <para><note>
+ In the next examples, to marshall the commands we have used the nexts snippet codes:
+
+ <itemizedlist>
+ <listitem>
+ <para>XStream</para>
+
+ <para>
+ <programlisting>String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>JSON</para>
+
+ <para>
+ <programlisting>String xml = BatchExecutionHelper.newJSonMarshaller().toXML(command);</programlisting>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>JAXB</para>
+
+ <para>
+ <programlisting>Marshaller marshaller = jaxbContext.createMarshaller();
+StringWriter xml = new StringWriter();
+marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+marshaller.marshal(command, xml);</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+
+ </note></para>
+
<xi:include href="Section-BatchExecutionCommand.xml" />
-
+
<xi:include href="Section-InsertObjectCommand.xml" />
-
+
<xi:include href="Section-RetractCommand.xml" />
-
+
<xi:include href="Section-ModifyCommand.xml" />
-
+
<xi:include href="Section-GetObjectCommand.xml" />
-
+
<xi:include href="Section-InsertElementsCommand.xml" />
-
+
<xi:include href="Section-FireAllRulesCommand.xml" />
-
+
<xi:include href="Section-StartProcessCommand.xml" />
-
+
<xi:include href="Section-SignalEventCommand.xml" />
-
+
<xi:include href="Section-CompleteWorkItemCommand.xml" />
-
+
<xi:include href="Section-AbortWorkItemCommand.xml" />
-
+
<xi:include href="Section-QueryCommand.xml" />
-
+
<xi:include href="Section-SetGlobalCommand.xml" />
-
+
<xi:include href="Section-GetGlobalCommand.xml" />
-
+
<xi:include href="Section-GetObjectsCommand.xml" />
-
</section>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-CompleteWorkItemCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-CompleteWorkItemCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-CompleteWorkItemCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -50,7 +50,6 @@
<entry>false</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -61,8 +60,7 @@
command.setLookup("ksession1");
CompleteWorkItemCommand completeWorkItemCommand = new CompleteWorkItemCommand();
completeWorkItemCommand.setWorkItemId(1001);
-command.getCommands().add(completeWorkItemCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(completeWorkItemCommand);</programlisting></para>
<para></para>
</listitem>
@@ -92,7 +90,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <complete-work-item id="1001"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-FireAllRulesCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-FireAllRulesCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-FireAllRulesCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -71,8 +71,9 @@
<para>Command creation<programlisting>BatchExecutionCommand command = new BatchExecutionCommand();
command.setLookup("ksession1");
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
-command.getCommands().add(fireAllRulesCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+fireAllRulesCommand.setMax(10);
+fireAllRulesCommand.setOutIdentifier("firedActivations");
+command.getCommands().add(fireAllRulesCommand);</programlisting></para>
<para></para>
</listitem>
@@ -85,8 +86,9 @@
<para>XStream</para>
<para><programlisting><batch-execution lookup="ksession1">
- <fire-all-rules/>
-</batch-execution></programlisting></para>
+ <fire-all-rules max="10" outIdentifier="firedActivations"/>
+</batch-execution>
+</programlisting></para>
<para></para>
</listitem>
@@ -94,7 +96,7 @@
<listitem>
<para>JSON</para>
- <para><programlisting>{"batch-execution":{"lookup":"ksession1","commands":{"fire-all-rules":""}}} </programlisting></para>
+ <para><programlisting>{"batch-execution":{"lookup":"ksession1","commands":{"fire-all-rules":{"max":10,"outIdentifier":"firedActivations"}}}}</programlisting></para>
<para></para>
</listitem>
@@ -102,7 +104,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <fire-all-rules outIdentifier="firedActivations" max="10"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetGlobalCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetGlobalCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetGlobalCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -52,7 +52,6 @@
<entry>false</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -64,8 +63,7 @@
GetGlobalCommand setGlobalCommand = new GetGlobalCommand();
setGlobalCommand.setIdentifier("helper");
setGlobalCommand.setOutIdentifier("helperOutput");
-command.getCommands().add(setGlobalCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(setGlobalCommand);</programlisting></para>
<para></para>
</listitem>
@@ -95,7 +93,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <get-global out-identifier="helperOutput" identifier="helper"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -52,7 +52,6 @@
<entry>false</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -64,8 +63,7 @@
GetObjectCommand getObjectCommand = new GetObjectCommand();
getObjectCommand.setFactHandleFromString("123:234:345:456:567");
getObjectCommand.setOutIdentifier("john");
-command.getCommands().add(getObjectCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(getObjectCommand);</programlisting></para>
<para></para>
</listitem>
@@ -96,7 +94,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <get-object out-identifier="john" factHandle="0:234:345:456:567"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectsCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectsCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-GetObjectsCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -53,7 +53,6 @@
<entry>false</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -63,8 +62,7 @@
<para>Command creation<programlisting>BatchExecutionCommand command = new BatchExecutionCommand();
command.setLookup("ksession1");
GetObjectsCommand getObjectsCommand = new GetObjectsCommand();
-command.getCommands().add(getObjectsCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(getObjectsCommand);</programlisting></para>
<para></para>
</listitem>
@@ -94,7 +92,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <get-objects/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertElementsCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertElementsCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertElementsCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -74,8 +74,7 @@
objects.add(new Person("john", 25));
objects.add(new Person("sarah", 35));
insertElementsCommand.setObjects(objects);
-command.getCommands().add(insertElementsCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(insertElementsCommand);</programlisting></para>
<para></para>
</listitem>
@@ -114,7 +113,19 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <insert-elements returnObject="true">
+ <objects xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>25</age>
+ <name>john</name>
+ </objects>
+ <objects xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>35</age>
+ <name>sarah</name>
+ </objects>
+ </insert-elements>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertObjectCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertObjectCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-InsertObjectCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -71,8 +71,7 @@
InsertObjectCommand insertObjectCommand = new InsertObjectCommand(new Person("john", 25));
insertObjectCommand.setOutIdentifier("john");
insertObjectCommand.setReturnObject(false);
-command.getCommands().add(insertObjectCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(insertObjectCommand);</programlisting></para>
<para></para>
</listitem>
@@ -108,7 +107,15 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <insert out-identifier="john">
+ <object xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>25</age>
+ <name>john</name>
+ </object>
+ </insert>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-ModifyCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-ModifyCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-ModifyCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -52,7 +52,6 @@
<entry>true</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -66,8 +65,7 @@
List<Setter> setters = new ArrayList<Setter>();
setters.add(new SetterImpl("age", "30"));
modifyCommand.setSetters(setters);
-command.getCommands().add(modifyCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(modifyCommand);</programlisting></para>
<para></para>
</listitem>
@@ -97,7 +95,12 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <modify factHandle="0:234:345:456:567">
+ <set value="30" accessor="age"/>
+ </modify>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-QueryCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-QueryCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-QueryCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -72,8 +72,7 @@
QueryCommand queryCommand = new QueryCommand();
queryCommand.setName("persons");
queryCommand.setOutIdentifier("persons");
-command.getCommands().add(queryCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(queryCommand);</programlisting></para>
<para></para>
</listitem>
@@ -103,7 +102,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <query name="persons" out-identifier="persons"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-RetractCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-RetractCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-RetractCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -58,21 +58,19 @@
<para><programlisting>BatchExecutionCommand command = new BatchExecutionCommand();
command.setLookup("ksession1");
-InsertObjectCommand insertObjectCommand = new InsertObjectCommand(new Person("john", 25));
-FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
-command.getCommands().add(insertObjectCommand);
-command.getCommands().add(fireAllRulesCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+RetractCommand retractCommand = new RetractCommand();
+retractCommand.setFactHandleFromString("123:234:345:456:567");
+command.getCommands().add(retractCommand);</programlisting></para>
</listitem>
<listitem>
- <para>Create the Fact Handle from a string</para>
+ <para>Set the Fact Handle that you got when the object was
+ inserted</para>
<para><programlisting>BatchExecutionCommand command = new BatchExecutionCommand();
command.setLookup("ksession1");
RetractCommand retractCommand = new RetractCommand(factHandle);
-command.getCommands().add(retractCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(retractCommand);</programlisting></para>
</listitem>
</orderedlist>
@@ -104,7 +102,10 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <retract factHandle="0:234:345:456:567"/>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SetGlobalCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SetGlobalCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SetGlobalCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -78,9 +78,8 @@
command.setLookup("ksession1");
SetGlobalCommand setGlobalCommand = new SetGlobalCommand();
setGlobalCommand.setIdentifier("helper");
-setGlobalCommand.setObject(new Object());
-command.getCommands().add(setGlobalCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+setGlobalCommand.setObject(new Person("kyle", 30));
+command.getCommands().add(setGlobalCommand);</programlisting></para>
<para></para>
</listitem>
@@ -94,7 +93,10 @@
<para><programlisting><batch-execution lookup="ksession1">
<set-global identifier="helper">
- <object/>
+ <org.drools.test.Person>
+ <name>kyle</name>
+ <age>30</age>
+ </org.drools.test.Person>
</set-global>
</batch-execution></programlisting></para>
@@ -104,7 +106,7 @@
<listitem>
<para>JSON</para>
- <para><programlisting>{"batch-execution":{"lookup":"ksession1","commands":{"set-global":{"identifier":"helper","object":{"object":""}}}}} </programlisting></para>
+ <para><programlisting>{"batch-execution":{"lookup":"ksession1","commands":{"set-global":{"identifier":"helper","object":{"org.drools.test.Person":{"name":"kyle","age":30}}}}}}</programlisting></para>
<para></para>
</listitem>
@@ -112,7 +114,15 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <set-global out="false" identifier="helper">
+ <object xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>30</age>
+ <name>kyle</name>
+ </object>
+ </set-global>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SignalEventCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SignalEventCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-SignalEventCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -69,8 +69,7 @@
SignalEventCommand signalEventCommand = new SignalEventCommand();
signalEventCommand.setEventType("start");
signalEventCommand.setEvent(new Person("john", 25));
-command.getCommands().add(signalEventCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(signalEventCommand);</programlisting></para>
<para></para>
</listitem>
@@ -105,7 +104,15 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <signal-event event-type="start" process-instance-id="-1">
+ <event xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <age>25</age>
+ <name>john</name>
+ </event>
+ </signal-event>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-StartProcessCommand.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-StartProcessCommand.xml 2010-06-09 19:36:22 UTC (rev 33425)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-integration/src/main/docbook/en-US/Chapter-Commands/Section-Commands/Section-StartProcessCommand.xml 2010-06-09 20:23:58 UTC (rev 33426)
@@ -71,8 +71,7 @@
command.setLookup("ksession1");
StartProcessCommand startProcessCommand = new StartProcessCommand();
startProcessCommand.setProcessId("org.drools.task.processOne");
-command.getCommands().add(startProcessCommand);
-String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);</programlisting></para>
+command.getCommands().add(startProcessCommand);</programlisting></para>
<para></para>
</listitem>
@@ -102,7 +101,12 @@
<listitem>
<para>JAXB</para>
- <para><programlisting>TODO</programlisting></para>
+ <para><programlisting><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<batch-execution lookup="ksession1">
+ <start-process processId="org.drools.task.processOne">
+ <parameter/>
+ </start-process>
+</batch-execution></programlisting></para>
<para></para>
</listitem>
More information about the jboss-svn-commits
mailing list