[jboss-svn-commits] JBL Code SVN: r34174 - in labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US: Chapter-BPMN2 and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 26 07:20:44 EDT 2010


Author: ge0ffrey
Date: 2010-07-26 07:20:44 -0400 (Mon, 26 Jul 2010)
New Revision: 34174

Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-API/Chapter-API.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-BPMN2/Chapter-BPMN2.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-DomainSpecificProcesses/Chapter-DomainSpecificProcesses.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Flow/Chapter-RuleFlow.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-GettingStarted/Chapter-GettingStarted.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-HumanTasks/Chapter-HumanTasks.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Persistence/Chapter-Persistence.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-RulesAndProcesses/Chapter-RulesAndProcesses.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Walkthrough/Chapter-Walkthrough.xml
Log:
JBRULES-2587 code highlighting java for drools-flow

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-API/Chapter-API.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-API/Chapter-API.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-API/Chapter-API.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -17,7 +17,7 @@
     one process definition, using a Knowledge Builder to add a resource, checking
     for errors and, finally, creating the Knowledge Base.</para>
 
-<programlisting>
+<programlisting role="JAVA">
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add(ResourceFactory.newClassPathResource("ruleflow.rf"), ResourceType.DRF);
 KnowledgeBuilderErrors errors = kbuilder.getErrors();
@@ -48,7 +48,7 @@
     is to create a session based on the earlier created Knowledge Base, and to start a
     process.</para>
 
-<programlisting>
+<programlisting role="JAVA">
 StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 ProcessInstance processInstance = ksession.startProcess("com.sample.ruleflow");
 </programlisting>
@@ -57,7 +57,7 @@
     for interacting with processes, as shown below.  Consult the Javadocs to get
     a detailed explanation for each of the methods.</para>
 
-<programlisting>
+<programlisting role="JAVA">
 ProcessInstance startProcess(String processId);
 ProcessInstance startProcess(String processId, Map&lt;String, Object&gt; parameters);
 void signalEvent(String type, Object event);
@@ -79,7 +79,7 @@
     to related information, like the process instance and node instance linked to
     the event.</para>
 
-<programlisting>
+<programlisting role="JAVA">
 public interface ProcessEventListener {
 
   void beforeProcessStarted( ProcessStartedEvent event );
@@ -117,7 +117,7 @@
     logger also requires the name of the log file to be created, and the threaded file
     logger requires the interval (in milliseconds) after which the events should be saved.</para>
 
-<programlisting>
+<programlisting role="JAVA">
 KnowledgeRuntimeLogger logger =
     KnowledgeRuntimeLoggerFactory.newFileLogger( ksession, "test" );
 // add invocations to the process engine here,

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-BPMN2/Chapter-BPMN2.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-BPMN2/Chapter-BPMN2.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-BPMN2/Chapter-BPMN2.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -302,7 +302,7 @@
 
   <para>The following code fragment shows you how to load a BPMN process into your knowledge base ...</para>
 
-  <programlisting>
+  <programlisting role="JAVA">
 private static KnowledgeBase readKnowledgeBase() throws Exception {
   KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
   kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);
@@ -311,7 +311,7 @@
 
   <para> ... and how to execute this process.</para>
 
-  <programlisting>
+  <programlisting role="JAVA">
 KnowledgeBase kbase = readKnowledgeBase();
 StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-DomainSpecificProcesses/Chapter-DomainSpecificProcesses.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-DomainSpecificProcesses/Chapter-DomainSpecificProcesses.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-DomainSpecificProcesses/Chapter-DomainSpecificProcesses.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -130,7 +130,7 @@
 
 <para>The Drools engine contains a WorkItemManager that is responsible for executing work items whenever necessary.  The WorkItemManager is responsible for delegating the work items to WorkItemHandlers that execute the work item and notify the WorkItemManager when the work item has been completed.  For executing notification work items, a NotificationWorkItemHandler should be created (implementing the WorkItemHandler interface):</para>
 
-<programlisting>
+<programlisting role="JAVA">
 package com.sample;
 
 import org.drools.process.instance.WorkItem;
@@ -163,7 +163,7 @@
 
 <para>WorkItemHandlers should be registered at the WorkItemManager, using the following API:</para>
 
-<programlisting>
+<programlisting role="JAVA">
   workingMemory.getWorkItemManager().registerWorkItemHandler(
     "Notification", new NotificationWorkItemHandler());
 </programlisting>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Flow/Chapter-RuleFlow.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Flow/Chapter-RuleFlow.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Flow/Chapter-RuleFlow.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -155,7 +155,7 @@
         <title>Example 1</title>
 
       <para>This is a simple example of a basic process with a ruleset node only:
-        <programlisting>
+        <programlisting role="JAVA">
 RuleFlowProcessFactory factory =
     RuleFlowProcessFactory.createProcess("org.drools.HelloWorldRuleSet");
 factory
@@ -210,7 +210,7 @@
         <title>Example 2</title>
 
       <para>This example is using Split and Join nodes:
-        <programlisting>
+        <programlisting role="JAVA">
 RuleFlowProcessFactory factory =
     RuleFlowProcessFactory.createProcess("org.drools.HelloWorldJoinSplit");
 factory
@@ -249,7 +249,7 @@
         <title>Example 3</title>
 
       <para>Now we show a more complex example with a ForEach node, where we have nested nodes:
-        <programlisting>
+        <programlisting role="JAVA">
 RuleFlowProcessFactory factory =
     RuleFlowProcessFactory.createProcess("org.drools.HelloWorldForeach");
 factory
@@ -307,7 +307,7 @@
       have a valid process, you can add the process to the Knowledge Base. Note
       that this is almost identical to adding rules to the Knowledge Base, except
       for the type of knowledge added:</para>
-      <programlisting>
+      <programlisting role="JAVA">
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newClassPathResource("MyProcess.rf"),
               ResourceType.DRF );</programlisting>
