[jbpm-commits] JBoss JBPM SVN: r2556 - in jbpm3/trunk/modules/core/src: main/java/org/jbpm/jpdl/xml and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Oct 16 22:39:20 EDT 2008


Author: alex.guizar at jboss.com
Date: 2008-10-16 22:39:19 -0400 (Thu, 16 Oct 2008)
New Revision: 2556

Added:
   jbpm3/trunk/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.3.xsd
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
Modified:
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Join.java
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
   jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml
   jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testProcessDefinitionWithSchemaLocation.xml
Log:
[JBPM-1755] made field Join.parentLockMode persistent
allow any lock mode, not just UPGRADE
added lock attribute to join element in xml schema
registered jpdl 3.3 schema in parser

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Join.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Join.java	2008-10-16 22:56:53 UTC (rev 2555)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Join.java	2008-10-17 02:39:19 UTC (rev 2556)
@@ -76,10 +76,14 @@
 
   public void read(Element element, JpdlXmlReader jpdlReader) {
     String lock = element.attributeValue("lock");
-    if ( (lock!=null) 
-         && (lock.equalsIgnoreCase("pessimistic"))
-       ) {
-      parentLockMode = LockMode.UPGRADE.toString();
+    if (lock != null) {
+      LockMode lockMode = LockMode.parse(lock);
+      if (lockMode != null)
+        parentLockMode = lockMode.toString();
+      else if ("pessimistic".equals(lock))
+        parentLockMode = LockMode.UPGRADE.toString();
+      else
+        jpdlReader.addError("invalid parent lock mode '" + lock + "'");
     }
   }
 
@@ -211,6 +215,12 @@
     return reactivateParent;
   }
 
+  public String getParentLockMode() {
+    return parentLockMode;
+  }
+  public void setParentLockMode(String parentLockMode) {
+    this.parentLockMode = parentLockMode;
+  }
   public Script getScript() {
     return script;
   }

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java	2008-10-16 22:56:53 UTC (rev 2555)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java	2008-10-17 02:39:19 UTC (rev 2556)
@@ -157,6 +157,7 @@
     schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.0.xsd");
     schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.1.xsd");
     schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.2.xsd");
+    schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.3.xsd");
     schemaResources.add("org/jboss/seam/pageflow-2.0.xsd");
     return schemaResources;
   }

Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml	2008-10-16 22:56:53 UTC (rev 2555)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml	2008-10-17 02:39:19 UTC (rev 2556)
@@ -5,8 +5,9 @@
 
 <hibernate-mapping auto-import="false" default-access="field" >
 
-  <subclass name="org.jbpm.graph.node.Join" 
-            discriminator-value="J" 
-            extends="org.jbpm.graph.def.Node"	/>
+  <subclass name="org.jbpm.graph.node.Join" discriminator-value="J"
+  	extends="org.jbpm.graph.def.Node">
+  	<property name="parentLockMode" column="PARENTLOCKMODE_"/>
+  </subclass>
 
 </hibernate-mapping>

