[jbpm-commits] JBoss JBPM SVN: r6750 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/jpdl/parsing and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Oct 9 05:50:20 EDT 2010


Author: rebody
Date: 2010-10-09 05:50:20 -0400 (Sat, 09 Oct 2010)
New Revision: 6750

Added:
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ObjectParsingTest.java
Modified:
   jbpm4/trunk/modules/api/src/main/resources/jpdl-4.5.xsd
Log:
JBPM-2938 add attribute name declaration in jpdl-4.5.xsd.

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.5.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.5.xsd	2010-10-09 03:46:44 UTC (rev 6749)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.5.xsd	2010-10-09 09:50:20 UTC (rev 6750)
@@ -692,6 +692,13 @@
           <documentation>Reference to an object in the current environment.</documentation>
         </annotation>
         <complexType>
+          <attribute name="name" type="string">
+            <annotation>
+              <documentation>The name of the object. Optional, serves as an identifier
+                to refer to this object from other object descriptions.
+                Also used to fetch the object programmatically.</documentation>
+            </annotation>
+          </attribute>
           <attribute name="object" type="string" use="required">
             <annotation>
               <documentation>The name of the referred object.</documentation>
@@ -821,7 +828,24 @@
       </element>
 
       <!-- OBJECT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-      <element name="object" type="tns:wireObjectType" />
+      <element name="object">
+        <annotation>
+          <documentation>java.util.Object instance.</documentation>
+        </annotation>
+        <complexType>
+          <complexContent>
+            <extension base="tns:wireObjectType">
+              <attribute name="name" type="string">
+                <annotation>
+                  <documentation>The name of the object. Optional, serves as an identifier
+                    to refer to this object from other object descriptions.
+                    Also used to fetch the object programmatically.</documentation>
+                </annotation>
+              </attribute>
+            </extension>
+          </complexContent>
+        </complexType>
+      </element>
 
       <!-- BASIC TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       <element name="string">

Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ObjectParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ObjectParsingTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ObjectParsingTest.java	2010-10-09 09:50:20 UTC (rev 6750)
@@ -0,0 +1,36 @@
+package org.jbpm.jpdl.parsing;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.Problem;
+
+/**
+ * JBPM-2938.
+ * @author Huisheng Xu
+ */
+public class ObjectParsingTest extends JpdlParseTestCase {
+
+  public void testArgOneValue() {
+    String xmlString = "<process name='MyProcess' version='1' xmlns='http://jbpm.org/4.5/jpdl'>"
+      + "  <start name='start'>"
+      + "    <transition to='hql'/>"
+      + "  </start>"
+      + "  <hql name='hql' var='result'>"
+      + "    <query>from ExecutionImpl where name=:name and key=:key</query>"
+      + "    <parameters>"
+      + "      <object name='name' expr='${name}' />"
+      + "      <ref name='key' object='key' />"
+      + "    </parameters>"
+      + "    <transition to='end'/>"
+      + "  </hql>"
+      + "  <end name='end'/>"
+      + "</process>";
+
+    List<Problem> problems = jpdlParser.createParse()
+      .setString(xmlString)
+      .execute()
+      .getProblems();
+
+    assertEquals(0, problems.size());
+  }
+}



More information about the jbpm-commits mailing list