@@ -315,7 +315,7 @@
       than one process, and even rules), you should probably check whether the
       process (and rules) have been parsed correctly and write out any errors
       like this:</para>
-      <programlisting>
+      <programlisting role="JAVA">
 KnowledgeBuilderErrors errors = kbuilder.getErrors();
 if (errors.size() > 0) {
     for (KnowledgeBuilderError error: errors) {
@@ -325,7 +325,7 @@
 }</programlisting>
       <para>Next, you need to create the Knowledge Base that contains all the necessary
       processes (and rules) like this:</para>
-      <programlisting>
+      <programlisting role="JAVA">
 KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
 kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());</programlisting>
       </listitem>
@@ -337,7 +337,7 @@
       to start each of these.  To activate a particular process, you will need
       to start it by calling the <code>startProcess</code> method on your session.
       For example:
-      <programlisting>
+      <programlisting role="JAVA">
 StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 ksession.startProcess("com.sample.MyProcess");</programlisting>
       The parameter of the <code>startProcess</code> method represents the id
@@ -356,7 +356,7 @@
       of the process.</para>
 
       <para>You can also start a process from within a rule consequence, using
-      <programlisting>
+      <programlisting role="JAVA">
 kcontext.getKnowledgeRuntime().startProcess("com.sample.MyProcess");</programlisting>
       </para></listitem>
 
@@ -1150,11 +1150,11 @@
         </listitem>
         <listitem>Actions can access variables directly, simply by using the
         name of the variable as a parameter name.
-          <programlisting>
+          <programlisting role="JAVA">
 // call method on the process variable "person"
 person.setAge(10);</programlisting>
         Changing the value of a variable can be done through the Knowledge Context:
-          <programlisting>
+          <programlisting role="JAVA">
 kcontext.setVariable(variableName, value);</programlisting>
         </listitem>
         <listitem>WorkItem and SubFlow nodes can pass the value of parameters
@@ -1176,7 +1176,7 @@
     globally defined variables that are considered immutable with regard
     to rule evaluation, and data in the Knowledge Session.  The Knowledge Session
     can be accessed in actions using the Knowledge Context:</para>
-    <programlisting>
+    <programlisting role="JAVA">
 kcontext.getKnowledgeRuntime().insert( new Person(...) );</programlisting>
 
   </section>
