[jbpm-commits] JBoss JBPM SVN: r3038 - in jbpm4/trunk/modules: api/src/main/resources and 17 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 21 10:59:34 EST 2008


Author: tom.baeyens at jboss.com
Date: 2008-11-21 10:59:34 -0500 (Fri, 21 Nov 2008)
New Revision: 3038

Added:
   jbpm4/trunk/modules/api/src/main/resources/
   jbpm4/trunk/modules/api/src/main/resources/cfg.xsd
   jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
   jbpm4/trunk/modules/devguide/src/
   jbpm4/trunk/modules/devguide/src/main/
   jbpm4/trunk/modules/devguide/src/main/diagrams/
   jbpm4/trunk/modules/devguide/src/main/diagrams/diagrams.mdzip
   jbpm4/trunk/modules/devguide/src/main/diagrams/images.ppt
   jbpm4/trunk/modules/devguide/src/main/docbook/
   jbpm4/trunk/modules/devguide/src/main/docbook/en/
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/apis.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch04.execution.states.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch09.persistent.process.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.definition.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.execution.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/composite.node.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait1.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait2.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait3.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.concurrency.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.archive.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.end.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.evaluate.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/initial.in.composite.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/interceptors.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.db.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.execution.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.ab.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.anatomy.classes.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.automatic.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.loan.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.propagate.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.structure.classes.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/self.transition.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transactions.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.inheritence.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.into.composite.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.out.of.composite.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.inner.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.outer.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch07-Variables.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Timers.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch09-AsynchronousContinuations.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch10-SoftwareLogging.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Environment.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml
   jbpm4/trunk/modules/userguide/src/
   jbpm4/trunk/modules/userguide/src/main/
   jbpm4/trunk/modules/userguide/src/main/diagrams/
   jbpm4/trunk/modules/userguide/src/main/diagrams/diagrams.mdzip
   jbpm4/trunk/modules/userguide/src/main/diagrams/images.ppt
   jbpm4/trunk/modules/userguide/src/main/docbook/
   jbpm4/trunk/modules/userguide/src/main/docbook/en/
   jbpm4/trunk/modules/userguide/src/main/docbook/en/images/
   jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Environments.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Removed:
   jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.xsd
   jbpm4/trunk/modules/pvm/src/main/resources/org/jbpm/pvm/wire.xsd
Log:
jbpm-configuration and userguide-devguide split

Added: jbpm4/trunk/modules/api/src/main/resources/cfg.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/cfg.xsd	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/resources/cfg.xsd	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,1350 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        targetNamespace="http://jbpm.org/xsd/cfg"
+        xmlns:tns="http://jbpm.org/xsd/cfg"
+        elementFormDefault="qualified">
+        
+  <annotation>
+    <documentation>Schema for the jBPM configuration file; configuration
+    is the top level element.
+    </documentation>
+  </annotation>
+
+  <!-- ### ELEMENTS ######################################################## -->
+
+  <element name="business-calendar">
+    <annotation><documentation>A BusinessCalendar that knows about working hours</documentation></annotation>
+    <complexType>
+      <sequence>
+        <element name="monday"    type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="tuesday"   type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="wednesday" type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="thursday"  type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="friday"    type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="saturday"  type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="sunday"    type="tns:businessCalendarDayType" minOccurs="0"/>
+        <element name="holiday" minOccurs="0" maxOccurs="unbounded">
+          <complexType>
+            <attribute name="period">
+              <annotation><documentation>Two dates in date-format, separated by 
+              a dash that specify a holiday period.  If it's just one day, a single day 
+              is also valid.</documentation></annotation>
+            </attribute>
+          </complexType>
+        </element>
+      </sequence>
+      <attribute name="timezone" type="string">
+        <annotation><documentation>Optional specification of the timezone as specified by 
+        java.util.TimeZone.getTimeZone(String)</documentation></annotation>
+      </attribute>
+      <attribute name="hour-format" type="string" default="HH:mm">
+        <annotation><documentation>Indicates how to interpret the hour specifications 
+        in this business calendar in java.text.SimpleDateFormat(String)</documentation></annotation>
+      </attribute>
+      <attribute name="date-format" type="string" default="dd/MM/yyyy">
+        <annotation><documentation>Indicates how to interpret the date specifications 
+        in this business calendar in java.text.SimpleDateFormat(String)</documentation></annotation>
+      </attribute>
+    </complexType>
+  </element>
+
+  <element name="byte">
+    <annotation><documentation>A java.lang.Byte</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" type="byte" use="required" />
+	  </complexType>
+  </element>
+
+  <element name="char">
+    <annotation><documentation>A java.lang.Character</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" use="required">
+	      <simpleType>
+	        <restriction base="string">
+	          <maxLength value="1" />
+	        </restriction>
+	      </simpleType>
+	    </attribute>
+	  </complexType>
+  </element>
+  
+  <element name="class">
+    <annotation><documentation>A java.lang.Class</documentation></annotation>
+		<complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+		  <attribute name="init" type="tns:initType" default="lazy">
+		    <annotation><documentation>Specifies when and how this object should be 
+		    created and initialized. Default is lazy.</documentation></annotation>
+		  </attribute>
+		  <attribute name="class-name" use="required" type="string">
+		    <annotation><documentation>A fully qualified name of a
+		      class that can be found on the wire context classpath or 
+		      (if that is not specified) on the current thread's context 
+		      classpath.  
+		    </documentation></annotation>
+		  </attribute>
+		</complexType>
+  </element>
+  
+  <element name="context-ref">
+    <annotation><documentation>The context.  This refers to
+    the environment, process-engine or the wire context.
+    </documentation></annotation>
+    <complexType>
+      <attribute name="context-name" type="string">
+        <annotation><documentation>The name of the context in the current 
+        environment.  If this attribute is omitted, the enclosing 
+        context will be given. 
+        </documentation></annotation>
+      </attribute>
+    </complexType>
+  </element>
+
+  <element name="jbpm-configuration">
+    <annotation><documentation>Defines an environment factory and 
+    an environment.
+    </documentation></annotation>
+    <complexType>
+      <sequence>
+        <element ref="tns:process-engine" />
+        <element ref="tns:environment" />
+      </sequence>
+    </complexType>
+  </element>
+
+  <element name="process-engine" type="tns:contextType">
+    <annotation><documentation>Defines the environment factory 
+    context.  (Aka application context)
+    </documentation></annotation>
+  </element>
+
+  <element name="environment" type="tns:contextType">
+    <annotation><documentation>Defines the environment 
+    context.  This context exists stretches for the duration of 
+    an Environment try-finally block.
+    </documentation></annotation>
+  </element>
+
+  <element name="deployer-manager">
+    <annotation><documentation>Has a list of deployers (org.jbpm.deploy.Deployer) 
+    for each process language for handling deployments.  
+    </documentation></annotation>
+	  <complexType>
+	    <choice maxOccurs="unbounded">
+	    	<element name="language">
+		      <annotation><documentation>A process language that contains 
+		      a list of deployers</documentation></annotation>
+	    	  <complexType>
+	    	    <choice maxOccurs="unbounded">
+	    	      <group ref="tns:deployers" />
+	    	    </choice>
+	          <attribute name="name" type="string" use="required" />
+	          <attribute name="extension" type="string" />
+	    	  </complexType>
+	    	</element>
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      created and initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="resource" type="string">
+	      <annotation><documentation>Imports contents of the document element 
+	      of all resource files (using deep scan ClassLoader.getResources(String)) 
+	      as content into this element.
+	      </documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+
+  <element name="double">
+    <annotation><documentation>A java.lang.Double</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" type="double" use="required" />
+	  </complexType>
+  </element>
+
+  <element name="environment-ref">
+    <annotation><documentation>Obtains the current environment.  The environment 
+    is only available in objects declared inside the environment context.  So it 
+    can't be used inside the session-factory context. 
+    </documentation></annotation>
+  </element>
+
+  <element name="process-engine-ref">
+    <annotation><documentation>Obtains the current environment.  The environment 
+    is only available in objects declared inside the environment context.  So it 
+    can't be used inside the session-factory context. 
+    </documentation></annotation>
+  </element>
+
+  <element name="false">
+    <annotation><documentation>java.lang.Boolean.FALSE 
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="float">
+    <annotation><documentation>A java.lang.Float
+    </documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" type="float" use="required" />
+	  </complexType>
+  </element>
+  
+  <element name="hibernate-configuration" type="tns:hibernateConfigurationType">
+    <annotation><documentation>A hibernate Configuration to be used in the 
+    process-engine context</documentation></annotation>
+  </element>
+  
+  <element name="hibernate-session">
+    <annotation><documentation>A hibernate Session to be used in the 
+    environment context</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>Optional name of this hibernate session.
+	      Typically a session is looked up by type.  Only if multiple sessions 
+	      are declared, a name can be used to distinct them. 
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="factory" type="string">
+	      <annotation><documentation>Optional name referring to the session-factory.
+	      If no factory name is provided, the SessionFactory is looked up by type.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="tx" type="tns:booleanValueType">
+	      <annotation><documentation>Indicates if a hibernate transaction should 
+	      be started and ended in this environment.  Default is true.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="current" type="tns:booleanValueType">
+	      <annotation><documentation>Indicates if the SessionFactory.getCurrentSession()
+	      should be used instead of opening and closing a new session.  Default is false.
+	      If 'current' is set to true, then the default of 'close' will be set to false. 
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="close" type="tns:booleanValueType">
+	      <annotation><documentation>Indicates if the session should be closed when the
+	      environment closes.  The default is true (unless 'current' is set to true) 
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="standard-transaction" type="string">
+	      <annotation><documentation>Optional name of the standard transaction.
+	      If 'tx' is set to true, a StandardTransaction needs to be found to enlist 
+	      this hibernate session.  By default, the lookup of the StandardTransaction 
+	      is done by type.  But this attribute allows to refer to the standard 
+	      transaction by name.   
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="connection" type="string">
+	      <annotation><documentation>Optional name of the JDBC connection to use 
+	      when creating this hibernate session.  If no connection name is specified,
+	      the creation of the connection is left to the hibernate session.
+	      </documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+  
+  <element name="hibernate-session-factory">
+    <annotation><documentation>A hibernate SessionFactory to be used in the 
+    process-engine context.  The hibernate Configuration can be inlined in this 
+    'session-factory', it can be refered by type or referred by name.
+    </documentation></annotation>
+	  <complexType>
+	    <complexContent>
+	      <extension base="tns:hibernateConfigurationType">
+	        <attribute name="configuration" type="string">
+			      <annotation><documentation>The name of the configuration to use to build 
+			      this hibernate SessionFactory.  This is optional as the alternative methods 
+			      to specify a configuration are just inlining it here in this hibernate 
+			      session-factory element or looking up the hibernate Configuration by type.
+			      </documentation></annotation>
+			    </attribute>
+	      </extension>
+	    </complexContent>
+	  </complexType>
+  </element>
+  
+  <element name="int">
+    <annotation><documentation>A java.lang.Integer
+    </documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" type="int" use="required"/>
+	  </complexType>
+  </element>
+  
+  <element name="jndi">
+    <annotation><documentation>A lookup from JNDI through the InitialContext
+    </documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="jndi-name" type="string" use="required" />
+	  </complexType>
+  </element>
+  
+  <element name="job-db-session">
+    <annotation><documentation>A hibernate based JobDbSession</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="session" type="string" />
+	  </complexType>
+  </element>
+  
+  <element name="job-executor">
+    <annotation><documentation>The default component for executing timers and messages.
+    A job-executor requires a CommandService.  
+    </documentation></annotation>
+		<complexType>
+		  <attribute name="name" type="string">
+		    <annotation><documentation>Optional name of this object used to look up 
+		    this object from the environment.  This name (along with ip-address) is 
+        used as the basis for the names of the threads in the job executor's thread 
+		    pool.  So when you're running more then one job-executor on the same 
+		    machine, you should be specifying custom job executor names.</documentation></annotation>
+		  </attribute>
+		  <attribute name="init" type="tns:initType" default="lazy">
+		    <annotation><documentation>Specifies when and how this object should be 
+		    initialized. Default is lazy.</documentation></annotation>
+		  </attribute>
+		  <attribute name="command-service" type="string">
+		    <annotation><documentation>Optional name of the command service to use.  If 
+		    this attribute is not present, the command service will be looked up 
+		    by type.</documentation></annotation>
+		  </attribute>
+		  <attribute name="threads" type="int">
+		    <annotation><documentation>Number of worker threads.  One extra thread will 
+		    be created for scanning and acquisition of jobs (DispatcherThread).</documentation></annotation>
+		  </attribute>
+		  <attribute name="idle" type="int">
+		    <annotation><documentation>Number of milliseconds the dispatcher thread  
+		    will normally wait inbetween checks for new jobs.  Each time an exception
+		    occurs, the idle period will be doubled until the 'idle-max' is reached.
+		    This is a back-off mechanism in case the job executor can't access the 
+		    database. 
+		    </documentation></annotation>
+		  </attribute>
+		  <attribute name="idle-max" type="int">
+		    <annotation><documentation>Maxumum number of milliseconds the dispatcher thread  
+		    will wait inbetween checks for new jobs.  
+		    </documentation></annotation>
+		  </attribute>
+		  <attribute name="history" type="int">
+		    <annotation><documentation>Number of history records of job executions that will be 
+		    kept in memory.</documentation></annotation>
+		  </attribute>
+		  <attribute name="lock" type="int">
+		    <annotation><documentation>Number of milliseconds that a job will be locked at 
+		    acquisition time.  When a job is acquired, the job executor will write it's name 
+		    in the lock owner field of the job and the lockExpirationTime
+		    will be set to the current time plus 'lock' milliseconds.  The lock by that thread should 
+		    be considered as released if the lockExpirationTime has passed.  This prevents starvation 
+		    in case one of more JobExecutors in a cluster would die.</documentation></annotation>
+		  </attribute>
+		  <attribute name="auto-start" type="tns:booleanValueType">
+		    <annotation><documentation>Indicates if the job-executor should be started when it 
+		    is created.  Default is true.  If the job-executor is not auto-started, it can be 
+		    started programmatically with the start method on the JobExecutor.</documentation></annotation>
+		  </attribute>
+		</complexType>
+  </element>
+
+  <element name="job-test-helper">
+    <annotation><documentation>A test helper for controlling job executions</documentation></annotation>
+  </element>
+
+  <element name="list">
+    <annotation><documentation>A java.util.List</documentation></annotation>
+	  <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <group ref="tns:persistableDescriptors" />
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      created and initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="class" type="string" default="java.util.ArrayList">
+	      <annotation><documentation>Implementation class for this list.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
+	      <annotation><documentation>Indicates if this collection should be synchronized
+	      with Collections.synchronizedList(List)</documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+  
+  <element name="long">
+    <annotation><documentation>A java.lang.Long</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="value" type="long" use="required"/>
+	  </complexType>
+  </element>
+  
+  <element name="map">
+    <annotation><documentation>A java.util.Map</documentation></annotation>
+	  <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <element name="entry">
+	        <complexType>
+	          <choice minOccurs="0">
+	            <element name="key" minOccurs="0">
+	              <complexType>
+	                <group ref="tns:persistableDescriptors" />
+	              </complexType>
+	            </element>
+	            <element name="value" minOccurs="0">
+	              <complexType>
+	                <group ref="tns:persistableDescriptors" />
+	              </complexType>
+	            </element>
+	          </choice>
+	        </complexType>
+	      </element>
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      created and initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="class" type="string" default="java.util.HashMap">
+	      <annotation><documentation>Implementation class for this map.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
+	      <annotation><documentation>Indicates if this collection should be synchronized
+	      with Collections.synchronizedMap(Map)</documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+  
+  <element name="message-session">
+    <annotation><documentation>Specifies an implementation of the MessageSession 
+    interface that sends messages to the JobExecutor.  The main usage of MessageSession 
+    is by the PVM implementation for asynchronous continuations.  The PVM will look 
+    up the message session by type.  All message-session implementations depend on a 
+    DbSession like e.g. the 'pvm-db-session'.  A DbSession will be looked up by type.
+    </documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="target" type="tns:messageSessionTargetType" default="job-executor">
+	      <annotation><documentation>
+	      <p>Specifies the implementation of the message session.
+	      </p>  
+	      <p><code><b>job-executor</b></code>: Is the default and sends to messages to the 
+	      job-executor.  In this case the message session has a dependency on 
+	      a DbSession (like the PvmDbSession) and a Transaction to which the 
+	      message session will register a listener to notify the job executor upon 
+	      successfull completion.
+	      </p>
+	      <p><code><b>jms</b></code>: Sends the messages over JMS and a JMS listener is assumed 
+	      (like the command executor MDB) that executes the message.  If 'jms' is specified, 
+	      attributes 'session-jndi' and 'destination-jndi' become required.
+	      </p>
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="session-jndi" type="string" use="optional">
+	      <annotation><documentation>The JNDI name of the JMS Session.  Only used in case of
+	      target <b>jms</b>. </documentation></annotation>
+	    </attribute>
+	    <attribute name="destination-jndi" type="string" use="optional">
+	      <annotation><documentation>The JNDI name of the Queue destination to use. Only used 
+	      in case of target <b>jms</b>.</documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+
+  <element name="null">
+    <annotation><documentation>the null value 
+    </documentation></annotation>
+  </element>
+  
+  <element name="object">
+    <annotation><documentation>Any java object that will be created by reflection.                                                                        .
+    <p>There are three main ways to create an object: by constructor or by a factory 
+    object or a static factory method.</p>
+    <p><b>Using the constructor</b>: Then the <code>class</code> attribute must provide the 
+    fully qualified class name.  In case another constructor then the default is 
+    targetted, a <code>constructor</code> child element can be provided.
+    The <code>factory</code> attribute should not be provided for using a constructor. 
+    </p>
+    <p><b>Using a factory</b>: Then the <code>factory</code> attribute or one 
+    <code>factory</code> element must be provided along with the attribute 
+    <code>method</code>. 
+    </p>
+    <p><b>Using a static factory method</b>: Then the <code>class</code> and 
+    <code>method</code> attributes should be specified.  There should be no 
+    reference to a <code>factory</code> attribute of element. 
+    </p>
+    <p><b>Construction and initialization</b>: all objects (constructor and factory)
+    are build in two phases: construction and initialisation phase.  During construction
+    all is done until a pointer is obtained to the object.  In initialisation, operations 
+    are applied to the object until it is ready to be used.  The separation between 
+    construction and initialisation is made to allow for bidirectional references.  In 
+    that case, at least one of both ends can not be fully initialised before it is injected 
+    into the other end.
+    </p>
+    <p><b>Operations</b>: after construction, various operations can be applied to objects 
+    like e.g. direct field injection, injection through setters, method invocation, 
+    enlist with the standard transaction, subscribe the object as a listener to an observable  
+    </p>
+    <p><b>Arguments</b>: There are two different places for arguments.  The <code>arg</code> 
+    elements for the factory method invocation should be placed as child elements under the 
+    <code>object</code> element.  The <code>arg</code> elements for the constructor should be 
+    placed as child elements under the <code>constructor</code> element.    
+    </p>
+    </documentation></annotation>
+	  <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <element name="factory">
+	        <annotation><documentation>Contains one element that describes the factory object.</documentation></annotation>
+	        <complexType>
+	          <group ref="tns:persistableDescriptors" />
+	        </complexType>
+	      </element>
+	      <element name="constructor">
+	        <annotation><documentation>Specifies the arguments to use for a non-default constructor.</documentation></annotation>
+	        <complexType>
+	          <choice maxOccurs="unbounded">
+	            <element name="arg" type="tns:argType" />
+	          </choice>
+	        </complexType>
+	      </element>
+	      <element name="arg" type="tns:argType">
+	        <annotation><documentation>The factory method arguments.</documentation></annotation>
+	      </element>
+	      <group ref="tns:operations" />
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="class" type="string">
+	      <annotation><documentation>The fully qualified class name</documentation></annotation>
+	    </attribute>
+	    <attribute name="factory" type="string">
+	      <annotation><documentation>The name of the factory object</documentation></annotation>
+	    </attribute>
+	    <attribute name="method" type="string">
+	      <annotation><documentation>The factory method name</documentation></annotation>
+	    </attribute>
+	    <attribute name="auto-wire" type="string">
+	      <annotation><documentation>Indicates if the member fields and setter properties 
+	      should be automatically wired based on matching the property names and types with the 
+	      object names and types</documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+
+  <element name="process-service">
+    <annotation><documentation>The default process service implementation 
+    that delegates method implementations to a CommandService.  process-service 
+    depends on a command service.
+    </documentation></annotation>
+  </element>
+  
+  <element name="properties">
+    <annotation><documentation>A java.util.Properties</documentation></annotation>
+	  <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <element name="property">
+	        <complexType>
+	          <attribute name="name" type="string" use="required" />
+	          <attribute name="value" type="string" use="required" />
+	        </complexType>
+	      </element>
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="file" type="string">
+	      <annotation><documentation>A file on the file system</documentation></annotation>
+	    </attribute>
+	    <attribute name="resource" type="string">
+	      <annotation><documentation>A file as a resource in the classpath</documentation></annotation>
+	    </attribute>
+	    <attribute name="url" type="string">
+	      <annotation><documentation>the contents is fetched by loading a url</documentation></annotation>
+	    </attribute>
+	    <attribute name="is-xml" type="tns:booleanValueType">
+	      <annotation><documentation>optionally indicates if the content of referenced file in attributes
+	      'file', 'resource' or 'url' is XML.  The default is the 
+	      plain properties format with a space or the equals character (=) separating key and value on 
+	      each line.</documentation></annotation>
+	    </attribute>
+	  </complexType>
+  </element>
+
+  <element name="pvm-db-session">
+    <annotation><documentation>A hibernate based PvmDbSession</documentation></annotation>
+	  <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="session" type="string" />
+	  </complexType>
+  </element>
+
+  <element name="ref">
+    <annotation><documentation>A reference to another object by name</documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="object" type="string" use="required">
+	      <annotation><documentation>The name of the referred object</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="set">
+    <annotation><documentation>A java.util.Set 
+    </documentation></annotation>
+    <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <group ref="tns:persistableDescriptors" />
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="class" type="string" default="java.util.HashList">
+	      <annotation><documentation>Implementation class for this set.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
+	      <annotation><documentation>Indicates if this collection should be synchronized
+	      with Collections.synchronizedSet(Set)</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="short">
+    <annotation><documentation>a java.lang.Short
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+      <attribute name="value" type="short" use="required"/>
+    </complexType>
+  </element>
+
+  <element name="command-service">
+    <annotation><documentation>The command service for usage in standard  
+    Java environments.
+    </documentation></annotation>
+    <complexType>
+	    <choice minOccurs="0" maxOccurs="unbounded">
+	      <group ref="tns:interceptors" />
+	    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="string">
+    <annotation><documentation>a java.lang.String 
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+    <attribute name="value" type="string" use="required"/>
+    </complexType>
+  </element>
+
+  <element name="timer-session">
+    <annotation><documentation>A timer session is used during process execution to create 
+    timers.  Different implementations of the timer service make the process portable 
+    over different environments. 
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="target" default="job-executor">
+	      <annotation><documentation>Specifies the target implementation.  Use 
+	      <code>job-executor</code> when the job executor is responsible for executing the 
+	      timers (default).  Use <code>ejb</code> in case the EJB Timer Service should be used.
+	      If the target is job-executor, there is a dependency on the transaction, the job-executor
+	      and a job-db-session. 
+	      </documentation></annotation>
+	      <simpleType>
+	        <restriction base="string">
+	          <enumeration value="job-executor" />
+	          <enumeration value="ejb" />
+	        </restriction>
+	      </simpleType>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="transaction">
+    <annotation><documentation>The transaction binding.  Specifies how the transaction in the 
+    pvm environment gets bound to the actual transaction in the real environment.  
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="target" default="standard">
+	      <annotation><documentation>The real transaction to be wrapped.  Use <code>standard</code>
+	      in standard environments and enterprise in enterprise environments.  In case of the 
+	      <code>enterprise</code> target, the <code>jndi</code> name of the user transaction and 
+	      the <code>manage</code> attribute can optionally be specified. 
+	      </documentation></annotation>
+	      <simpleType>
+	        <restriction base="string">
+	          <enumeration value="standard" />
+	          <enumeration value="enterprise" />
+	        </restriction>
+	      </simpleType>
+	    </attribute>
+	    <attribute name="jndi" type="string" default="java:comp/UserTransaction">
+	      <annotation><documentation>The jndi name of the user transaction  
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="manage" type="tns:booleanValueType" default="false">
+	      <annotation><documentation>Indicates if the user transaction be controlled (=managed) 
+	      by the environment.  
+	      </documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="transaction-ref">
+    <annotation><documentation>Reference to the org.jbpm.pvm.api.env.Transaction in the 
+    current environment. 
+    </documentation></annotation>
+  </element>
+
+  <element name="true">
+    <annotation><documentation>java.lang.Boolean.TRUE 
+    </documentation></annotation>
+    <complexType>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <element name="variable-types">
+    <annotation><documentation>Specifies automatic variable type resolution, transforming 
+    variable values of any java class into their persistable format.  When the 
+    type of a variable needs to be automatically detected.  Each of the type elements will 
+    be scanned in order.  When the type matches, it is used to store the value. 
+    </documentation></annotation>
+    <complexType>
+      <choice minOccurs="0" maxOccurs="unbounded">
+        <element name="type">
+          <complexType>
+            <choice>
+              <element name="matcher">
+                <annotation><documentation>Alternative to the <code>class</code> attribute to 
+                specify the matcher for this type.</documentation></annotation>
+                <complexType>
+          	      <group ref="tns:allDescriptors" />
+                </complexType>
+              </element>
+            </choice>
+				    <attribute name="name" type="string">
+				      <annotation><documentation>The name of the type is optional.  It's used when 
+				      users declare variables in the process.</documentation></annotation>
+				    </attribute>
+				    <attribute name="class" type="string">
+				      <annotation><documentation>Specifies a matcher based on the class of the 
+				      object.  The java class name of the values that will be 
+				      stored in this type.  Apart from Java class names following literals can be 
+				      used as well:
+				      <p><b><code>persistable</code></b>: Matches when the class of the object is 
+				      known by the hibernate-session-factory so that a generic reference (any-mapping)
+				      can be created to the persistable object.  If <code>class="persistable"</code>
+				      the attribute <code>id-type</code> becomes required. 
+				      </p>
+				      <p><b><code>serializable</code></b>: Matches if the object implements the 
+				      java.io.Serializable interface. 
+				      </p>
+				      <p>If no <code>class</code> is provided, a matcher can also be specified 
+				      as a separate child element.</p>
+				      </documentation></annotation>
+				    </attribute>
+				    <attribute name="hibernate-session-factory" type="string">
+				      <annotation><documentation>The name of the hibernate-session-factory. Only 
+				      required if <code>class="persistable"</code> is used and if there is more then 
+				      one hibernate session factory specified in the environment.
+				      </documentation></annotation>
+				    </attribute>
+				    <attribute name="id-type">
+				      <annotation><documentation>The type of the id property in the persistable object. 
+				      </documentation></annotation>
+				      <simpleType>
+				        <restriction base="string">
+				          <enumeration value="long" />
+				          <enumeration value="string" />
+				        </restriction>
+				      </simpleType>
+				    </attribute>
+				    <attribute name="converter" type="string">
+				      <annotation><documentation>The class name of the converter.  The converter must implement 
+				      the Converter interface and have a default constructor</documentation></annotation>
+				    </attribute>
+				    <attribute name="variable-class" type="string" use="required">
+				      <annotation><documentation>The class name of the variable class.  The variable class must be 
+				      a sub class of Variable and must have a default constructor.</documentation></annotation>
+				    </attribute>
+          </complexType>
+        </element>
+      </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>The name of the object.  It's optional and serves 
+	      as an id to refer to this object from other object declarations.  This name can 
+	      also be used lookup the object programmatically.</documentation></annotation>
+	    </attribute>
+	    <attribute name="init" type="tns:initType" default="lazy">
+	      <annotation><documentation>Specifies when and how this object should be 
+	      initialized. Default is lazy.</documentation></annotation>
+	    </attribute>
+	    <attribute name="file" type="string">
+	      <annotation><documentation>Imports variable types from a file.  All the 
+	      top level elements of the root document element are imported.</documentation></annotation>
+	    </attribute>
+	    <attribute name="url" type="string">
+	      <annotation><documentation>Imports variable types from a URL.  All the 
+	      top level elements of the root document element are imported.</documentation></annotation>
+	    </attribute>
+	    <attribute name="resource" type="string">
+	      <annotation><documentation>Imports variable types from a resource.  All the 
+	      top level elements of the root document element are imported.</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+
+  <!-- ### COMPLEX TYPES ################################################### -->
+
+  <complexType name="argType">
+    <annotation><documentation>The method arguments.
+    Each 'arg' element should have exactly one child element 
+    that represents the value of the argument.
+    </documentation></annotation>
+    <attribute name="type" type="string">
+      <annotation><documentation>The java class name representing 
+      the type of the method.  This is optional and can be used to 
+      indicate the appropriate method in case of method overloading. 
+      </documentation></annotation>
+    </attribute>
+  </complexType>
+  
+  <complexType name="contextType">
+    <annotation><documentation>A context is a set of object 
+    descriptions.
+    </documentation></annotation>
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <group ref="tns:allDescriptors" />
+    </choice>
+  </complexType>
+
+  <complexType name="hibernateConfigurationType">
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <element name="mappings">
+        <annotation><documentation>Imports mapping file references from the 
+        referenced resource files</documentation></annotation>
+        <complexType>
+          <attribute name="resource" type="string">
+            <annotation><documentation>Import mapping references from a resource file.
+            The full classpath is scanned for all the resource 
+            files of the given name.  All mapping elements that are found as the content in 
+            the top level document element will be imported for all of the resource files 
+            found on the classpath with that name. </documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+      <element name="mapping">
+        <annotation><documentation>Imports a hibernate mapping file</documentation></annotation>
+        <complexType>
+          <attribute name="resource" type="string">
+            <annotation><documentation>Adds the referenced resource file as a mapping 
+            file to the hibernate configuration</documentation></annotation>
+          </attribute>
+          <attribute name="file" type="string">
+            <annotation><documentation>Adds the referenced file as a mapping 
+            file to the hibernate configuration</documentation></annotation>
+          </attribute>
+          <attribute name="class" type="string">
+            <annotation><documentation>Adds the resource file that matches the given class 
+            name as a mapping file to the hibernate configuration. Matching means 
+            .hbm.xml instead of .java</documentation></annotation>
+          </attribute>
+          <attribute name="url" type="string">
+            <annotation><documentation>Adds file supplied by the URL as a mapping 
+            file to the hibernate configuration</documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+      <element ref="tns:properties" />
+      <element name="cache-configuration">
+        <complexType>
+          <choice minOccurs="0" maxOccurs="unbounded">
+            <element name="class-cache">
+              <annotation><documentation>Persistent class for which hibernate should 
+              activate its second level cache</documentation></annotation>
+              <complexType>
+                <attribute name="class">
+                  <annotation><documentation>Fully qualified classname</documentation></annotation>
+                </attribute>
+              </complexType>
+            </element>
+            <element name="collection-cache">
+              <annotation><documentation>Persistent collection for which hibernate should 
+              activate its second level cache</documentation></annotation>
+              <complexType>
+                <attribute name="collection">
+                  <annotation><documentation>Fully qualified classname, a dot (.) and 
+                  then the property name of the collection</documentation></annotation>
+                </attribute>
+              </complexType>
+            </element>
+          </choice>
+          <attribute name="usage" type="tns:hibernateCacheUsageType">
+            <annotation><documentation>The caching strategy. see hibernate 
+            docs for more info.</documentation></annotation>
+          </attribute>
+          <attribute name="file" type="string">
+            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
+          </attribute>
+          <attribute name="resource" type="string">
+            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
+          </attribute>
+          <attribute name="url" type="string">
+            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+    </choice>
+	    <attribute name="name" type="string">
+	      <annotation><documentation>Optional name of this hibernate session factory.
+	      Typically a session factory is looked up by type.  Only if multiple sessions 
+	      are declared, a name can be used to distinct them. 
+	      </documentation></annotation>
+	    </attribute>
+    <attribute name="init" type="tns:initType" default="lazy">
+      <annotation><documentation>Specifies when and how this object should be 
+      initialized. Default is lazy.</documentation></annotation>
+    </attribute>
+    <attribute name="class" type="string">
+      <annotation><documentation>Optional class of the hibernate configuration.  
+      By default org.hibernate.cfg.Configuration will be used.  This can be used 
+      to specify e.g. an AnnotationConfiguration.</documentation></annotation>
+    </attribute>
+    <attribute name="schema-operation" type="tns:hibernateSchemaOperationType">
+      <annotation><documentation>Optional schema operation to be applied when 
+      this configuration has been created.  By default, no schema operation will 
+      be applied.</documentation></annotation>
+    </attribute>
+  </complexType>
+
+  <complexType name="businessCalendarDayType">
+    <attribute name="hours" type="string">
+      <annotation><documentation>The working hours of this day.  Day parts are separated 
+      with 'and'.  Begin and end hours are separated by '-'.  E.g:
+      9:00-12:00 and 12:30-17:00
+      </documentation></annotation>
+    </attribute>
+  </complexType>
+  
+
+
+  <!-- ### SIMPLE VALUE TYPES ############################################## -->
+
+  <simpleType name="booleanValueType">
+    <restriction base="string">
+      <enumeration value="true" />
+      <enumeration value="on" />
+      <enumeration value="enabled" />
+      <enumeration value="false" />
+      <enumeration value="off" />
+      <enumeration value="disabled" />
+    </restriction>
+  </simpleType>
+
+  <simpleType name="hibernateSchemaOperationType">
+    <restriction base="string">
+      <enumeration value="update" />
+      <enumeration value="create" />
+    </restriction>
+  </simpleType>
+  
+  <simpleType name="hibernateCacheUsageType">
+    <restriction base="string">
+      <enumeration value="read-only" />
+      <enumeration value="nonstrict-read-write" />
+      <enumeration value="read-write" />
+      <enumeration value="transactional" />
+    </restriction>
+  </simpleType>
+  
+  <simpleType name="initType">
+    <annotation><documentation>Specifies when and how this object should be 
+      initialized. Default is lazy.
+      
+      <p><code><b>lazy</b></code>: The object is only created when it is asked for.  
+        In case of transitive dependencies, the object might not yet be initialized.
+      </p>
+         
+      <p><code><b>eager</b></code>: The object is created when the context is created.  
+        In case of transitive dependencies, the object might not yet be initialized.
+      </p>
+        
+      <p><code><b>eager</b></code>: The object is created when the context is created.  
+        In case of transitive dependencies, the initialization is also mandatory.
+      </p>
+        
+      <p><code><b>eager</b></code>: The object is only created when it is asked for.  
+        In case of transitive dependencies, initialization is mandatory.  
+      </p>
+     </documentation></annotation>
+    <restriction base="string">
+      <enumeration value="lazy" />
+      <enumeration value="eager" />
+      <enumeration value="immediate" />
+      <enumeration value="required" />
+    </restriction>
+  </simpleType>
+
+  <simpleType name="messageSessionTargetType">
+    <restriction base="string">
+      <enumeration value="job-executor" />
+      <enumeration value="jms" />
+      <enumeration value="test" />
+    </restriction>
+  </simpleType>
+  
+  
+  <!-- ### GROUPS ########################################################## -->
+
+  <group name="persistableDescriptors">
+    <choice>
+      <element ref="tns:byte" />
+      <element ref="tns:char" />
+      <element ref="tns:class" />
+      <element ref="tns:context-ref" />
+      <element ref="tns:double" />
+      <element ref="tns:environment-ref" />
+      <element ref="tns:process-engine-ref" />
+      <element ref="tns:false" />
+      <element ref="tns:float" />
+      <element ref="tns:int" />
+      <element ref="tns:jndi" />
+      <element ref="tns:list" />
+      <element ref="tns:long" />
+      <element ref="tns:map" />
+      <element ref="tns:message-session" />
+      <element ref="tns:null" />
+      <element ref="tns:object" />
+      <element ref="tns:pvm-db-session" />
+      <element ref="tns:properties" />
+      <element ref="tns:ref" />
+      <element ref="tns:set" />
+      <element ref="tns:short" />
+      <element ref="tns:string" />
+      <element ref="tns:timer-session" />
+      <element ref="tns:transaction-ref" />
+      <element ref="tns:true" />
+    </choice>
+  </group>
+  
+  <group name="allDescriptors">
+    <choice>
+      <group ref="tns:persistableDescriptors" />
+      <element ref="tns:business-calendar" />
+      <element ref="tns:process-service" />
+      <element ref="tns:deployer-manager" />
+      <element ref="tns:hibernate-configuration" />
+      <element ref="tns:hibernate-session-factory" />
+      <element ref="tns:hibernate-session" />
+      <element ref="tns:job-executor" />
+      <element ref="tns:job-test-helper" />
+      <element ref="tns:command-service" />
+      <element ref="tns:transaction" />
+      <element ref="tns:variable-types" />
+    </choice>
+  </group>
+  
+  <group name="interceptors">
+    <choice>
+		  <element name="environment-interceptor">
+		    <annotation><documentation>Interceptor that can be used as part of declaring 
+		    a command service. 
+		    </documentation></annotation>
+		  </element>
+		  <element name="retry-interceptor">
+		    <annotation><documentation>Interceptor that retries the method invocation in 
+		    case of exceptions. 
+		    </documentation></annotation>
+		    <complexType>
+		      <attribute name="retries" default="3">
+		        <annotation><documentation>Max number of attempts before giving up</documentation></annotation>
+		      </attribute>
+		      <attribute name="delay" default="50">
+		        <annotation><documentation>Delay in milliseconds after the first exception</documentation></annotation>
+		      </attribute>
+		      <attribute name="delay-factor" default="4">
+		        <annotation><documentation>Factor with which the delay is multiplied after subsequent 
+		        failed attempts.  This enables back-off to reduce load in case of repetitive failures.
+		        </documentation></annotation>
+		      </attribute>
+		    </complexType>
+		  </element>
+		  <element name="transaction-interceptor">
+		    <annotation><documentation>Interceptor that will make sure the transaction is initialized before each 
+		    invocation and it will issue a setRollbackOnly on the transaction in case an exception occors. 
+		    </documentation></annotation>
+		  </element>
+    </choice>
+  </group>
+
+  <group name="deployers">
+    <choice>
+      <element name="create-process">
+        <annotation><documentation>Deployer that can instantiate the 
+	      process definition of a given type. 
+	      </documentation></annotation>
+	      <complexType>
+  		    <attribute name="name" type="string" />
+	  	    <attribute name="class" type="string" use="required"/>
+		    </complexType>
+      </element>
+      <element name="check-version">
+        <annotation><documentation>Deployer checks if the version of the 
+        deployed process is exactly 1 more then the last version of the same 
+        process.   If a version already exists, it is left untouched.  
+        If no version exists, by default, this deployer will assign 
+        a version to the process definition that is 1 higher then the 
+        highest deployed version in the DB for that process name.  This 
+        default can be overridden by the 'assign' attribute. 
+        </documentation></annotation>
+        <complexType>
+          <attribute name="assign" default="true">
+            <annotation><documentation>In case there the process definition 
+            has not be given a version explicitely, this attribute specifies 
+            if this deployer should assign a version.  The assigned version 
+            will be 1 higher then the highest version in the db for processes
+            with the same name.  Starting with 1 if no similarly named procses 
+            definitions are found.  
+            </documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+      <element name="create-id">
+        <annotation><documentation>Deployer verifies if the version of the 
+        deployed process is exactly 1 more then the last version of the same 
+        process. 
+        </documentation></annotation>
+      </element>
+      <element name="save-process">
+        <annotation><documentation>Deployer that saves the process with
+        the PvmDbSession. 
+	      </documentation></annotation>
+      </element>
+    </choice>
+  </group>
+
+  <group name="operations">
+    <choice>
+      <element name="enlist">
+        <annotation><documentation>Enlists this object (assumes a org.jbpm.tx.Resource) with the current org.jbpm.tx.StandardTransaction</documentation></annotation>
+        <complexType>
+			    <attribute name="transaction" type="string">
+			      <annotation><documentation>Optional reference to the name of the 
+			      standard transaction.  If no transaction name is specified, the transaction 
+			      is looked up by type in the environment.
+			      </documentation></annotation>
+			    </attribute>
+        </complexType>
+      </element>
+      <element name="field">
+        <annotation><documentation>Injects a value into a member field of this object.
+        Exactly one child element must specify the value.
+        </documentation></annotation>
+        <complexType>
+          <group ref="tns:persistableDescriptors" />
+          <attribute name="name">
+            <annotation><documentation>The member field name</documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+		  <element name="invoke">
+		    <annotation><documentation>Invokes a method</documentation></annotation>
+			  <complexType>
+			    <choice minOccurs="0" maxOccurs="unbounded">
+			      <element name="arg" type="tns:argType" />
+			    </choice>
+			    <attribute name="method" type="string" use="required">
+			      <annotation><documentation>the method name</documentation></annotation>
+			    </attribute>
+			  </complexType>
+		  </element>
+		  <element name="subscribe">
+		    <annotation><documentation>Subscribes this object to an observable</documentation></annotation>
+			  <complexType>
+			    <choice minOccurs="0" maxOccurs="unbounded">
+			      <element name="arg" type="tns:argType" />
+			    </choice>
+			    <attribute name="context" type="string">
+			      <annotation><documentation>The context in which to find the observable.  If not specified, 
+			      the context of this object will be taken.  If no observable object names are specified, the 
+			      context object itself will be used as the observable.</documentation></annotation>
+			    </attribute>
+			    <attribute name="to" default="object-events">
+			      <annotation><documentation>Indicates if this object is interested in the events fired by 
+			      the object itself (object-events) or in the wire events fired by the wire context 
+			      (wire-events).</documentation></annotation>
+			      <simpleType>
+			        <restriction base="string">
+			          <enumeration value="wire-events" />
+			          <enumeration value="object-events" />
+			        </restriction>
+			      </simpleType>
+			    </attribute>
+			    <attribute name="event" type="string">
+			      <annotation><documentation>A single event.  See 'events' for more information.</documentation></annotation>
+			    </attribute>
+			    <attribute name="events" type="string">
+			      <annotation><documentation>Comma separated list of events to listen to, filtering out all other events.  
+			      If no events are specified or if the '*' wildcard is specified, the object will be notified of all events.
+			      </documentation></annotation>
+			    </attribute>
+			    <attribute name="object" type="string">
+			      <annotation><documentation>A single object name.  See 'objects' for more information.</documentation></annotation>
+			    </attribute>
+			    <attribute name="objects" type="string">
+			      <annotation><documentation>Comma separated list of object names to listen to.  
+			      If no objects are specified the specified context will be used as the observable.
+			      </documentation></annotation>
+			    </attribute>
+			    <attribute name="method" type="string">
+			      <annotation><documentation>Name of the method to invoke.  If no method is specified, it is assumed that the 
+			      object implements the Listener interface.  Nested 'arg' elements can be used to provide arguments
+			      in the method invocation. 
+			      </documentation></annotation>
+			    </attribute>
+			  </complexType>
+		  </element>
+    </choice>
+  </group>
+
+</schema>
\ No newline at end of file

