JBoss JBPM SVN: r5692 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-10-05 14:17:23 -0400 (Mon, 05 Oct 2009)
New Revision: 5692
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
Log:
fix import
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-10-05 11:28:57 UTC (rev 5691)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-10-05 18:17:23 UTC (rev 5692)
@@ -21,15 +21,15 @@
*/
package org.jbpm.pvm.internal.history.model;
-import java.io.Serializable;
import java.util.Date;
+import org.jbpm.api.history.HistoryDetail;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.id.DbidGenerator;
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.internal.util.EqualsUtil;
-public class HistoryDetailImpl implements Serializable {
+public class HistoryDetailImpl implements HistoryDetail {
private static final long serialVersionUID = 1L;
16 years, 7 months
JBoss JBPM SVN: r5691 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/xml and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-05 07:28:57 -0400 (Mon, 05 Oct 2009)
New Revision: 5691
Added:
jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
Removed:
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.eventlisteners.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlBindingsParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
Log:
JBPM-2565 switched to explicit use of jpdlparser attribute to indicate specific parser version, ignoring namespace declaration
Added: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd (rev 0)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd 2009-10-05 11:28:57 UTC (rev 5691)
@@ -0,0 +1,1186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://jbpm.org/4.2/jpdl"
+ xmlns:tns="http://jbpm.org/4.2/jpdl"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
+
+ <annotation>
+ <documentation>Schema for jPDL 4 process descriptions;
+ element process is the top level element.
+ </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">
+ <element name="description" minOccurs="0" maxOccurs="unbounded" type="string" />
+ <element ref="tns:swimlane" minOccurs="0" maxOccurs="unbounded" />
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+ <group ref="tns:activityGroup" 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="key" type="string">
+ <annotation>
+ <documentation>
+ The key can be used to provide a short acronym that will replace the name as the basis for the generated
+ process definition id
+ </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>
+ <anyAttribute processContents="skip">
+ <annotation><documentation>for extensibility
+ </documentation></annotation>
+ </anyAttribute>
+ </complexType>
+ </element>
+
+ <!-- ### ACTIVITIES ##################################################### -->
+
+ <group name="activityGroup">
+ <choice>
+ <!-- ~~~ START ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="start">
+ <annotation><documentation>Start event
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="form" type="string">
+ <annotation><documentation>the resource name of the form in the
+ deployment.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="end">
+ <annotation><documentation>End event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="ends" default="process-instance">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="execution"/>
+ <enumeration value="process-instance"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="state" default="ended" type="string">
+ <annotation><documentation>sets the state of the execution explicitely</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="end-cancel">
+ <annotation><documentation>End cancel event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="ends" default="process-instance">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="execution"/>
+ <enumeration value="process-instance"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="end-error">
+ <annotation><documentation>End cancel event.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <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:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element ref="tns:timer" minOccurs="0" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ DECISION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="decision">
+ <annotation><documentation>Decision gateway: selects one path out of many alternatives.
+ When an execution comes in, exactly one outgoing transition is taken.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element name="handler" minOccurs="0" type="tns:wireObjectType" />
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element name="condition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The script text that will be evaluated.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Identification of the scripting language
+ to use.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- TODO add conditions -->
+ </element>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="expr" type="string">
+ <annotation><documentation>The script that will be evaluated and resolve to
+ the name of the outgoing transition.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Identification of the scripting language
+ to use for the expr attribute.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ FORK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="fork">
+ <annotation><documentation>Spawns multiple concurrent paths of
+ execution.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ JOIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="join">
+ <annotation><documentation>Spawns multiple concurrent paths of
+ execution.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attribute name="multiplicity" type="int" />
+ <attribute name="lockmode" default="upgrade">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="none"/>
+ <enumeration value="read"/>
+ <enumeration value="upgrade"/>
+ <enumeration value="upgrade_nowait"/>
+ <enumeration value="write"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- ~~~ SCRIPT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <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:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ HQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="hql">
+ <annotation><documentation>Performs a hibernate query
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:qlType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ SQL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="sql">
+ <annotation><documentation>Performs a hibernate SQL query
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:qlType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ MAIL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="mail">
+ <annotation><documentation>Sends an email
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:mailType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ JAVA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="java">
+ <annotation><documentation>Invokes a method on a java object.
+ Either the java class is instantiated with reflection, or the
+ java object is fetched from the environment. Then values from the
+ environment are injected into the fields and a method is executed.
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:javaType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ CUSTOM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="custom">
+ <annotation><documentation>Uses a user defined, custom implementation of
+ ActivityBehaviour
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:wireObjectType">
+ <sequence>
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <!-- ~~~ TASK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="task">
+ <annotation><documentation>Creates a task in the task component.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
+ <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="notification" minOccurs="0">
+ <complexType>
+ <attribute name="continue" type="tns:continueType" default="sync" />
+ <attribute name="template" type="tns:templateType" use="optional" />
+ </complexType>
+ </element>
+ <element name="reminder" minOccurs="0">
+ <complexType>
+ <attribute name="duedate" type="string" />
+ <attribute name="repeat" type="string" />
+ <attribute name="continue" type="tns:continueType" default="sync" />
+ <attribute name="template" type="tns:templateType" use="optional"/>
+ </complexType>
+ </element>
+ <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence>
+ <element ref="tns:timer" minOccurs="0" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attributeGroup ref="tns:activityAttributes" />
+ <attributeGroup ref="tns:assignmentAttributes"/>
+ <attribute name="swimlane" type="string" />
+ <attribute name="form" type="string">
+ <annotation><documentation>the resource name of the form in the
+ deployment.</documentation></annotation>
+ </attribute>
+ <attribute name="duedate" type="string" />
+ <attribute name="on-transition" default="cancel">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="keep"/>
+ <enumeration value="cancel"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="completion" type="string" default="complete" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ SUB-PROCESS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="sub-process">
+ <annotation><documentation>Waits while a sub process instance is
+ being executed and continues when the sub process instance ends.
+ </documentation></annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element name="parameter-in" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="parameter-out" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
+ <element ref="tns:timer" 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 name="swimlane-mapping" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="swimlane" type="string" use="required" />
+ <attribute name="sub-swimlane" type="string" use="required" />
+ </complexType>
+ </element>
+ <element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <extension base="tns:transitionType">
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element name="outcome-value">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="sub-process-id" type="string">
+ <annotation><documentation>Identifies the sub process by the id. This means that a specific
+ version of a process definition is referenced
+ </documentation></annotation>
+ </attribute>
+ <attribute name="sub-process-key" type="string">
+ <annotation><documentation>Identifies the sub process by the key. This means that the latest
+ version of the process definition with the given key is referenced. The latest version
+ of the process is looked up each time the activity executes.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="outcome" type="string">
+ <annotation><documentation>Expression that is evaluated when the sub process
+ instance ends. The value is then used for outcome transition mapping.
+ </documentation></annotation>
+ </attribute>
+ <attributeGroup ref="tns:activityAttributes" />
+ </complexType>
+ </element>
+
+ <!-- ~~~ group ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <element name="group">
+ <annotation><documentation>Scope enclosing a number of activities.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
+ <element ref="tns:transition" 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:activityAttributes" />
+ </complexType>
+ </element>
+ </choice>
+ </group>
+
+ <group name="wireObjectGroup">
+ <choice>
+ <!-- SPECIAL OBJECTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="null">
+ <annotation><documentation>the null value
+ </documentation></annotation>
+ </element>
+ <element name="ref">
+ <annotation><documentation>A reference to an object in the current environment</documentation></annotation>
+ <complexType>
+ <attribute name="object" type="string" use="required">
+ <annotation><documentation>The name of the referred object</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="env-ref">
+ <annotation><documentation>The current environment.
+ </documentation></annotation>
+ </element>
+ <element name="jndi">
+ <annotation><documentation>A lookup from JNDI through the InitialContext
+ </documentation></annotation>
+ <complexType>
+ <attribute name="jndi-name" type="string" use="required" />
+ </complexType>
+ </element>
+
+ <!-- COLLECTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="list">
+ <annotation><documentation>A java.util.List</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <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="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:wireObjectGroup" />
+ </complexType>
+ </element>
+ <element name="value" minOccurs="0">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ </choice>
+ </complexType>
+ </element>
+ </choice>
+ <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.synchronizedList(List)</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:wireObjectGroup" />
+ </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="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="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="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>
+
+ <!-- OBJECT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="object" type="tns:wireObjectType" />
+
+ <!-- BASIC TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="string">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="value">
+ <annotation><documentation>the actual string value</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="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="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="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="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="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="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>
+
+
+ </choice>
+ </group>
+
+ <complexType name="wireObjectType">
+ <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>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="factory">
+ <annotation><documentation>Contains one element that describes the factory object.</documentation></annotation>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </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>
+ <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:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The member field name</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="property">
+ <annotation><documentation>Injects a value through a setter method.
+ Exactly one child element must specify the value.
+ </documentation></annotation>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The name of the property (without the 'set' prefix)</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>
+ </choice>
+ <attribute name="class" type="string">
+ <annotation><documentation>The fully qualified class name</documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The class to instantiate.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>The class to instantiate.
+ </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>
+
+ <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="javaType">
+ <sequence>
+ <element name="field" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>Field injections from the environment
+ invocation.</documentation></annotation>
+ </element>
+ <element name="arg" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>Method arguments.</documentation></annotation>
+ </element>
+ </sequence>
+ <attribute name="object" type="string">
+ <annotation><documentation>Name of the object in the environment
+ </documentation></annotation>
+ </attribute>
+ <attribute name="method" type="string" use="required">
+ <annotation><documentation>The name of the method to invoke.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation><documentation>The class to instantiate.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>Expression that resolves to the target object
+ on which the method should be invoked.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>The language in which attribute 'expr' is to be
+ resolved.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="var" type="string">
+ <annotation><documentation>The variable name to store the return value
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <complexType name="scriptType">
+ <sequence>
+ <element name="text" type="string" minOccurs="0">
+ <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>
+ <attribute name="var" type="string">
+ <annotation><documentation>Name of the variable in which the result
+ of the script evaluation will be stored</documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <complexType name="qlType">
+ <sequence>
+ <element name="query" type="string">
+ <annotation><documentation>The query text.</documentation></annotation>
+ </element>
+ <element name="parameters" minOccurs="0">
+ <annotation><documentation>Query parameters.</documentation></annotation>
+ <complexType>
+ <sequence>
+ <group ref="tns:wireObjectGroup" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="var" type="string">
+ <annotation><documentation>Name of the variable in which the result
+ of the script evaluation will be stored</documentation></annotation>
+ </attribute>
+ <attribute name="unique" type="string">
+ <annotation><documentation>Does this query return a unique result or a list
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <attributeGroup name="activityAttributes">
+ <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>
+ <attribute name="continue" default="sync" type="tns:continueType">
+ <annotation><documentation>To specify async continuations.
+ sync is the default.
+ </documentation></annotation>
+ </attribute>
+ </attributeGroup>
+
+ <simpleType name="continueType">
+ <restriction base="string">
+ <enumeration value="async" />
+ <enumeration value="sync" />
+ <enumeration value="exclusive" />
+ </restriction>
+ </simpleType>
+
+
+ <attributeGroup name="assignmentAttributes">
+ <annotation><documentation>the assignment attributes will be used in
+ tasks and swimlanes to specify to whom these respectively are assigned.
+ </documentation></annotation>
+ <attribute name="assignee" type="string">
+ <annotation><documentation>Expression that resolves to a userId referencing
+ the person to which the task or swimlane will be assigned.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="assignee-lang" type="string">
+ <annotation><documentation>Expression language for the assignee attribute.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="candidate-users" type="string">
+ <annotation><documentation>Expression that resolves to a comma separated
+ list of userId's. All the referred people will be candidates for
+ take the task or swimlane.</documentation></annotation>
+ </attribute>
+ <attribute name="candidate-users-lang" type="string">
+ <annotation><documentation>Expression language for the
+ candidate-users attribute.</documentation></annotation>
+ </attribute>
+ <attribute name="candidate-groups" type="string">
+ <annotation><documentation>Resolves to a comma separated list of groupId's.
+ All the referred people will be candidates to
+ take the task or swimlane.</documentation></annotation>
+ </attribute>
+ <attribute name="candidate-groups-lang" type="string">
+ <annotation><documentation>Expression language for the
+ candidate-groups attribute.</documentation></annotation>
+ </attribute>
+ </attributeGroup>
+
+ <element name="swimlane">
+ <annotation><documentation>A process role.</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required" />
+ <attributeGroup ref="tns:assignmentAttributes" />
+ </complexType>
+ </element>
+
+ <complexType name="transitionType">
+ <annotation><documentation>The outgoing transitions. The first in the list
+ will be the default outgoing transition.
+ </documentation></annotation>
+ <sequence>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="string">
+ <annotation><documentation>Name of this outgoing transition</documentation></annotation>
+ </attribute>
+ <attribute name="to" type="string">
+ <annotation><documentation>Name of the destination activity of this transition.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="g" type="string">
+ <annotation><documentation>Graphical information used by process designer tool.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <element name="transition" type="tns:transitionType">
+ <annotation><documentation>A transition from one activity to another.</documentation></annotation>
+ </element>
+
+ <element name="on">
+ <complexType>
+ <sequence>
+ <element ref="tns:timer" minOccurs="0" />
+ <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. start, end, take or
+ any other custom event.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <complexType name="parameterType">
+ <attribute name="subvar" type="string">
+ <annotation><documentation>The name of the sub process variable.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>An expression for which the resulting
+ value will be used as value.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Language of the expression.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="var" type="string">
+ <annotation><documentation>Name of the process variable
+ in the super process execution..
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
+
+ <element name="timer">
+ <complexType>
+ <sequence>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>A list of event listeners that will
+ be notified when the timer fires</documentation></annotation>
+ </group>
+ </sequence>
+ <attribute name="duedate" type="string">
+ <annotation><documentation>Timer duedate expression that defines the duedate of this
+ timer relative to the creation time of the timer. E.g. '2 hours' or '4 business days'
+ </documentation></annotation>
+ </attribute>
+ <attribute name="repeat" type="string">
+ <annotation><documentation>Timer duedate expression that defines repeated scheduling
+ relative to the last timer fire event. E.g. '2 hours' or '4 business days'
+ </documentation></annotation>
+ </attribute>
+ <attribute name="duedatetime" type="string">
+ <annotation><documentation>Absolute time in format <code>HH:mm dd/MM/yyyy</code>
+ (see SimpleDateFormat). The format for the absolute time can be customized in the
+ jbpm configuration.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <group name="eventListenerGroup">
+ <choice>
+ <element name="event-listener" type="tns:wireObjectType" />
+ <element name="hql" type="tns:qlType" />
+ <element name="sql" type="tns:qlType" />
+ <element name="java" type="tns:javaType" />
+ <element name="script" type="tns:scriptType" />
+ <element name="mail" type="tns:mailType" />
+ </choice>
+ </group>
+
+ <complexType name="mailType">
+ <sequence>
+ <element name="from" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="to" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="cc" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="bcc" type="tns:mailRecipientType" minOccurs="0" />
+ <element name="subject" type="string" minOccurs="0" />
+ <element name="text" type="string" minOccurs="0" />
+ <element name="html" type="string" minOccurs="0" />
+ <element name="attachments" minOccurs="0" >
+ <complexType>
+ <sequence>
+ <element name="attachment" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="url" type="string">
+ <annotation><documentation>URL reference to the attachment</documentation></annotation>
+ </attribute>
+ <attribute name="resource" type="string">
+ <annotation><documentation>Name of the attachment resource on the classpath</documentation></annotation>
+ </attribute>
+ <attribute name="file" type="string">
+ <annotation><documentation>File reference to the attachment</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="template" type="tns:templateType" />
+ </complexType>
+
+ <complexType name="mailRecipientType">
+ <attribute name="addresses" type="string">
+ <annotation><documentation>list of email address separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ </attribute>
+ <attribute name="users" type="string">
+ <annotation><documentation>list of user ids that are resolved to the email address against configured identity component.
+ user ids should be separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ </attribute>
+ <attribute name="groups" type="string">
+ <annotation><documentation>list of group ids that are resolved to the email address against configured identity component.
+ group ids should be separated by ',' (comma) ';' (semicolon) '|' or whitespace</documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <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="templateType">
+ <annotation><documentation>Reference to the email template</documentation></annotation>
+ <restriction base="string"></restriction>
+ </simpleType>
+</schema>
Property changes on: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlBindingsParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlBindingsParser.java 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlBindingsParser.java 2009-10-05 11:28:57 UTC (rev 5691)
@@ -21,12 +21,11 @@
*/
package org.jbpm.jpdl.internal.xml;
-import java.util.ArrayList;
-import java.util.List;
-
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Binding;
+import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -39,12 +38,12 @@
private static final Log log = Log.getLog(JpdlBindingsParser.class.getName());
public Object parseDocumentElement(Element documentElement, Parse parse) {
- List<Binding> bindings = new ArrayList<Binding>();
+ Bindings bindings = (Bindings) parse.contextMapGet(Parse.CONTEXT_KEY_BINDINGS);
parse.setDocumentObject(bindings);
for (Element bindingElement : XmlUtil.elements(documentElement)) {
Binding binding = instantiateBinding(bindingElement, parse);
- bindings.add(binding);
+ bindings.addBinding(binding);
}
return bindings;
@@ -59,7 +58,18 @@
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Class<?> bindingClass = Class.forName(bindingClassName, true, classLoader);
- return (Binding) bindingClass.newInstance();
+ TagBinding binding = (TagBinding) bindingClass.newInstance();
+
+ String tagLocalName = XmlUtil.getTagLocalName(bindingElement);
+ if ("activity".equals(tagLocalName)) {
+ binding.setCategory(JpdlParser.CATEGORY_ACTIVITY);
+ } else if ("eventlistener".equals(tagLocalName)) {
+ binding.setCategory(JpdlParser.CATEGORY_EVENT_LISTENER);
+ } else {
+ parse.addProblem("unrecognized binding tag: "+tagLocalName);
+ }
+
+ return binding;
} catch (Exception e) {
parse.addProblem("couldn't instantiate activity binding "+bindingClassName, e);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-05 11:28:57 UTC (rev 5691)
@@ -90,82 +90,54 @@
public static final String CURRENT_VERSION_JBPM = "4.2";
public static final String CURRENT_VERSION_NAMESPACE = "http://jbpm.org/"+CURRENT_VERSION_JBPM+"/jpdl";
public static final String CURRENT_VERSION_PROCESS_LANGUAGE_ID = "jpdl-"+CURRENT_VERSION_JBPM;
+
+ public static final List<String> SCHEMA_RESOURCES = new ArrayList<String>();
+ static {
+ SCHEMA_RESOURCES.add("jpdl-4.0.xsd");
+ SCHEMA_RESOURCES.add("jpdl-4.2.xsd");
+ }
public static final WireParser wireParser = WireParser.getInstance();
// array elements are mutable, even when final
// never make a static array public
- static final String[] DEFAULT_ACTIVITIES_RESOURCES = {
- "jbpm.jpdl.activities.xml",
- "jbpm.user.activities.xml"
+ static final String[] DEFAULT_BINDING_RESOURCES = {
+ "jbpm.jpdl.bindings.xml",
+ "jbpm.user.bindings.xml"
};
- static final String[] DEFAULT_EVENTLISTENERS_RESOURCES = {
- "jbpm.jpdl.eventlisteners.xml",
- "jbpm.user.eventlisteners.xml"
- };
-
static JpdlBindingsParser jpdlBindingsParser = new JpdlBindingsParser();
- static final String CATEGORY_ACTIVITY = "activity";
- static final String CATEGORY_EVENT_LISTENER = "eventlistener";
+ public static final String CATEGORY_ACTIVITY = "activity";
+ public static final String CATEGORY_EVENT_LISTENER = "eventlistener";
+
public JpdlParser() {
initialize();
parseBindings();
- List<String> schemaResources = new ArrayList<String>();
- schemaResources.add("jpdl-4.0.xsd");
- setSchemaResources(schemaResources);
+ setSchemaResources(SCHEMA_RESOURCES);
}
protected void parseBindings() {
- Bindings bindings = new Bindings();
- setBindings(bindings);
+ this.bindings = new Bindings();
- for (String activityResource: DEFAULT_ACTIVITIES_RESOURCES) {
+ for (String activityResource: DEFAULT_BINDING_RESOURCES) {
Enumeration<URL> resourceUrls = getResources(activityResource);
if (resourceUrls.hasMoreElements()) {
while (resourceUrls.hasMoreElements()) {
URL resourceUrl = resourceUrls.nextElement();
- log.trace("loading jpdl activities from resource: "+resourceUrl);
- List<JpdlBinding> activityBindings = (List<JpdlBinding>) jpdlBindingsParser.createParse()
+ log.trace("loading jpdl bindings from resource: "+resourceUrl);
+ jpdlBindingsParser.createParse()
.setUrl(resourceUrl)
+ .contextMapPut(Parse.CONTEXT_KEY_BINDINGS, bindings)
.execute()
- .checkErrors("jpdl activities from "+resourceUrl.toString())
- .getDocumentObject();
-
- for (JpdlBinding binding: activityBindings) {
- binding.setCategory(CATEGORY_ACTIVITY);
- bindings.addBinding(binding);
- }
+ .checkErrors("jpdl bindings from "+resourceUrl.toString());
}
} else {
log.trace("skipping unavailable jpdl activities resource: "+activityResource);
}
}
-
- for (String eventListenerResource: DEFAULT_EVENTLISTENERS_RESOURCES) {
- Enumeration<URL> resourceUrls = getResources(eventListenerResource);
- if (resourceUrls.hasMoreElements()) {
- while (resourceUrls.hasMoreElements()) {
- URL resourceUrl = resourceUrls.nextElement();
- log.trace("loading jpdl eventlisteners from resource: "+resourceUrl);
- List<JpdlBinding> activityBindings = (List<JpdlBinding>) jpdlBindingsParser.createParse()
- .setUrl(resourceUrl)
- .execute()
- .checkErrors("jpdl eventlisteners from "+resourceUrl.toString())
- .getDocumentObject();
-
- for (JpdlBinding binding: activityBindings) {
- binding.setCategory(CATEGORY_EVENT_LISTENER);
- bindings.addBinding(binding);
- }
- }
- } else {
- log.trace("skipping unavailable jpdl eventlistener resource: "+eventListenerResource);
- }
- }
}
protected Enumeration<URL> getResources(String resourceName) {
@@ -198,15 +170,17 @@
if (deployment!=null) {
String processLanguageId = deployment.getProcessLanguageId(name);
if (processLanguageId==null) {
- String namespaceUri = documentElement.getNamespaceURI();
- if (namespaceUri!=null) {
- processLanguageId = "jpdl-"+namespaceUri.substring(16, 19);
+ String jpdlParser = XmlUtil.attribute(documentElement, "jpdlparser");
+ if (jpdlParser!=null) {
+ processLanguageId = "jpdl-"+jpdlParser;
+
} else {
// specify the jpdltestversion with "mvn -Djpdltestversion=jpdl-4.3 clean install"
// that way, the whole test suite will be use the specified parser
- String jpdlTest = System.getProperty("jpdlparser");
- if (jpdlTest!=null) {
- processLanguageId = "jpdl-"+jpdlTest;
+ jpdlParser = System.getProperty("jpdlparser");
+ if (jpdlParser!=null) {
+ processLanguageId = "jpdl-"+jpdlParser;
+
} else {
processLanguageId = CURRENT_VERSION_PROCESS_LANGUAGE_ID;
}
Deleted: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2009-10-05 11:28:57 UTC (rev 5691)
@@ -1,19 +0,0 @@
-<activities>
- <activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ForkBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.JoinBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.TaskBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.SubProcessBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.MailBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.GroupBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.CustomBinding" />
-</activities>
Copied: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml (from rev 5688, jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml 2009-10-05 11:28:57 UTC (rev 5691)
@@ -0,0 +1,28 @@
+<bindings>
+
+ <activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.ForkBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.JoinBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.TaskBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.SubProcessBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.MailBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.GroupBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.CustomBinding" />
+
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.MailBinding" />
+
+</bindings>
Property changes on: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.eventlisteners.xml 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.eventlisteners.xml 2009-10-05 11:28:57 UTC (rev 5691)
@@ -1,8 +0,0 @@
-<eventlisteners>
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.MailBinding" />
-</eventlisteners>
Deleted: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2009-10-05 11:28:57 UTC (rev 5691)
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping default-access="field">
-
- <subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
- extends="org.jbpm.pvm.internal.model.ExecutionImpl"
- discriminator-value="jpdl">
-
- <map name="swimlanes"
- cascade="all-delete-orphan">
- <key foreign-key="FK_SWIMLANE_EXEC">
- <column name="EXECUTION_" index="IDX_SWIMLANE_EXEC"/>
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.task.SwimlaneImpl" />
- </map>
- </subclass>
-
-</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-10-05 09:25:12 UTC (rev 5690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-10-05 11:28:57 UTC (rev 5691)
@@ -54,6 +54,7 @@
public static final String CONTEXT_KEY_DEPLOYMENT = "deployment";
public static final String CONTEXT_KEY_PROCESS_LANGUAGE_ID = "proclangid";
+ public static final String CONTEXT_KEY_BINDINGS = "bindings";
protected Parser parser;
16 years, 7 months
JBoss JBPM SVN: r5690 - jbpm3/tags.
by do-not-reply@jboss.org
Author: jcoleman(a)redhat.com
Date: 2009-10-05 05:25:12 -0400 (Mon, 05 Oct 2009)
New Revision: 5690
Added:
jbpm3/tags/jbpm-3.2.8.CR1/
Log:
Create 3.2.8 CR1 tag from 3.2-soa branch
Copied: jbpm3/tags/jbpm-3.2.8.CR1 (from rev 5689, jbpm3/branches/jbpm-3.2-soa)
16 years, 7 months
JBoss JBPM SVN: r5689 - in jbpm4/trunk: qa and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-05 04:45:40 -0400 (Mon, 05 Oct 2009)
New Revision: 5689
Added:
jbpm4/trunk/qa/hudson-jbpm4-parsers.sh
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
Log:
JBPM-2565 created hudson job jbpm4-parsers
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-05 08:10:23 UTC (rev 5688)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-05 08:45:40 UTC (rev 5689)
@@ -204,10 +204,9 @@
} else {
// specify the jpdltestversion with "mvn -Djpdltestversion=jpdl-4.3 clean install"
// that way, the whole test suite will be use the specified parser
- String jpdlTest = System.getProperty("jpdltestversion");
+ String jpdlTest = System.getProperty("jpdlparser");
if (jpdlTest!=null) {
- processLanguageId = jpdlTest;
- throw new RuntimeException("USING TEST LANGUAGE VERSION "+processLanguageId);
+ processLanguageId = "jpdl-"+jpdlTest;
} else {
processLanguageId = CURRENT_VERSION_PROCESS_LANGUAGE_ID;
}
Added: jbpm4/trunk/qa/hudson-jbpm4-parsers.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-parsers.sh (rev 0)
+++ jbpm4/trunk/qa/hudson-jbpm4-parsers.sh 2009-10-05 08:45:40 UTC (rev 5689)
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# runs the jpdl parser backwards compatibility tests
+
+mvn -U -Djpdlparser=$JPDL_VERSION clean install
16 years, 7 months
JBoss JBPM SVN: r5688 - jbpm4/branches/tbaeyens.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-05 04:10:23 -0400 (Mon, 05 Oct 2009)
New Revision: 5688
Modified:
jbpm4/branches/tbaeyens/.project
Log:
changed eclipse project name to jbpm4-tbaeyens
Modified: jbpm4/branches/tbaeyens/.project
===================================================================
--- jbpm4/branches/tbaeyens/.project 2009-10-05 06:04:54 UTC (rev 5687)
+++ jbpm4/branches/tbaeyens/.project 2009-10-05 08:10:23 UTC (rev 5688)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm4</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm4-tbaeyens</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
16 years, 7 months
JBoss JBPM SVN: r5687 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-05 02:04:54 -0400 (Mon, 05 Oct 2009)
New Revision: 5687
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskTimerExecutionDbTest.java
Log:
[JBPM-2563] Prevent test suite from continuously recreating database schema
increase timeout in TaskTimerExecutionDbTest
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskTimerExecutionDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskTimerExecutionDbTest.java 2009-10-05 05:49:47 UTC (rev 5686)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/taskmgmt/exe/TaskTimerExecutionDbTest.java 2009-10-05 06:04:54 UTC (rev 5687)
@@ -136,7 +136,7 @@
processInstance.signal();
jbpmContext.save(processInstance);
- processJobs(5000);
+ processJobs(60 * 1000);
processInstance = jbpmContext.loadProcessInstance(processInstance.getId());
assertEquals(new Integer(1), processInstance.getContextInstance()
@@ -166,7 +166,7 @@
processInstance.signal();
jbpmContext.save(processInstance);
- processJobs(5000);
+ processJobs(60 * 1000);
processInstance = jbpmContext.loadProcessInstance(processInstance.getId());
assertEquals(new Integer(1), processInstance.getContextInstance()
16 years, 7 months
JBoss JBPM SVN: r5686 - in jbpm3/branches/jbpm-3.2-soa/modules: core/src/test/java/org/jbpm/graph/node and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-05 01:49:47 -0400 (Mon, 05 Oct 2009)
New Revision: 5686
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/taskinstance/CustomTaskInstanceTest.java
jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/websale/WebsaleTest.java
Log:
[JBPM-2563] Prevent test suite from continuously recreating database schema -
pay a visit to examples module
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-10-05 05:02:22 UTC (rev 5685)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-10-05 05:49:47 UTC (rev 5686)
@@ -42,8 +42,10 @@
try {
DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext
.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+
Configuration configuration = persistenceServiceFactory.getConfiguration();
configuration.addClass(CustomLongClass.class);
+
JbpmSchema jbpmSchema = new JbpmSchema(configuration);
jbpmSchema.updateSchema();
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-10-05 05:02:22 UTC (rev 5685)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-10-05 05:49:47 UTC (rev 5686)
@@ -42,8 +42,10 @@
try {
DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext
.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+
Configuration configuration = persistenceServiceFactory.getConfiguration();
configuration.addClass(CustomStringClass.class);
+
JbpmSchema jbpmSchema = new JbpmSchema(configuration);
jbpmSchema.updateSchema();
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-10-05 05:02:22 UTC (rev 5685)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-10-05 05:49:47 UTC (rev 5686)
@@ -56,9 +56,12 @@
URL cfgResource = getClass().getClassLoader().getResource("hibernate.cfg.xml");
try {
InputStream cfgSource = cfgResource.openStream();
- OutputStream cfgSink = new FileOutputStream(new File(URI.create(cfgResource.toString())
+ OutputStream cfgSink = new FileOutputStream(new File(URI
+ .create(cfgResource.toString())
.resolve("hibernate.join.cfg.xml")));
+
sed("Join\\.hbm\\.xml", "Join.lock.hbm.xml", cfgSource, cfgSink);
+
cfgSource.close();
cfgSink.close();
}
@@ -71,7 +74,9 @@
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+
JbpmSchema jbpmSchema = new JbpmSchema(persistenceServiceFactory.getConfiguration());
jbpmSchema.updateSchema();
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/taskinstance/CustomTaskInstanceTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/taskinstance/CustomTaskInstanceTest.java 2009-10-05 05:02:22 UTC (rev 5685)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/taskinstance/CustomTaskInstanceTest.java 2009-10-05 05:49:47 UTC (rev 5686)
@@ -29,6 +29,7 @@
import org.jbpm.JbpmConfiguration;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.db.JbpmSchema;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.persistence.db.DbPersistenceServiceFactory;
@@ -58,20 +59,21 @@
// the jbpm.cfg.xml file is modified to add the CustomTaskInstanceFactory
// so we will read in the file from the config directory of this example
jbpmConfiguration = JbpmConfiguration.parseResource("taskinstance/jbpm.cfg.xml");
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmConfiguration
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
Configuration configuration = factory.getConfiguration();
configuration.addResource("taskinstance/CustomTaskInstance.hbm.xml");
- // TODO https://jira.jboss.org/jira/browse/JBPM-1812
- // JbpmSchema jbpmSchema = new JbpmSchema(configuration);
- // jbpmSchema.updateTable("JBPM_TASKINSTANCE");
+ JbpmSchema jbpmSchema = new JbpmSchema(configuration);
+ jbpmSchema.updateSchema();
}
return jbpmConfiguration;
}
void deployProcess() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("taskinstance/processdefinition.xml");
+ ProcessDefinition processDefinition = ProcessDefinition
+ .parseXmlResource("taskinstance/processdefinition.xml");
jbpmContext.deployProcessDefinition(processDefinition);
processDefinitionId = processDefinition.getId();
}
@@ -102,7 +104,8 @@
long createNewProcessInstance() {
String processDefinitionName = "CustomTaskInstance";
- ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate(processDefinitionName);
+ ProcessInstance processInstance = jbpmContext
+ .newProcessInstanceForUpdate(processDefinitionName);
ContextInstance contextInstance = processInstance.getContextInstance();
contextInstance.setVariable("processDefinitionName", processDefinitionName);
@@ -127,13 +130,15 @@
}
void completeTask(long taskInstanceId) {
- CustomTaskInstance taskInstance = (CustomTaskInstance) jbpmContext.getSession()
+ CustomTaskInstance taskInstance = (CustomTaskInstance) jbpmContext
+ .getSession()
.load(CustomTaskInstance.class, new Long(taskInstanceId));
taskInstance.end();
}
List findPooledTaskListByCustomId(String actorId, String customId) {
- return jbpmContext.getSession()
+ return jbpmContext
+ .getSession()
.createCriteria(CustomTaskInstance.class)
.add(Restrictions.isNull("actorId"))
.add(Restrictions.isNull("end"))
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/websale/WebsaleTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/websale/WebsaleTest.java 2009-10-05 05:02:22 UTC (rev 5685)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/websale/WebsaleTest.java 2009-10-05 05:49:47 UTC (rev 5686)
@@ -42,6 +42,7 @@
}
protected void tearDown() throws Exception {
+ newTransaction();
graphSession.deleteProcessDefinition(processDefinitionId);
super.tearDown();
}
@@ -65,8 +66,6 @@
TaskInstance taskInstance = createNewProcessInstance();
assertEquals("Create new web sale order", taskInstance.getName());
assertEquals(0, taskInstance.getVariables().size());
-
- newTransaction();
}
public void testPerformWebSaleOrderTask() {
16 years, 7 months
JBoss JBPM SVN: r5685 - in jbpm3/branches/jbpm-3.2-soa: modules/core and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-05 01:02:22 -0400 (Mon, 05 Oct 2009)
New Revision: 5685
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/userguide/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/master.xml
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
[JBPM-2564] Dependencies are not synced between jbpm-jpdl and jboss-as -
bump jbpm version to 3.2.8 -
downgrade hibernate to 3.2.4.sp1
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/identity/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/master.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/master.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -21,7 +21,7 @@
<!ENTITY security SYSTEM "modules/security.xml">
<!ENTITY tdd SYSTEM "modules/tdd.xml">
<!ENTITY pluggable SYSTEM "modules/pluggable.xml">
-<!ENTITY version "3.2.7">
+<!ENTITY version "3.2.8">
]>
<book lang="en">
<bookinfo>
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-04 23:19:29 UTC (rev 5684)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-05 05:02:22 UTC (rev 5685)
@@ -18,7 +18,7 @@
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>3.2.7</version>
+ <version>3.2.8</version>
<!-- Parent -->
<parent>
@@ -54,7 +54,7 @@
<dom4j.version>1.6.1</dom4j.version>
<drools.version>4.0.7</drools.version>
<dumbster.version>1.6</dumbster.version>
- <hibernate.version>3.2.6.ga</hibernate.version>
+ <hibernate.version>3.2.4.sp1</hibernate.version>
<izpack.version>1.0-alpha-5</izpack.version>
<jackrabbit.version>1.4.5</jackrabbit.version>
<jasper.reports.version>3.0.0</jasper.reports.version>
16 years, 7 months
JBoss JBPM SVN: r5684 - jbpm3/branches/jbpm-3.2-soa/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-04 19:19:29 -0400 (Sun, 04 Oct 2009)
New Revision: 5684
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
Log:
switch to mysql 5.0 server in qa lab
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-10-04 22:16:32 UTC (rev 5683)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-10-04 23:19:29 UTC (rev 5684)
@@ -25,7 +25,7 @@
<jdbc.mssql.username>jbpm</jdbc.mssql.username>
<jdbc.mssql.password>jbpm</jdbc.mssql.password>
- <jdbc.mysql.server>vmg02.mw.lab.eng.bos.redhat.com</jdbc.mysql.server>
+ <jdbc.mysql.server>vmg08.mw.lab.eng.bos.redhat.com</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
<jdbc.mysql.database>jbpm3</jdbc.mysql.database>
<jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
16 years, 7 months
JBoss JBPM SVN: r5683 - in jbpm3/branches/jbpm-3.2-soa/modules: core/src/main/java/org/jbpm/configuration and 13 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-04 18:16:32 -0400 (Sun, 04 Oct 2009)
New Revision: 5683
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/HibernateHelper.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.hsqldb.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.db2.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1071/JBPM1071Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
Log:
[JBPM-2563] Prevent test suite from continously recreating database schema
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -32,8 +32,8 @@
import org.jbpm.JbpmConfiguration;
/**
- * is used by {@link org.jbpm.bytes.ByteArray} to chop a
- * byte arrays into a list of chunks and glue them back together.
+ * is used by {@link org.jbpm.bytes.ByteArray} to chop a byte arrays into a list of chunks and
+ * glue them back together.
*/
public class ByteBlockChopper {
@@ -49,7 +49,7 @@
int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
int byteCount = byteArray.length;
if (byteCount > blockSize) {
- log.debug("chopping " + byteCount + " bytes");
+ if (log.isTraceEnabled()) log.trace("chopping up " + byteCount + " bytes");
bytes = new ArrayList();
int offset;
for (offset = 0; byteCount - offset > blockSize; offset += blockSize) {
@@ -58,7 +58,7 @@
bytes.add(subArray(byteArray, offset, byteCount - offset));
}
else if (byteCount > 0) {
- log.debug("no need to chop " + byteCount + " bytes");
+ if (log.isTraceEnabled()) log.trace("no need to chop " + byteCount + " bytes");
bytes = Collections.singletonList(byteArray);
}
}
@@ -68,13 +68,13 @@
private static byte[] subArray(byte[] array, int offset, int length) {
byte[] subArray = new byte[length];
System.arraycopy(array, offset, subArray, 0, length);
- log.debug("chopped " + length + " bytes beggining at " + offset);
+ if (log.isTraceEnabled()) log.trace("chopped " + length + " bytes at offset " + offset);
return subArray;
}
public static byte[] glueChopsBackTogether(List byteBlocks) {
byte[] byteArray = null;
-
+
if (byteBlocks != null) {
int blockCount = byteBlocks.size();
switch (blockCount) {
@@ -82,13 +82,13 @@
break;
case 1:
byteArray = (byte[]) byteBlocks.get(0);
- log.debug("no need to glue " + byteArray.length + " bytes");
+ if (log.isTraceEnabled()) log.trace("no need to glue " + byteArray.length + " bytes");
break;
default:
int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
byte[] lastBlock = (byte[]) byteBlocks.get(blockCount - 1);
int byteCount = blockSize * (blockCount - 1) + lastBlock.length;
- log.debug("gluing " + byteCount + " bytes");
+ if (log.isTraceEnabled()) log.trace("gluing " + byteCount + " bytes back together");
byteArray = new byte[byteCount];
int offset = 0;
@@ -96,16 +96,18 @@
byte[] block = (byte[]) byteBlocks.get(i);
int length = block.length;
System.arraycopy(block, 0, byteArray, offset, length);
- log.debug("glued " + length + " bytes beggining at " + offset);
+ if (log.isTraceEnabled())
+ log.trace("glued " + length + " bytes at offset " + offset);
+
// JBPM-702 sybase truncates trailing zeros
- if (length < blockSize && i < n-1) {
+ if (length < blockSize && i < n - 1) {
Arrays.fill(byteArray, offset + length, offset + blockSize, (byte) 0);
- log.debug("zero filled " + (blockSize - length) + " trailing bytes");
offset += blockSize;
+ if (log.isTraceEnabled())
+ log.trace("zero filled " + (blockSize - length) + " trailing bytes");
}
- else {
- offset += length;
- }
+ else
+ offset += length;
}
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -38,12 +38,12 @@
private static final long serialVersionUID = 1L;
- ClassLoader classLoader = null; // lazy load it later! See below..
- List objectInfos = null;
- Map namedObjectInfos = null;
- Map singletons = new HashMap();
- Map objects = new HashMap();
- Collection objectsUnderConstruction = new HashSet();
+ ClassLoader classLoader;
+ final List objectInfos;
+ final Map namedObjectInfos;
+ final Map singletons = new HashMap();
+ final Map objects = new HashMap();
+ final Collection objectsUnderConstruction = new HashSet();
public ObjectFactoryImpl() {
objectInfos = new ArrayList();
@@ -67,8 +67,8 @@
}
/**
- * create a new object of the given name. Before creation starts, the non-singlton objects will be
- * cleared from the registry. The singletons will remain in the registry.
+ * create a new object of the given name. Before creation starts, the non-singlton objects
+ * will be cleared from the registry. The singletons will remain in the registry.
*/
public synchronized Object createObject(String name) {
ObjectInfo objectInfo = (ObjectInfo) namedObjectInfos.get(name);
@@ -86,11 +86,11 @@
}
/**
- * create a new object for the given index. Before creation starts, the non-singlton objects will
- * be cleared from the registry. The singletons will remain in the registry.
+ * create a new object for the given index. Before creation starts, the non-singlton objects
+ * will be cleared from the registry. The singletons will remain in the registry.
*/
public Object createObject(int index) {
- if ((index < 0) || (index >= objectInfos.size())) {
+ if (index < 0 || index >= objectInfos.size()) {
throw new ConfigurationException("index '"
+ index
+ "' is not defined in the configuration. range [0.."
@@ -101,8 +101,9 @@
}
/**
- * create a new object for the given {@link ObjectInfo}. Before creation starts, the non-singlton
- * objects will be cleared from the registry. The singletons will remain in the registry.
+ * create a new object for the given {@link ObjectInfo}. Before creation starts, the
+ * non-singlton objects will be cleared from the registry. The singletons will remain in the
+ * registry.
*/
public Object createObject(ObjectInfo objectInfo) {
clearRegistry();
@@ -115,8 +116,8 @@
}
/**
- * create an object of the given name. If the object was created before, that object is returned
- * from the registry.
+ * create an object of the given name. If the object was created before, that object is
+ * returned from the registry.
*/
Object getObject(String name) {
Object object = null;
@@ -143,7 +144,6 @@
Object registryKey = getRegistryKey(objectInfo);
if (isInRegistry(registryKey)) {
object = findInRegistry(registryKey);
-
}
else {
if (registryKey != null) {
@@ -157,9 +157,7 @@
finally {
objectsUnderConstruction.remove(registryKey);
}
-
putInRegistry(objectInfo, object, registryKey);
-
}
else {
object = objectInfo.createObject(this);
@@ -169,9 +167,6 @@
}
Class classForName(String className) {
- // "lazy load" classloader, shouldn't be loaded too early
- // because if jbpm.cfg.xml is not yet parsed, the correct class loader
- // may not be initialized yet.
if (classLoader == null) {
classLoader = ClassLoaderUtil.getClassLoader();
}
@@ -192,7 +187,8 @@
}
boolean isInRegistry(Object registryKey) {
- return ((registryKey != null) && ((objects.containsKey(registryKey)) || (singletons.containsKey(registryKey))));
+ return registryKey != null
+ && (objects.containsKey(registryKey) || singletons.containsKey(registryKey));
}
void putInRegistry(ObjectInfo objectInfo, Object object, Object registryKey) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -66,7 +66,8 @@
private String delimiter;
private final List exceptions = new ArrayList();
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
+ private static final String[] EMPTY_STRING_ARRAY = {};
+ private static final String[] TABLE_TYPES = { "TABLE" };
public JbpmSchema(Configuration configuration) {
this.configuration = configuration;
@@ -121,7 +122,8 @@
Connection connection = null;
try {
connection = createConnection();
- return configuration.generateSchemaUpdateScript(getDialect(), getDatabaseMetadata(connection));
+ return configuration.generateSchemaUpdateScript(getDialect(),
+ getDatabaseMetadata(connection));
}
catch (SQLException e) {
exceptions.add(e);
@@ -306,7 +308,7 @@
DatabaseMetaData metaData = connection.getMetaData();
boolean storesLowerCaseIdentifiers = metaData.storesLowerCaseIdentifiers();
ResultSet resultSet = metaData.getTables(getDefaultCatalog(), getDefaultSchema(), null,
- new String[] { "TABLE" });
+ TABLE_TYPES);
try {
while (resultSet.next()) {
String tableName = resultSet.getString("TABLE_NAME");
@@ -335,8 +337,16 @@
Connection connection = null;
try {
connection = createConnection();
- Table table = findTableMapping(tableName);
- return getTableMetadata(connection, table) != null;
+
+ DatabaseMetaData metaData = connection.getMetaData();
+ ResultSet resultSet = metaData.getTables(getDefaultCatalog(), getDefaultSchema(),
+ tableName, TABLE_TYPES);
+ try {
+ return resultSet.next();
+ }
+ finally {
+ resultSet.close();
+ }
}
catch (SQLException e) {
exceptions.add(e);
@@ -390,7 +400,8 @@
return new DatabaseMetadata(connection, getDialect());
}
- private TableMetadata getTableMetadata(Connection connection, Table table) throws SQLException {
+ private TableMetadata getTableMetadata(Connection connection, Table table)
+ throws SQLException {
String tableSchema = table.getSchema();
String tableCatalog = table.getCatalog();
return getDatabaseMetadata(connection).getTableMetadata(table.getName(),
@@ -424,6 +435,9 @@
else if ("clean".equalsIgnoreCase(action)) {
getJbpmSchema(args, 1).cleanSchema();
}
+ else if ("update".equalsIgnoreCase(action)) {
+ getJbpmSchema(args, 1).updateSchema();
+ }
else if ("scripts".equalsIgnoreCase(action) && args.length > 2) {
getJbpmSchema(args, 3).saveSqlScripts(args[1], args[2]);
}
@@ -439,6 +453,7 @@
System.err.println("JbpmSchema create [<hibernate.cfg.xml> [<hibernate.properties>]]");
System.err.println("JbpmSchema drop [<hibernate.cfg.xml> [<hibernate.properties>]]");
System.err.println("JbpmSchema clean [<hibernate.cfg.xml> [<hibernate.properties>]]");
+ System.err.println("JbpmSchema update [<hibernate.cfg.xml> [<hibernate.properties>]]");
System.err.println("JbpmSchema scripts <dir> <prefix> [<hibernate.cfg.xml> [<hibernate.properties>]]");
System.exit(1);
}
@@ -455,9 +470,10 @@
if (index + 1 < args.length) {
String hibernateProperties = args[index + 1];
try {
- InputStream inputStream = new FileInputStream(hibernateProperties);
+ InputStream fileSource = new FileInputStream(hibernateProperties);
Properties properties = new Properties();
- properties.load(inputStream);
+ properties.load(fileSource);
+ fileSource.close();
configuration.addProperties(properties);
}
catch (IOException e) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/HibernateHelper.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/HibernateHelper.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/HibernateHelper.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -100,8 +100,8 @@
// load the properties
Properties properties = loadPropertiesFromResource(propertiesResource);
if (!properties.isEmpty()) {
- // and overwrite the properties with the specified properties
- configuration.setProperties(properties);
+ // add (and replace) the properties to the configuration
+ configuration.addProperties(properties);
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -94,7 +94,6 @@
public synchronized SessionFactory getSessionFactory() {
if (sessionFactory == null) {
-
if (sessionFactoryJndiName != null) {
log.debug("looking up hibernate session factory in jndi '" + sessionFactoryJndiName + "'");
sessionFactory = (SessionFactory) JndiUtil.lookup(sessionFactoryJndiName, SessionFactory.class);
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -91,8 +91,8 @@
* <li><code>jbpm</code> (default) indicates the class loader of the jBPM classes. Before <a
* href="https://jira.jboss.org/jira/browse/JBPM-1148">JBPM-1148</a> no other behavior was
* available</li>
- * <li><code>context</code> indicates the {@linkplain Thread#getContextClassLoader() context class
- * loader}</li>
+ * <li><code>context</code> indicates the {@linkplain Thread#getContextClassLoader() context
+ * class loader}</li>
* <li>any other value is interpreted as a reference to a class loader bean described in the
* configuration</li>
* </ul>
@@ -129,20 +129,17 @@
}
/**
- * Load jbpm configuration related resources as stream (normally jbpm.cfg.xml). This method first
- * tries to load the resource from the {@link ClassLoaderUtil} class loader, if not found it tries
- * the context class loader. If this doesn't return any ressource the call is delegated to the
- * class loader configured by calling getClassLoader(). This is a special method because the class
- * loader which has to be used for loading the jbpm.cfg.xml cannot be configured in the
- * jbpm.cfg.xml itself.
+ * Load classpath resource as stream. This method first loads the resource from the context
+ * class loader, if not found it tries the current class loader. If no resource is found the
+ * call returns <code>null</code>. This is a special method because the class loader used for
+ * loading the jBPM configuration cannot be configured in the configuration file itself.
*/
public static InputStream getStream(String resource, boolean useConfiguredLoader) {
if (useConfiguredLoader) return getStream(resource);
// try context class loader first, so that applications can override provided classes
- InputStream stream = Thread.currentThread()
- .getContextClassLoader()
- .getResourceAsStream(resource);
+ InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
+ resource);
if (stream == null) {
// try the class loader of the current class
stream = ClassLoaderUtil.class.getClassLoader().getResourceAsStream(resource);
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -16,16 +16,13 @@
<!-- # common settings # -->
<!-- ################################### -->
- <!-- Automatic schema creation (begin) -->
- <property name="hibernate.hbm2ddl.auto">create</property>
- <!-- Automatic schema creation (end) -->
-
<!-- Simple memory-only cache -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <!-- SQL rendering properties -->
+ <!-- SQL rendering properties (begin) ===
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
+ ==== SQL rendering properties (end) -->
<!-- ############################################ -->
<!-- # mapping files with external dependencies # -->
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.hsqldb.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.hsqldb.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.hsqldb.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -9,3 +9,6 @@
<property name="hibernate.connection.password"></property>
<!-- JDBC connection properties (end) -->
+ <!-- Automatic schema creation (begin) -->
+ <property name="hibernate.hbm2ddl.auto">create</property>
+ <!-- Automatic schema creation (end) -->
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.db2.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.db2.hbm.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.db2.hbm.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -10,7 +10,6 @@
abstract="true"
discriminator-value="V">
<id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
<!-- V : org.jbpm.context.exe.VariableInstance -->
<!-- B : org.jbpm.context.exe.variableinstance.ByteArrayInstance -->
<!-- D : org.jbpm.context.exe.variableinstance.DateInstance -->
@@ -21,6 +20,7 @@
<!-- S : org.jbpm.context.exe.variableinstance.StringInstance -->
<!-- N : org.jbpm.context.exe.variableinstance.NullInstance -->
<!-- J : org.jbpm.context.exe.variableinstance.JcrNodeInstance -->
+ <discriminator type="char" column="CLASS_"/>
<version name="version" column="VERSION_" />
<property name="name" column="NAME_"/>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/exe/VariableInstance.hbm.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -10,7 +10,6 @@
abstract="true"
discriminator-value="V">
<id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
<!-- V : org.jbpm.context.exe.VariableInstance -->
<!-- B : org.jbpm.context.exe.variableinstance.ByteArrayInstance -->
<!-- D : org.jbpm.context.exe.variableinstance.DateInstance -->
@@ -21,6 +20,7 @@
<!-- S : org.jbpm.context.exe.variableinstance.StringInstance -->
<!-- N : org.jbpm.context.exe.variableinstance.NullInstance -->
<!-- J : org.jbpm.context.exe.variableinstance.JcrNodeInstance -->
+ <discriminator type="char" column="CLASS_"/>
<version name="version" column="VERSION_" />
<property name="name" column="NAME_"/>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/module/exe/ModuleInstance.hbm.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -11,14 +11,13 @@
abstract="true"
discriminator-value="M">
<id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
- <version name="version" column="VERSION_" />
-
<!-- M : org.jbpm.module.exe.ModuleInstance -->
<!-- C : org.jbpm.context.exe.ContextInstance -->
<!-- L : org.jbpm.logging.exe.LoggingInstance -->
<!-- I : org.jbpm.scheduler.exe.SchedulerInstance -->
<!-- T : org.jbpm.taskmgmt.def.TaskMgmtDefinition -->
+ <discriminator type="char" column="CLASS_"/>
+ <version name="version" column="VERSION_" />
<many-to-one name="processInstance"
column="PROCESSINSTANCE_"
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableLongIdDbTest.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -21,10 +21,13 @@
*/
package org.jbpm.context.exe;
+import org.hibernate.cfg.Configuration;
+
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.context.def.ContextDefinition;
import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.db.JbpmSchema;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.persistence.db.DbPersistenceServiceFactory;
@@ -37,9 +40,12 @@
jbpmConfiguration = JbpmConfiguration.parseResource(getJbpmTestConfig());
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServices()
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext
.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- persistenceServiceFactory.getConfiguration().addClass(CustomLongClass.class);
+ Configuration configuration = persistenceServiceFactory.getConfiguration();
+ configuration.addClass(CustomLongClass.class);
+ JbpmSchema jbpmSchema = new JbpmSchema(configuration);
+ jbpmSchema.updateSchema();
}
finally {
jbpmContext.close();
@@ -71,7 +77,8 @@
contextInstance = processInstance.getContextInstance();
// get the custom hibernatable object from the variables
- customLongObject = (CustomLongClass) contextInstance.getVariable("custom hibernate object");
+ customLongObject = (CustomLongClass) contextInstance
+ .getVariable("custom hibernate object");
assertNotNull(customLongObject);
assertEquals("customname", customLongObject.getName());
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/context/exe/CustomVariableStringIdDbTest.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -21,10 +21,13 @@
*/
package org.jbpm.context.exe;
+import org.hibernate.cfg.Configuration;
+
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.context.def.ContextDefinition;
import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.db.JbpmSchema;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.persistence.db.DbPersistenceServiceFactory;
@@ -37,9 +40,12 @@
jbpmConfiguration = JbpmConfiguration.parseResource(getJbpmTestConfig());
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServices()
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext
.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- persistenceServiceFactory.getConfiguration().addClass(CustomStringClass.class);
+ Configuration configuration = persistenceServiceFactory.getConfiguration();
+ configuration.addClass(CustomStringClass.class);
+ JbpmSchema jbpmSchema = new JbpmSchema(configuration);
+ jbpmSchema.updateSchema();
}
finally {
jbpmContext.close();
@@ -71,7 +77,8 @@
contextInstance = processInstance.getContextInstance();
// get the custom hibernatable object from the variables
- customStringObject = (CustomStringClass) contextInstance.getVariable("custom hibernate object");
+ customStringObject = (CustomStringClass) contextInstance
+ .getVariable("custom hibernate object");
assertNotNull(customStringObject);
assertEquals("customname", customStringObject.getName());
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -28,7 +28,6 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
-import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.URI;
import java.net.URL;
@@ -37,9 +36,13 @@
import org.hibernate.LockMode;
import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.db.JbpmSchema;
import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.persistence.db.DbPersistenceServiceFactory;
+import org.jbpm.svc.Services;
/**
* Verifies the join node can be persisted correctly.
@@ -52,10 +55,12 @@
if (jbpmConfiguration == null) {
URL cfgResource = getClass().getClassLoader().getResource("hibernate.cfg.xml");
try {
- OutputStream outStream = new FileOutputStream(new File(URI.create(cfgResource.toString())
+ InputStream cfgSource = cfgResource.openStream();
+ OutputStream cfgSink = new FileOutputStream(new File(URI.create(cfgResource.toString())
.resolve("hibernate.join.cfg.xml")));
- sed("Join\\.hbm\\.xml", "Join.lock.hbm.xml", cfgResource.openStream(), outStream);
- outStream.close();
+ sed("Join\\.hbm\\.xml", "Join.lock.hbm.xml", cfgSource, cfgSink);
+ cfgSource.close();
+ cfgSink.close();
}
catch (IOException e) {
throw new JbpmException("could not edit hibernate configuration", e);
@@ -63,6 +68,16 @@
jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ " <string name='resource.hibernate.cfg.xml' value='hibernate.join.cfg.xml' />"
+ "</jbpm-configuration>");
+
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try {
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ JbpmSchema jbpmSchema = new JbpmSchema(persistenceServiceFactory.getConfiguration());
+ jbpmSchema.updateSchema();
+ }
+ finally {
+ jbpmContext.close();
+ }
}
return jbpmConfiguration;
}
@@ -75,13 +90,12 @@
private static void sed(String regex, String replacement, InputStream inStream,
OutputStream outStream) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
- PrintWriter writer = new PrintWriter(new OutputStreamWriter(outStream));
+ PrintWriter writer = new PrintWriter(outStream);
Pattern pattern = Pattern.compile(regex);
for (String inLine; (inLine = reader.readLine()) != null;) {
String outLine = pattern.matcher(inLine).replaceAll(replacement);
writer.println(outLine);
}
- reader.close();
writer.flush();
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1071/JBPM1071Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1071/JBPM1071Test.java 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1071/JBPM1071Test.java 2009-10-04 22:16:32 UTC (rev 5683)
@@ -7,8 +7,10 @@
import org.jbpm.JbpmContext;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.def.Node.NodeType;
import org.jbpm.graph.exe.Comment;
import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
import org.jbpm.util.Semaphore;
/**
@@ -84,7 +86,7 @@
private List startThreads(Semaphore semaphore, long processInstanceId) {
List threads = new ArrayList();
for (int i = 0; i < nbrOfThreads; i++) {
- Thread thread = new LockThread(semaphore, processInstanceId);
+ Thread thread = new Thread(new Signaller(semaphore, processInstanceId));
threads.add(thread);
thread.start();
}
@@ -103,12 +105,12 @@
}
}
- class LockThread extends Thread {
+ class Signaller implements Runnable {
final Semaphore semaphore;
final long processInstanceId;
- public LockThread(Semaphore semaphore, long processInstanceId) {
+ Signaller(Semaphore semaphore, long processInstanceId) {
this.semaphore = semaphore;
this.processInstanceId = processInstanceId;
}
@@ -125,26 +127,37 @@
// after a thread is released (=notified), it will try to load the process instance,
// signal it and then commit the transaction
- JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext();
+ String threadName = Thread.currentThread().getName();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
+ Token rootToken = processInstance.getRootToken();
+
+ // check whether root token is still in start state
+ if (rootToken.getNode().getNodeType() != NodeType.StartState) {
+ jbpmContext.setRollbackOnly();
+ return;
+ }
+
+ // move to end state
processInstance.signal();
- jbpmContext.save(processInstance);
// add a comment to see which thread won
- Comment comment = new Comment(getName() + " committed");
- jbpmContext.getSession().save(comment);
+ Comment comment = new Comment(threadName + " committed");
+ rootToken.addComment(comment);
+
+ jbpmContext.save(processInstance);
}
catch (RuntimeException e) {
jbpmContext.setRollbackOnly();
- log.debug(getName() + " rolled back", e);
+ log.debug(threadName + " rolled back", e);
}
finally {
try {
jbpmContext.close();
}
catch (RuntimeException e) {
- log.debug(getName() + " failed to close its jbpm context", e);
+ log.debug(threadName + " failed to close jbpm context", e);
}
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -36,11 +36,11 @@
<priority value="INFO" />
</category>
+ <!--
<category name="org.hibernate.SQL">
<priority value="DEBUG" />
</category>
- <!--
<category name="org.hibernate.type">
<priority value="TRACE" />
</category>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -107,6 +107,8 @@
<artifactId>jbpm-jpdl-designer-site</artifactId>
<type>zip</type>
</dependency>
+
+ <!-- Sources -->
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-enterprise</artifactId>
@@ -125,6 +127,8 @@
<classifier>sources</classifier>
<version>${project.version}</version>
</dependency>
+
+ <!-- Javadoc -->
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-enterprise</artifactId>
@@ -143,10 +147,14 @@
<classifier>javadoc</classifier>
<version>${project.version}</version>
</dependency>
+
+ <!-- Thirdparty Dependencies -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
+
+ <!-- Database Drivers -->
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
@@ -159,14 +167,6 @@
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
-
- <!-- Sources -->
-
- <!-- Javadoc -->
-
- <!-- Thirdparty Dependencies -->
-
- <!-- Database Drivers -->
</dependencies>
<!-- Plugins -->
@@ -204,16 +204,15 @@
</goals>
<configuration>
<tasks>
- <property name="project.version" value="${project.version}" />
- <property name="project.build.dir" value="${project.build.directory}" />
- <property name="project.build.assembly.resources"
- value="${project.build.assemblyDirectory}/resources" />
- <property name="resources.dir" value="${resources.directory}" />
- <property name="resources.output.dir" value="${resources.outputDirectory}" />
- <property name="container" value="${container}" />
- <property name="jboss.home" value="${jboss.home}" />
- <property name="database" value="${database}" />
- <ant antfile="scripts/antrun-installer.xml" target="process-resources" />
+ <property name="project.version" value="${project.version}"/>
+ <property name="project.build.dir" value="${project.build.directory}"/>
+ <property name="project.build.assembly.resources" value="${project.build.assemblyDirectory}/resources"/>
+ <property name="resources.dir" value="${resources.directory}"/>
+ <property name="resources.output.dir" value="${resources.outputDirectory}"/>
+ <property name="container" value="${container}"/>
+ <property name="jboss.home" value="${jboss.home}"/>
+ <property name="database" value="${database}"/>
+ <ant antfile="scripts/antrun-installer.xml" target="process-resources"/>
</tasks>
</configuration>
</execution>
@@ -252,6 +251,7 @@
<type>war</type>
</dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
@@ -266,10 +266,11 @@
<configuration>
<tasks>
<!-- replace jsf-console.war with the SOA platform build -->
- <property name="project.build.assembly.lib" value="${project.build.assemblyDirectory}/lib" />
+ <property name="project.build.assembly.lib" value="${project.build.assemblyDirectory}/lib"/>
<echo>**** Replacing jsf-console with SOA-P build ****</echo>
- <copy file="${project.build.assembly.lib}/jsf-console-soa.war" tofile="${project.build.assembly.lib}/jsf-console.war"
- overwrite="yes" />
+ <copy file="${project.build.assembly.lib}/jsf-console-soa.war"
+ tofile="${project.build.assembly.lib}/jsf-console.war"
+ overwrite="yes"/>
</tasks>
</configuration>
</execution>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml 2009-10-04 15:43:28 UTC (rev 5682)
+++ jbpm3/branches/jbpm-3.2-soa/modules/enterprise/pom.xml 2009-10-04 22:16:32 UTC (rev 5683)
@@ -232,7 +232,7 @@
<!--
Name: no-database
- Descr: Setup the default database
+ Description: Default database test exclusions
-->
<profile>
<id>no-database</id>
@@ -261,7 +261,7 @@
<!--
Name: hsqldb
- Descr: Hypersonic Database Setup
+ Description: HSQLDB test exclusions
-->
<profile>
<id>hsqldb</id>
16 years, 7 months