@@ -1195,7 +1195,7 @@
         to the globals and variables defined in the process.  Here is an example
         of a valid Java code constraint, <code>person</code> being a variable
         in the process:
-          <programlisting>
+          <programlisting role="JAVA">
 return person.getAge() > 20;</programlisting>
 A similar example of a valid MVEL code constraint is:
           <programlisting>
@@ -1253,14 +1253,14 @@
         <listitem>Getting the current node instance (if applicable).  The node
         instance could be queried for data, such as its name and type.  You can
         also cancel the current node instance.
-        <programlisting>
+        <programlisting role="JAVA">
 NodeInstance node = context.getNodeInstance();
 String name = node.getNodeName();</programlisting>
         </listitem>
         <listitem>Getting the current process instance.  A process instance
         can be queried for data (name, id, processId, etc.), aborted or
         signalled an internal event.
-        <programlisting>
+        <programlisting role="JAVA">
 WorkflowProcessInstance proc = context.getProcessInstance();
 proc.signalEvent( type, eventObject );</programlisting>
         </listitem>
@@ -1324,11 +1324,11 @@
         action node, or an on-entry or on-exit action of some node) can signal the
         occurence of an internal event to the surrounding process instance, using code
         like the following:
-        <programlisting>
+        <programlisting role="JAVA">
 context.getProcessInstance().signalEvent(type, eventData);</programlisting></listitem>
         <listitem>External event: A process instance can be notified of an event
         from outside using code such as:
-        <programlisting>
+        <programlisting role="JAVA">
 processInstance.signalEvent(type, eventData);</programlisting></listitem>
         <listitem>External event using event correlation: Instead of notifying a
         process instance directly, it is also possible to have the engine
@@ -1338,7 +1338,7 @@
         listening to external events of some type is notified whenever such
         an event occurs. To signal such an event to the process engine, write
         code such as:
-        <programlisting>
+        <programlisting role="JAVA">
 workingMemory.signalEvent(type, eventData);</programlisting></listitem>
       </itemizedlist>
     </para>
@@ -1395,7 +1395,7 @@
     to respond to the given fault.  In most cases, the behavior that is
     needed to react to the given fault cannot be expressed in one action.
     It is therefore recommended to have the exception handler signal an