Added: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,615 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        targetNamespace="http://jbpm.org/xsd/jpdl"
+        xmlns:tns="http://jbpm.org/xsd/jpdl"
+        elementFormDefault="qualified"
+        attributeFormDefault="qualified">
+        
+  <annotation>
+    <documentation>Schema for jPDL 4 process descriptions; 
+    element process is the top level element.
+      
+      TODO: Add node pluggability.  (add the proper any's and 
+            anyAttributes)
+    
+      TODO: Pull up expression.  The expression element in the 
+            delegation group can be pulled up as an expression 
+            attribute in each use case of the delegationGroup
+    
+      TODO: Should automatic activities have timers?  That makes sense
+            in a transient scenario, but not in a transactional scenario.
+            Same comment holds for asynchronous continuations
+    
+      TODO: Is it a good idea to move blocking and signalling to the API ?
+    
+      TODO: Figure out task reuse (requires templating and parameters) 
+            and dynamic task creation (requires tasks to be declared by name
+            in the process definition and that from the API tasks can be 
+            easily instantiated.   
+            
+      TODO: Investigate if object-refs to centrally defined objects would 
+            add value over inline defined objects.
+    </documentation>
+  </annotation>
+
+  <!-- ### PROCESS DEFINITION ############################################# -->
+  
+  <element name="process">
+    <annotation><documentation>A jPDL process definition description; This 
+    is the top level element in a jPDL process file.</documentation></annotation>
+    <complexType>
+      <sequence minOccurs="0" maxOccurs="unbounded">
+        <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded"/>
+        <!-- 
+        <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+          <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+        </element>
+        <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+         -->
+      </sequence>
+      <attribute name="name" use="required" type="string">
+        <annotation><documentation>The process name.  Multiple processes can 
+        be deployed with the same name, as long as they have a different 
+        version.</documentation></annotation>
+      </attribute>
+      <attribute name="version" type="int">
+        <annotation><documentation>Indicates the sequence number of this 
+        version for all processes with the same name.  By specifying a version
+        automatic deployment can figure out if this process is already deployed 
+        or not.
+        </documentation></annotation>
+      </attribute>
+      <attribute name="g" type="string">
+        <annotation><documentation>Graphical information used by designer tool.
+        </documentation></annotation>
+      </attribute>
+    </complexType>
+  </element>
+  
+  <!-- ### ACTIVITIES ##################################################### -->
+  
+  <group name="activityGroup">
+    <choice>
+      <!-- ~~~ START ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+      <element name="start">
+        <annotation><documentation>Start event
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+
+      <!-- ~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+      <element name="end">
+        <annotation><documentation>End event.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+          <attribute name="ends" default="process-instance">
+            <simpleType>
+              <restriction base="string">
+                <enumeration value="execution"/>
+                <enumeration value="process-instance"/>
+              </restriction>
+            </simpleType>
+          </attribute>
+        </complexType>
+      </element>
+      
+      <!-- ~~~ STATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+      <element name="state">
+        <annotation><documentation>A wait state.  When an execution arrives in this 
+        activity, the execution will wait until an external trigger is received 
+        with execution.signal() or execution.getActivityInstance().signal()
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+            <!-- 
+            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+            -->
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+
+      <!-- ~~~ EXCLUSIVE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+      <element name="exclusive">
+        <annotation><documentation>Exclusive gayteway: selects one path out of many alternatives.  
+        When an execution comes in, exactly one outgoing flow is taken.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+    
+      <!-- 
+      <element name="fork">
+        <annotation><documentation>Spawns multiple concurrent paths of 
+        execution.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+    
+      <element name="join">
+        <annotation><documentation>Spawns multiple concurrent paths of 
+        execution.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+    
+      <element name="process-state">
+        <annotation><documentation>Waits while a sub process instance is 
+        being executed and continues when the sub process instance ends.
+        </documentation></annotation>
+        < ! - - take into account the following situation:
+        Unlike in jBPM 3, a process-state should not signal the newly created 
+        process instance.  The signal in jBPM 3 is probably historically there 
+        because in the beginning there was no initial attribute on the process
+        definition.
+        - - >
+        <complexType>
+          <sequence>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+
+      <element name="super-state">
+        <annotation><documentation>Scope enclosing a number of nodes.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+    
+      <element name="activity">
+        <annotation><documentation>Executes an activity implementation.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+            <group ref="tns:delegationGroup"/>
+            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+            </element>
+          </sequence> 
+          <attributeGroup ref="tns:nodeAttributes" />
+        </complexType>
+      </element>
+      
+      <element name="invoke">
+        <annotation><documentation>Invokes a method on a java object
+        </documentation></annotation>
+        <complexType>
+          <complexContent>
+            <extension base="tns:invokeType">
+              <sequence>
+                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+                </element>
+              </sequence>
+              <attributeGroup ref="tns:nodeAttributes" />
+            </extension>
+          </complexContent>
+        </complexType>
+      </element>
+      
+      <element name="script">
+        <annotation><documentation>Evaluates a piece of text as a script
+        </documentation></annotation>
+        <complexType>
+          <complexContent>
+            <extension base="tns:scriptType">
+              <sequence>
+                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+                </element>
+              </sequence>
+              <attributeGroup ref="tns:nodeAttributes" />
+            </extension>
+          </complexContent>
+        </complexType>
+      </element>
+      
+      <element name="email">
+        <annotation><documentation>Sends an email
+        </documentation></annotation>
+        <complexType>
+          <complexContent>
+            <extension base="tns:emailType">
+              <sequence>
+                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+                </element>
+              </sequence>
+              <attributeGroup ref="tns:nodeAttributes" />
+            </extension>
+          </complexContent>
+        </complexType>
+      </element>
+      
+      <element name="task">
+        <annotation><documentation>Creates a human task
+        </documentation></annotation>
+        <complexType>
+          <complexContent>
+            <extension base="tns:taskType">
+              <sequence>
+                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
+                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+                </element>
+                <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+              </sequence>
+              <attributeGroup ref="tns:nodeAttributes" />
+            </extension>
+          </complexContent>
+        </complexType>
+      </element>
+      -->
+    </choice>
+  </group>
+
+  <attributeGroup name="nodeAttributes">
+    <attribute name="name" type="string">
+      <annotation><documentation>The id of this activity.  The name should be unique
+      in the complete scope of the process.</documentation></annotation>
+    </attribute>
+    <attribute name="g" type="string">
+      <annotation><documentation>Graphical information used by process designer tool.
+      </documentation></annotation>
+    </attribute>
+  </attributeGroup>
+  
+  <complexType name="flowType">
+    <annotation><documentation>The outgoing flows.  The first in the list 
+      will be the default outgoing flow.
+    </documentation></annotation>
+    <!-- 
+    <sequence>
+      <group ref="tns:eventListenerGroup" />
+    </sequence>
+    -->
+    <attribute name="name" type="string">
+      <annotation><documentation>Name of this outgoing flow</documentation></annotation>
+    </attribute>
+    <attribute name="to" type="string">
+      <annotation><documentation>Name of the destination node of this flow. 
+      </documentation></annotation>
+    </attribute>
+    <attribute name="g" type="string">
+      <annotation><documentation>Graphical information used by process designer tool.
+      </documentation></annotation>
+    </attribute>
+  </complexType>
+  
+  <element name="flow" type="tns:flowType">
+    <annotation><documentation>A flow from one node to another.</documentation></annotation>
+  </element>
+  
+  <element name="on">
+    <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
+    <complexType>
+      <!-- 
+      <sequence>
+        <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
+          <annotation><documentation>A list of event listeners that will 
+          be notified when the event is fired</documentation></annotation>
+        </group>
+      </sequence>
+      -->
+      <attribute name="event" type="string">
+        <annotation><documentation>The event identification
+        </documentation></annotation>
+      </attribute>
+    </complexType>
+  </element>
+  
+  <!-- 
+
+  <group name="eventListenerGroup">
+    <choice>
+      <element name="notify">
+        <annotation><documentation>Calls the notify method on an 
+        EventListener.
+        </documentation></annotation>
+        <complexType>
+          <group ref="tns:delegationGroup" />
+          <attribute name="object" type="string">
+            <annotation><documentation>The reference to an object that is declared 
+            in the objects section of this process definition.
+            </documentation></annotation>
+          </attribute>
+          <attribute name="expr" type="string">
+            <annotation><documentation>The expression that will resolve to 
+            an Activity implementation.</documentation></annotation>
+          </attribute>
+        </complexType>
+      </element>
+      <element name="invoke" type="tns:invokeType">
+        <annotation><documentation>Invokes a method on a Java object
+        through reflection.  The return value can be captured in a 
+        process variable.
+        </documentation></annotation>
+      </element>
+      <element name="script" type="tns:scriptType">
+        <annotation><documentation>Evaluates a piece of text as a script
+        </documentation></annotation>
+      </element>
+      <element name="email" type="tns:emailType">
+        <annotation><documentation>Sends an email
+        </documentation></annotation>
+      </element>
+      <element ref="tns:timer">
+        <annotation><documentation>Creates a timer.
+        </documentation></annotation>
+      </element>
+    </choice>
+  </group>
+
+  <group name="delegationGroup">
+    <choice>
+      <element name="object">
+        <annotation><documentation>A java object that will be obtained by using 
+        the constructor through reflection or through a factory method.</documentation></annotation>
+        <complexType>
+          <attribute name="class" type="string" />
+        </complexType>
+      </element>
+      <element name="jndi">
+        <complexType>
+          <attribute name="name" type="string" />
+        </complexType>
+      </element>
+      <element name="expr">
+        <complexType>
+          <attribute name="text" type="string" use="required"/>
+          <attribute name="language" type="string" />
+        </complexType>
+      </element>
+    </choice>
+  </group>
+  
+  <complexType name="invokeType">
+    <sequence>
+      <group ref="tns:delegationGroup">
+        <annotation><documentation>The object on which the method 
+        will be invoked</documentation></annotation>
+      </group>
+      <element name="arg" minOccurs="0" maxOccurs="unbounded">
+        <annotation><documentation>Arguments passed into the method 
+        invocation.</documentation></annotation>
+      </element>
+    </sequence>
+    <attribute name="method" type="string" use="required">
+      <annotation><documentation>The name of the method to invoke.
+      </documentation></annotation>
+    </attribute>
+  </complexType>
+
+  <complexType name="scriptType">
+    <sequence>
+      <element name="expr" type="string">
+        <annotation><documentation>The content of this expression element 
+        is the script text that will be evaluated.  This is mutually 
+        exclusive with the expression attribute.</documentation></annotation>
+      </element>
+    </sequence>
+    <attribute name="expr" type="string">
+      <annotation><documentation>The script text that will be evaluated.  This 
+      is mutually exclusive with the expression element.
+      </documentation></annotation>
+    </attribute>
+    <attribute name="lang" type="string">
+      <annotation><documentation>Identification of the scripting language 
+      to use.</documentation></annotation>
+    </attribute>
+  </complexType>
+
+  <complexType name="emailType">
+    <sequence>
+      <element name="property">
+        <annotation><documentation>Template property value</documentation></annotation>
+        <complexType>
+          <attribute name="name" type="string" />
+          <attribute name="value" type="string" />
+        </complexType>
+      </element>
+    </sequence>
+    <attribute name="to" type="string" />
+    <attribute name="type" type="string">
+      <annotation><documentation>Reference to the email template</documentation></annotation>
+    </attribute>
+  </complexType>
+
+  <element name="timer">
+    <annotation><documentation>A timer that will be bound to the most inner enclosing scope.
+    Timers can give a signal to an activity instance.  The signal will correspond to a flow 
+    or to an event being fired.
+    </documentation></annotation>
+    <complexType>
+      <choice minOccurs="0" maxOccurs="unbounded">
+        <group ref="tns:eventListenerGroup">
+          <annotation><documentation>An inline list of event listeners 
+          on a timer is a short cut for defining the event separately.
+          </documentation></annotation>
+        </group>
+      </choice>
+      <attribute name="duedate" type="string" use="required" />
+      <attribute name="signal" type="string"  use="required">
+        <annotation><documentation>Refers to the signal that will be used.
+        If inline event listeners are declared, the signal name can not be 
+        the same as an event that is declared in this scope.
+        </documentation></annotation>
+      </attribute>
+      <attribute name="repeat" type="string" />
+    </complexType>
+  </element>
+
+  <complexType name="taskType">
+    <sequence>
+      <element ref="tns:assignment" />
+      <element name="reminder">
+        <complexType>
+          <attribute name="duedate" type="string" use="required" />
+          <attribute name="repeat" type="string" />
+        </complexType>
+      </element>
+      <element ref="tns:subtask" />
+    </sequence>
+    <attribute name="title" type="string">
+    </attribute>
+    <attribute name="form" type="string">
+    </attribute>
+    <attribute name="swimlane" type="string">
+    </attribute>
+    <attribute name="description" type="string" />
+    <attribute name="duedate" type="string" />
+    <attribute name="priority" type="tns:priorityType" default="normal" />
+    <attribute name="notify" type="boolean" default="false"/>
+    <attribute name="dynamic" type="boolean" default="true">
+      <annotation><documentation>Is dynamic creation of subtasks 
+      allowed ?</documentation></annotation>
+    </attribute>
+    <attribute name="subtasksync">
+      <simpleType>
+        <union>
+          <simpleType>
+            <restriction base="string">
+              <enumeration value="last">
+                <annotation><documentation>When the last subtask completes,
+                this task is completed.</documentation></annotation>
+              </enumeration>
+              <enumeration value="first">
+                <annotation><documentation>When the first subtask completes,
+                this task is completed.</documentation></annotation>
+              </enumeration>
+            </restriction>
+          </simpleType>
+          <simpleType>
+            <restriction base="int">
+              <annotation><documentation>The number of subtasks that 
+              have to complete before this task is considered 
+              completed.</documentation></annotation>
+            </restriction>
+          </simpleType>
+        </union>
+      </simpleType>
+    </attribute>
+  </complexType>
+  
+  <simpleType name="priorityType">
+    <restriction base="string">
+      <enumeration value="highest"/>
+      <enumeration value="high"/>
+      <enumeration value="normal"/>
+      <enumeration value="low"/>
+      <enumeration value="lowest"/>
+    </restriction>
+  </simpleType>
+
+  <element name="subtask" type="tns:taskType">
+    <annotation><documentation>Subtask in a task activity.</documentation></annotation>
+  </element>
+  
+  <element name="swimlane">
+    <annotation><documentation>A process role.</documentation></annotation>
+    <complexType>
+      <sequence>
+        <element ref="tns:assignment"/>
+      </sequence>
+      <attribute name="name" type="string" use="required" />
+    </complexType>
+  </element>
+  
+  <element name="assignment">
+    <annotation><documentation>Specifies how a task or a swimlane should be assigned 
+    to a specific user or who will be identified as a candidate for it.</documentation></annotation>
+    <complexType>
+      <sequence minOccurs="0">
+        <group ref="tns:delegationGroup">
+          <annotation><documentation>An object that implements the 
+          Assigner interface.
+          </documentation></annotation>
+        </group>
+      </sequence>
+	    <attribute name="assignee" type="string">
+	      <annotation><documentation>User ID of the person to which the task
+	      or swimlane will be assigned.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="assignee-expr" type="string">
+	      <annotation><documentation>Expression that resolves to a 
+	      User ID to which the task or swimlane will be assigned.
+	      </documentation></annotation>
+	    </attribute>
+	    <attribute name="candidates" type="string">
+	      <annotation><documentation>Comma separated list of User ID's 
+	      or Group ID's.  All the referred people will be candidates to 
+	      take the task or swimlane.</documentation></annotation>
+	    </attribute>
+	    <attribute name="candidate-expr" type="string">
+	      <annotation><documentation>Expression that resolves to a 
+	      comma separated list of User ID's or Group ID's.  All the 
+	      referred people will be candidates to 
+	      take the task or swimlane.</documentation></annotation>
+	    </attribute>
+    </complexType>
+  </element>
+  -->  
+  
+</schema>

Added: jbpm4/trunk/modules/devguide/src/main/diagrams/diagrams.mdzip
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/diagrams/diagrams.mdzip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/diagrams/images.ppt
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/diagrams/images.ppt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/apis.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/apis.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch04.execution.states.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch04.execution.states.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch09.persistent.process.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/ch09.persistent.process.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.definition.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.definition.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.execution.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/class.diagram.process.execution.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/composite.node.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/composite.node.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait1.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait2.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait3.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.automatic.wait3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.concurrency.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.concurrency.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.archive.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.archive.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.end.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.end.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.evaluate.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/execution.loan.evaluate.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/initial.in.composite.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/initial.in.composite.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/interceptors.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/interceptors.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.db.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.db.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.execution.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/loan.execution.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.ab.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.ab.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.anatomy.classes.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.anatomy.classes.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.automatic.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.automatic.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.loan.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.loan.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.propagate.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.propagate.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.structure.classes.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/process.structure.classes.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/self.transition.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/self.transition.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transactions.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transactions.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.inheritence.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.inheritence.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.into.composite.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.into.composite.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.out.of.composite.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.out.of.composite.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.inner.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.inner.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.outer.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/transition.to.outer.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE book [
+  <!ENTITY ch01-Introduction                   SYSTEM "modules/ch01-Introduction.xml">
+  <!ENTITY ch02-ExecutionModes                 SYSTEM "modules/ch02-ExecutionModes.xml">
+  <!ENTITY ch03-Architecture                   SYSTEM "modules/ch03-Architecture.xml">
+  <!ENTITY ch04-ImplementingBasicActivities    SYSTEM "modules/ch04-ImplementingBasicActivities.xml">
+  <!ENTITY ch05-ProcessAnatomy                 SYSTEM "modules/ch05-ProcessAnatomy.xml">
+  <!ENTITY ch06-ImplementingAdvancedActivities SYSTEM "modules/ch06-ImplementingAdvancedActivities.xml">
+  <!ENTITY ch07-Variables                      SYSTEM "modules/ch07-Variables.xml">
+  <!ENTITY ch08-Timers                         SYSTEM "modules/ch08-Timers.xml">
+  <!ENTITY ch09-AsynchronousContinuations      SYSTEM "modules/ch09-AsynchronousContinuations.xml">
+  <!ENTITY ch10-SoftwareLogging                SYSTEM "modules/ch10-SoftwareLogging.xml">
+]>
+
+<book lang="en">
+
+  <bookinfo>
+    <title>jBPM Developers Guide</title>
+  </bookinfo>
+
+  <toc />
+
+  &ch01-Introduction;
+  &ch02-ExecutionModes;
+  &ch03-Architecture;
+  &ch04-ImplementingBasicActivities;
+  &ch05-ProcessAnatomy;
+  &ch06-ImplementingAdvancedActivities;
+  &ch07-Variables;
+  &ch08-Timers;
+  &ch09-AsynchronousContinuations;
+  &ch10-SoftwareLogging;
+
+</book>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,131 @@
+<chapter id="introduction">
+  <title>Introduction</title>
+  
+  <section>
+    <title>License and EULA</title>
+    <para>The Process Virtual Machine component is distributed under the terms of the 
+    GNU Lesser General Public License (LGPL) and the JBoss End User License Agreement (EULA).  
+    See <ulink url="../../../lgpl.html">the full LGPL license text</ulink> and <ulink url="../../../JBossORG-EULA.txt">the 
+    full End User License Agreement</ulink>. 
+    </para>
+  </section>
+
+  <section>
+    <title>Sources</title>
+    <para>The source code for this component can be found in the jBPM SVN repository:
+    </para>
+    <ulink url="https://anonsvn.jboss.org/repos/jbpm/jbpm4/pvm/">https://anonsvn.jboss.org/repos/jbpm/jbpm4/pvm/</ulink>
+  </section>
+
+  <section>
+    <title>JVM version</title>
+    <para>jbpm-pvm.jar requires a JVM version 5 or higher.
+    </para>
+  </section>
+
+  <section>
+    <title>Library dependencies</title>
+    <para>For building and executing processes the jbpm-pvm.jar does not have any other 
+    dependencies then on the JVM.  If you're using DB persistence, then there is a dependency
+    on hibernate and it's dependencies.  More information about the optional depedencies can
+    be found in the <ulink url="../../lib/optional-dependencies.html">lib directory</ulink>. 
+    </para>
+  </section>
+
+  <section>
+    <title>What is it</title>
+    <para>In essence, the Process Virtual Machine is a framework specifying executable 
+    graphs.  A process definition represents an execution flow and has a structure that 
+    be represented graphically as a diagram.    
+    </para>  
+    <figure id="example.process.graph">
+      <title>Example process definition</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Typically, process definitions are static.  A process definition is composed of 
+    nodes and transitions.  The runtime behaviour of a node is encapsulated in a so called 
+    Activity and it's decoupled from the process graph structure.  
+    </para>
+    <figure id="class.diagram.process.definition">
+      <title>Process structure class diagram</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.definition.png"/></imageobject></mediaobject>
+    </figure>
+    <para>The Process Virtual 
+    Machine doesn't contain any such activity implementations.  It only provides the 
+    execution environment and an activity API to write <literal>Activity</literal> 
+    implementations as Java components.  Activities can also be wait states.  This means 
+    that the node control flow goes outside the process system. For example a human task 
+    or invoking an service asynchronously.
+    </para>
+    <para>Many executions can be started for one process definition. An execution is a pointer 
+    that keeps track of the current node.
+    </para>
+    <figure id="example.execution">
+      <title>Example execution</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/loan.execution.png"/></imageobject></mediaobject>
+    </figure>
+    <para>To represent concurrent paths of execution, there is 
+    a hierarchical parent-child relation between so that one process instance can cope with concurrent 
+    paths of execution.
+    </para>
+    <figure id="class.diagram.process.execution">
+      <title>Execution class diagram</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.execution.png"/></imageobject></mediaobject>
+    </figure>
+  </section>
+    
+  <section>
+    <title>Features</title>
+    <para>The key features of this library are
+    <itemizedlist>
+      <listitem>Create executable processes that are based on a diagram structure</listitem>
+      <listitem>Runtime behaviour of the nodes can be provided as Activity implementations</listitem>
+      <listitem>Activities can be wait states</listitem>
+      <listitem>There are no constraints on the process graph structure</listitem>
+      <listitem>Processes diagrams can be based on composition (aka block structured)</listitem>
+      <listitem>Processes diagrams can be a mix of graph based and composition</listitem>
+      <listitem>During wait states, the runtime state of a process execution can be persisted</listitem>
+      <listitem>Persistence is optional</listitem>
+    </itemizedlist>
+    </para>
+  </section>
+  
+  <section>
+    <title>Purpose</title>
+    <para>The Process Virtual Machine is designed in such a way that it's easy to build 
+    workflow, BPM, orchestration and other graph based execution langauges on top 
+    of it.  Examples of languages that have been built on top of this library:
+    </para>
+    <itemizedlist>
+      <listitem>jPDL: Workflow language that combines powerful human task capabilities with easy binding to Java.</listitem>
+      <listitem>BPEL: Web-Service orchestration (to be exact for the purists: BPEL is a WSDL service orchestration language)</listitem>
+      <listitem>Pageflow: To describe navigation handling in a web application, pages can be seen as nodes and the nagivation between the pages as transitions.</listitem>
+      <listitem>XPDL: A graph based process language standardized by the Workflow Management Coalition (WfMC)</listitem>
+    </itemizedlist>
+    <para>Even while the nature of these languages is already very diverse, these are 
+    all examples of general purpose workflow languages.  The real power of the 
+    Process Virtual Machine is that it's very easy to build Domain Specific Languages (DSL)
+    with it.  For instance, it's very easy to build a very simple (and dedicated) workflow 
+    language to specify approvals related to documents in a document management system.
+    </para>
+    <para>BPM as a discipline refers to the management level effort to optimise efficiency
+    of an organisation by analysing and optimising the procedures of how people and systems 
+    work together. In designing the Process Virtual Machine and the jPDL language 
+    in particular, we have spend great care on facilitating the link between BPM analysis 
+    notations and executable process languages.  Here are the most known modeling notations: 
+    </para>
+    <itemizedlist>
+      <listitem>BPMN: OMG latest notation for modeling business processes.  
+      This is a modeling notation that is targetted explicitely to be bound 
+      to executable processes.
+      </listitem>
+      <listitem>UML activity diagrams: OMG notation for modeling business 
+      processes.  Mostly used in business context.</listitem>
+      <listitem>UML state diagrams: OMG modeling notation for defining technical 
+      state machines.  More used in a technical context.</listitem>
+      <listitem>EPC: Event driven process chains.  Rich notation for modeling 
+      business processes driven by SAP and IDS Scheer.</listitem>
+    </itemizedlist>
+  </section>
+    
+</chapter>

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,396 @@
+<chapter id="executionmodes">
+  <title>Execution modes</title>
+  
+  <para>There are basically three process execution modes: object, persistent 
+  and embedded.  For the persistent and embedded execution modes, the process 
+  execution has to participate in a transaction.  In that case, the process 
+  execution has to take place inside of an Environment.  The environment will be 
+  used to bind process execution updates to a transaction in the application 
+  transaction.  The environment can be used to bind  to e.g. a JDBC connection, 
+  JTA, BMT, Spring transactions and so on.  
+  </para>
+
+  <section id="objectexecutionmode">
+    <title>Object execution mode</title>
+    <para>Object execution mode is the simplest form of working with the Process
+    Virtual Machine.  This means working with the process definition and execution 
+    objects directly through the client API. Let's show this by an example.  We 
+    start by creating a <literal>ClientProcessDefinition</literal> that looks like this: 
+    </para>
+  
+    <para>Object execution mode is the simplest form of working with the Process
+    Virtual Machine.  This means working with the process definition and execution 
+    objects directly through the client API. Let's show this by an example.  We 
+    start by creating a <literal>ClientProcessDefinition</literal> that looks like this: 
+    </para>
+    <figure id="loan.process">
+      <title>The loan process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
+    </figure>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+  .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+    .transition().to("evaluate")
+  .node("evaluate").behaviour(WaitState.class)
+    .transition("approve").to("wire money")
+    .transition("reject").to("end")
+  .node("wire money").behaviour(AutomaticActivity.class)
+    .transition().to("archive")
+  .node("archive").behaviour(WaitState.class)
+    .transition().to("end")
+  .node("end").behaviour(WaitState.class)
+.done();</programlisting>
+      <para>The <literal>ProcessFactory</literal> is a helper class that provides convenience 
+      for building an object graph that represents a process definition.  
+      <literal>AutomaticActivity</literal> is a pass-through activity without anything 
+      happening and <literal>WaitState</literal> will wait until an external signal is given.  Both 
+      activity implementations will be covered in more depth later.
+      </para>
+      <para>The <literal>processDefinition</literal> object serves as a factory for process 
+      instance objects.  A process instance represents one execution of the process definition.
+      More precise, the process instance is the main path of execution.  
+      </para>
+      <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+      <para>A process instance 
+      itself is also an <literal>Execution</literal>.  Potentially, an execution can have 
+      child executions to represent concurrent paths of execution.
+      </para>  
+      <para>The <literal>execution</literal> can be seen as a state machine that operates as 
+      described in the process definition.  Starting a process 
+      instance means that the initial node of the process definition is executed.
+      Since this is an automatic activity, the execution will proceed to the 
+      <literal>evaluate</literal> node.  The <literal>evaluate</literal> node is a wait state.
+      When the execution arrived at the evaluate node, the method <literal>startProcessInstance</literal>
+      will return and waits until an external signal is provided with the <literal>signal</literal>
+      method.  So after the <literal>startProcessInstance</literal> we can verify if the 
+      execution is positioned in the evaluate node. 
+      </para>
+      <programlisting>assertEquals("evaluate", execution.getNodeName());</programlisting>
+      <para>To make the process execute further, we provide an external trigger with the 
+      <literal>signal</literal> method.  The result of the evaluation will be given as the 
+      signalName parameter like this:
+      </para>
+      <programlisting>execution.signal("approve");</programlisting>
+      <para>The <literal>WaitState</literal> activity implementation will take the transition 
+      that corresponds to the given signalName.  So the execution will first execute 
+      the automatic activity <literal>wire money</literal> and then return after entering 
+      the next wait state <literal>archive</literal>.
+      </para>
+      <programlisting>assertEquals("archive", execution.getNodeName());</programlisting>
+      <para>When the execution is waiting in the archive node, the default signal will
+      make it take the first unnamed transition.
+      </para>
+      <programlisting>execution.signal();
+assertEquals("end", execution.getNodeName());</programlisting>
+      <para>The process has executed in the thread of the client.  The 
+      <literal>startProcessInstance</literal> method only returned when the <literal>evaluate</literal> 
+      node was reached.  In other words, the <literal>ClientProcessDefinition.startProcessInstance</literal>
+      and <literal>ClientExecution.signal</literal> methods are blocking until the next 
+      wait state is reached.
+      </para>
+    </section>
+    
+    <section id="persistentexecutionmode">
+      <title>Persistent execution mode</title>
+      <para>The Process Virtual Machine also contains the hibernate mappings to store the 
+      process definitions and executions in any database.  A special session facade called 
+      <literal>ExecutionService</literal> is provided for working with process executions 
+      in such a persistent environment. 
+      </para>
+      <para>Two configuration files should be available on the classpath: an environment 
+      configuration file and a <literal>hibernate.properties</literal> file.  A basic  
+      configuration for persistent execution mode in a standard Java environment looks 
+      like this:
+      </para>
+      <literal><emphasis role="bold">environment.cfg.xml</emphasis>:</literal>
+      <programlisting>&lt;jbpm-configuration xmlns=&quot;http://jbpm.org/xsd/cfg&quot;&gt;
+
+  &lt;process-engine&gt;
+  
+    &lt;deployer-manager&gt;
+      &lt;language name=&quot;api&quot;&gt;
+        &lt;check-version /&gt;
+        &lt;create-id /&gt;
+        &lt;save-process /&gt;
+      &lt;/language&gt;
+    &lt;/deployer-manager&gt;
+    
+    &lt;process-service /&gt;
+    &lt;execution-service /&gt;
+    &lt;management-service /&gt;
+  
+    &lt;command-service&gt;
+      &lt;retry-interceptor /&gt;
+      &lt;environment-interceptor /&gt;
+      &lt;standard-transaction-interceptor /&gt;
+    &lt;/command-service&gt;
+    
+    &lt;hibernate-configuration&gt;
+      &lt;properties resource=&quot;hibernate.properties&quot; /&gt;
+      &lt;mappings resource=&quot;org/jbpm/pvm/pvm.hibernate.mappings.xml&quot; /&gt;
+      &lt;cache-configuration resource=&quot;org/jbpm/pvm/pvm.cache.xml&quot; 
+                           usage=&quot;nonstrict-read-write&quot; /&gt;
+    &lt;/hibernate-configuration&gt;
+    
+    &lt;hibernate-session-factory /&gt;
+    
+    &lt;id-generator /&gt;
+    &lt;variable-types resource=&quot;org/jbpm/pvm/pvm.types.xml&quot; /&gt;
+    &lt;job-executor auto-start=&quot;false&quot; /&gt;
+  
+  &lt;/process-engine&gt;
+
+  &lt;environment&gt;
+    &lt;hibernate-session /&gt;
+    &lt;transaction /&gt;
+    &lt;pvm-db-session /&gt;
+    &lt;job-db-session /&gt;
+    &lt;message-session /&gt;
+  &lt;/environment&gt;
+
+&lt;/jbpm-configuration&gt;</programlisting>
+      <para>And next to it a hibernate.properties like this</para>
+      <literal>hibernate.properties:</literal>
+      <programlisting>hibernate.dialect                      org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class      org.hsqldb.jdbcDriver
+hibernate.connection.url               jdbc:hsqldb:mem:.
+hibernate.connection.username          sa
+hibernate.connection.password
+hibernate.hbm2ddl.auto                 create-drop
+hibernate.cache.use_second_level_cache true
+hibernate.cache.provider_class         org.hibernate.cache.HashtableCacheProvider
+# hibernate.show_sql                     true
+hibernate.format_sql                   true
+hibernate.use_sql_comments             true</programlisting>
+      <para>Then you can obtain the services from the environment factory like this:
+      </para>
+      <programlisting>EnvironmentFactory environmentFactory = new PvmEnvironmentFactory(&quot;environment.cfg.xml&quot;);
+
+ProcessService processService = environmentFactory.get(ProcessService.class);
+ExecutionService executionService = environmentFactory.get(ExecutionService.class);
+ManagementService managementService = environmentFactory.get(ManagementService.class);</programlisting>
+      <para>The responsibility of the <literal>ProcessService</literal> is to manage
+      the repository of process definitions.  Before we can start a process execution, 
+      the process definition needs to be deployed into the process repository.
+      Process definitions can be supplied in various formats and process definition 
+      languages.  A deployment collects process definition information from various 
+      sources like a ZIP file, an XML file or a process definition object.
+      The method <literal>ProcessService.deploy</literal> will take a deployment 
+      through all the deployers that are configured in the configuration file.    
+      </para>
+      <para>In this example, we'll supply a process definition programmatically
+      for deployment.</para>
+      <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+  .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+    .transition().to("evaluate")
+  .node("evaluate").behaviour(WaitState.class)
+    .transition("approve").to("wire money")
+    .transition("reject").to("end")
+  .node("wire money").behaviour(AutomaticActivity.class)
+    .transition().to("archive")
+  .node("archive").behaviour(WaitState.class)
+    .transition().to("end")
+  .node("end").behaviour(WaitState.class)
+.done();
+
+Deployment deployment = new Deployment(processDefinition);
+processService.deploy(deployment);</programlisting>
+    <para>Now, a version of that process definition is stored in the database. 
+    The <literal>check-version</literal> deployer will have assigned version 1 
+    to the  stored process definition.  The <literal>create-id</literal> deployer 
+    will have distilled id <literal>loan:1</literal> from the process name and the 
+    assigned version.
+    </para>
+    <para>Deploying that process again will lead to a new process definition 
+    version being created in the database.  But an incremented version number will 
+    be assigned.  For the purpose of versioning, process definitions are considered 
+    equal if they have the same name.</para>
+    <para>It is recommended that a user provided key reference is supplied for 
+    all process executions.  Starting a new process execution goes like this:
+    </para>
+    <programlisting>Execution execution = executionService.startExecution("loan:1", "request7836");</programlisting>
+    <para>The return value is an execution interface, which prevents navigation of relations.  
+    That is because outside of the service methods, the transaction and hibernate session 
+    is not guaranteed to still be open.  In fact, the default configuration as given 
+    above will only keep the transaction and session open for the duration of the
+    service method.  So navigating the relations outside of the service methods might result 
+    into a hibernate <literal>LazyInitializationException</literal>.  But the 
+    current node name can still be verified:
+    </para>
+    <programlisting>assertEquals("evaluate", execution.getNodeName());</programlisting>
+    <para>Also very important is the generated id that can be obtained.  The default 
+    <literal>id-generator</literal> will use the process definition id and the 
+    given key to make a unique id for the process execution like this:</para>
+    <programlisting>assertEquals("loan:1/request7836", execution.getId());</programlisting>
+    <para>That id must be when providing the subsequent external triggers to the 
+    process execution like this:
+    </para>
+    <programlisting>executionService.signalExecution("loan:1/request7836", "approve");</programlisting>
+    <para>More information about service interfaces to run in persistent 
+    mode can be found in package 
+    <ulink url="../../api/org/jbpm/pvm/package-summary.html"><literal>org.jbpm.pvm</literal> of the
+    api docs</ulink>. 
+    </para>
+  </section>
+
+  <section id="embeddedexecutionmode">
+    <title>Embedded execution mode</title>
+    <para>Embedded execution mode means that the state of a process is stored 
+    as a string column inside a user domain object like e.g. a loan.
+    </para>
+    <programlisting>public class Loan {
+
+  <emphasis role="bold">/** the loan process definition as a static resource */
+  private static final ClientProcessDefinition processDefinition = createLoanProcess();
+  
+  private static ClientProcessDefinition createLoanProcess() {
+    ClientProcessDefinition processDefinition = ProcessFactory.build(&quot;loan&quot;)
+      .node(&quot;submit loan request&quot;).initial().behaviour(AutomaticActivity.class)
+        .transition().to(&quot;evaluate&quot;)
+      .node(&quot;evaluate&quot;).behaviour(WaitState.class)
+        .transition(&quot;approve&quot;).to(&quot;wire money&quot;)
+        .transition(&quot;reject&quot;).to(&quot;end&quot;)
+      .node(&quot;wire money&quot;).behaviour(AutomaticActivity.class)
+        .transition().to(&quot;archive&quot;)
+      .node(&quot;archive&quot;).behaviour(WaitState.class)
+        .transition().to(&quot;end&quot;)
+      .node(&quot;end&quot;).behaviour(WaitState.class)
+    .done();
+    
+    return processDefinition;
+  }
+
+  /** exposes the process definition to the execution hibernate type */
+  private static ClientProcessDefinition getProcessDefinition() {
+    return processDefinition;
+  }
+  </emphasis>
+
+  long dbid;
+  String customer;
+  double amount;
+  <emphasis role="bold">ClientExecution execution;</emphasis>
+  
+  /** constructor for persistence */
+  protected Loan() {
+  }
+
+  public Loan(String customer, double amount) {
+    this.customer = customer;
+    this.amount = amount;
+    <emphasis role="bold">this.execution = processDefinition.startProcessInstance();</emphasis>
+  }
+
+  public void approve() {
+    <emphasis role="bold">execution.signal(&quot;approve&quot;);</emphasis>
+  }
+
+  public void reject() {
+    <emphasis role="bold">execution.signal(&quot;reject&quot;);</emphasis>
+  }
+
+  public void archiveComplete() {
+    <emphasis role="bold">execution.signal();</emphasis>
+  }
+
+  public String getState() {
+    return <emphasis role="bold">execution.getNodeName()</emphasis>;
+  }
+
+  ...getters...
+}</programlisting>
+    <para>If you ignore the bold parts for a second, you can see that this is a 
+    POJO without anything fancy.  It's just a bean that can be stored with hibernate. 
+    The bold part indicate that implementation part of the class that is related 
+    to process and execution.  Not that nothing of the process definition or 
+    execution is exposed to the user of the Loan class.
+    </para>
+    <para>Each <literal>Loan</literal> object corresponds to a <literal>loan</literal> 
+    process instance.  Some methods of the <literal>Loan</literal> class correspond 
+    to the external triggers that need to be given during the lifecycle of a
+    <literal>Loan</literal> object.
+    </para>
+    <para>Next we'll show how to use this class.  To get started we need a</para>
+    <emphasis role="bold"><literal>hibernate.cfg.xml:</literal></emphasis>
+    <programlisting>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+
+&lt;!DOCTYPE hibernate-configuration PUBLIC
+          &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
+          &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
+
+&lt;hibernate-configuration&gt;
+  &lt;session-factory&gt;
+
+    &lt;property name=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;
+    &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;org.hsqldb.jdbcDriver&lt;/property&gt;
+    &lt;property name=&quot;hibernate.connection.url&quot;&gt;jdbc:hsqldb:mem:.&lt;/property&gt;
+    &lt;property name=&quot;hibernate.connection.username&quot;&gt;sa&lt;/property&gt;
+    &lt;property name=&quot;hibernate.connection.password&quot;&gt;&lt;/property&gt;
+    &lt;property name=&quot;hibernate.hbm2ddl.auto&quot;&gt;create&lt;/property&gt;
+    &lt;property name=&quot;hibernate.show_sql&quot;&gt;true&quot;&lt;/property&gt;
+    &lt;property name=&quot;hibernate.format_sql&quot;&gt;true&quot;&lt;/property&gt;
+    &lt;property name=&quot;hibernate.use_sql_comments&quot;&gt;true&quot;&lt;/property&gt;
+    
+    &lt;mapping resource=&quot;Loan.hbm.xml&quot;/&gt;
+    
+  &lt;/session-factory&gt;
+&lt;/hibernate-configuration&gt;</programlisting>
+    <para>And a</para>
+    <emphasis role="bold"><literal>Loan.hbm.xml:</literal></emphasis>
+    <programlisting>&lt;?xml version=&quot;1.0&quot;?&lt;
+
+&lt;!DOCTYPE hibernate-mapping PUBLIC 
+          &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot; 
+          &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&lt;
+
+&lt;hibernate-mapping package=&quot;org.jbpm.pvm.api.db.embedded&quot; default-access=&quot;field&quot;&lt;
+
+  &lt;typedef name=&quot;execution&quot; class=&quot;org.jbpm.pvm.internal.hibernate.ExecutionType&quot; /&lt;
+
+  &lt;class name=&quot;Loan&quot; table=&quot;LOAN&quot;&lt;
+
+    &lt;id name=&quot;dbid&quot;&lt;
+      &lt;generator class=&quot;sequence&quot;/&lt;
+    &lt;/id&lt;
+
+    &lt;property name=&quot;execution&quot; type=&quot;execution&quot; /&lt;
+    &lt;property name=&quot;customer&quot; /&lt;
+    &lt;property name=&quot;amount&quot; /&lt;
+    
+  &lt;/class&lt;
+
+&lt;/hibernate-mapping&lt;</programlisting>
+    <para>Then you can use the Loan class like this in a test</para>
+    <programlisting>Configuration configuration = new Configuration();
+configuration.configure();
+SessionFactory sessionFactory = configuration.buildSessionFactory();
+
+// start a session/transaction
+Session session = sessionFactory.openSession();
+Transaction transaction = session.beginTransaction();
+
+Loan loan = new Loan("john doe", 234.0);
+session.save(loan);
+assertEquals("evaluate", loan.getState());
+
+// start a new session/transaction
+transaction.commit();
+session.close();
+session = sessionFactory.openSession();
+transaction = session.beginTransaction();
+
+loan = (Loan) session.get(Loan.class, loan.getDbid());
+assertEquals("evaluate", loan.getState());
+loan.approve();
+assertEquals("archive", loan.getState());
+
+// start a new session/transaction
+transaction.commit();
+session.close();</programlisting>
+    <para>After executing this code snippet, this is the loan record in the DB:</para>
+    <figure id="loan.db">
+      <title>The loan record in the DB</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/loan.db.png"/></imageobject></mediaobject>
+    </figure>
+  </section>
+
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,250 @@
+<chapter id="architecture">
+  <title>Architecture</title>
+  
+  <section id="apis">
+    <title>APIs</title>
+    <para>The Process Virtual Machine has 4 integrated API's that together 
+    offer a complete coverage of working with processes in the different execution modes.  
+    Each of the APIs has a specific purpose that fits within the following overall 
+    architecture.
+    </para>
+    <figure id="apis">
+      <title>The 4 API's of the Process Virtual Machine</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/apis.png"/></imageobject></mediaobject>
+    </figure>
+    <para>The services interfaces should be used from application code that wants to interact 
+    with the Process Virtual Machine which runs in transactional persistent mode, backed by a 
+    database.  This is the most typical way how users interact with the PVM as a workflow engine.
+    </para>
+    <para>To execute processes without persistence, the client API can be used to work with process 
+    and execution objects directly.  The client API expose the methods of the core model objects.
+    </para>
+    <para>The activity API is used to implement the runtime behaviour of activities.  So a activity 
+    type is in fact a component with at the core an implementation of the <literal>Activity</literal> 
+    interface.  Activity implementations can control the flow of execution.
+    </para>  
+    <para>The event listener API serves to write pieces of Java code that should be executed upon 
+    process events.  It's very similar to the activity API with that exception that event listeners
+    are not able to control the flow of execution. 
+    </para> 
+  </section>
+  
+  <section>
+    <title>Activity API</title>
+    <para>The activity API allows to implement the runtime activity behaviour in Java.
+    </para>
+    <programlisting>public interface Activity extends Serializable {
+  void execute(ActivityExecution execution) throws Exception;
+}</programlisting>
+    <para>An activity is the behaviour of the node to which it is associated.
+    The provided execution is the execution that arrives in the node.
+    The interface <literal>ActivityExecution</literal> exposes special 
+    methods to control the execution flow.
+    </para>
+    <programlisting>public interface ActivityExecution extends OpenExecution {
+
+  void waitForSignal();
+  void take(String transitionName);
+  void execute(String nodeName);
+
+  ...
+
+}</programlisting>
+  </section>
+
+  <section>
+    <title>Event listener API</title>
+    <para>The event listener API allows for listeners to be developed in Java code 
+    and that are invoked on specific process events like entering a node or leaving 
+    a node.  It is very similar to the activity API, but the difference is  
+    that the propagation of the execution flow cannot be controlled.  E.g. when an execution 
+    is taking a transition, a listener to that event can be notified, but since the 
+    transition is already being taking, the execution flow cannot be changed 
+    by the event listeners.  
+    </para>
+    <programlisting>public interface EventListener extends Serializable {
+  
+  void notify(EventListenerExecution execution) throws Exception;
+
+}</programlisting>
+  </section>
+
+  <section>
+    <title>Client API</title>
+    <para>The client API was already introduced above in the object execution mode 
+    and embedded execution mode.  It's an interface that exposes the methods for 
+    managing executions on the plain process definition and execution objects directly. 
+    </para>
+    <para>At a minimal, the client API and the activity API are needed to create 
+    some a process definition with activities and execute it.
+    </para>
+  </section>
+
+  <section>
+    <title>Environment</title>
+    <para>In the persistent execution mode, the first purpose of the environment is 
+    to enable processes to be executed in different transactional environments like 
+    standard Java, enterprise Java, SEAM and Spring.
+    </para>
+    <para>The PVM code itself will only use transactional resources through self-defined 
+    interfaces.  For example, the PVM itself has interfaces for some methods on the hibernate 
+    session, a async messaging session and a timer session.
+    </para>
+    <para>The environment allows to configure the actual implementations, lazy 
+    initialization of the services on a request-basis and caching the service 
+    objects for the duration of the transaction. 
+    </para>
+    <para>An environment factory is static and one environment factory can serve 
+    all the threads in an application.
+    </para>
+    <programlisting>EnvironmentFactory environmentFactory = new PvmEnvironmentFactory("environment.cfg.xml");</programlisting>
+    <para>Environment blocks can surround persistent process operations 
+    like this:
+    </para>
+    <programlisting>Environment environment = environmentFactory.openEnvironment();
+try {
+
+  ... inside the environment block...
+
+} finally {
+  environment.close();
+}</programlisting>
+    <para>The PVM itself will fetch all it's transactional resources and configurations 
+    from the environment.  It's recommended that <literal>Activity</literal> implementations
+    do the same.
+    </para>
+  </section>
+
+  <section>
+    <title>Commands</title>
+    <para>Commands encapsulate operations that are to be executed within an environment 
+    block.  The main purpose for commands is to capture the logic of 
+    </para>
+    <programlisting>public interface Command&lt;T&gt; extends Serializable {
+
+  T execute(Environment environment) throws Exception;
+
+}</programlisting>
+    <para></para>
+  </section>
+
+  <section>
+    <title>Services</title>
+    <para>There are three services: <literal>ProcessService</literal>, 
+    <literal>ExecutionService</literal> and <literal>ManagementService</literal>.
+    In general, services are session facades that expose methods for persistent 
+    usage of the PVM. The next fragments show the essential methods as example 
+    to illustrate those services. 
+    </para>
+    <para>The <literal>ProcessService</literal> manages the repository of 
+    process definitions.
+    </para>
+    <programlisting>public interface ProcessService {
+
+  ProcessDefinition deploy(Deployment deployment);
+
+  ProcessDefinition findLatestProcessDefinition(String processDefinitionName);
+
+  ...
+
+}</programlisting>
+    <para>The <literal>ExecutionService</literal> manages the runtime 
+    executions.</para>
+    <programlisting>public interface ExecutionService {
+
+  Execution startExecution(String processDefinitionId, String executionKey);
+
+  Execution signalExecution(String executionId, String signalName);
+   
+  ...
+
+}</programlisting>
+    <para>The <literal>ManagementService</literal> groups all management operations
+    that are needed to keep the system up and running.
+    </para>
+    <programlisting>public interface ManagementService {
+
+  List&lt;Job&gt; getJobsWithException(int firstResult, int maxResults);
+
+  void executeJob(String jobId);
+  
+  ...
+  
+}</programlisting>
+    <para>The implementation of all these methods is encapsulated in 
+    <literal>Command</literal>s.  And the three services all delegate the 
+    execution of the commands to a <literal>CommandService</literal>:
+    </para>
+    <programlisting>public interface CommandService {
+
+  &lt;T&gt; T execute(Command&lt;T&gt; command);
+
+}</programlisting>
+    <para>The <literal>CommandService</literal> is configured in the 
+    environment.  A chain of CommandServices can act as interceptors 
+    around a command.  This is the core mechanism on how persistence and 
+    transactional support can be offered in a variety of environments.
+    </para>
+    <para>From the default configuration which is included in full above, 
+    here is the section that configures the services
+    </para>
+    <programlisting>&lt;jbpm-configuration xmlns=&quot;http://jbpm.org/xsd/cfg&quot;&gt;
+
+  &lt;process-engine&gt;
+  
+    &lt;process-service /&gt;
+    &lt;execution-service /&gt;
+    &lt;management-service /&gt;
+  
+    &lt;command-service&gt;
+      &lt;retry-interceptor /&gt;
+      &lt;environment-interceptor /&gt;
+      &lt;standard-transaction-interceptor /&gt;
+    &lt;/command-service&gt;
+    
+    ...
+    </programlisting>
+    <para>The three services <literal>process-service</literal>, <literal>execution-service</literal>
+    and <literal>management-service</literal> will look up the configured 
+    <literal>command-service</literal> by type.  The <literal>command-service</literal>
+    tag corresponds to the default command service that essentially does nothing else 
+    then just execute the command providing it the current environment.
+    </para>
+    <para>The configured <literal>command-service</literal> results into the following 
+    a chain of three interceptors followed by the default command executor. 
+    </para>
+    <figure id="interceptors">
+      <title>The CommandService interceptors</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/interceptors.png"/></imageobject></mediaobject>
+    </figure>
+    <para>The retry interceptor is the first in the chain and that one that will be exposed as the 
+    <literal>CommandService.class</literal> from the environment.  So the retry interceptor 
+    will be given to the respective services <literal>process-service</literal>, <literal>execution-service</literal>
+    and <literal>management-service</literal>.  
+    </para>
+    <para>The <literal>retry-interceptor</literal> will catch hibernate StaleObjectExceptions 
+    (indicating optimistic locking failures) and retry to execute the command.
+    </para>
+    <para>The <literal>environment-interceptor</literal> will put an environment block 
+    around the execution of the command.
+    </para>
+    <para>The <literal>standard-transaction-interceptor</literal> will initialize a 
+    <literal>StandardTransaction</literal>.  The hibernate session/transaction will be 
+    enlisted as a resource with this standard transaction.
+    </para>
+    <para>Different configurations of this interceptor stack will also enable to 
+    </para>
+    <itemizedlist>
+      <listitem>delegate execution to a local ejb command service so that an container 
+      managed transaction is started.
+      </listitem>
+      <listitem>delegate to a remote ejb command service so that the command actually 
+      gets executed on a different JVM.
+      </listitem>
+      <listitem>package the command as an asynchronous message so that the command gets 
+      executed asynchronously in a different transaction.
+      </listitem>
+    </itemizedlist>
+  </section>
+
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,536 @@
+<chapter id="implementingbasicactivities">
+  <title>Implementing basic activities</title>
+  
+  <para>This chapter explains the basics of process definitions, the features offered by 
+  the Process Virtual Machine and how activity implementations can be build.   At the same 
+  time the client API is shown to execute processes with those activity implementations.  
+  </para>
+
+  <!-- ### Activity ####################################################### -->
+  <section id="activity">
+    <title>Activity</title>
+    <para>The PVM library doesn't have a fixed set of process constructs. 
+    Instead, runtime behaviour of a node is delegated to an <literal>Activity</literal>.  
+    In other words, <literal>Activity</literal> is an interface to implement the runtime 
+    behaviour of process constructs in plain Java.
+    </para>
+    <programlisting>public <emphasis role="bold">interface Activity</emphasis> extends Serializable {
+    
+  void <emphasis role="bold">execute</emphasis>(ActivityExecution execution) throws Exception;
+  
+}</programlisting>
+    <para>When an activity is used as the node behaviour, it is in full control of the further 
+    propagation of the execution.  In other words, a node behaviour can decide what the execution 
+    should do next.  For example, it can take a transition with 
+    <literal>execution.take(Transition)</literal> or go into a wait state with 
+    <literal>execution.waitForSignal()</literal>.  In case the node behaviour does not invoke 
+    any of the above execution propagation methods, the execution will 
+    <link linkend="implicitproceedbehaviour">proceed in a default way</link>.
+    </para>
+  </section>
+
+  <!-- ### Activity example ############################################### -->
+  <section id="activityexample">
+    <title>Activity example</title>
+    <para>We'll start with a very original hello world example.  A Display 
+    activity will print a message to the console:
+    </para>
+    <programlisting>public <emphasis role="bold">class Display</emphasis> implements <emphasis role="bold">Activity</emphasis> {
+
+  String message;
+
+  public Display(String message) {
+    this.message = message;
+  }
+
+  public void execute(ActivityExecution execution) {
+    <emphasis role="bold">System.out.println(message);</emphasis>
+  }
+}</programlisting>
+    <para>Let' build our first process definition with this activity:</para>
+    <figure id="activity.example">
+      <title>Display example process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
+    </figure>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
+    .<emphasis role="bold">node("a").initial()</emphasis>.behaviour(<emphasis role="bold">new Display("hello")</emphasis>)
+      .transition().to("b")
+    .<emphasis role="bold">node("b")</emphasis>.behaviour(<emphasis role="bold">new Display("world")</emphasis>)
+.done();</programlisting>
+    <para>Now we can execute this process as follows:</para>
+    <programlisting>Execution execution = processDefinition.startExecution();</programlisting>
+    <para>The invocation of <literal>startExecution</literal> will print hello world to the console:</para>
+    <programlisting>hello
+world</programlisting>
+    <para>One thing already worth noticing is that activities can be configured 
+    with properties.  In the Display example, you can see that the message property 
+    is configured differently in the two usages.  With configuration properties 
+    it becomes possible to write reusable activities. They can then be configured 
+    differently each time they are used in a process.  That is an essential part of 
+    how process languages can be build on top of the Process Virtual Machine.
+    </para>
+    <para>The other part that needs explanation is that this activity 
+    implementation does not contain any instructions for the propagation of the
+    execution.  When a new process instance is started, the execution is positioned
+    in the initial node and that activity is executed.  The method 
+    <literal>Display.execute</literal> makes use of what is called implicit propagation 
+    of execution.  Concretely this means that the activity itself does not 
+    invoke any of the methods on the execution to propagate it.  In that case 
+    implicit propagation kicks in.  Implicit propagation will take the first 
+    transition if there is one.  If not, it will end the execution.  This explains 
+    why both nodes <literal>a</literal> and <literal>b</literal> are executed and that 
+    the execution stops after node <literal>b</literal> is executed. 
+    </para>
+    <para>More details about the implicit proceed behaviour can be found 
+    in <xref linkend="implicitproceedbehaviour" /></para>
+  </section>
+    
+  <!-- ### ExternalActivity ############################################### -->
+  <section id="externalactivity">
+    <title>ExternalActivity</title>
+    <para>External activities are activities for which the responsibility for proceeding 
+    the execution is transferred externally, meaning outside the process system. This 
+    means that for the system that is executing the process, it's a wait state.  The 
+    execution will wait until an external trigger is given.  
+    </para>
+    <para>For dealing with external triggers, <literal>ExternalActivity</literal> 
+    adds two methods to the <literal>Activity</literal>:</para>
+    <programlisting>public <emphasis role="bold">interface ExternalActivity</emphasis> extends <emphasis role="bold">Activity</emphasis> {
+
+  void <emphasis role="bold">signal</emphasis>(Execution execution,
+              String signal, 
+              Map&lt;String, Object&gt; parameters) throws Exception;
+              
+}</programlisting>
+    <para>Just like with plain activities, when an execution arrives in a node, the 
+    <literal>execute</literal>-method of the node behaviour is invoked.
+    In external activities, the execute method typically does something to 
+    transfer the responsibility to another system and then enters a wait 
+    state by invoking <literal>execution.waitForSignal()</literal>.  For 
+    example in the execute method, responsibility could be transferred to a 
+    person by creating a task entry in a task management system and then
+    wait until the person completes the task.
+    </para>
+    <para>In case a node behaves as a wait state, then the execution will 
+    wait in that node until the execution's <literal>signal</literal> method 
+    is invoked.  The execution will delegate that signal to the behaviour Activity 
+    of the current node.
+    </para>
+    <para>So the Activity's <literal>signal</literal>-method is invoked 
+    when the execution receives an external trigger during the wait state.  With the 
+    signal method, responsibility is transferred back to the process execution. For 
+    example, when a person completes a task, the task management system calls the 
+    signal method on the execution.
+    </para>  
+    <para>A signal can optionally have a signal name and a map of parameters.  Most 
+    common way on how node behaviours interprete the signal and parameters is that 
+    the signal relates to the outgoing transition that needs to be taken and that the 
+    parameters are set as variables on the execution. But those are just examples, it 
+    is up to the activity to use the signal and the parameters as it pleases.
+    </para>
+  </section>
+  
+  <!-- ### ExternalActivity example ####################################### -->
+  <section id="externalactivityexample">
+    <title>ExternalActivity example</title>
+    <para>Here's a first example of a simple wait state implementation:
+    </para>
+    <programlisting>public <emphasis role="bold">class WaitState</emphasis> implements <emphasis role="bold">ExternalActivity</emphasis> {
+
+  public void execute(ActivityExecution execution) {
+    <emphasis role="bold">execution.waitForSignal();</emphasis>
+  }
+
+  public void signal(ActivityExecution execution, 
+                     String signalName, 
+                     Map&lt;String, Object&gt; parameters) {
+    <emphasis role="bold">execution.take(signalName);</emphasis>
+  }
+}</programlisting>
+    <para>The <literal>execute</literal>-method calls 
+    <literal>execution.waitForSignal()</literal>.  The invocation of 
+    <literal>execution.waitForSignal()</literal> will bring the process execution 
+    into a wait state until an external trigger is given. 
+    </para>
+    <para><literal>signal</literal>-method takes the transition with 
+    the signal parameter as the transition name.  So when an execution receives an 
+    external trigger, the signal name is interpreted as the name of an outgoing
+    transition and the execution will be propagated over that transition.
+    </para>
+    <para>Here's the same simple process that has a transition from a to b.  This 
+    time, the behaviour of the two nodes will be WaitState's.
+    </para>
+    <figure id="process.diagram">
+      <title>The external activity example process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
+    </figure>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
+    <emphasis role="bold">.node("a").initial().behaviour(new WaitState())</emphasis>
+      .transition().to("b")
+    <emphasis role="bold">.node("b").behaviour(new WaitState())</emphasis>
+.done();</programlisting>
+    <para>Let's start a new process instance for this process definition:</para>
+    <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+    <para>Starting this process will execute the <literal>WaitState</literal> activity 
+    in node <literal>a</literal>.  <literal>WaitState.execute</literal> will invoke 
+    <literal>ActivityExecution.waitForSignal</literal>.  So when the 
+    <literal>processDefinition.startProcessInstance()</literal> returns, the execution 
+    will still be positioned in node a.  
+    </para>
+    <programlisting>assertEquals("a", execution.getNodeName());</programlisting>
+    <para>Then we provide the external trigger by calling the <literal>signal</literal> 
+    method.
+    </para>
+    <programlisting>execution.signal();</programlisting>
+    <para>The <literal>execution.signal()</literal> will delegate to the activity 
+    of the current node.  So in this case that is the <literal>WaitState</literal>
+    activity in node <literal>a</literal>.  The <literal>WaitState.signal</literal>
+    will invoke the <literal>ActivityExecution.take(String transitionName)</literal>.
+    Since we didn't supply a signalName, the first transition with name <literal>null</literal>
+    will be taken.  The only transition we specified out of node <literal>a</literal> 
+    didn't get a name so that one will be taken.  And that transition points to node 
+    <literal>b</literal>.  When the execution arrives in node <literal>b</literal>,
+    the <literal>WaitState</literal> in node <literal>b</literal> is executed. 
+    Similar as we saw above, the execution will wait in node <literal>b</literal>
+    and this time the <literal>signal</literal> method will return, leaving the 
+    execution positioned in node <literal>b</literal>.  
+    </para>
+    <programlisting>assertEquals("b", execution.getNodeName());</programlisting>
+  </section>
+  
+  <!-- ### BASIC PROCESS EXECUTION ######################################## -->
+  <section id="basicprocessexecution">
+    <title>Basic process execution</title>
+    <para>In this next example, we'll combine automatic activities and wait states.
+    This example builds upon the loan approval process with the <literal>WaitState</literal>
+    and <literal>Display</literal> activities that we've just created.  Graphically,
+    the loan process looks like this:  
+    </para>
+    <figure id="basicprocessexecution.loan.process">
+      <title>The loan process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Building process graphs in Java code can be tedious because you have to keep track of all the 
+    references in local variables.  To resolve that, the Process Virtual Machine comes with a 
+    ProcessFactory.  The ProcessFactory is a kind of domain specific language (DSL) that is embedded 
+    in Java and eases the construction of process graphs.  This pattern is also known as 
+    a <ulink url="http://martinfowler.com/bliki/FluentInterface.html">fluent 
+    interface</ulink>.    
+    </para>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+  .node(<emphasis role="bold">"submit loan request"</emphasis>).initial().behaviour(new Display("loan request submitted"))
+    .transition().to("evaluate")
+  <emphasis role="bold">.node("evaluate").behaviour(new WaitState())</emphasis>
+    .transition("approve").to("wire money")
+    .transition("reject").to("end")
+  <emphasis role="bold">.node("wire money").behaviour(new Display("wire the money"))</emphasis>
+    .transition().to("archive")
+  <emphasis role="bold">.node("archive").behaviour(new WaitState())</emphasis>
+    .transition().to("end")
+  <emphasis role="bold">.node("end").behaviour(new WaitState())</emphasis>
+.done();</programlisting>
+    <para>For more details about the ProcessFactory, see <ulink url="../../api/org/jbpm/pvm/package-summary.html">the
+    api docs</ulink>.  An alternative for 
+    the ProcessFactory would be to create an XML language and an XML parser for expressing 
+    processes.  The XML parser can then instantiate the classes of package 
+    <literal>org.jbpm.pvm.internal.model</literal> directly. That approach is typically taken by 
+    process languages.  
+    </para>
+    <para>The initial node <literal>submit loan request</literal> and the node 
+    <literal>wire the money</literal> are automatic nodes.  In this example, 
+    the <literal>Display</literal> implementation of node 
+    <literal>wire the money</literal> uses the Java API's to just print a 
+    message to the console.  But the witty reader can imagine an alternative 
+    <literal>Activity</literal> implementation that uses the Java API of a payment 
+    processing library to make a real automatic payment.  
+    </para>
+    <para>A new execution for the process above can be started like this
+    </para>
+    <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+    <para>When the <literal>startExecution</literal>-method returns, the node 
+    <literal>submit loan request</literal> will be executed and the execution will be 
+    positioned in the node <literal>evaluate</literal>.
+    </para>
+    <figure id="execution.loan.evaluate">
+      <title>Execution positioned in the 'evaluate' node</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.evaluate.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Now, the execution is at an interesting point.  There are two transitions out of 
+    the state <literal>evaluate</literal>.  One transition is called <literal>approve</literal> 
+    and one transition is called <literal>reject</literal>.  As we explained above, the WaitState
+    implementation will take the transition that corresponds to the signal that is given.  
+    Let's feed in the 'approve' signal like this:
+    </para>
+    <programlisting>execution.signal("approve");</programlisting>
+    <para>The <literal>approve</literal> signal will cause the execution to take the <literal>approve</literal>
+    transition and it will arrive in the node <literal>wire money</literal>.
+    </para>
+    <para>In node <literal>wire money</literal>, the message will be printed to the console.
+    Since, the <literal>Display</literal> activity didn't invoke the 
+    <literal>execution.waitForSignal()</literal>, nor any of the other execution propagation 
+    methods, the implicit proceed behaviour will just make the execution continue 
+    over the outgoing transition to node <literal>archive</literal>, which is again 
+    a <literal>WaitState</literal>.
+    </para>
+    <figure id="execution.loan.archive">
+      <title>Execution positioned in 'archive' node</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.archive.png"/></imageobject></mediaobject>
+    </figure>
+    <para>So only when the <literal>archive</literal> wait state is reached, 
+    the <literal>signal("approve")</literal> returns.   
+    </para>
+    <para>Another signal like this:</para>
+    <programlisting>execution.signal("approve");</programlisting>
+    <para>will bring the execution eventually in the end state.</para>
+    <figure id="execution.loan.end">
+      <title>Execution positioned in the 'end' node</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.end.png"/></imageobject></mediaobject>
+    </figure>
+  </section>
+
+  <!-- ### EVENTS ######################################################### -->
+  <section id="events">
+    <title>Events</title>
+    <para>Events are points in the process definition to which a list of 
+    <literal>EventListener</literal>s can be subscribed. 
+    </para>
+    <programlisting>public interface EventListener extends Serializable {
+  
+  void notify(EventListenerExecution execution) throws Exception;
+
+}</programlisting>
+    <para>The motivation for events is to allow for 
+    developers to add programming logic to a process without changing the process diagram.  
+    This is a very valuable instrument in facilitating the collaboration between business analysts 
+    and developers.  Business analysts
+    are responsible for expressing the requirements.  When they use a process graph to document 
+    those requirements, developers can take this diagram and make it executable.  Events can 
+    be a very handy to insert technical details into a process (like e.g. some database insert) 
+    in which the business analyst is not interested.   
+    </para>
+    <para>Most common events are fired by the execution automatically:
+    </para>
+    <para><emphasis role="bold">WARNING: the following event names will be 
+    subject to change in the next release: see 
+    <ulink url="https://jira.jboss.org/jira/browse/JBPM-1753">JBPM-1753</ulink></emphasis>
+    </para>
+    <itemizedlist>
+      <listitem><literal><emphasis role="bold">Event.TRANSITION_TAKE</emphasis> = "transition-take"</literal> : 
+      fired on transitions when transitions are taken. 
+      </listitem>
+      <listitem><literal><emphasis role="bold">Event.NODE_BEGIN</emphasis> = "node-begin"</literal> : fired on the node 
+      when execution enters that node.  This happens when execution takes a transition 
+      to that node, when a child node is being executed with <literal>execution.execute(Node)</literal>
+      or when a transition is taken from a node outside that node to a contained node.
+      The latter refers to super states in state machines.  
+      </listitem>
+      <listitem><literal><emphasis role="bold">Event.NODE_END</emphasis> = "node-end"</literal> : fired on the node 
+      when a transition is taken out of that node or when a child node execution is 
+      finished and the execution is propagated to the parent node.
+      </listitem>
+      <listitem><literal><emphasis role="bold">Event.PROCESS_BEGIN</emphasis> = "process-begin"</literal> : fired on a process 
+      when a new process is started.
+      </listitem>
+      <listitem><literal><emphasis role="bold">Event.PROCESS_END</emphasis> = "process-end"</literal> : fired on a process 
+      when a new process is ended.  This might include a executions that are ended 
+      with a cancelled or error state.
+      </listitem>
+    </itemizedlist>
+    <para>Events are identified by the combination of a process element 
+    and an event name.  Users and process languages can also fire events 
+    programmatically with the fire method on the Execution:
+    </para>
+    <programlisting>public interface Execution extends Serializable {
+  ...
+  void fire(String eventName, ProcessElement eventSource);
+  ...
+}</programlisting>
+    
+    <para>A list of <literal>EventListeners</literal> can be associated to an 
+    event. But event listeners can not influence the control flow of the execution since 
+    they are merely listeners to an execution which is already in progress.  This is different from 
+    activities that serve as the behaviour for nodes.  Node behaviour activities are responsible 
+    for propagating the execution. 
+    </para>
+    <para>We'll create a <literal>PrintLn</literal> event listener which is 
+    very similar to the <literal>Display</literal> activity from above.
+    </para>
+    <programlisting>public class PrintLn implements EventListener {
+  
+  String message;
+  
+  public PrintLn(String message) {
+    this.message = message;
+  }
+
+  public void notify(EventListenerExecution execution) throws Exception {
+    System.out.println("message");
+  }
+}</programlisting>
+    <para>Several <literal>PrintLn</literal> listeners will be subscribed to events in 
+    the process.</para>
+    <figure id="action.process">
+      <title>The PrintLn listener process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
+    </figure>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
+  .node("a").initial().behaviour(new AutomaticActivity())
+    <emphasis role="bold">.event("node-end")
+      .listener(new PrintLn("leaving a"))
+      .listener(new PrintLn("second message while leaving a"))</emphasis>
+    .transition().to("b")
+      <emphasis role="bold">.listener(new PrintLn("taking transition"))</emphasis>
+  .node("b").behaviour(new WaitState())
+    .event("node-begin")
+      <emphasis role="bold">.listener(new PrintLn("entering b"))</emphasis>
+.done();</programlisting>
+     <para>The first event shows how to register multiple listeners to the same 
+     event.  They will be notified in the order as they are specified.
+     </para>
+     <para>Then, on the transition, there is only one type of event.  So in that case,
+     the event type must not be specified and the listeners can be added directly on 
+     the transition.
+     </para>
+     <para>A listeners will be called each time an execution fires the event to 
+     which the listener is subscribed.  The execution will be provided in the activity 
+     interface as a parameter and can be used by listeners except for the methods that
+     control the propagation of execution.
+     </para>   
+   </section>
+
+  <!-- ### EVENT PROPAGATION ############################################## -->
+  <section>
+    <title>Event propagation</title>
+    <para>Events are by default propagated to enclosing process elements.  The motivation 
+    is to allow for listeners on process definitions or composite nodes that get executed
+    for all events that occur within that process element.  For example this feature 
+    allows to register an event listener on a process definition or a composite node on 
+    <literal>node-end</literal> events.  Such action will be executed if that node is 
+    left.  And if that event listener is registered on a composite node, it will also be executed 
+    for all nodes that are left within that composite node. 
+    </para>
+    <para>To show this clearly, we'll create a <literal>DisplaySource</literal> event listener
+    that will print the message <literal>leaving</literal> and the source of the event
+    to the console.
+    </para>
+    <programlisting>public class <emphasis role="bold">DisplaySource</emphasis> implements EventListener {
+    
+  public void execute(EventListenerExecution execution) {
+    <emphasis role="bold">System.out.println("leaving "+execution.getEventSource());</emphasis>
+  }
+}</programlisting>
+    <para>Note that the purpose of event listeners is not to be visible, that's why the event listener 
+    itself should not be displayed in the diagram. A <literal>DisplaySource</literal> event listener
+    will be added as a listener to the event <literal>node-end</literal> on the composite node.  
+    </para>
+    <para>The next process shows how the <literal>DisplaySource</literal> event listener is registered 
+    as a listener to to the 'node-end' event on the <literal>composite</literal> node:</para>
+    <figure id="process.propagate">
+      <title>A process with an invisible event listener on a node-end event on a composite node.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.propagate.png"/></imageobject></mediaobject>
+    </figure>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("propagate")
+  <emphasis role="bold">.compositeNode("composite")
+    .event(Event.NODE_END) 
+      .listener(new DisplaySource())</emphasis>
+    .node("a").initial().behaviour(new WaitState())
+      .transition().to("b")
+    .node("b").behaviour(new WaitState())
+      .transition().to("c")
+  .compositeEnd()
+  .node("c").behaviour(new WaitState())
+.done();</programlisting>
+    <para>Next we'll start an execution.</para>
+    <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+    <para>After starting a new execution, the execution will be in node <literal>a</literal> as 
+    that is the initial node.  No nodes have been left so no message is logged.  Next a signal 
+    will be given to the execution, causing it to take the transition from <literal>a</literal>
+    to <literal>b</literal>.
+    </para>
+    <programlisting>execution.signal();</programlisting>  
+    <para>When the signal method returns, the execution will have taken the transition and 
+    the <literal>node-end</literal> event will be fired on node <literal>a</literal>.  That 
+    event will be propagated to the 
+    composite node and to the process definition.  Since our <literal>DisplaySource</literal> 
+    event listener is placed 
+    on the <literal>composite</literal> node, it will receive the event and print the following 
+    message on the console:
+    </para>
+    <programlisting>leaving node(a)</programlisting>
+    <para>Another</para>
+    <programlisting>execution.signal();</programlisting>
+    <para>will take the transition from b to c.  That will fire two node-leave events.  One on  
+    node b and one on node composite.  So the following lines will be appended to the console 
+    output:</para>  
+    <programlisting>leaving node(b)
+leaving node(composite)</programlisting>
+    <para>Event propagation is build on the hierarchical composition structure of the process 
+    definition.  The top level element is always the process definition.  The process 
+    definition contains a list of nodes.  Each node can be a leaf node or it can be a 
+    composite node, which means that it contains a list of nested nodes.  Nested nodes 
+    can be used for e.g. super states or composite activities in nested process languages like BPEL.    
+    </para>
+    <para>So the even model also works similarly for composite nodes as it did for the process 
+    definition above.  Suppose that 'Phase one' models 
+    a super state as in state machines.  Then event propagation allows to subscribe to all events 
+    within that super state.  The idea is that the hierarchical composition corresponds to 
+    diagram representation. If an element 'e' is drawn inside another element 'p', then p 
+    is the parent of e. A process definition has a set of top level nodes.  Every node can have 
+    a set of nested nodes.  The parent of a transition is considered as the first common 
+    parent for it's source and destination.  
+    </para>
+    <para>If an event listener is not interested in propagated events, propagation can be disabled 
+    with <literal>propagationDisabled()</literal> while building the process with the 
+    <literal>ProcessFactory</literal>.  The next process is the same process 
+    as above except that propagated events will be disabled on the event listener.  The graph diagram
+    remains the same.
+    </para>
+    <figure id="process.propagate.propagation.disabled">
+      <title>A process with an event listener to 'node-end' events with propagation disabled.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.propagate.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Building the process with the process factory:
+    </para>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("propagate")
+  .compositeNode("composite")
+    .event(Event.NODE_END) 
+      .listener(new DisplaySource())
+      <emphasis role="bold">.propagationDisabled()</emphasis>
+    .node("a").initial().behaviour(new WaitState())
+      .transition().to("b")
+    .node("b").behaviour(new WaitState())
+      .transition().to("c")
+  .compositeEnd()
+  .node("c").behaviour(new WaitState())
+.done();</programlisting>
+    <para>So when the first signal is given for this process, again the <literal>node-end</literal> 
+    event will be fired on node <literal>a</literal>, but now the event listener on the composite 
+    node will not be executed cause 
+    propagated events have been disabled.  Disabling propagation is a property on the individual 
+    event listener and doesn't influence the other listeners.  The event will always be fired and 
+    propagated over the whole parent hierarchy.
+    </para>
+    <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+    <para>The first signal will take the process from <literal>a</literal> to 
+    <literal>b</literal>.  No messages will be printed to the console.
+    </para>
+    <programlisting>execution.signal();</programlisting>
+    <para>Next, the second signal will take the transition from b to c.  
+    </para>
+    <programlisting>execution.signal()</programlisting>
+    <para>Again two <literal>node-end</literal>
+    events are fired just like above on nodes <literal>b</literal> and <literal>composite</literal> 
+    respectively.  The first event 
+    is the <literal>node-end</literal> event on node <literal>b</literal>.  That will be propagated 
+    to the <literal>composite</literal> node.  So the event 
+    listener will not be executed for this event cause it has propagation disabled.  But the 
+    event listener will be executed for the <literal>node-end</literal> event on the 
+    <literal>composite</literal> node.  That is not 
+    propagated, but fired directly on the <literal>composite</literal> node.  So the event 
+    listener will now be executed 
+    only once for the composite node as shown in the following console output: 
+    </para>
+    <programlisting>leaving node(composite)</programlisting>
+  </section>
+
+</chapter>

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,62 @@
+<chapter id="processanatomy">
+  <title>Process anatomy</title>
+  
+  <para>Above we already touched briefly on the two main process constructs: 
+  Nodes, transitions and node composition.  This chapter explores in full 
+  all the possibilities of the process definition structures.
+  </para>
+  
+  <para>There are basically two forms of process languages: graph based and composite 
+  process languages.  First of all, the process supports both.  Even graph based execution 
+  and node composition can be used in combination to implement something like UML super states.
+  Furthermore, automatic functional activities can be implemented so that they can be 
+  used with transitions as well as with node composition.
+  </para>
+
+  <figure id="process.anatomy">
+    <title>UML class diagram of the logical process structure</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/process.anatomy.classes.png"/></imageobject></mediaobject>
+  </figure>
+  
+  <para>Next we'll show a series of example diagram structures that can be formed 
+  with the PVM process model.
+  </para>
+  
+  <figure id="transition">
+    <title>Any two nodes can be connected with a transition.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.png"/></imageobject></mediaobject>
+  </figure>
+
+  <figure id="self.transition">
+    <title>A self transition.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/self.transition.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="composite.node">
+    <title>Composite node is a list of nested nodes.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/composite.node.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="transition.into.composite">
+    <title>Transition to a node inside a composite.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.into.composite.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="transition.out.of.composite">
+    <title>Transition from a node inside a composite to a node outside the composite.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.out.of.composite.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="transition.inheritence">
+    <title>Transition of composite nodes are inherited.  The node inside can take the transition of the composite node.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.inheritence.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="transition.to.outer">
+    <title>Transition from a node to an outer composite.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.to.outer.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="transition.to.inner">
+    <title>Transition from a composite node to an inner composed node.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/transition.to.inner.png"/></imageobject></mediaobject>
+  </figure>
+  <figure id="initial.in.composite">
+    <title>An initial node inside a composite node.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/initial.in.composite.png"/></imageobject></mediaobject>
+  </figure>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,393 @@
+<chapter id="advancedgraphexecution">
+  <title>Advanced graph execution</title>
+
+  <!-- ### LOOPS ########################################################## -->
+  <section>
+    <title>Loops</title>
+    <para>Activities can implement loops based on transitions or on node composition.  
+    Loops can contain wait states.    
+    </para>
+    <para>To support high numbers of automatic loop executions, the Process Virtual Machine 
+    tranformed the propagation of execution from tail recursion to a while loop.
+    </para>
+  </section>
+
+  <!-- ### SUB PROCESSES ################################################## -->
+  <section>
+    <title>Sub processes</title>
+    <para>TODO: sub processes</para>
+  </section>
+  
+  <!-- ### DEFAULT PROCEED BEHAVIOUR ###################################### -->
+  <section id="implicitproceedbehaviour">
+    <title>Implicit proceed behaviour</title>
+    <para>When an <literal>Activity</literal> is used as node behaviour, it can 
+    explicitely propagate the execution with following methods:
+    </para>
+    <itemizedlist>
+      <listitem><literal>waitForSignal()</literal></listitem>
+      <listitem><literal>take(Transition)</literal></listitem>
+      <listitem><literal>end(*)</literal></listitem>
+      <listitem><literal>execute(Node)</literal></listitem>
+      <listitem><literal>createExecution(*)</literal></listitem>
+    </itemizedlist>
+    <para>When <literal>Activity</literal> implementations used for node behviour 
+    don't call any of the following execution propagation methods, then, after 
+    the activity is executed, the execution will apply the implicit proceed behaviour. 
+    </para>
+    <para>The implicit proceed behaviour is defined as follows:</para>
+    <itemizedlist>
+      <listitem>If the current node has a default outgoing transition, take it.</listitem>
+      <listitem>If the current node has a parent node, move back to the parent node.</listitem>
+      <listitem>Otherwise, end this execution.</listitem>
+    </itemizedlist>
+    <para>Process languages can overwrite the implicit proceed behaviour 
+    by overriding the <literal>proceed</literal> method in 
+    <literal>ExecutionImpl</literal>.
+    </para>
+  </section>
+
+  <!-- ### FUNCTIONAL ACTIVITIES ################################ -->
+  <section id="functionalactivities">
+    <title>Functional activities</title>
+    <para>Activities that also can be used as event listeners are called functional 
+    activities. Examples of automatic activities are sending an email, doing a database 
+    update, generating a pdf, calculating an average, etc.  All of these are automatic 
+    activities that do not change the execution flow.  Here's how such activities can 
+    be implemented:  
+    </para>
+    <programlisting>public class FunctionalActivity implements Activity, EventListener {
+    public void execute(ActivityExecution execution) {
+      perform(execution);
+    }
+    public void notify(EventListenerExecution execution) {
+      perform(execution);
+    }
+    void perform(OpenExecution execution) {
+      ...do functional work...
+    }
+  }</programlisting>
+    <para>The <literal>perform</literal> method takes an <literal>OpenExecution</literal>, 
+    which is the supertype of both <literal>ActivityExecution</literal> and 
+    <literal>EventListenerExecution</literal>.  <literal>OpenExecution</literal>
+    does not allow any of the specific purpose methods, but still 
+    the current state and the process definition can be inspected as well 
+    as the variables, which contain the context information for the process 
+    execution.
+    </para>
+    <para>None of these methods actually invoke execution propagation methods.
+    So after the perform method is completed, the execution will
+    <link linkend="implicitproceedbehaviour">proceed in the default way</link>.
+    </para>
+  </section>
+    
+
+  <!-- ### EXECUTION AND THREADS ########################################## -->
+  <section id="executionandthreads">
+    <title>Execution and threads</title>
+    <para>This section explains how the Process Virtual Machine boroughs the thread
+    from the client to bring an execution from one wait state to another.
+    </para>
+    <para>When a client invokes a method (like e.g. the signal method) on an execution, 
+    by default, the Process Virtual Machine will use that thread to progress the execution
+    until it reached a wait state.  Once the next wait state has been reached, the 
+    method returns and the client gets the thread back.  This is the default way 
+    for the Process Virtual Machine to operate.  Two more levels of asynchonous 
+    execution complement this default behaviour: 
+    <link linkend="asynchronouscontinuations">Asynchronous continuations</link>
+    and the <link linkend="architecture">asynchronous command service</link>.
+    </para>
+    <para>The next process will show the basics concretely.  It has three wait states 
+    and four automatic nodes.
+    </para>
+    <figure id="process.automatic">
+      <title>Process with many sequential automatic activities.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/process.automatic.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Here's how to build the process:</para>
+    <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("automatic")
+    .<emphasis role="bold">node("wait 1").initial()</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+      .transition().to("automatic 1")
+    .<emphasis role="bold">node("automatic 1")</emphasis>.behaviour(new <emphasis role="bold">Display("one")</emphasis>)
+      .transition().to("wait 2")
+    .<emphasis role="bold">node("wait 2")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+      .transition().to("automatic 2")
+    .<emphasis role="bold">node("automatic 2")</emphasis>.behaviour(new <emphasis role="bold">Display("two")</emphasis>)
+      .transition().to("automatic 3")
+    .<emphasis role="bold">node("automatic 3")</emphasis>.behaviour(new <emphasis role="bold">Display("three")</emphasis>)
+      .transition().to("automatic 4")
+    .<emphasis role="bold">node("automatic 4")</emphasis>.behaviour(new <emphasis role="bold">Display("four")</emphasis>)
+      .transition().to("wait 3")
+    .<emphasis role="bold">node("wait 3")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+.done();</programlisting>
+    <para>Let's walk you through one execution of this process.  
+    </para>
+    <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
+    <para>Starting a new execution means that the initial node is executed.  So if an automatic 
+    activity is the initial node, this means that immediately the first unnamed outgoing transition 
+    is taken.  This happens all inside of the invocation of <literal>startProcessInstance</literal>.
+    </para>
+    <para>In this case however, the initial node is a wait state.  So 
+    the method <literal>startProcessInstance</literal> returns immediately and the execution will be 
+    positioned in the initial node 'wait 1'.
+    </para>
+    <figure id="execution.automatic.wait1">
+      <title>A new execution will be positioned in 'wait 1'.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.automatic.wait1.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Then an external trigger is given with the signal method.</para>
+    <programlisting>execution.signal();</programlisting>
+    <para>As explained above when <link linkend="externalactivityexample">introducing the WaitState</link>, 
+    that signal will cause the default transition to be taken.  The 
+    transition will move the execution to node <literal>automatic 1</literal> and execute it.  
+    The execute method of the <literal>Display</literal> activity in <literal>automatic 1</literal> 
+    print a line to the console and it will <emphasis role="bold">not</emphasis> call 
+    <literal>execution.waitForSignal()</literal>.  Therefore, the execution will proceed by 
+    taking the default transition out of <literal>automatic 1</literal>.  At this stage, the 
+    signal method is still blocking.  Another way to think about it is that the execution 
+    methods like <literal>signal</literal> will use the thread of the client to interpret 
+    the process definition until a wait state is reached.   
+    </para>
+    <para>Then the execution arrives in <literal>wait 2</literal> and executes 
+    the <literal>WaitState</literal> activity.  That method will invoke 
+    the <literal>execution.waitForSignal()</literal>, which will cause the signal method 
+    to return.  That is when the thread is given back to the client that invoked the 
+    <literal>signal</literal> method.
+    </para>
+    <para>So when the signal method returns, the execution is positioned in <literal>wait 2</literal>.</para>
+    <figure id="execution.automatic.wait2">
+      <title>One signal brought the execution from 'initial' to 'wait 2'.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.automatic.wait2.png"/></imageobject></mediaobject>
+    </figure>
+    <para>Then the execution is now waiting for an external trigger just as an object 
+    (more precisely an object graph) in memory until the next external trigger is given 
+    with the signal method.
+    </para>
+    <programlisting>execution.signal();</programlisting>
+    <para>This second invocation of signal will take the execution similarly all the 
+    way to <literal>wait 3</literal> before it returns.
+    </para>
+    <figure id="automatic.wait3">
+      <title>The second signal brought the execution all the way to 'wait 3'.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/ch04.automatic.wait3.png"/></imageobject></mediaobject>
+    </figure>
+    <para>The benefits of using this paradigm is that the same process definition 
+    can be executed in <link linkend="clientexecutionmode">client execution mode</link> 
+    (in-memory without persistence) as well as in <link linkend="persistentexecutionmode">
+    persistent execution mode</link>, depending on the application and on the environment.
+    </para>
+    <para>When executing a process in persistent mode, this is how you typically want 
+    to bind that process execution to transactions of the database:
+    </para>
+    <figure id="transactions.png">
+      <title>Transactions over time in persistent execution mode.</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/transactions.png"/></imageobject></mediaobject>
+    </figure>
+    <para>In most situations, the computational work that needs to be done as part of 
+    the process after an external trigger (the red pieces) is pretty minimal.  Typically 
+    transactions combining the process execution and processing the request from the 
+    UI takes typically less then a second.  Whereas the wait state in business processes 
+    typically can span for hours, days or even years.  The clue is to clearly distinct 
+    when a wait state starts so that only the computational work done before the start 
+    of that wait state should be included in the transaction.  
+    </para>
+    <para>Think of 
+    it this way: &quot;When an approval arrives, what are all the automated processing that 
+    needs to be done before the process system needs to wait for another external 
+    trigger?&quot;  Unless pdf's need to be generated or mass emails need to be send,
+    the amount of time that this takes is usually neglectable.  That is why in the 
+    default persistent execution mode, the process work is executed in the thread 
+    of the client.
+    </para>
+    <para>This reasoning even holds in case of concurrent paths of execution.  
+    When a single path of execution splits into concurrent paths of execution,
+    the process overhead of calculating that is neglectable.  So that is why it 
+    makes sense for a fork or split activity implementation that targets persistent 
+    execution mode to spawn the concurrent paths sequentially in the same thread.
+    Basically it's all just computational work as part of the same transaction.
+    This can only be done because the fork/split knows that each concurrent path 
+    of execution will return whenever a wait state is encountered. 
+    </para>
+    <para>Since this is a difficult concept to grasp, I'll explain it again with other 
+    words.  Look at it from the overhead that is produced by the process execution 
+    itself in persistent execution mode.  If in a transaction, an execution is given 
+    an external trigger and that causes the execution to split into multiple concurrent 
+    paths of execution.  Then the process overhead of calculating this is neglectable. 
+    Also the overhead of the generated SQL is neglectable.  And since all the work done 
+    in the concurrent branches must be done inside that single transaction, there is 
+    typically no point in having fork/split implementations spawn the concurrent 
+    paths of execution in multiple threads. 
+    </para>
+    <para>To make executable processes, developers need to know exactly what the automatic activities
+    are, what the wait states are and which threads will be allocated to the process execution.  
+    For business analysts that draw the analysis process, things are a bit simpler.   For the  
+    activities they draw, they usually know whether it's a human or a system that is responsible.
+    But they typically don't not how this translates to threads and transactions.
+    </para>
+    <para>So for the developer, the first job is to analyse what needs to be executed 
+    within the thread of control of the process and what is outside.  Looking for the external 
+    triggers can be a good start to find the wait states in a process, just like verbs and nouns 
+    can be the rule of thumb in building UML class diagrams. 
+    </para>
+  </section>
+  
+  <!-- ### PROCESS CONCURRENCY ############################################ -->
+  <section>
+    <title>Process concurrency</title>
+    <para>To model process concurrency, there is a parent-child tree structure on the 
+    execution. The idea is that the main path of execution is the root of that tree.
+    The main path of execution is also called the process instance.  It is the execution 
+    that is created when starting or creating a new process instance for a given  
+    process definition. 
+    </para>
+    <para>Now, because the main path of execution is the same object as the 
+    process instance, this keeps the usage simple in case of simple processes 
+    without concurrency. 
+    </para>
+    <figure id="execution.structure">
+      <title>UML class diagram of the basic execution structure</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.execution.png"/></imageobject></mediaobject>
+    </figure>
+    <para>To establish multiple concurrent paths of execution, activity implementations 
+    like a fork or split can create child executions with method 
+    <literal>ActivityExecution.createExecution</literal>.  Activity implementations 
+    like join or merge can stop these concurrent paths of execution by calling 
+    method <literal>stop</literal> on the concurrent execution.  
+    </para>
+    <para>Only leaf executions can be active.  Non-leave executions should be 
+    inactive.  This tree structure of executions doesn't enforce a particular type of 
+    concurrency or join behaviour.  It's up to the forks or and-splits and to the joins 
+    or and-merges to use the execution tree structure in any way they want to define 
+    the wanted concurrency behaviour.  Here you see an example 
+    of concurrent executions. 
+    </para>
+    <figure id="concurrency">
+      <title>Concurrent paths of execution</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/execution.concurrency.png"/></imageobject></mediaobject>
+    </figure>
+    <para>There is a billing and a shipping path of execution.  In this case, the 
+    flat bar nodes represent nodes that fork and join.  The execution shows a three 
+    executions.  The main path of execution is inactive (represented as gray) and the 
+    billing and shipping paths of execution are active and point to the node 
+    <literal>bill</literal> and <literal>ship</literal> respectively.
+    </para>
+    <para>It's up to the node behaviour implementations how they want to use this 
+    execution structure.  Suppose that multiple tasks have to be completed before the 
+    execution is to proceed.  The node behaviour can spawn a series of child executions 
+    for this.  Or alternatively, the task component could support task groups that 
+    are associated to one single execution.  In that case, the task component becomes
+    responsible for synchronizing the tasks, thereby moving this responsibility 
+    outside the scope of the execution tree structure.
+    </para>
+  </section>
+
+  <!-- ### EXCEPTION HANDLERS ############################################# -->
+  <section>
+    <title>Exception handlers</title>
+    <para>In all the code that is associated to a process
+    like <literal>Activity</literal>s, <literal>EventListeners</literal> and 
+    <literal>Condition</literal>s, it's possible to associate exception handlers.  This 
+    can be thought of as including try-catch blocks in 
+    the method implementations of those implementations.  But in order to build more reusable building 
+    blocks for both the delegation classes and the exception handling logic, exception handlers are 
+    added to the core process model. 
+    </para>
+    <para>An exception handler can be associated to any process element.  When an exception 
+    occurs in a delegation class, a matching exception handler will be searched for.  If 
+    such an exception handler is found, it will get a chance to handle the exception.
+    </para>
+    <para>If an exception handler completes without problems, then the exception is considered 
+    handled and the execution resumes right after the delegation code that was called.  For example,
+    a transition has three actions and the second action throws an exception that is handled 
+    by an exception handler, then   
+    </para>
+    <para>Writing automatic activities that are exception handler aware is easy.  The 
+    default is to proceed anyway.  No method needs to be called on the execution.  So 
+    if an automatic activity throws an exception that is handled by an exception handler,
+    the execution will just proceed after that activity.  It becomes a big more difficult 
+    for control flow activities.  They might have to include try-finally blocks to 
+    invoke the proper methods on the execution before an exception handler gets a 
+    chance to handle the exception.  For example, if an activity is a wait state and 
+    an exception occurs, then there is a risk that the thread jumps over the 
+    invocation of <literal>execution.waitForSignal()</literal>, causing the execution 
+    to proceed after the activity. 
+    </para>
+    <para>TODO: exceptionhandler.isRethrowMasked</para>
+    <para>TODO: transactional exception handlers</para>
+    <para>TODO: we never catch errors</para>
+  </section>
+
+  <!-- ### PROCESS MODIFICATIONS ########################################## -->
+  <section>
+    <title>Process modifications</title>
+    <para>TODO: process modifications</para>
+  </section>
+
+  <!-- ### LOCKING AND EXECUTION STATE #################################### -->
+  <section>
+    <title>Locking and execution state</title>
+    <para>The state of an execution is either active or locked. An active 
+    execution is either executing or waiting for an external trigger. If an 
+    execution is not in <literal>STATE_ACTIVE</literal>, then it is locked. 
+    A locked execution is read only and cannot receive any external triggers.
+    </para> 
+    <para>When a new execution is created, it is in STATE_ACTIVE. To change 
+    the state to a locked state, use lock(String). Some STATE_* constants 
+    are provided that represent the most commonly used locked states. But 
+    the state '...' in the picture indicates that any string can be provided 
+    as the state in the lock method.
+    </para>
+    <figure id="execution.states">
+      <title>States of an execution</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/ch04.execution.states.png"/></imageobject></mediaobject>
+    </figure>
+    <para>If an execution is locked, methods that change the execution will 
+    throw a PvmException and the message will reference the actual locking state. 
+    Firing events, updating variables, updating priority and adding comments 
+    are not considered to change an execution. Also creation and removal of child 
+    executions are unchecked, which means that those methods can be invoked by 
+    external API clients and node behaviour methods, even while the execution 
+    is in a locked state.
+    </para> 
+    <para>Make sure that comparisons between getState() and the STATE_* constants 
+    are done with .equals and not with '==' because if executions are loaded 
+    from persistent storage, a new string is created instead of the constants.
+    </para> 
+    <para>An execution implementation will be locked:
+    </para>
+    <itemizedlist>
+      <listitem>When it is ended</listitem>
+      <listitem>When it is suspended</listitem>
+      <listitem>During asynchronous continuations</listitem>
+    </itemizedlist>
+    <para>Furthermore, locking can be used by Activity implementations to make 
+    executions read only during wait states hen responsibility for the execution is 
+    transferred to an external entity such as:
+    </para>
+    <itemizedlist>
+      <listitem>A human task</listitem>
+      <listitem>A service invocation</listitem>
+      <listitem>A wait state that ends when a scanner detects that a file appears</listitem>
+    </itemizedlist>
+    <para>In these situations the strategy is that the external entity should get 
+    full control over the execution because it wants to control what is allowed 
+    and what not.  To get that control, they lock the execution so that all interactions 
+    have to go through the external entity. 
+    </para>
+    <para>One of the main reasons to create external entities is that they can live
+    on after the execution has already proceeded.  For example, in case 
+    of a service invocation, a timer could cause the execution to take the timeout transition.
+    When the response arrives after the timeout, the service invocation entity should 
+    make sure it doesn't signal the execution.  So the service invocation can be 
+    seen as a node instance (aka activity instance) and is unique for every execution 
+    of the node.
+    </para>
+    <para>External entities themselves are responsible for managing the execution 
+    lock.  If the timers and client applications are consequent in addressing the 
+    external entities instead of the execution directly, then locking is in theory 
+    unnecessary.  It's up to the node behaviour implementations whether they want 
+    to take the overhead of locking and unlocking.
+    </para>
+  </section>
+
+</chapter>

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch07-Variables.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch07-Variables.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch07-Variables.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,4 @@
+<chapter id="variables">
+  <title>Variables</title>
+  <para>TODO</para>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Timers.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Timers.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Timers.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,4 @@
+<chapter id="timers">
+  <title>Timers</title>
+  <para>TODO</para>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch09-AsynchronousContinuations.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch09-AsynchronousContinuations.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch09-AsynchronousContinuations.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,4 @@
+<chapter id="asynchronouscontinuations">
+  <title>Asynchronous continuations</title>
+  <para>TODO</para>
+</chapter>

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch10-SoftwareLogging.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch10-SoftwareLogging.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch10-SoftwareLogging.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,99 @@
+<chapter id="softwarelogging">
+  <title>Software logging</title>
+
+  <section>
+    <title>Configuration</title>
+    <para>PVM can use JDK logging (java.util.logging) or log4j. When the first message is 
+    logged, PVM logging will make the selection with following procedure:
+    <orderedlist>
+      <listitem>If a <literal>logging.properties</literal> resource is found 
+      on the classpath (using the context classloader), then JDK logging will 
+      be used and that file will be used to initialize the JDK logging.
+      </listitem>
+      <listitem>If log4j is found on the classpath, then log4j will be used.
+      The check for log4j will be done by checking availability of class 
+      <literal>org.apache.log4j.LogManager</literal> with the context classloader.
+      </listitem>
+      <listitem>If none of the above, JDK logging will be used.</listitem>
+    </orderedlist>
+    </para>
+  </section>
+
+  <section>
+    <title>Categories</title>
+    <para>The PVM classes use their class name as the category for the logger.
+    </para>
+    <para>To have a basic understanding of what the PVM classes are doing, 
+    turning on the <literal>debug</literal> level is great.  Level 
+    <literal>trace</literal> might be spitting out too much for that 
+    purpose. 
+    </para>
+  </section>
+  
+  <section>
+    <title>JDK logging</title>
+    <para>In JDK logging, <literal>debug</literal>maps to <literal>fine</literal> 
+    and <literal>trace</literal> maps to <literal>finest</literal>. 
+    Level <literal>finer</literal> is not used.
+    </para>
+    <para><literal>org.jbpm.pvm.internal.log.LogFormatter</literal> is part of 
+    the pvm library and it can create a nice one-line output for log messages.
+    It also has a neat feature that creates a unique indentation per thread.
+    To configure it, this is a typical <literal>logging.properties</literal>
+    </para>
+    <programlisting>handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.pvm.internal.log.LogFormatter
+
+# For example, set the com.xyz.foo logger to only log SEVERE messages:
+# com.xyz.foo.level = SEVERE
+
+.level = SEVERE
+org.jbpm.level=FINE
+org.jbpm.tx.level=FINE
+org.jbpm.pvm.internal.wire.level=FINE</programlisting>
+
+<!-- 
+    <para>For production usage, jBPM also includes an error triggered log handler.  This is 
+    a log handler that will only keep the most recent log messages in 
+    memory and these will only be flushed to a file in case an error occurs.
+    </para>
+    <para>to configure it, add <literal>org.jbpm.util.ErrorTriggeredFileHandler</literal>
+    to the handlers in the logging properties like this:
+    </para>
+    <programlisting>handlers = java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler</programlisting>
+    <para>Next snippet shows how in the same logging.properties, the error 
+    triggered file handler can be configured.  The given values are the default 
+    values.
+    </para>
+    <programlisting>org.jbpm.util.ErrorTriggeredFileHandler.size = 500
+org.jbpm.util.ErrorTriggeredFileHandler.push = SEVERE
+org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log</programlisting>
+    <para>Alternatively to using the org.jbpm.util.ErrorTriggeredFileHandler, the 
+    JDK handlers FileHandler and MemoryHandler can used in combination to get 
+    similar results with a bit more configuration.
+    </para>
+
+-->    
+  </section>
+
+  <section>
+    <title>Debugging persistence</title>
+    <para>When testing the persistence, following logging configurations can be 
+    valuable.  Category <literal>org.hibernate.SQL</literal> shows the SQL statement that is executed 
+    and category <literal>org.hibernate.type</literal> shows the values of the parameters that are 
+    set in the queries. 
+    </para>
+    <programlisting>org.hibernate.SQL.level=FINEST
+org.hibernate.type.level=FINEST</programlisting>
+    <para>And in case you get a failed batch as a cause in a hibernate exception,
+    you might want to set the batch size to 0 like this in the hibernate properties:
+    </para>
+    <programlisting>hibernate.jdbc.batch_size = 0</programlisting>
+    <para>Also in the hibernate properties, the following properties allow for 
+    detailed logs of the SQL that hibernate spits out:</para>
+    <programlisting>hibernate.show_sql = true
+hibernate.format_sql = true
+hibernate.use_sql_comments = true</programlisting>
+  </section>
+</chapter>  
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,53 @@
+<chapter id="delegationclasses">
+  <title>Delegation classes</title>
+  
+   <section>
+     <title>What are delegation classes</title>
+     <para>Delegation classes are the classes that implement 
+     <literal>Activity</literal> or <literal>Condition</literal>.  From the Process 
+     Virtual Machine's perspective, these are external classes that provide 
+     programming logic that is inserted into the PVM's graph execution.
+     Delegation classes can be provided by the process languages as well 
+     as by the end users.
+     </para>
+   </section>
+
+   <section>
+     <title>Configuration of delegation classes</title>
+     <para>Delegation classes can be made configurable.  Member fields can 
+     contain configuration parameters so that a delegation class can be 
+     configured differently each time it is used.  For example, in the 
+     <literal><link linkend="activity">Display</link></literal> activity,
+     the message that is to be printed to the console is a configuration 
+     parameter.
+     </para>
+     <para>Delegation classes should be stateless.  This means that executing the interface 
+     methods should not change values of the member fields.  Changing member field values 
+     of delegation classes during execution methods is actually changing the process 
+     while it's executing.  That is not threadsafe and usually leads to unexpected 
+     results.  As an exception, getters and setters might be made available to inject 
+     the configuration cause they are used before the delegation object is actually 
+     used in the process execution.
+     </para>
+  </section>
+
+  <section>
+    <title>Object references</title>
+    <para>TODO</para>
+  </section>
+  
+   <section>
+     <title>Design time versus runtime</title>
+     <para>TODO: the node behaviour allows for design time as well as runtime behaviour.</para>
+   </section>
+    
+   <section>
+     <title>UserCodeInterceptor</title>
+     <para>TODO: UserCodeInterceptor</para>
+   </section>
+    
+   <section>
+     <title>Member field configurations versus properties</title>
+     <para>TODO: document field configurations versus properties</para>
+   </section>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Environment.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Environment.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Environment.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,139 @@
+<chapter id="environment">
+  <title>Environment</title>
+  
+  <section>
+    <title>Introduction</title>
+    <para>The environment component together with the wire context is a kind of 
+    Inversion of Control (IoC) container.  It reads configuration information that 
+    describes how objects should be instantiated, configured and wired together.
+    </para>
+    <para>The environment is used to retrieve resources and services needed by 
+    <literal>Activity</literal> implementations and the Process Virtual Machine 
+    itself.  The main purpose is to make various aspects of the Process Virtual Machine 
+    configurable so that the PVM and the languages that run on top can work 
+    in a standard Java environment as well as an enterprise Java environment.
+    </para>
+    <para>The environment is partitioned into a set of contexts.  Each context 
+    can have its own lifecycle.  For instance, the process-engine context will 
+    strech over the full lifetime of the application.  The block context only 
+    for the duration of a try-finally block.  Typically a block context represents 
+    a database transaction.  Each context exposes a list of key-value 
+    pairs. 
+    </para>
+  </section>
+  
+  <section id="environmentfactory">
+    <title>EnvironmentFactory</title>
+    <para>To start working with an environment, you need an EnvironmentFactory.
+    One single environment factory object can be used throughout the complete 
+    lifetime of the application.  So typically this is kept in a static 
+    member field.  The EnvironmentFactory itself is the process-engine context.
+    </para>
+    <para>An <literal>EnvironmentFactory</literal> is typically obtained by 
+    parsing a configuration file like this:
+    </para>
+    <programlisting>static EnvironmentFactory environmentFactory = 
+        EnvironmentFactory.parse(new ResourceStreamSource("pvm.cfg.xml");</programlisting>
+    <para>See javadocs package org.jbpm.stream for more types of stream sources.
+    </para>
+    <para>There is a default parser in the environment factory that will 
+    create <literal>DefaultEnvironmentFactory</literal>s.  The idea is that we'll 
+    also support spring as an IoC container.  But that is still TODO.  Feel free 
+    to help us out :-).  The parser can be configured with the static setter 
+    method <literal>EnvironmentFactory.setParser(Parser)</literal>
+    </para>
+  </section>
+    
+  <section id="environmentblock">
+    <title>Environment block</title>
+    <para>An environment exists for the duration of a try-finally block.  This is how 
+    an environment block looks like:
+    </para>
+    <programlisting><emphasis role="bold">Environment environment = environmentFactory.openEnvironment();
+try {
+
+  ...
+
+} finally {
+  environment.close();
+}</emphasis></programlisting>
+    <para>The environment block defines another lifespan: the <literal>block</literal> context.  
+    A transaction would be a typical example of an object that is defined in the block 
+    context. 
+    </para>
+    <para>Inside such a block, objects can be looked up from the environment by name 
+    or by type.  If objects can looked up from the environment with method 
+    <literal>environment.get(String name)</literal> or 
+    <literal>&lt;T&gt; T environment.get(Class&lt;T&gt;)</literal>.  
+    </para>
+    <para>when an environment is created, it has a <literal>process-engine</literal> context 
+    and a <literal>block</literal>
+    context.  
+    </para>
+    <para>In the default implementation, the <literal>process-engine</literal> context and 
+    the <literal>block</literal> context are <literal>WireContext</literal>s.  A 
+    <literal>WireContext</literal> contains a description of how its objects are 
+    created and wired together to form object graphs.
+    </para>
+  </section>
+  
+  <section>
+    <title>Example</title>
+    <para>To start with a simple example, we'll need a <literal>Book</literal>:</para>
+    <programlisting>public class <emphasis role="bold">Book</emphasis> {
+  ...
+  public Book() {}
+  ...
+}</programlisting>
+    <para>Then let's create an environment factory that knows how to create book</para>
+    <programlisting>static EnvironmentFactory environmentFactory = EnvironmentFactory.parseXmlString(
+    "&lt;jbpm-configuration&gt;" +
+    "  &lt;process-engine&gt;" +
+    "    &lt;object name='book' class='org.jbpm.examples.ch09.Book' /&gt;" +
+    "  &lt;/process-engine&gt;" +
+    "&lt;/jbpm-configuration&gt;"
+));</programlisting>
+    <para>Now we'll create an environment block with this environment factory and 
+    we'll look up the book in the environment.  First the lookup is done by 
+    type and secondly by name.
+    </para>
+    <programlisting>Environment environment = environmentFactory.openEnvironment();
+try {
+  
+  Book book = <emphasis role="bold">environment.get(Book.class);</emphasis>
+  assertNotNull(book);
+  
+  assertSame(book, <emphasis role="bold">environment.get("book")</emphasis>);
+  
+} finally {
+  environment.close();
+}</programlisting>
+    <para>To prevent that you have to pass the environment as a parameter in 
+    all methods, the current environment is maintained in a threadlocal stack:
+    </para>
+    <programlisting>Environment environment = Environment.getCurrent();</programlisting>
+  </section>
+  
+  <section id="context">
+    <title>Context</title>
+    <para>Contexts can be added and removed dynamically.  Anything can be exposed 
+    as a <literal>Context</literal>.
+    </para>
+    <programlisting>public interface <emphasis role="bold">Context</emphasis> {
+  
+  <emphasis role="bold">Object get(String key);
+  &lt;T&gt; T get(Class&lt;T&gt; type);
+  Set&lt;String&gt; keys();</emphasis>
+
+  ...
+}</programlisting>
+    <para>When doing a lookup on the environment, there is a default search order 
+    in which the contexts will be scanned for the requested object.  The default 
+    order is the inverse of the sequence in which the contexts were added.  E.g.
+    if an object is defined in both the process-engine context and in the block context,
+    the block context is considered more applicable and that will be scanned first.
+    Alternatively, an explicit search order can be passed in with the 
+    <literal>get</literal> lookups as an optional parameter.
+    </para>
+  </section>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,15 @@
+<chapter id="history">
+  <title>History</title>
+
+  <section id="processlogs">
+    <title>Process logs</title>
+  </section>
+
+  <section id="businessintelligence">
+    <title>Business Intelligence (BI)</title>
+  </section>
+
+  <section id="businessactivitymonitoring">
+    <title>Business Activity Monitoring (BAM)</title>
+  </section>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,266 @@
+<chapter id="persistence">
+  <title>Persistence</title>
+  
+  <section>
+    <title>Standard environment configuration</title>
+	  <para>This section describes how the environment can be configured to use 
+	  hibernate in a standard Java environment.
+	  </para>
+	  <programlisting>01 | &lt;jbpm-configuration&gt;
+02 | 
+03 |   &lt;process-engine&gt;
+04 |<emphasis role="bold">     &lt;hibernate-session-factory /&gt;</emphasis>
+05 |<emphasis role="bold">     &lt;hibernate-configuration&gt;</emphasis>
+06 |<emphasis role="bold">       &lt;properties resource="hibernate.properties" /&gt;</emphasis>
+07 |<emphasis role="bold">       &lt;mappings resource="org/jbpm/pvm/pvm.hibernate.mappings.xml" /&gt;</emphasis>
+08 |<emphasis role="bold">       &lt;cache-configuration </emphasis>
+09 |<emphasis role="bold">            resource="org/jbpm/pvm/pvm.cache.xml" </emphasis>
+10 |<emphasis role="bold">            usage="nonstrict-read-write" /&gt;</emphasis>
+11 |<emphasis role="bold">     &lt;/hibernate-configuration&gt;</emphasis>
+12 |   &lt;/process-engine&gt;
+13 |
+14 |   &lt;block&gt;
+15 |<emphasis role="bold">     &lt;standard-transaction /&gt;</emphasis>
+16 |<emphasis role="bold">     &lt;hibernate-session /&gt;</emphasis>
+17 |<emphasis role="bold">     &lt;pvm-db-session /&gt;</emphasis>
+18 |   &lt;/block&gt;
+19 |
+20 | &lt;/jbpm-configuration&gt;</programlisting>
+    <para><literal>line 04</literal> specifies a hibernate session factory in the 
+    process-engine context.  This means that a hibernate session factory is lazy 
+    created when it is first needed and cached in the 
+    <literal>EnvironmentFactory</literal>.
+    </para>
+    <para>A hibernate session factory is build calling the 
+    method <literal>buildSessionFactory()</literal> on a hibernate configuration.
+    By default, the hibernate configuration will be looked up by type.
+    </para>
+    <para><literal>line 05</literal> specifies a hibernate configuration.  
+    </para>
+    <para><literal>line 06</literal> specifies the that the resource file 
+    <literal>hibernate.properties</literal> should be loaded into the configuration. 
+    </para>
+    <para><literal>line 07</literal> (note the plural form of mapping<emphasis role="bold">s</emphasis>) 
+    specifies that resources <literal>org/jbpm/pvm/pvm.hibernate.mappings.xml</literal> contain references 
+    to hibernate mapping files or resources that should be included into the  
+    configuration.    Also note the plural form of <literal>resources</literal>.  
+    This means that not one, but all the resource files on the whole classpath will be found.  
+    This way new library components containing a <literal>org/jbpm/pvm/pvm.hibernate.mappings.xml</literal> 
+    resource can plug automatically into the same hibernate session by just being added to 
+    the classpath.  
+    </para>
+    <para>Alternatively, individual hibernate mapping files can be referenced with the 
+    singular <literal>mapping</literal> element.
+    </para>
+    <para><literal>line 08 - 10</literal> provide a single place to specify the 
+    hibernate caching strategy for all the PVM classes and collections.  
+    </para>
+    <para><literal>line 15</literal> specifies a standard transaction.  This is 
+    a very simple global transaction strategy without recovery that can be used 
+    in standard environments to get all-or-nothing semantics over multiple 
+    transactional resources.  
+    </para>
+    <para><literal>line 16</literal> specifies the hibernate session that will 
+    automatically register itself with the standard transaction.  
+    </para>
+    <para><literal>line 17</literal> specifies a <literal>PvmDbSession</literal>.
+    That is a class that adds methods that bind to specific queries to be executed
+    on the hibernate session.
+    </para>
+  </section>
+
+  <section>
+    <title>Standard hibernate configuration</title>
+    <para>Here is a set of default properties to configure hibernate with 
+    hsqldb in a standard Java environment.
+    </para>
+    <programlisting>hibernate.dialect                      org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class      org.hsqldb.jdbcDriver
+hibernate.connection.url               jdbc:hsqldb:mem:.
+hibernate.connection.username          sa
+hibernate.connection.password
+hibernate.cache.use_second_level_cache true
+hibernate.cache.provider_class         org.hibernate.cache.HashtableCacheProvider</programlisting>
+    <para>Optionally in development the schema export can be used to 
+    create the schema when the session factory is created and drop the 
+    schema when the session factory is closed.
+    </para>
+    <programlisting>hibernate.hbm2ddl.auto                 create-drop</programlisting>
+    <para>For more information about hibernate configurations, see the hibernate 
+    reference manual.
+    </para>
+  </section>
+
+  <section>
+    <title>Standard transaction</title>
+    <para>By default, the <literal>&lt;hibernate-session /&gt;</literal> will
+    start a hibernate transaction with <literal>session.beginTransaction()</literal>.
+    Then the hibernate transaction is wrapped in a <literal>org.jbpm.pvm.internal.hibernate.HibernateTransactionResource</literal>
+    and that resource is enlisted with the <literal>&lt;standard-transaction /&gt;</literal> 
+    (<literal>org.jbpm.tx.StandardTransaction</literal>)
+    </para>
+    <para>Inside of the environment block, the transaction is available
+    through <literal>environment.getTransaction()</literal>.  So inside an 
+    environment block, the transaction can be rolled back with 
+    <literal>environment.getTransaction().setRollbackOnly()</literal> 
+    </para>
+    <para>When created, the standard transaction will register itself to be notified on the 
+    close of the environment.  So in side the close, the standard transaction will 
+    commit or rollback depending on whether <literal>setRollbackOnly()</literal> 
+    was called.
+    </para>
+    <para>So in the configuration shown above, each environment block will be 
+    a separate transaction.  At least, if the hibernate session is used.</para>
+  </section>
+
+  <section>
+    <title>Basics of process persistence</title>
+    <para>In the next example, we'll show how this hibernate persistence is 
+    used with a concrete example.  The 'persistent process' is a simple 
+    three-step process: 
+    </para>
+    <figure id="the.persistent.process">
+      <title>The persistent process</title>
+      <mediaobject><imageobject><imagedata align="center" fileref="images/ch09.persistent.process.png"/></imageobject></mediaobject>
+    </figure>
+    <para>The activities in the three nodes will be wait states just like 
+    in <xref linkend="externalactivityexample" /> 
+    </para>
+    <para>To make sure we can persist this class, we create the hibernate mapping for 
+    it and add it to the configuration like this:
+    </para>
+    <programlisting>&lt;hibernate-configuration&gt;
+  &lt;properties resource="hibernate.properties" /&gt;
+  &lt;mappings resource="org/jbpm/pvm/pvm.hibernate.mappings.xml" /&gt;
+  <emphasis role="bold">&lt;mapping resource="org/jbpm/examples/ch09/state.hbm.xml" /&gt;</emphasis>
+  &lt;cache-configuration 
+        resource="org/jbpm/pvm/pvm.cache.xml" 
+        usage="nonstrict-read-write" /&gt;</programlisting>
+    <para>The next code pieces show the contents of one unit test method.  The method 
+    will first create the environment factory. Then, in a first transaction, a process 
+    definition will be created and saved into the database.  Then the next transaction will 
+    create a new execution of that process.  And the following two transactions will 
+    provide external triggers to the execution.
+    </para>
+    <programlisting>EnvironmentFactory environmentFactory = EnvironmentFactory.parse(new ResourceStreamSource(
+    "org/jbpm/examples/ch09/environment.cfg.xml"
+));</programlisting>
+    <para>Then in a first transaction, a process is created and saved in the database.
+    This is typically referred to as deploying a process and it only needs to be done 
+    once.
+    </para>
+    <programlisting>Environment environment = environmentFactory.openEnvironment();
+try {
+  PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+  
+  ProcessDefinition processDefinition = ProcessFactory.build("persisted process")
+    .node("one").initial().behaviour(new State())
+      .transition().to("two")
+    .node("two").behaviour(new State())
+      .transition().to("three")
+    .node("three").behaviour(new State())
+  .done();
+  
+  pvmDbSession.save(processDefinition);
+} finally {
+  environment.close();
+}</programlisting>
+    <para>In the previous transaction, the process definition, the nodes and transitions 
+    will be inserted into the database tables.
+    </para>
+    <para>Next we'll show how a new process execution can be started for this 
+    process definition.  Note that in this case, we provide <link linkend="businesskey">a 
+    business key</link> called 'first'.  This will make it easy for us to retrieve 
+    the same execution from the database in subsequent transactions.  After starting 
+    the new process execution, it will wait in node 'one' cause the behaviour is a 
+    wait state.
+    </para>
+    <programlisting>environment = environmentFactory.openEnvironment();
+try {
+  PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+  
+  ProcessDefinition processDefinition = pvmDbSession.findProcessDefinition("persisted process");
+  assertNotNull(processDefinition);
+  
+  Execution execution = processDefinition.startExecution("first");
+  assertEquals("one", execution.getNode().getName());
+  pvmDbSession.save(execution);
+
+} finally {
+  environment.close();
+}</programlisting>
+    <para>In the previous transaction, a new execution record will be inserted into 
+    the database.
+    </para>
+    <para>Next we feed in an external trigger into this existing process execution.
+    We load the execution, provide a signal and just save it back into the database.
+    </para>
+    <programlisting>environment = environmentFactory.openEnvironment();
+try {
+  PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+  
+  Execution execution = pvmDbSession.findExecution("persisted process", "first");
+  assertNotNull(execution);
+  assertEquals("one", execution.getNode().getName());
+  
+  // external trigger that will cause the execution to execute until 
+  // it reaches the next wait state
+  execution.signal();
+
+  assertEquals("two", execution.getNode().getName());
+
+  pvmDbSession.save(execution);
+
+} finally {
+  environment.close();
+}</programlisting>
+    <para>The previous transaction will result in an update of the existing 
+    execution, reassigning the foreign key to reference another record in 
+    the node table.
+    </para>
+    <programlisting>UPDATE JBPM_EXECUTION 
+SET
+  NODE_=?,
+  DBVERSION_=?,
+  ...
+WHERE DBID_=? 
+  AND DBVERSION_=?</programlisting>
+    <para>The version in this SQL shows the automatic optimistic locking that 
+    is baked into the PVM persistence so that process persistence can easily 
+    scale to multiple JVM's or multiple machines.
+    </para>
+    <para>In the example code, there is one more transaction that is 
+    completely similar to the previous which takes the execution from 
+    node 'two' to node 'three'. 
+    </para>
+    <para>All of this shows that the PVM can move from one wait state to 
+    another wait state transactionally.  Each transaction correcponds to 
+    a state transition.
+    </para>
+    <para>Note that in case of automatic activities, multiple activities 
+    will be executed before the execution reaches a wait state.  Typically 
+    that is desired behaviour.  In case the automatic activities take too 
+    long or you don't want to block the original transaction to wait for 
+    the completion of those automatic activities, check out <xref linkend="asynchronouscontinuations"/>
+    to learn about how it's possible to demarcate transactions in the process 
+    definition, which can also be seen as safe-points during process execution.
+    </para>
+  </section>
+
+  <section id="businesskey">
+    <title>Business key</title>
+    <para>TODO</para>
+  </section>
+    	  
+	  
+  <para>TODO: General persistence architecture
+  </para>
+  <para>TODO: Object references
+  </para>
+  <para>TODO: Threads, concurrency with respect to forks and joins
+  </para>
+  <para>TODO: Caching
+  </para>
+  <para>TODO: Process instance migration
+  </para>
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,19 @@
+<chapter id="processlanguages">
+  <title>Process languages</title>
+  
+  <para>TODO: xml parser infrastructure
+  </para>
+  <para>TODO: inherit from ProcessDefinitionImpl, ExecutionImpl
+  </para>
+  <para>TODO: overriding the default proceed()
+  </para>
+  <para>TODO: node type implementations
+  </para>
+  <para>TODO: persistence
+  </para>
+  <para>TODO: compensation: languages like bpel and bpnm define that 
+       as a normal contination that fits within the process 
+       structures available in the pvm (taking a transition and 
+       executing a nested node). 
+  </para>
+</chapter>
\ No newline at end of file