Added: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.3.xsd
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.3.xsd	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.3.xsd	2008-10-17 02:39:19 UTC (rev 2556)
@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema targetNamespace="urn:jbpm.org:jpdl-3.3"
+           elementFormDefault="qualified"
+           xmlns="urn:jbpm.org:jpdl-3.3"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <!--  PROCESS-DEFINITION -->
+  <!--  ################## -->
+  <xs:element name="process-definition">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="description" />
+        <xs:element ref="swimlane" />
+        <xs:element ref="start-state" />
+        <xs:group   ref="node-elements"/>
+        <xs:group   ref="action-elements" />
+        <xs:element ref="event" />
+        <xs:element ref="exception-handler" />
+        <xs:element ref="task" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  SWIMLANE -->
+  <!--  ######## -->
+  <xs:element name="swimlane">
+    <xs:complexType>
+      <xs:sequence minOccurs="0" maxOccurs="1">
+        <xs:element ref="assignment"/>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  NODES -->
+  <!--  ##### -->
+  <xs:element name="start-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="description" />
+        <xs:element ref="task"/>
+        <xs:element ref="transition"/>
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="end-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="description" />
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="end-complete-process" type="booleanType" use="optional" default="false"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="decision">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="description" />
+        <xs:element name="handler" type="delegation" />
+        <xs:element ref="event"/>
+        <xs:element ref="exception-handler"/>
+        <xs:element ref="transition"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="expression" type="xs:string" />
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="fork">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="script" />
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="join">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+      <xs:attribute name="lock" type="lockMode"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="node">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:group ref="action-elements" />
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:group ref="node-content-elements" />
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="process-state">
+    <xs:complexType>
+    	<xs:choice minOccurs="0" maxOccurs="unbounded">
+    		<xs:element name="sub-process">
+    			<xs:complexType>
+    				<xs:attribute name="name" type="xs:string"
+    					use="required" />
+    				<xs:attribute name="version" type="xs:integer" />
+    				<xs:attribute name="binding" type="xs:string" />
+    			</xs:complexType>
+    		</xs:element>
+    		<xs:element ref="variable" />
+    		<xs:group ref="node-content-elements" />
+    	</xs:choice>
+    	<xs:attribute name="name" type="xs:string" use="required" />
+    	<xs:attribute name="async" type="xs:string" default="false" />
+    	<xs:attribute name="binding" type="bindingType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-content-elements"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="super-state">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="node-elements"/>
+        <xs:group ref="node-content-elements"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="task-node">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="task" />
+        <xs:group ref="node-content-elements" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="create-tasks" type="booleanType" default="true" />
+      <xs:attribute name="end-tasks" type="booleanType" default="false" />
+      <xs:attribute name="signal" default="last">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="unsynchronized"/>
+            <xs:enumeration value="never"/>
+            <xs:enumeration value="first"/>
+            <xs:enumeration value="first-wait"/>
+            <xs:enumeration value="last"/>
+            <xs:enumeration value="last-wait"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="async" type="xs:string" default="false" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="mail-node">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="subject" />
+        <xs:element ref="text" />
+        <xs:group ref="node-content-elements"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+      <xs:attribute name="template" type="xs:string"/>
+      <xs:attribute name="actors" type="xs:string"/>
+      <xs:attribute name="to" type="xs:string"/>
+      <xs:attribute name="subject" type="xs:string"/>
+      <xs:attribute name="text" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+
+  <!--  TRANSITION -->
+  <!--  ########## -->
+  <xs:element name="transition">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+         <xs:element ref="description" />
+         <xs:element name="condition">
+           <xs:complexType mixed="true">
+             <xs:sequence minOccurs="0" maxOccurs="unbounded">
+               <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+             </xs:sequence>
+             <xs:attribute name="expression" type="xs:string" />
+           </xs:complexType>
+         </xs:element>
+        <xs:group ref="action-elements"/>
+        <xs:element ref="exception-handler" />
+      </xs:choice>
+      <xs:attribute name="to" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <!-- ACTIONS -->
+  <!-- ####### -->
+  <xs:element name="action">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="class" type="xs:string" />
+      <xs:attribute name="config-type" default="field" type="xs:string" />
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="ref-name" type="xs:string" />
+      <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+      <xs:attribute name="expression" type="xs:string" />
+      <xs:attribute name="async" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="cancel-timer">
+    <xs:complexType>
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="create-timer">
+    <xs:complexType>
+      <xs:choice  minOccurs="0">
+        <xs:element ref="action"/>
+        <xs:element ref="script"/>
+      </xs:choice>
+      <xs:attribute name="duedate" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="repeat" type="xs:string" />
+      <xs:attribute name="transition" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="script">
+    <xs:complexType  mixed="true">
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="mail">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="subject" />
+        <xs:element ref="text" />
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="async" type="xs:string" default="false" />
+      <xs:attribute name="template" type="xs:string"/>
+      <xs:attribute name="actors" type="xs:string"/>
+      <xs:attribute name="to" type="xs:string"/>
+      <xs:attribute name="subject" type="xs:string"/>
+      <xs:attribute name="text" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  EVENT -->
+  <!--  ##### -->
+  <xs:element name="event">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:group ref="action-elements"/>
+      </xs:choice>
+      <xs:attribute name="type" use="required">
+        <xs:simpleType>
+          <xs:union>
+            <xs:simpleType>
+              <xs:restriction base="xs:string"/>
+            </xs:simpleType>
+            <xs:simpleType>
+              <xs:restriction base="xs:string">
+                <xs:enumeration value="node-enter"/>
+                <xs:enumeration value="node-leave"/>
+                <xs:enumeration value="process-start"/>
+                <xs:enumeration value="process-end"/>
+                <xs:enumeration value="task-create"/>
+                <xs:enumeration value="task-assign"/>
+                <xs:enumeration value="task-start"/>
+                <xs:enumeration value="task-end"/>
+                <xs:enumeration value="before-signal"/>
+                <xs:enumeration value="after-signal"/>
+                <xs:enumeration value="superstate-enter"/>
+                <xs:enumeration value="superstate-leave"/>
+                <xs:enumeration value="timer-create"/>
+                <xs:enumeration value="subprocess-created"/>
+                <xs:enumeration value="subprocess-end"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:union>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  EXCEPTION-HANDLER -->
+  <!--  ################# -->
+  <xs:element name="exception-handler">
+    <xs:complexType>
+      <xs:choice minOccurs="1" maxOccurs="unbounded">
+        <xs:element ref="action"/>
+        <xs:element ref="script"/>
+      </xs:choice>
+      <xs:attribute name="exception-class" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  TASK -->
+  <!--  #### -->
+  <xs:element name="task">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="description" />
+        <xs:element ref="assignment"/>
+        <xs:element ref="controller"/>
+        <xs:element ref="event"/>
+        <xs:element ref="timer"/>
+        <xs:element name="reminder">
+          <xs:complexType>
+            <xs:attribute name="duedate" type="xs:string" use="required" />
+            <xs:attribute name="repeat" type="xs:string" />
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="blocking" type="booleanType" default="false"/>
+      <xs:attribute name="signalling" type="booleanType" default="true"/>
+      <xs:attribute name="description" type="xs:string" />
+      <xs:attribute name="duedate" type="xs:string" />
+      <xs:attribute name="swimlane" type="xs:string" />
+      <xs:attribute name="priority" type="priorityType" default="normal" />
+      <xs:attribute name="notify" type="booleanType" default="false"/>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="controller" type="delegation" />
+
+  <xs:element name="assignment">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="delegation">
+          <xs:attribute name="expression" type="xs:string" />
+          <xs:attribute name="actor-id" type="xs:string" />
+          <xs:attribute name="pooled-actors" type="xs:string" />
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <!--  TIMER -->
+  <!--  ##### -->
+  <xs:element name="timer">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="1">
+        <xs:group ref="action-elements" />
+      </xs:choice>
+      <xs:attribute name="duedate" type="xs:string" use="required" />
+      <xs:attribute name="name" type="xs:string" />
+      <xs:attribute name="repeat" type="xs:string" />
+      <xs:attribute name="transition" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="variable">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="access" type="xs:string" default="read,write"/>
+      <xs:attribute name="mapped-name" type="xs:string" />
+    </xs:complexType>
+  </xs:element>
+
+  <!--  MAIL  -->
+  <!--  #### -->
+  <xs:element name="to" type="xs:string"/>
+  <xs:element name="recipients" type="xs:string"/>
+  <xs:element name="subject" type="xs:string"/>
+  <xs:element name="text" type="xs:string"/>
+  <xs:element name="template" type="xs:string"/>
+
+  <!-- TYPES AND GROUPS -->
+  <!-- ################ -->
+
+  <xs:element name="description" type="xs:string" />
+
+  <xs:complexType name="delegation" mixed="true">
+    <xs:sequence>
+      <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xs:sequence>
+    <xs:attribute name="class" type="xs:string" />
+    <xs:attribute name="config-type" default="field" type="xs:string" />
+  </xs:complexType>
+
+  <xs:simpleType name="configType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="field"/>
+      <xs:enumeration value="bean"/>
+      <xs:enumeration value="constructor"/>
+      <xs:enumeration value="configuration-property"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="booleanType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="yes"/>
+      <xs:enumeration value="no"/>
+      <xs:enumeration value="true"/>
+      <xs:enumeration value="false"/>
+      <xs:enumeration value="on"/>
+      <xs:enumeration value="off"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:simpleType name="priorityType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="highest"/>
+          <xs:enumeration value="high"/>
+          <xs:enumeration value="normal"/>
+          <xs:enumeration value="low"/>
+          <xs:enumeration value="lowest"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction base="xs:int"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+
+  <xs:group name="node-elements">
+    <xs:choice>
+      <xs:element ref="node"/>
+      <xs:element ref="state"/>
+      <xs:element ref="task-node"/>
+      <xs:element ref="super-state"/>
+      <xs:element ref="process-state"/>
+      <xs:element ref="fork"/>
+      <xs:element ref="join"/>
+      <xs:element ref="decision"/>
+      <xs:element ref="end-state"/>
+      <xs:element ref="mail-node"/>
+    </xs:choice>
+  </xs:group>
+  
+  <xs:group name="action-elements">
+    <xs:choice>
+      <xs:element ref="action"/>
+      <xs:element ref="script"/>
+      <xs:element ref="create-timer"/>
+      <xs:element ref="cancel-timer"/>
+      <xs:element ref="mail"/>
+    </xs:choice>
+  </xs:group>
+  
+  <xs:group name="node-content-elements">
+    <xs:choice>
+      <xs:element ref="description" />
+      <xs:element ref="event"/>
+      <xs:element ref="exception-handler"/>
+      <xs:element ref="timer"/>
+      <xs:element ref="transition"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:simpleType name="bindingType">
+    <xs:restriction base="xs:string">
+  	  <xs:enumeration value="late"/>
+  	  <xs:enumeration value="early"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="lockMode">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="NONE"/>
+      <xs:enumeration value="READ"/>
+      <xs:enumeration value="UPGRADE"/>
+      <xs:enumeration value="UPGRADE_NOWAIT"/>
+      <xs:enumeration value="FORCE"/>
+      <xs:enumeration value="pessimistic"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>

Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java	2008-10-17 02:39:19 UTC (rev 2556)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.graph.node;
+
+import org.hibernate.LockMode;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+
+/**
+ * Verifies the join node can be persisted correctly.
+ * @author Alejandro Guizar
+ */
+public class JoinDbTest extends AbstractDbTestCase {
+
+  private long processDefinitionId;
+
+  protected void setUp() throws Exception {
+    super.setUp();
+    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
+        "<process-definition name='" + getName() + "'>" +
+        "  <join name='read' lock='READ' />" +
+        "  <join name='nowait' lock='UPGRADE_NOWAIT' />" +
+        "  <join name='upgrade' lock='pessimistic' />" +
+        "</process-definition>");
+    jbpmContext.deployProcessDefinition(processDefinition);
+    processDefinitionId = processDefinition.getId();
+    newTransaction();
+  }
+
+  protected void tearDown() throws Exception {
+    graphSession.deleteProcessDefinition(processDefinitionId);
+    super.tearDown();
+  }
+
+  public void testParentLockMode() {
+    ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition(getName());
+    Join join = (Join) processDefinition.getNode("read");
+    assertEquals(LockMode.READ.toString(), join.getParentLockMode());
+    join = (Join) processDefinition.getNode("nowait");
+    assertEquals(LockMode.UPGRADE_NOWAIT.toString(), join.getParentLockMode());
+    join = (Join) processDefinition.getNode("upgrade");
+    assertEquals(LockMode.UPGRADE.toString(), join.getParentLockMode());
+  }
+}

Modified: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testProcessDefinitionWithSchemaLocation.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testProcessDefinitionWithSchemaLocation.xml	2008-10-16 22:56:53 UTC (rev 2555)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testProcessDefinitionWithSchemaLocation.xml	2008-10-17 02:39:19 UTC (rev 2556)
@@ -1,7 +1,7 @@
 <process-definition 
     xmlns="urn:jbpm.org:jpdl-3.2" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="urn:jbpm.org:jpdl-3.1 http://jbpm.org/jpdl-3.2.xsd"
+    xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/jpdl-3.2.xsd"
     name="process definition with schema location">
     
     <blablablab />




More information about the jbpm-commits mailing list