-    event of a specific type (in this case "Fault") using <programlisting>
+    event of a specific type (in this case "Fault") using <programlisting role="JAVA">
 context.getProcessInstance().signalEvent("FaultType", context.getVariable("FaultVariable");</programlisting>
     </para>
 
@@ -1458,7 +1458,7 @@
     logic calling <code>halt()</code> on the session.  The following
     code snippet shows how to do this.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 new Thread(new Runnable() {
   public void run() {
     ksession.fireUntilHalt();
@@ -1547,7 +1547,7 @@
     is simply the new node id in the node container (so no unique node id here, simply the new
     node id).  The following code snippet shows a simple example.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 // create the session and start the process "com.sample.ruleflow"
 KnowledgeBuilder kbuilder = ...
 StatefulKnowledgeSession ksession = ...

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-GettingStarted/Chapter-GettingStarted.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-GettingStarted/Chapter-GettingStarted.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-GettingStarted/Chapter-GettingStarted.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -236,7 +236,7 @@
       </listitem>
     </orderedlist>
 
-<programlisting>
+<programlisting role="JAVA">
 package com.sample;
 
 import org.drools.KnowledgeBase;

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-HumanTasks/Chapter-HumanTasks.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-HumanTasks/Chapter-HumanTasks.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-HumanTasks/Chapter-HumanTasks.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -236,7 +236,7 @@
       (org.drools.process.workitem.wsht.WSHumanTaskHandler in the 
       drools-process-task module) so you can easily link this
       work item handler like this:</para>
-      <programlisting>
+      <programlisting role="JAVA">
   StatefulKnowledgeSession session = ...;
   session.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());</programlisting>
       <para>By default, this handler will connect to the human task management component
@@ -256,7 +256,7 @@
       the implementation of the following methods for interacting with Human
       Tasks:</para>
 
-      <para><programlisting>
+      <para><programlisting role="JAVA">
 public void start( long taskId, String userId, TaskOperationResponseHandler responseHandler )
 public void stop( long taskId, String userId, TaskOperationResponseHandler responseHandler )
 public void release( long taskId, String userId, TaskOperationResponseHandler responseHandler )
@@ -301,7 +301,7 @@
       implement the correct action. A creation of one of this messages will be
       like this:</para>
 
-      <para><programlisting>
+      <para><programlisting role="JAVA">
 public void complete(long taskId,
                      String userId,
                      ContentData outputData,
@@ -345,7 +345,7 @@
       start it as a separate service as well.  To start the task server, you 
       can use the following code fragment:</para>
 
-      <programlisting>
+      <programlisting role="JAVA">
 EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.task");
 taskService = new TaskService(emf);
 MinaTaskServer server = new MinaTaskServer( taskService );

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Persistence/Chapter-Persistence.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Persistence/Chapter-Persistence.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Persistence/Chapter-Persistence.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -108,7 +108,7 @@
     environment.  The environment needs to contain a reference to your
     Entity Manager Factory.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 // create the entity manager factory and register it in the environment
 EntityManagerFactory emf =
     Persistence.createEntityManagerFactory( "org.drools.persistence.jpa" );
@@ -127,7 +127,7 @@
     <para>You can also yse the <code>JPAKnowledgeService</code> to recreate
     a session based on a specific session id:</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 // recreate the session from database using the sessionId
 ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, null, env );</programlisting>
 
@@ -199,7 +199,7 @@
     The following Java fragment could be used to set up this data source, where
     we are using the file-based H2 database.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 PoolingDataSource ds = new PoolingDataSource();
 ds.setUniqueName("jdbc/processInstanceDS");
 ds.setClassName("org.h2.jdbcx.JdbcDataSource");
@@ -220,7 +220,7 @@
     that was started in another session), as the runtime state is persisted safely in a database, and can be
     retrieved whenever necessary.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
   StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
   long processInstanceId = session.startProcess("org.drools.test.TestProcess").getId();
   session.dispose();</programlisting-->
@@ -240,7 +240,7 @@
     transaction manager.  Next, we use the Java Transaction API (JTA)
     to specify transaction boundaries, as shown below:</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 // create the entity manager factory and register it in the environment
 EntityManagerFactory emf =
     Persistence.createEntityManagerFactory( "org.drools.persistence.jpa" );
@@ -346,7 +346,7 @@
       <para>To log process history information in a database like this, you
       need to register the logger on your session (or working memory) like
       this:</para>
-      <programlisting>
+      <programlisting role="JAVA">
 StatefulKnowledgeSession ksession = ...;
 WorkingMemoryDbLogger logger = new WorkingMemoryDbLogger(ksession);
 

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-RulesAndProcesses/Chapter-RulesAndProcesses.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-RulesAndProcesses/Chapter-RulesAndProcesses.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-RulesAndProcesses/Chapter-RulesAndProcesses.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -381,7 +381,7 @@
       or a set of rules into the engine is very similar. Also, different
       rule implementations, such DRL or DSL, are handled in a uniform way.</para>
 
-      <programlisting>
+      <programlisting role="JAVA">
 private static KnowledgeBase createKnowledgeBase() throws Exception {
     KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
     kbuilder.add( ResourceFactory.newClassPathResource(

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Walkthrough/Chapter-Walkthrough.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Walkthrough/Chapter-Walkthrough.xml	2010-07-26 10:54:11 UTC (rev 34173)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-flow/src/main/docbook/en-US/Chapter-Walkthrough/Chapter-Walkthrough.xml	2010-07-26 11:20:44 UTC (rev 34174)
@@ -131,7 +131,7 @@
     event request.  The following code snippet shows how this looks.  For more detail on how to create
     the knowledge base and session, you can take a look at the source code in drools-examples.</para>
 
-<programlisting>public static final void main(String[] args) {
+<programlisting role="JAVA">public static final void main(String[] args) {
   try {
     // load up the knowledge base
     KnowledgeBase kbase = readKnowledgeBase();



More information about the jboss-svn-commits mailing list