Deleted: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.xsd	2008-11-21 15:52:02 UTC (rev 3037)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.xsd	2008-11-21 15:59:34 UTC (rev 3038)
@@ -1,615 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
-        targetNamespace="http://jbpm.org/jpdl4"
-        xmlns:tns="http://jbpm.org/jpdl4"
-        elementFormDefault="qualified"
-        attributeFormDefault="qualified">
-        
-  <annotation>
-    <documentation>Prelimiary draft of the jPDL 4 process definition 
-      grammar; element process is the top level element.
-      
-      TODO: Add node pluggability.  (add the proper any's and 
-            anyAttributes)
-    
-      TODO: Pull up expression.  The expression element in the 
-            delegation group can be pulled up as an expression 
-            attribute in each use case of the delegationGroup
-    
-      TODO: Should automatic activities have timers?  That makes sense
-            in a transient scenario, but not in a transactional scenario.
-            Same comment holds for asynchronous continuations
-    
-      TODO: Is it a good idea to move blocking and signalling to the API ?
-    
-      TODO: Figure out task reuse (requires templating and parameters) 
-            and dynamic task creation (requires tasks to be declared by name
-            in the process definition and that from the API tasks can be 
-            easily instantiated.   
-            
-      TODO: Investigate if object-refs to centrally defined objects would 
-            add value over inline defined objects.
-    </documentation>
-  </annotation>
-
-  <!-- ### PROCESS DEFINITION ############################################# -->
-  
-  <element name="process">
-    <annotation><documentation>A jPDL process definition description; This 
-    is the top level element in a jPDL process file.</documentation></annotation>
-    <complexType>
-      <sequence minOccurs="0" maxOccurs="unbounded">
-        <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded"/>
-        <!-- 
-        <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-          <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-        </element>
-        <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
-         -->
-      </sequence>
-      <attribute name="name" use="required" type="string">
-        <annotation><documentation>The process name.  Multiple processes can 
-        be deployed with the same name, as long as they have a different 
-        version.</documentation></annotation>
-      </attribute>
-      <attribute name="version" type="int">
-        <annotation><documentation>Indicates the sequence number of this 
-        version for all processes with the same name.  By specifying a version
-        automatic deployment can figure out if this process is already deployed 
-        or not.
-        </documentation></annotation>
-      </attribute>
-      <attribute name="g" type="string">
-        <annotation><documentation>Graphical information used by designer tool.
-        </documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
-  
-  <!-- ### ACTIVITIES ##################################################### -->
-  
-  <group name="activityGroup">
-    <choice>
-      <!-- ~~~ START ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-      <element name="start">
-        <annotation><documentation>Start event
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-
-      <!-- ~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-      <element name="end">
-        <annotation><documentation>End event.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-          <attribute name="ends" default="process-instance">
-            <simpleType>
-              <restriction base="string">
-                <enumeration value="execution"/>
-                <enumeration value="process-instance"/>
-              </restriction>
-            </simpleType>
-          </attribute>
-        </complexType>
-      </element>
-      
-      <!-- ~~~ STATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-      <element name="state">
-        <annotation><documentation>A wait state.  When an execution arrives in this 
-        activity, the execution will wait until an external trigger is received 
-        with execution.signal() or execution.getActivityInstance().signal()
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-            <!-- 
-            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
-            -->
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-
-      <!-- ~~~ EXCLUSIVE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-      <element name="exclusive">
-        <annotation><documentation>Exclusive gayteway: selects one path out of many alternatives.  
-        When an execution comes in, exactly one outgoing flow is taken.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-    
-      <!-- 
-      <element name="fork">
-        <annotation><documentation>Spawns multiple concurrent paths of 
-        execution.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-    
-      <element name="join">
-        <annotation><documentation>Spawns multiple concurrent paths of 
-        execution.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-    
-      <element name="process-state">
-        <annotation><documentation>Waits while a sub process instance is 
-        being executed and continues when the sub process instance ends.
-        </documentation></annotation>
-        < ! - - take into account the following situation:
-        Unlike in jBPM 3, a process-state should not signal the newly created 
-        process instance.  The signal in jBPM 3 is probably historically there 
-        because in the beginning there was no initial attribute on the process
-        definition.
-        - - >
-        <complexType>
-          <sequence>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-
-      <element name="super-state">
-        <annotation><documentation>Scope enclosing a number of nodes.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-            <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
-          </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-    
-      <element name="activity">
-        <annotation><documentation>Executes an activity implementation.
-        </documentation></annotation>
-        <complexType>
-          <sequence>
-            <group ref="tns:delegationGroup"/>
-            <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-              <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-            </element>
-          </sequence> 
-          <attributeGroup ref="tns:nodeAttributes" />
-        </complexType>
-      </element>
-      
-      <element name="invoke">
-        <annotation><documentation>Invokes a method on a java object
-        </documentation></annotation>
-        <complexType>
-          <complexContent>
-            <extension base="tns:invokeType">
-              <sequence>
-                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-                </element>
-              </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
-            </extension>
-          </complexContent>
-        </complexType>
-      </element>
-      
-      <element name="script">
-        <annotation><documentation>Evaluates a piece of text as a script
-        </documentation></annotation>
-        <complexType>
-          <complexContent>
-            <extension base="tns:scriptType">
-              <sequence>
-                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-                </element>
-              </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
-            </extension>
-          </complexContent>
-        </complexType>
-      </element>
-      
-      <element name="email">
-        <annotation><documentation>Sends an email
-        </documentation></annotation>
-        <complexType>
-          <complexContent>
-            <extension base="tns:emailType">
-              <sequence>
-                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-                </element>
-              </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
-            </extension>
-          </complexContent>
-        </complexType>
-      </element>
-      
-      <element name="task">
-        <annotation><documentation>Creates a human task
-        </documentation></annotation>
-        <complexType>
-          <complexContent>
-            <extension base="tns:taskType">
-              <sequence>
-                <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
-                <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
-                  <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-                </element>
-                <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
-              </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
-            </extension>
-          </complexContent>
-        </complexType>
-      </element>
-      -->
-    </choice>
-  </group>
-
-  <attributeGroup name="nodeAttributes">
-    <attribute name="name" type="string">
-      <annotation><documentation>The id of this activity.  The name should be unique
-      in the complete scope of the process.</documentation></annotation>
-    </attribute>
-    <attribute name="g" type="string">
-      <annotation><documentation>Graphical information used by process designer tool.
-      </documentation></annotation>
-    </attribute>
-  </attributeGroup>
-  
-  <complexType name="flowType">
-    <annotation><documentation>The outgoing flows.  The first in the list 
-      will be the default outgoing flow.
-    </documentation></annotation>
-    <!-- 
-    <sequence>
-      <group ref="tns:eventListenerGroup" />
-    </sequence>
-    -->
-    <attribute name="name" type="string">
-      <annotation><documentation>Name of this outgoing flow</documentation></annotation>
-    </attribute>
-    <attribute name="to" type="string">
-      <annotation><documentation>Name of the destination node of this flow. 
-      </documentation></annotation>
-    </attribute>
-    <attribute name="g" type="string">
-      <annotation><documentation>Graphical information used by process designer tool.
-      </documentation></annotation>
-    </attribute>
-  </complexType>
-  
-  <element name="flow" type="tns:flowType">
-    <annotation><documentation>A flow from one node to another.</documentation></annotation>
-  </element>
-  
-  <element name="on">
-    <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
-    <complexType>
-      <!-- 
-      <sequence>
-        <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
-          <annotation><documentation>A list of event listeners that will 
-          be notified when the event is fired</documentation></annotation>
-        </group>
-      </sequence>
-      -->
-      <attribute name="event" type="string">
-        <annotation><documentation>The event identification
-        </documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
-  
-  <!-- 
-
-  <group name="eventListenerGroup">
-    <choice>
-      <element name="notify">
-        <annotation><documentation>Calls the notify method on an 
-        EventListener.
-        </documentation></annotation>
-        <complexType>
-          <group ref="tns:delegationGroup" />
-          <attribute name="object" type="string">
-            <annotation><documentation>The reference to an object that is declared 
-            in the objects section of this process definition.
-            </documentation></annotation>
-          </attribute>
-          <attribute name="expr" type="string">
-            <annotation><documentation>The expression that will resolve to 
-            an Activity implementation.</documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-      <element name="invoke" type="tns:invokeType">
-        <annotation><documentation>Invokes a method on a Java object
-        through reflection.  The return value can be captured in a 
-        process variable.
-        </documentation></annotation>
-      </element>
-      <element name="script" type="tns:scriptType">
-        <annotation><documentation>Evaluates a piece of text as a script
-        </documentation></annotation>
-      </element>
-      <element name="email" type="tns:emailType">
-        <annotation><documentation>Sends an email
-        </documentation></annotation>
-      </element>
-      <element ref="tns:timer">
-        <annotation><documentation>Creates a timer.
-        </documentation></annotation>
-      </element>
-    </choice>
-  </group>
-
-  <group name="delegationGroup">
-    <choice>
-      <element name="object">
-        <annotation><documentation>A java object that will be obtained by using 
-        the constructor through reflection or through a factory method.</documentation></annotation>
-        <complexType>
-          <attribute name="class" type="string" />
-        </complexType>
-      </element>
-      <element name="jndi">
-        <complexType>
-          <attribute name="name" type="string" />
-        </complexType>
-      </element>
-      <element name="expr">
-        <complexType>
-          <attribute name="text" type="string" use="required"/>
-          <attribute name="language" type="string" />
-        </complexType>
-      </element>
-    </choice>
-  </group>
-  
-  <complexType name="invokeType">
-    <sequence>
-      <group ref="tns:delegationGroup">
-        <annotation><documentation>The object on which the method 
-        will be invoked</documentation></annotation>
-      </group>
-      <element name="arg" minOccurs="0" maxOccurs="unbounded">
-        <annotation><documentation>Arguments passed into the method 
-        invocation.</documentation></annotation>
-      </element>
-    </sequence>
-    <attribute name="method" type="string" use="required">
-      <annotation><documentation>The name of the method to invoke.
-      </documentation></annotation>
-    </attribute>
-  </complexType>
-
-  <complexType name="scriptType">
-    <sequence>
-      <element name="expr" type="string">
-        <annotation><documentation>The content of this expression element 
-        is the script text that will be evaluated.  This is mutually 
-        exclusive with the expression attribute.</documentation></annotation>
-      </element>
-    </sequence>
-    <attribute name="expr" type="string">
-      <annotation><documentation>The script text that will be evaluated.  This 
-      is mutually exclusive with the expression element.
-      </documentation></annotation>
-    </attribute>
-    <attribute name="lang" type="string">
-      <annotation><documentation>Identification of the scripting language 
-      to use.</documentation></annotation>
-    </attribute>
-  </complexType>
-
-  <complexType name="emailType">
-    <sequence>
-      <element name="property">
-        <annotation><documentation>Template property value</documentation></annotation>
-        <complexType>
-          <attribute name="name" type="string" />
-          <attribute name="value" type="string" />
-        </complexType>
-      </element>
-    </sequence>
-    <attribute name="to" type="string" />
-    <attribute name="type" type="string">
-      <annotation><documentation>Reference to the email template</documentation></annotation>
-    </attribute>
-  </complexType>
-
-  <element name="timer">
-    <annotation><documentation>A timer that will be bound to the most inner enclosing scope.
-    Timers can give a signal to an activity instance.  The signal will correspond to a flow 
-    or to an event being fired.
-    </documentation></annotation>
-    <complexType>
-      <choice minOccurs="0" maxOccurs="unbounded">
-        <group ref="tns:eventListenerGroup">
-          <annotation><documentation>An inline list of event listeners 
-          on a timer is a short cut for defining the event separately.
-          </documentation></annotation>
-        </group>
-      </choice>
-      <attribute name="duedate" type="string" use="required" />
-      <attribute name="signal" type="string"  use="required">
-        <annotation><documentation>Refers to the signal that will be used.
-        If inline event listeners are declared, the signal name can not be 
-        the same as an event that is declared in this scope.
-        </documentation></annotation>
-      </attribute>
-      <attribute name="repeat" type="string" />
-    </complexType>
-  </element>
-
-  <complexType name="taskType">
-    <sequence>
-      <element ref="tns:assignment" />
-      <element name="reminder">
-        <complexType>
-          <attribute name="duedate" type="string" use="required" />
-          <attribute name="repeat" type="string" />
-        </complexType>
-      </element>
-      <element ref="tns:subtask" />
-    </sequence>
-    <attribute name="title" type="string">
-    </attribute>
-    <attribute name="form" type="string">
-    </attribute>
-    <attribute name="swimlane" type="string">
-    </attribute>
-    <attribute name="description" type="string" />
-    <attribute name="duedate" type="string" />
-    <attribute name="priority" type="tns:priorityType" default="normal" />
-    <attribute name="notify" type="boolean" default="false"/>
-    <attribute name="dynamic" type="boolean" default="true">
-      <annotation><documentation>Is dynamic creation of subtasks 
-      allowed ?</documentation></annotation>
-    </attribute>
-    <attribute name="subtasksync">
-      <simpleType>
-        <union>
-          <simpleType>
-            <restriction base="string">
-              <enumeration value="last">
-                <annotation><documentation>When the last subtask completes,
-                this task is completed.</documentation></annotation>
-              </enumeration>
-              <enumeration value="first">
-                <annotation><documentation>When the first subtask completes,
-                this task is completed.</documentation></annotation>
-              </enumeration>
-            </restriction>
-          </simpleType>
-          <simpleType>
-            <restriction base="int">
-              <annotation><documentation>The number of subtasks that 
-              have to complete before this task is considered 
-              completed.</documentation></annotation>
-            </restriction>
-          </simpleType>
-        </union>
-      </simpleType>
-    </attribute>
-  </complexType>
-  
-  <simpleType name="priorityType">
-    <restriction base="string">
-      <enumeration value="highest"/>
-      <enumeration value="high"/>
-      <enumeration value="normal"/>
-      <enumeration value="low"/>
-      <enumeration value="lowest"/>
-    </restriction>
-  </simpleType>
-
-  <element name="subtask" type="tns:taskType">
-    <annotation><documentation>Subtask in a task activity.</documentation></annotation>
-  </element>
-  
-  <element name="swimlane">
-    <annotation><documentation>A process role.</documentation></annotation>
-    <complexType>
-      <sequence>
-        <element ref="tns:assignment"/>
-      </sequence>
-      <attribute name="name" type="string" use="required" />
-    </complexType>
-  </element>
-  
-  <element name="assignment">
-    <annotation><documentation>Specifies how a task or a swimlane should be assigned 
-    to a specific user or who will be identified as a candidate for it.</documentation></annotation>
-    <complexType>
-      <sequence minOccurs="0">
-        <group ref="tns:delegationGroup">
-          <annotation><documentation>An object that implements the 
-          Assigner interface.
-          </documentation></annotation>
-        </group>
-      </sequence>
-	    <attribute name="assignee" type="string">
-	      <annotation><documentation>User ID of the person to which the task
-	      or swimlane will be assigned.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="assignee-expr" type="string">
-	      <annotation><documentation>Expression that resolves to a 
-	      User ID to which the task or swimlane will be assigned.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="candidates" type="string">
-	      <annotation><documentation>Comma separated list of User ID's 
-	      or Group ID's.  All the referred people will be candidates to 
-	      take the task or swimlane.</documentation></annotation>
-	    </attribute>
-	    <attribute name="candidate-expr" type="string">
-	      <annotation><documentation>Expression that resolves to a 
-	      comma separated list of User ID's or Group ID's.  All the 
-	      referred people will be candidates to 
-	      take the task or swimlane.</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-  -->  
-  
-</schema>

Deleted: jbpm4/trunk/modules/pvm/src/main/resources/org/jbpm/pvm/wire.xsd
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/org/jbpm/pvm/wire.xsd	2008-11-21 15:52:02 UTC (rev 3037)
+++ jbpm4/trunk/modules/pvm/src/main/resources/org/jbpm/pvm/wire.xsd	2008-11-21 15:59:34 UTC (rev 3038)
@@ -1,1350 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
-        targetNamespace="http://jbpm.org/pvm/1.0/wire"
-        xmlns:tns="http://jbpm.org/pvm/1.0/wire"
-        elementFormDefault="qualified">
-        
-  <annotation>
-    <documentation>XML schema to express how java objects can be 
-    created and wired together.  aka IoC.
-    </documentation>
-  </annotation>
-
-  <!-- ### ELEMENTS ######################################################## -->
-
-  <element name="business-calendar">
-    <annotation><documentation>A BusinessCalendar that knows about working hours</documentation></annotation>
-    <complexType>
-      <sequence>
-        <element name="monday"    type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="tuesday"   type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="wednesday" type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="thursday"  type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="friday"    type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="saturday"  type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="sunday"    type="tns:businessCalendarDayType" minOccurs="0"/>
-        <element name="holiday" minOccurs="0" maxOccurs="unbounded">
-          <complexType>
-            <attribute name="period">
-              <annotation><documentation>Two dates in date-format, separated by 
-              a dash that specify a holiday period.  If it's just one day, a single day 
-              is also valid.</documentation></annotation>
-            </attribute>
-          </complexType>
-        </element>
-      </sequence>
-      <attribute name="timezone" type="string">
-        <annotation><documentation>Optional specification of the timezone as specified by 
-        java.util.TimeZone.getTimeZone(String)</documentation></annotation>
-      </attribute>
-      <attribute name="hour-format" type="string" default="HH:mm">
-        <annotation><documentation>Indicates how to interpret the hour specifications 
-        in this business calendar in java.text.SimpleDateFormat(String)</documentation></annotation>
-      </attribute>
-      <attribute name="date-format" type="string" default="dd/MM/yyyy">
-        <annotation><documentation>Indicates how to interpret the date specifications 
-        in this business calendar in java.text.SimpleDateFormat(String)</documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
-
-  <element name="byte">
-    <annotation><documentation>A java.lang.Byte</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" type="byte" use="required" />
-	  </complexType>
-  </element>
-
-  <element name="char">
-    <annotation><documentation>A java.lang.Character</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" use="required">
-	      <simpleType>
-	        <restriction base="string">
-	          <maxLength value="1" />
-	        </restriction>
-	      </simpleType>
-	    </attribute>
-	  </complexType>
-  </element>
-  
-  <element name="class">
-    <annotation><documentation>A java.lang.Class</documentation></annotation>
-		<complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-		  <attribute name="init" type="tns:initType" default="lazy">
-		    <annotation><documentation>Specifies when and how this object should be 
-		    created and initialized. Default is lazy.</documentation></annotation>
-		  </attribute>
-		  <attribute name="class-name" use="required" type="string">
-		    <annotation><documentation>A fully qualified name of a
-		      class that can be found on the wire context classpath or 
-		      (if that is not specified) on the current thread's context 
-		      classpath.  
-		    </documentation></annotation>
-		  </attribute>
-		</complexType>
-  </element>
-  
-  <element name="context-ref">
-    <annotation><documentation>The context.  This refers to
-    the environment, environment-factory or the wire context.
-    </documentation></annotation>
-    <complexType>
-      <attribute name="context-name" type="string">
-        <annotation><documentation>The name of the context in the current 
-        environment.  If this attribute is omitted, the enclosing 
-        context will be given. 
-        </documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
-
-  <element name="contexts">
-    <annotation><documentation>Defines an environment factory and 
-    an environment.
-    </documentation></annotation>
-    <complexType>
-      <sequence>
-        <element ref="tns:environment-factory" />
-        <element ref="tns:environment" />
-      </sequence>
-    </complexType>
-  </element>
-
-  <element name="environment-factory" type="tns:contextType">
-    <annotation><documentation>Defines the environment factory 
-    context.  (Aka application context)
-    </documentation></annotation>
-  </element>
-
-  <element name="environment" type="tns:contextType">
-    <annotation><documentation>Defines the environment 
-    context.  This context exists stretches for the duration of 
-    an Environment try-finally block.
-    </documentation></annotation>
-  </element>
-
-  <element name="deployer-manager">
-    <annotation><documentation>Has a list of deployers (org.jbpm.deploy.Deployer) 
-    for each process language for handling deployments.  
-    </documentation></annotation>
-	  <complexType>
-	    <choice maxOccurs="unbounded">
-	    	<element name="language">
-		      <annotation><documentation>A process language that contains 
-		      a list of deployers</documentation></annotation>
-	    	  <complexType>
-	    	    <choice maxOccurs="unbounded">
-	    	      <group ref="tns:deployers" />
-	    	    </choice>
-	          <attribute name="name" type="string" use="required" />
-	          <attribute name="extension" type="string" />
-	    	  </complexType>
-	    	</element>
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      created and initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="resource" type="string">
-	      <annotation><documentation>Imports contents of the document element 
-	      of all resource files (using deep scan ClassLoader.getResources(String)) 
-	      as content into this element.
-	      </documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-
-  <element name="double">
-    <annotation><documentation>A java.lang.Double</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" type="double" use="required" />
-	  </complexType>
-  </element>
-
-  <element name="environment-ref">
-    <annotation><documentation>Obtains the current environment.  The environment 
-    is only available in objects declared inside the environment context.  So it 
-    can't be used inside the session-factory context. 
-    </documentation></annotation>
-  </element>
-
-  <element name="environment-factory-ref">
-    <annotation><documentation>Obtains the current environment.  The environment 
-    is only available in objects declared inside the environment context.  So it 
-    can't be used inside the session-factory context. 
-    </documentation></annotation>
-  </element>
-
-  <element name="false">
-    <annotation><documentation>java.lang.Boolean.FALSE 
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="float">
-    <annotation><documentation>A java.lang.Float
-    </documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" type="float" use="required" />
-	  </complexType>
-  </element>
-  
-  <element name="hibernate-configuration" type="tns:hibernateConfigurationType">
-    <annotation><documentation>A hibernate Configuration to be used in the 
-    environment-factory context</documentation></annotation>
-  </element>
-  
-  <element name="hibernate-session">
-    <annotation><documentation>A hibernate Session to be used in the 
-    environment context</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>Optional name of this hibernate session.
-	      Typically a session is looked up by type.  Only if multiple sessions 
-	      are declared, a name can be used to distinct them. 
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="factory" type="string">
-	      <annotation><documentation>Optional name referring to the session-factory.
-	      If no factory name is provided, the SessionFactory is looked up by type.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="tx" type="tns:booleanValueType">
-	      <annotation><documentation>Indicates if a hibernate transaction should 
-	      be started and ended in this environment.  Default is true.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="current" type="tns:booleanValueType">
-	      <annotation><documentation>Indicates if the SessionFactory.getCurrentSession()
-	      should be used instead of opening and closing a new session.  Default is false.
-	      If 'current' is set to true, then the default of 'close' will be set to false. 
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="close" type="tns:booleanValueType">
-	      <annotation><documentation>Indicates if the session should be closed when the
-	      environment closes.  The default is true (unless 'current' is set to true) 
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="standard-transaction" type="string">
-	      <annotation><documentation>Optional name of the standard transaction.
-	      If 'tx' is set to true, a StandardTransaction needs to be found to enlist 
-	      this hibernate session.  By default, the lookup of the StandardTransaction 
-	      is done by type.  But this attribute allows to refer to the standard 
-	      transaction by name.   
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="connection" type="string">
-	      <annotation><documentation>Optional name of the JDBC connection to use 
-	      when creating this hibernate session.  If no connection name is specified,
-	      the creation of the connection is left to the hibernate session.
-	      </documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-  
-  <element name="hibernate-session-factory">
-    <annotation><documentation>A hibernate SessionFactory to be used in the 
-    environment-factory context.  The hibernate Configuration can be inlined in this 
-    'session-factory', it can be refered by type or referred by name.
-    </documentation></annotation>
-	  <complexType>
-	    <complexContent>
-	      <extension base="tns:hibernateConfigurationType">
-	        <attribute name="configuration" type="string">
-			      <annotation><documentation>The name of the configuration to use to build 
-			      this hibernate SessionFactory.  This is optional as the alternative methods 
-			      to specify a configuration are just inlining it here in this hibernate 
-			      session-factory element or looking up the hibernate Configuration by type.
-			      </documentation></annotation>
-			    </attribute>
-	      </extension>
-	    </complexContent>
-	  </complexType>
-  </element>
-  
-  <element name="int">
-    <annotation><documentation>A java.lang.Integer
-    </documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" type="int" use="required"/>
-	  </complexType>
-  </element>
-  
-  <element name="jndi">
-    <annotation><documentation>A lookup from JNDI through the InitialContext
-    </documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="jndi-name" type="string" use="required" />
-	  </complexType>
-  </element>
-  
-  <element name="job-db-session">
-    <annotation><documentation>A hibernate based JobDbSession</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="session" type="string" />
-	  </complexType>
-  </element>
-  
-  <element name="job-executor">
-    <annotation><documentation>The default component for executing timers and messages.
-    A job-executor requires a CommandService.  
-    </documentation></annotation>
-		<complexType>
-		  <attribute name="name" type="string">
-		    <annotation><documentation>Optional name of this object used to look up 
-		    this object from the environment.  This name (along with ip-address) is 
-        used as the basis for the names of the threads in the job executor's thread 
-		    pool.  So when you're running more then one job-executor on the same 
-		    machine, you should be specifying custom job executor names.</documentation></annotation>
-		  </attribute>
-		  <attribute name="init" type="tns:initType" default="lazy">
-		    <annotation><documentation>Specifies when and how this object should be 
-		    initialized. Default is lazy.</documentation></annotation>
-		  </attribute>
-		  <attribute name="command-service" type="string">
-		    <annotation><documentation>Optional name of the command service to use.  If 
-		    this attribute is not present, the command service will be looked up 
-		    by type.</documentation></annotation>
-		  </attribute>
-		  <attribute name="threads" type="int">
-		    <annotation><documentation>Number of worker threads.  One extra thread will 
-		    be created for scanning and acquisition of jobs (DispatcherThread).</documentation></annotation>
-		  </attribute>
-		  <attribute name="idle" type="int">
-		    <annotation><documentation>Number of milliseconds the dispatcher thread  
-		    will normally wait inbetween checks for new jobs.  Each time an exception
-		    occurs, the idle period will be doubled until the 'idle-max' is reached.
-		    This is a back-off mechanism in case the job executor can't access the 
-		    database. 
-		    </documentation></annotation>
-		  </attribute>
-		  <attribute name="idle-max" type="int">
-		    <annotation><documentation>Maxumum number of milliseconds the dispatcher thread  
-		    will wait inbetween checks for new jobs.  
-		    </documentation></annotation>
-		  </attribute>
-		  <attribute name="history" type="int">
-		    <annotation><documentation>Number of history records of job executions that will be 
-		    kept in memory.</documentation></annotation>
-		  </attribute>
-		  <attribute name="lock" type="int">
-		    <annotation><documentation>Number of milliseconds that a job will be locked at 
-		    acquisition time.  When a job is acquired, the job executor will write it's name 
-		    in the lock owner field of the job and the lockExpirationTime
-		    will be set to the current time plus 'lock' milliseconds.  The lock by that thread should 
-		    be considered as released if the lockExpirationTime has passed.  This prevents starvation 
-		    in case one of more JobExecutors in a cluster would die.</documentation></annotation>
-		  </attribute>
-		  <attribute name="auto-start" type="tns:booleanValueType">
-		    <annotation><documentation>Indicates if the job-executor should be started when it 
-		    is created.  Default is true.  If the job-executor is not auto-started, it can be 
-		    started programmatically with the start method on the JobExecutor.</documentation></annotation>
-		  </attribute>
-		</complexType>
-  </element>
-
-  <element name="job-test-helper">
-    <annotation><documentation>A test helper for controlling job executions</documentation></annotation>
-  </element>
-
-  <element name="list">
-    <annotation><documentation>A java.util.List</documentation></annotation>
-	  <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <group ref="tns:persistableDescriptors" />
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      created and initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="class" type="string" default="java.util.ArrayList">
-	      <annotation><documentation>Implementation class for this list.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
-	      <annotation><documentation>Indicates if this collection should be synchronized
-	      with Collections.synchronizedList(List)</documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-  
-  <element name="long">
-    <annotation><documentation>A java.lang.Long</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="value" type="long" use="required"/>
-	  </complexType>
-  </element>
-  
-  <element name="map">
-    <annotation><documentation>A java.util.Map</documentation></annotation>
-	  <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <element name="entry">
-	        <complexType>
-	          <choice minOccurs="0">
-	            <element name="key" minOccurs="0">
-	              <complexType>
-	                <group ref="tns:persistableDescriptors" />
-	              </complexType>
-	            </element>
-	            <element name="value" minOccurs="0">
-	              <complexType>
-	                <group ref="tns:persistableDescriptors" />
-	              </complexType>
-	            </element>
-	          </choice>
-	        </complexType>
-	      </element>
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      created and initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="class" type="string" default="java.util.HashMap">
-	      <annotation><documentation>Implementation class for this map.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
-	      <annotation><documentation>Indicates if this collection should be synchronized
-	      with Collections.synchronizedMap(Map)</documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-  
-  <element name="message-session">
-    <annotation><documentation>Specifies an implementation of the MessageSession 
-    interface that sends messages to the JobExecutor.  The main usage of MessageSession 
-    is by the PVM implementation for asynchronous continuations.  The PVM will look 
-    up the message session by type.  All message-session implementations depend on a 
-    DbSession like e.g. the 'pvm-db-session'.  A DbSession will be looked up by type.
-    </documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="target" type="tns:messageSessionTargetType" default="job-executor">
-	      <annotation><documentation>
-	      <p>Specifies the implementation of the message session.
-	      </p>  
-	      <p><code><b>job-executor</b></code>: Is the default and sends to messages to the 
-	      job-executor.  In this case the message session has a dependency on 
-	      a DbSession (like the PvmDbSession) and a Transaction to which the 
-	      message session will register a listener to notify the job executor upon 
-	      successfull completion.
-	      </p>
-	      <p><code><b>jms</b></code>: Sends the messages over JMS and a JMS listener is assumed 
-	      (like the command executor MDB) that executes the message.  If 'jms' is specified, 
-	      attributes 'session-jndi' and 'destination-jndi' become required.
-	      </p>
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="session-jndi" type="string" use="optional">
-	      <annotation><documentation>The JNDI name of the JMS Session.  Only used in case of
-	      target <b>jms</b>. </documentation></annotation>
-	    </attribute>
-	    <attribute name="destination-jndi" type="string" use="optional">
-	      <annotation><documentation>The JNDI name of the Queue destination to use. Only used 
-	      in case of target <b>jms</b>.</documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-
-  <element name="null">
-    <annotation><documentation>the null value 
-    </documentation></annotation>
-  </element>
-  
-  <element name="object">
-    <annotation><documentation>Any java object that will be created by reflection.                                                                        .
-    <p>There are three main ways to create an object: by constructor or by a factory 
-    object or a static factory method.</p>
-    <p><b>Using the constructor</b>: Then the <code>class</code> attribute must provide the 
-    fully qualified class name.  In case another constructor then the default is 
-    targetted, a <code>constructor</code> child element can be provided.
-    The <code>factory</code> attribute should not be provided for using a constructor. 
-    </p>
-    <p><b>Using a factory</b>: Then the <code>factory</code> attribute or one 
-    <code>factory</code> element must be provided along with the attribute 
-    <code>method</code>. 
-    </p>
-    <p><b>Using a static factory method</b>: Then the <code>class</code> and 
-    <code>method</code> attributes should be specified.  There should be no 
-    reference to a <code>factory</code> attribute of element. 
-    </p>
-    <p><b>Construction and initialization</b>: all objects (constructor and factory)
-    are build in two phases: construction and initialisation phase.  During construction
-    all is done until a pointer is obtained to the object.  In initialisation, operations 
-    are applied to the object until it is ready to be used.  The separation between 
-    construction and initialisation is made to allow for bidirectional references.  In 
-    that case, at least one of both ends can not be fully initialised before it is injected 
-    into the other end.
-    </p>
-    <p><b>Operations</b>: after construction, various operations can be applied to objects 
-    like e.g. direct field injection, injection through setters, method invocation, 
-    enlist with the standard transaction, subscribe the object as a listener to an observable  
-    </p>
-    <p><b>Arguments</b>: There are two different places for arguments.  The <code>arg</code> 
-    elements for the factory method invocation should be placed as child elements under the 
-    <code>object</code> element.  The <code>arg</code> elements for the constructor should be 
-    placed as child elements under the <code>constructor</code> element.    
-    </p>
-    </documentation></annotation>
-	  <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <element name="factory">
-	        <annotation><documentation>Contains one element that describes the factory object.</documentation></annotation>
-	        <complexType>
-	          <group ref="tns:persistableDescriptors" />
-	        </complexType>
-	      </element>
-	      <element name="constructor">
-	        <annotation><documentation>Specifies the arguments to use for a non-default constructor.</documentation></annotation>
-	        <complexType>
-	          <choice maxOccurs="unbounded">
-	            <element name="arg" type="tns:argType" />
-	          </choice>
-	        </complexType>
-	      </element>
-	      <element name="arg" type="tns:argType">
-	        <annotation><documentation>The factory method arguments.</documentation></annotation>
-	      </element>
-	      <group ref="tns:operations" />
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="class" type="string">
-	      <annotation><documentation>The fully qualified class name</documentation></annotation>
-	    </attribute>
-	    <attribute name="factory" type="string">
-	      <annotation><documentation>The name of the factory object</documentation></annotation>
-	    </attribute>
-	    <attribute name="method" type="string">
-	      <annotation><documentation>The factory method name</documentation></annotation>
-	    </attribute>
-	    <attribute name="auto-wire" type="string">
-	      <annotation><documentation>Indicates if the member fields and setter properties 
-	      should be automatically wired based on matching the property names and types with the 
-	      object names and types</documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-
-  <element name="process-service">
-    <annotation><documentation>The default process service implementation 
-    that delegates method implementations to a CommandService.  process-service 
-    depends on a command service.
-    </documentation></annotation>
-  </element>
-  
-  <element name="properties">
-    <annotation><documentation>A java.util.Properties</documentation></annotation>
-	  <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <element name="property">
-	        <complexType>
-	          <attribute name="name" type="string" use="required" />
-	          <attribute name="value" type="string" use="required" />
-	        </complexType>
-	      </element>
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="file" type="string">
-	      <annotation><documentation>A file on the file system</documentation></annotation>
-	    </attribute>
-	    <attribute name="resource" type="string">
-	      <annotation><documentation>A file as a resource in the classpath</documentation></annotation>
-	    </attribute>
-	    <attribute name="url" type="string">
-	      <annotation><documentation>the contents is fetched by loading a url</documentation></annotation>
-	    </attribute>
-	    <attribute name="is-xml" type="tns:booleanValueType">
-	      <annotation><documentation>optionally indicates if the content of referenced file in attributes
-	      'file', 'resource' or 'url' is XML.  The default is the 
-	      plain properties format with a space or the equals character (=) separating key and value on 
-	      each line.</documentation></annotation>
-	    </attribute>
-	  </complexType>
-  </element>
-
-  <element name="pvm-db-session">
-    <annotation><documentation>A hibernate based PvmDbSession</documentation></annotation>
-	  <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="session" type="string" />
-	  </complexType>
-  </element>
-
-  <element name="ref">
-    <annotation><documentation>A reference to another object by name</documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="object" type="string" use="required">
-	      <annotation><documentation>The name of the referred object</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="set">
-    <annotation><documentation>A java.util.Set 
-    </documentation></annotation>
-    <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <group ref="tns:persistableDescriptors" />
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="class" type="string" default="java.util.HashList">
-	      <annotation><documentation>Implementation class for this set.
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="synchronized" type="tns:booleanValueType" default="false">
-	      <annotation><documentation>Indicates if this collection should be synchronized
-	      with Collections.synchronizedSet(Set)</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="short">
-    <annotation><documentation>a java.lang.Short
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-      <attribute name="value" type="short" use="required"/>
-    </complexType>
-  </element>
-
-  <element name="command-service">
-    <annotation><documentation>The command service for usage in standard  
-    Java environments.
-    </documentation></annotation>
-    <complexType>
-	    <choice minOccurs="0" maxOccurs="unbounded">
-	      <group ref="tns:interceptors" />
-	    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="string">
-    <annotation><documentation>a java.lang.String 
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-    <attribute name="value" type="string" use="required"/>
-    </complexType>
-  </element>
-
-  <element name="timer-session">
-    <annotation><documentation>A timer session is used during process execution to create 
-    timers.  Different implementations of the timer service make the process portable 
-    over different environments. 
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="target" default="job-executor">
-	      <annotation><documentation>Specifies the target implementation.  Use 
-	      <code>job-executor</code> when the job executor is responsible for executing the 
-	      timers (default).  Use <code>ejb</code> in case the EJB Timer Service should be used.
-	      If the target is job-executor, there is a dependency on the transaction, the job-executor
-	      and a job-db-session. 
-	      </documentation></annotation>
-	      <simpleType>
-	        <restriction base="string">
-	          <enumeration value="job-executor" />
-	          <enumeration value="ejb" />
-	        </restriction>
-	      </simpleType>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="transaction">
-    <annotation><documentation>The transaction binding.  Specifies how the transaction in the 
-    pvm environment gets bound to the actual transaction in the real environment.  
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="target" default="standard">
-	      <annotation><documentation>The real transaction to be wrapped.  Use <code>standard</code>
-	      in standard environments and enterprise in enterprise environments.  In case of the 
-	      <code>enterprise</code> target, the <code>jndi</code> name of the user transaction and 
-	      the <code>manage</code> attribute can optionally be specified. 
-	      </documentation></annotation>
-	      <simpleType>
-	        <restriction base="string">
-	          <enumeration value="standard" />
-	          <enumeration value="enterprise" />
-	        </restriction>
-	      </simpleType>
-	    </attribute>
-	    <attribute name="jndi" type="string" default="java:comp/UserTransaction">
-	      <annotation><documentation>The jndi name of the user transaction  
-	      </documentation></annotation>
-	    </attribute>
-	    <attribute name="manage" type="tns:booleanValueType" default="false">
-	      <annotation><documentation>Indicates if the user transaction be controlled (=managed) 
-	      by the environment.  
-	      </documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="transaction-ref">
-    <annotation><documentation>Reference to the org.jbpm.pvm.api.env.Transaction in the 
-    current environment. 
-    </documentation></annotation>
-  </element>
-
-  <element name="true">
-    <annotation><documentation>java.lang.Boolean.TRUE 
-    </documentation></annotation>
-    <complexType>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <element name="variable-types">
-    <annotation><documentation>Specifies automatic variable type resolution, transforming 
-    variable values of any java class into their persistable format.  When the 
-    type of a variable needs to be automatically detected.  Each of the type elements will 
-    be scanned in order.  When the type matches, it is used to store the value. 
-    </documentation></annotation>
-    <complexType>
-      <choice minOccurs="0" maxOccurs="unbounded">
-        <element name="type">
-          <complexType>
-            <choice>
-              <element name="matcher">
-                <annotation><documentation>Alternative to the <code>class</code> attribute to 
-                specify the matcher for this type.</documentation></annotation>
-                <complexType>
-          	      <group ref="tns:allDescriptors" />
-                </complexType>
-              </element>
-            </choice>
-				    <attribute name="name" type="string">
-				      <annotation><documentation>The name of the type is optional.  It's used when 
-				      users declare variables in the process.</documentation></annotation>
-				    </attribute>
-				    <attribute name="class" type="string">
-				      <annotation><documentation>Specifies a matcher based on the class of the 
-				      object.  The java class name of the values that will be 
-				      stored in this type.  Apart from Java class names following literals can be 
-				      used as well:
-				      <p><b><code>persistable</code></b>: Matches when the class of the object is 
-				      known by the hibernate-session-factory so that a generic reference (any-mapping)
-				      can be created to the persistable object.  If <code>class="persistable"</code>
-				      the attribute <code>id-type</code> becomes required. 
-				      </p>
-				      <p><b><code>serializable</code></b>: Matches if the object implements the 
-				      java.io.Serializable interface. 
-				      </p>
-				      <p>If no <code>class</code> is provided, a matcher can also be specified 
-				      as a separate child element.</p>
-				      </documentation></annotation>
-				    </attribute>
-				    <attribute name="hibernate-session-factory" type="string">
-				      <annotation><documentation>The name of the hibernate-session-factory. Only 
-				      required if <code>class="persistable"</code> is used and if there is more then 
-				      one hibernate session factory specified in the environment.
-				      </documentation></annotation>
-				    </attribute>
-				    <attribute name="id-type">
-				      <annotation><documentation>The type of the id property in the persistable object. 
-				      </documentation></annotation>
-				      <simpleType>
-				        <restriction base="string">
-				          <enumeration value="long" />
-				          <enumeration value="string" />
-				        </restriction>
-				      </simpleType>
-				    </attribute>
-				    <attribute name="converter" type="string">
-				      <annotation><documentation>The class name of the converter.  The converter must implement 
-				      the Converter interface and have a default constructor</documentation></annotation>
-				    </attribute>
-				    <attribute name="variable-class" type="string" use="required">
-				      <annotation><documentation>The class name of the variable class.  The variable class must be 
-				      a sub class of Variable and must have a default constructor.</documentation></annotation>
-				    </attribute>
-          </complexType>
-        </element>
-      </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>The name of the object.  It's optional and serves 
-	      as an id to refer to this object from other object declarations.  This name can 
-	      also be used lookup the object programmatically.</documentation></annotation>
-	    </attribute>
-	    <attribute name="init" type="tns:initType" default="lazy">
-	      <annotation><documentation>Specifies when and how this object should be 
-	      initialized. Default is lazy.</documentation></annotation>
-	    </attribute>
-	    <attribute name="file" type="string">
-	      <annotation><documentation>Imports variable types from a file.  All the 
-	      top level elements of the root document element are imported.</documentation></annotation>
-	    </attribute>
-	    <attribute name="url" type="string">
-	      <annotation><documentation>Imports variable types from a URL.  All the 
-	      top level elements of the root document element are imported.</documentation></annotation>
-	    </attribute>
-	    <attribute name="resource" type="string">
-	      <annotation><documentation>Imports variable types from a resource.  All the 
-	      top level elements of the root document element are imported.</documentation></annotation>
-	    </attribute>
-    </complexType>
-  </element>
-
-  <!-- ### COMPLEX TYPES ################################################### -->
-
-  <complexType name="argType">
-    <annotation><documentation>The method arguments.
-    Each 'arg' element should have exactly one child element 
-    that represents the value of the argument.
-    </documentation></annotation>
-    <attribute name="type" type="string">
-      <annotation><documentation>The java class name representing 
-      the type of the method.  This is optional and can be used to 
-      indicate the appropriate method in case of method overloading. 
-      </documentation></annotation>
-    </attribute>
-  </complexType>
-  
-  <complexType name="contextType">
-    <annotation><documentation>A context is a set of object 
-    descriptions.
-    </documentation></annotation>
-    <choice minOccurs="0" maxOccurs="unbounded">
-      <group ref="tns:allDescriptors" />
-    </choice>
-  </complexType>
-
-  <complexType name="hibernateConfigurationType">
-    <choice minOccurs="0" maxOccurs="unbounded">
-      <element name="mappings">
-        <annotation><documentation>Imports mapping file references from the 
-        referenced resource files</documentation></annotation>
-        <complexType>
-          <attribute name="resource" type="string">
-            <annotation><documentation>Import mapping references from a resource file.
-            The full classpath is scanned for all the resource 
-            files of the given name.  All mapping elements that are found as the content in 
-            the top level document element will be imported for all of the resource files 
-            found on the classpath with that name. </documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-      <element name="mapping">
-        <annotation><documentation>Imports a hibernate mapping file</documentation></annotation>
-        <complexType>
-          <attribute name="resource" type="string">
-            <annotation><documentation>Adds the referenced resource file as a mapping 
-            file to the hibernate configuration</documentation></annotation>
-          </attribute>
-          <attribute name="file" type="string">
-            <annotation><documentation>Adds the referenced file as a mapping 
-            file to the hibernate configuration</documentation></annotation>
-          </attribute>
-          <attribute name="class" type="string">
-            <annotation><documentation>Adds the resource file that matches the given class 
-            name as a mapping file to the hibernate configuration. Matching means 
-            .hbm.xml instead of .java</documentation></annotation>
-          </attribute>
-          <attribute name="url" type="string">
-            <annotation><documentation>Adds file supplied by the URL as a mapping 
-            file to the hibernate configuration</documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-      <element ref="tns:properties" />
-      <element name="cache-configuration">
-        <complexType>
-          <choice minOccurs="0" maxOccurs="unbounded">
-            <element name="class-cache">
-              <annotation><documentation>Persistent class for which hibernate should 
-              activate its second level cache</documentation></annotation>
-              <complexType>
-                <attribute name="class">
-                  <annotation><documentation>Fully qualified classname</documentation></annotation>
-                </attribute>
-              </complexType>
-            </element>
-            <element name="collection-cache">
-              <annotation><documentation>Persistent collection for which hibernate should 
-              activate its second level cache</documentation></annotation>
-              <complexType>
-                <attribute name="collection">
-                  <annotation><documentation>Fully qualified classname, a dot (.) and 
-                  then the property name of the collection</documentation></annotation>
-                </attribute>
-              </complexType>
-            </element>
-          </choice>
-          <attribute name="usage" type="tns:hibernateCacheUsageType">
-            <annotation><documentation>The caching strategy. see hibernate 
-            docs for more info.</documentation></annotation>
-          </attribute>
-          <attribute name="file" type="string">
-            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
-          </attribute>
-          <attribute name="resource" type="string">
-            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
-          </attribute>
-          <attribute name="url" type="string">
-            <annotation><documentation>Import source for class-cache elements</documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-    </choice>
-	    <attribute name="name" type="string">
-	      <annotation><documentation>Optional name of this hibernate session factory.
-	      Typically a session factory is looked up by type.  Only if multiple sessions 
-	      are declared, a name can be used to distinct them. 
-	      </documentation></annotation>
-	    </attribute>
-    <attribute name="init" type="tns:initType" default="lazy">
-      <annotation><documentation>Specifies when and how this object should be 
-      initialized. Default is lazy.</documentation></annotation>
-    </attribute>
-    <attribute name="class" type="string">
-      <annotation><documentation>Optional class of the hibernate configuration.  
-      By default org.hibernate.cfg.Configuration will be used.  This can be used 
-      to specify e.g. an AnnotationConfiguration.</documentation></annotation>
-    </attribute>
-    <attribute name="schema-operation" type="tns:hibernateSchemaOperationType">
-      <annotation><documentation>Optional schema operation to be applied when 
-      this configuration has been created.  By default, no schema operation will 
-      be applied.</documentation></annotation>
-    </attribute>
-  </complexType>
-
-  <complexType name="businessCalendarDayType">
-    <attribute name="hours" type="string">
-      <annotation><documentation>The working hours of this day.  Day parts are separated 
-      with 'and'.  Begin and end hours are separated by '-'.  E.g:
-      9:00-12:00 and 12:30-17:00
-      </documentation></annotation>
-    </attribute>
-  </complexType>
-  
-
-
-  <!-- ### SIMPLE VALUE TYPES ############################################## -->
-
-  <simpleType name="booleanValueType">
-    <restriction base="string">
-      <enumeration value="true" />
-      <enumeration value="on" />
-      <enumeration value="enabled" />
-      <enumeration value="false" />
-      <enumeration value="off" />
-      <enumeration value="disabled" />
-    </restriction>
-  </simpleType>
-
-  <simpleType name="hibernateSchemaOperationType">
-    <restriction base="string">
-      <enumeration value="update" />
-      <enumeration value="create" />
-    </restriction>
-  </simpleType>
-  
-  <simpleType name="hibernateCacheUsageType">
-    <restriction base="string">
-      <enumeration value="read-only" />
-      <enumeration value="nonstrict-read-write" />
-      <enumeration value="read-write" />
-      <enumeration value="transactional" />
-    </restriction>
-  </simpleType>
-  
-  <simpleType name="initType">
-    <annotation><documentation>Specifies when and how this object should be 
-      initialized. Default is lazy.
-      
-      <p><code><b>lazy</b></code>: The object is only created when it is asked for.  
-        In case of transitive dependencies, the object might not yet be initialized.
-      </p>
-         
-      <p><code><b>eager</b></code>: The object is created when the context is created.  
-        In case of transitive dependencies, the object might not yet be initialized.
-      </p>
-        
-      <p><code><b>eager</b></code>: The object is created when the context is created.  
-        In case of transitive dependencies, the initialization is also mandatory.
-      </p>
-        
-      <p><code><b>eager</b></code>: The object is only created when it is asked for.  
-        In case of transitive dependencies, initialization is mandatory.  
-      </p>
-     </documentation></annotation>
-    <restriction base="string">
-      <enumeration value="lazy" />
-      <enumeration value="eager" />
-      <enumeration value="immediate" />
-      <enumeration value="required" />
-    </restriction>
-  </simpleType>
-
-  <simpleType name="messageSessionTargetType">
-    <restriction base="string">
-      <enumeration value="job-executor" />
-      <enumeration value="jms" />
-      <enumeration value="test" />
-    </restriction>
-  </simpleType>
-  
-  
-  <!-- ### GROUPS ########################################################## -->
-
-  <group name="persistableDescriptors">
-    <choice>
-      <element ref="tns:byte" />
-      <element ref="tns:char" />
-      <element ref="tns:class" />
-      <element ref="tns:context-ref" />
-      <element ref="tns:double" />
-      <element ref="tns:environment-ref" />
-      <element ref="tns:environment-factory-ref" />
-      <element ref="tns:false" />
-      <element ref="tns:float" />
-      <element ref="tns:int" />
-      <element ref="tns:jndi" />
-      <element ref="tns:list" />
-      <element ref="tns:long" />
-      <element ref="tns:map" />
-      <element ref="tns:message-session" />
-      <element ref="tns:null" />
-      <element ref="tns:object" />
-      <element ref="tns:pvm-db-session" />
-      <element ref="tns:properties" />
-      <element ref="tns:ref" />
-      <element ref="tns:set" />
-      <element ref="tns:short" />
-      <element ref="tns:string" />
-      <element ref="tns:timer-session" />
-      <element ref="tns:transaction-ref" />
-      <element ref="tns:true" />
-    </choice>
-  </group>
-  
-  <group name="allDescriptors">
-    <choice>
-      <group ref="tns:persistableDescriptors" />
-      <element ref="tns:business-calendar" />
-      <element ref="tns:process-service" />
-      <element ref="tns:deployer-manager" />
-      <element ref="tns:hibernate-configuration" />
-      <element ref="tns:hibernate-session-factory" />
-      <element ref="tns:hibernate-session" />
-      <element ref="tns:job-executor" />
-      <element ref="tns:job-test-helper" />
-      <element ref="tns:command-service" />
-      <element ref="tns:transaction" />
-      <element ref="tns:variable-types" />
-    </choice>
-  </group>
-  
-  <group name="interceptors">
-    <choice>
-		  <element name="environment-interceptor">
-		    <annotation><documentation>Interceptor that can be used as part of declaring 
-		    a command service. 
-		    </documentation></annotation>
-		  </element>
-		  <element name="retry-interceptor">
-		    <annotation><documentation>Interceptor that retries the method invocation in 
-		    case of exceptions. 
-		    </documentation></annotation>
-		    <complexType>
-		      <attribute name="retries" default="3">
-		        <annotation><documentation>Max number of attempts before giving up</documentation></annotation>
-		      </attribute>
-		      <attribute name="delay" default="50">
-		        <annotation><documentation>Delay in milliseconds after the first exception</documentation></annotation>
-		      </attribute>
-		      <attribute name="delay-factor" default="4">
-		        <annotation><documentation>Factor with which the delay is multiplied after subsequent 
-		        failed attempts.  This enables back-off to reduce load in case of repetitive failures.
-		        </documentation></annotation>
-		      </attribute>
-		    </complexType>
-		  </element>
-		  <element name="transaction-interceptor">
-		    <annotation><documentation>Interceptor that will make sure the transaction is initialized before each 
-		    invocation and it will issue a setRollbackOnly on the transaction in case an exception occors. 
-		    </documentation></annotation>
-		  </element>
-    </choice>
-  </group>
-
-  <group name="deployers">
-    <choice>
-      <element name="create-process">
-        <annotation><documentation>Deployer that can instantiate the 
-	      process definition of a given type. 
-	      </documentation></annotation>
-	      <complexType>
-  		    <attribute name="name" type="string" />
-	  	    <attribute name="class" type="string" use="required"/>
-		    </complexType>
-      </element>
-      <element name="check-version">
-        <annotation><documentation>Deployer checks if the version of the 
-        deployed process is exactly 1 more then the last version of the same 
-        process.   If a version already exists, it is left untouched.  
-        If no version exists, by default, this deployer will assign 
-        a version to the process definition that is 1 higher then the 
-        highest deployed version in the DB for that process name.  This 
-        default can be overridden by the 'assign' attribute. 
-        </documentation></annotation>
-        <complexType>
-          <attribute name="assign" default="true">
-            <annotation><documentation>In case there the process definition 
-            has not be given a version explicitely, this attribute specifies 
-            if this deployer should assign a version.  The assigned version 
-            will be 1 higher then the highest version in the db for processes
-            with the same name.  Starting with 1 if no similarly named procses 
-            definitions are found.  
-            </documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-      <element name="create-id">
-        <annotation><documentation>Deployer verifies if the version of the 
-        deployed process is exactly 1 more then the last version of the same 
-        process. 
-        </documentation></annotation>
-      </element>
-      <element name="save-process">
-        <annotation><documentation>Deployer that saves the process with
-        the PvmDbSession. 
-	      </documentation></annotation>
-      </element>
-    </choice>
-  </group>
-
-  <group name="operations">
-    <choice>
-      <element name="enlist">
-        <annotation><documentation>Enlists this object (assumes a org.jbpm.tx.Resource) with the current org.jbpm.tx.StandardTransaction</documentation></annotation>
-        <complexType>
-			    <attribute name="transaction" type="string">
-			      <annotation><documentation>Optional reference to the name of the 
-			      standard transaction.  If no transaction name is specified, the transaction 
-			      is looked up by type in the environment.
-			      </documentation></annotation>
-			    </attribute>
-        </complexType>
-      </element>
-      <element name="field">
-        <annotation><documentation>Injects a value into a member field of this object.
-        Exactly one child element must specify the value.
-        </documentation></annotation>
-        <complexType>
-          <group ref="tns:persistableDescriptors" />
-          <attribute name="name">
-            <annotation><documentation>The member field name</documentation></annotation>
-          </attribute>
-        </complexType>
-      </element>
-		  <element name="invoke">
-		    <annotation><documentation>Invokes a method</documentation></annotation>
-			  <complexType>
-			    <choice minOccurs="0" maxOccurs="unbounded">
-			      <element name="arg" type="tns:argType" />
-			    </choice>
-			    <attribute name="method" type="string" use="required">
-			      <annotation><documentation>the method name</documentation></annotation>
-			    </attribute>
-			  </complexType>
-		  </element>
-		  <element name="subscribe">
-		    <annotation><documentation>Subscribes this object to an observable</documentation></annotation>
-			  <complexType>
-			    <choice minOccurs="0" maxOccurs="unbounded">
-			      <element name="arg" type="tns:argType" />
-			    </choice>
-			    <attribute name="context" type="string">
-			      <annotation><documentation>The context in which to find the observable.  If not specified, 
-			      the context of this object will be taken.  If no observable object names are specified, the 
-			      context object itself will be used as the observable.</documentation></annotation>
-			    </attribute>
-			    <attribute name="to" default="object-events">
-			      <annotation><documentation>Indicates if this object is interested in the events fired by 
-			      the object itself (object-events) or in the wire events fired by the wire context 
-			      (wire-events).</documentation></annotation>
-			      <simpleType>
-			        <restriction base="string">
-			          <enumeration value="wire-events" />
-			          <enumeration value="object-events" />
-			        </restriction>
-			      </simpleType>
-			    </attribute>
-			    <attribute name="event" type="string">
-			      <annotation><documentation>A single event.  See 'events' for more information.</documentation></annotation>
-			    </attribute>
-			    <attribute name="events" type="string">
-			      <annotation><documentation>Comma separated list of events to listen to, filtering out all other events.  
-			      If no events are specified or if the '*' wildcard is specified, the object will be notified of all events.
-			      </documentation></annotation>
-			    </attribute>
-			    <attribute name="object" type="string">
-			      <annotation><documentation>A single object name.  See 'objects' for more information.</documentation></annotation>
-			    </attribute>
-			    <attribute name="objects" type="string">
-			      <annotation><documentation>Comma separated list of object names to listen to.  
-			      If no objects are specified the specified context will be used as the observable.
-			      </documentation></annotation>
-			    </attribute>
-			    <attribute name="method" type="string">
-			      <annotation><documentation>Name of the method to invoke.  If no method is specified, it is assumed that the 
-			      object implements the Listener interface.  Nested 'arg' elements can be used to provide arguments
-			      in the method invocation. 
-			      </documentation></annotation>
-			    </attribute>
-			  </complexType>
-		  </element>
-    </choice>
-  </group>
-
-</schema>
\ No newline at end of file

Added: jbpm4/trunk/modules/userguide/src/main/diagrams/diagrams.mdzip
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/userguide/src/main/diagrams/diagrams.mdzip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/userguide/src/main/diagrams/images.ppt
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/userguide/src/main/diagrams/images.ppt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE book [
+  <!ENTITY ch01-Introduction                   SYSTEM "modules/ch01-Introduction.xml">
+  <!ENTITY ch02-Environments                   SYSTEM "modules/ch02-Environments.xml">
+  <!ENTITY ch03-Configuration                  SYSTEM "modules/ch03-Configuration.xml">
+  <!ENTITY ch04-Services                       SYSTEM "modules/ch04-Services.xml">
+]>
+
+<book lang="en">
+
+  <bookinfo>
+    <title>jBPM User Guide</title>
+  </bookinfo>
+
+  <toc />
+
+  &ch01-Introduction;
+  &ch02-Configuration;
+  &ch03-Services;
+
+</book>
\ No newline at end of file

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,49 @@
+<chapter id="introduction">
+  <title>Introduction</title>
+  
+  <section>
+    <title>License and EULA</title>
+    <para>jBPM is distributed under the terms of the 
+    GNU Lesser General Public License (LGPL) and the JBoss End User License Agreement (EULA).  
+    See <ulink url="../../../lgpl.html">the full LGPL license text</ulink> and <ulink url="../../../JBossORG-EULA.txt">the 
+    full End User License Agreement</ulink>. 
+    </para>
+  </section>
+
+  <section>
+    <title>Sources</title>
+    <para>The source code for this component can be found in the jBPM SVN repository:
+    </para>
+    <ulink url="https://anonsvn.jboss.org/repos/jbpm/jbpm4/">https://anonsvn.jboss.org/repos/jbpm/jbpm4/</ulink>
+  </section>
+
+  <section>
+    <title>JVM version</title>
+    <para>jBPM requires a JVM version 5 or higher.
+    </para>
+  </section>
+
+  <section>
+    <title>What is it</title>
+    <para>jBPM is an extensible and flexible process engine that can run 
+    as a standalone server or embedded in any Java application.
+    jBPM can run multiple process languages and it supports multiple 
+    execution modes.
+    </para>
+  </section>  
+
+  <section>
+    <title>Contents of this userguide</title>
+    <para>In this user guide, we'll describe the jPDL 
+    process language in persistent execution mode.  Persistent 
+    execution mode means that process definitions, process executions 
+    and process history is stored in a relational DB.  This is the common way 
+    of how jBPM is used. 
+    </para>
+    <para>This user guide explains the supported way on how to use jBPM.
+    The developers guide explains more advanced customization options that 
+    are not supported. 
+    </para>
+  </section>  
+
+</chapter>

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Environments.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Environments.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Environments.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,49 @@
+<chapter id="environments">
+  <title>Environments</title>
+  
+  <para>This chapter describes the supported environments 
+  and the supported configurations for these environments.
+  </para>
+  
+  <section id="plainjava">
+    <title>Plain Java</title>
+    <para>TODO : specify library dependencies</para>
+  </section>
+
+  <section id="tomcat-xxx">
+    <title>Tomcat xxx</title>
+    <para>TODO</para>
+  </section>
+
+  <section id="jboss-4.2.2">
+    <title>JBoss 4.2.2</title>
+    <para>TODO</para>
+  </section>
+
+  <section id="jboss-4.2.3">
+    <title>JBoss 4.2.3</title>
+    <para>TODO</para>
+  </section>
+
+  <section id="jboss-5.0.0">
+    <title>JBoss 5.0.0</title>
+    <para>TODO</para>
+  </section>
+
+  <section id="spring">
+    <title>Spring</title>
+    <para>Usage of jBPM with Spring is only supported when jBPM is configured with 
+    the jBPM configuration file and when hibernate or JTA is used for transaction 
+    demarcation.  For configuring jBPM in a Spring configuration file and for 
+    binding jBPM to Spring demarcated transactions, see the non-supported 
+    developers guide. 
+    </para>
+  </section>
+
+  <section id="osgi">
+    <title>OSGi</title>
+    <para>TODO 
+    </para>
+  </section>
+
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,10 @@
+<chapter id="configuration">
+  <title>Configuration</title>
+  
+  <para>Interacting with jBPM occurs through <link linkend="services">services</link>.
+  The service interfaces can be obtained from the <literal>ProcessEngine</literal>
+  which is build from a <literal>Configuration</literal>. 
+  </para>
+  
+
+</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	2008-11-21 15:59:34 UTC (rev 3038)
@@ -0,0 +1,7 @@
+<chapter id="services">
+  <title>Services</title>
+  
+  <para>  
+  </para>
+
+</chapter>
\ No newline at end of file




More information about the jbpm-commits mailing list