[jbpm-commits] JBoss JBPM SVN: r4685 - in jbpm4/trunk: modules/distro/scripts and 22 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Apr 30 13:46:29 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-04-30 13:46:29 -0400 (Thu, 30 Apr 2009)
New Revision: 4685

Added:
   jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/hsqldb.hibernate.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/mysql.hibernate.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/postgresql.hibernate.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/sybase.hibernate.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/hsqldb.properties
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/mysql.properties
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/oracle.properties
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/postgresql.properties
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc/sybase.properties
   jbpm4/trunk/modules/distro/src/main/files/examples/
   jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
   jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/
   jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
   jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/
   jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/jbpm.cfg.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
   jbpm4/trunk/qa/test.distribution.bat
Removed:
   jbpm4/trunk/modules/distro/src/main/files/db/jdbc.properties
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/DeployProcessTask.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
   jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
   jbpm4/trunk/modules/distro/src/main/files/db/build.xml
   jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
   jbpm4/trunk/modules/examples/pom.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/AntHelper.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
   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/Parser.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
   jbpm4/trunk/qa/build.xml
Log:
JBPM-2176, JBPM-2170 added ant task for business archive deployment and allowed for example data to be created

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -73,10 +73,12 @@
   }
 
   protected Configuration instantiate(String className) {
-    ClassLoader classLoader = getClassLoader();
     Configuration implementation;
     try {
-      Class<?> implementationClass = classLoader.loadClass(className);
+      Class<?> implementationClass = Thread
+            .currentThread()
+            .getContextClassLoader()
+            .loadClass(className);
       implementation = (Configuration) implementationClass.newInstance();
     } catch (Exception e) {
       throw new JbpmException("couldn't instantiate configuration of type "+className, e);

Modified: jbpm4/trunk/modules/distro/scripts/assembly-distro.xml
===================================================================
--- jbpm4/trunk/modules/distro/scripts/assembly-distro.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/distro/scripts/assembly-distro.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -5,7 +5,6 @@
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
 
   <id>jbpm.distribution</id>
-  <finalName>jbpm-${version}</finalName>
   <formats>
     <format>zip</format>
   </formats>
@@ -23,7 +22,6 @@
       <unpack>false</unpack>
     </dependencySet -->
     <dependencySet>
-      <outputDirectory>lib</outputDirectory>
       <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
       <!-- useStrictFiltering>true</useStrictFiltering -->
       <unpack>false</unpack>
@@ -39,18 +37,11 @@
         <exclude>org.jbpm.jbpm4:jbpm-examples:jar</exclude>
         <exclude>org.jbpm.jbpm4:jbpm-gpd:zip</exclude>
         <exclude>org.jbpm.jbpm4:jbpm-test-db:jar</exclude>
-        <exclude>org.jbpm.jbpm4:jbpm-jboss*:jar</exclude>
       </excludes>
+      <outputDirectory>lib</outputDirectory>
     </dependencySet>
     <dependencySet>
       <includes>
-        <include>org.jbpm.jbpm4:jbpm-jboss*:jar</include>
-      </includes>
-      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
-      <outputDirectory>jboss/lib</outputDirectory>
-    </dependencySet>
-    <dependencySet>
-      <includes>
         <include>org.jbpm.jbpm4:jbpm-gpd:zip</include>
       </includes>
       <outputFileNameMapping>jbpm-gpd-site.zip</outputFileNameMapping>

Modified: jbpm4/trunk/modules/distro/src/main/files/db/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/build.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/distro/src/main/files/db/build.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -2,9 +2,6 @@
 
 <project name="jbpm.db.install">
 	
-  <!-- JDBC CONFIGURATIONS -->
-  <property file="jdbc.properties" />
-
   <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
   <property file="${user.home}/.jbpm4/build.properties" />
 
@@ -15,14 +12,18 @@
   <property name="jbpm.distro.path" value="../modules/distro/target/jbpm-${jbpm.version}.zip" />
   <property name="jbpm.home" value="${workspace}/jbpm-${jbpm.version}" />
 
+	<!-- JDBC PROPERTIES -->
+  <property file="${jbpm.home}/jdbc/${database}.properties" />
+
+
   <!-- ### LOG PROPERTIES ################################################# -->
   <target name="log.properties">
+    <echo message="database....... ${database}" />
     <echo message="jdbc.driver.... ${jdbc.driver}" />
     <echo message="jdbc.url....... ${jdbc.url}" />
     <echo message="jdbc.username.. ${jdbc.username}" />
     <echo message="jdbc.password.. ${jdbc.password}" />
     <echo message="jbpm.home...... ${jbpm.home}" />
-    <echo message="database....... ${database}" />
 	</target>
 
   <!-- ### CREATE JBPM SCHEMA ############################################# -->
@@ -59,6 +60,23 @@
     </sql>
   </target>
 
+  <!-- ### LOAD EXAMPLE IDENTITIES ######################################## -->
+  <target name="load.example.identities">
+    <sql driver="${jdbc.driver}"
+         url="${jdbc.url}"
+         userid="${jdbc.username}"
+         password="${jdbc.password}"
+         onerror="continue">
+      <transaction src="${jbpm.home}/db/example.identities.sql"/>
+      <classpath>
+        <fileset dir="${jbpm.home}/lib">
+          <include name="*.jar"/>
+        </fileset>
+      </classpath>
+    </sql>
+  </target>
+
+
   <!-- ### START HSQLDB DATABASE MGR ##################################### -->
   <target name="hsqldb.databasemanager">
     <fail message="property 'workspace' not specified.  workspace is the directory in which jbpm and jboss will be installed.  specify -Dworkspace=... on the command line or add workspace=... in your ${user.home}/.jbpm4/build.properties" unless="workspace" />

Added: jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,17 @@
+INSERT INTO JBPM_ID_GROUP VALUES (1,0,'manager','manager','security-role',NULL);
+INSERT INTO JBPM_ID_GROUP VALUES (2,0,'administrator','administrator','security-role',NULL);
+INSERT INTO JBPM_ID_GROUP VALUES (3,0,'user','user','security-role',NULL);
+INSERT INTO JBPM_ID_GROUP VALUES(4,0,'sales','sales',NULL,NULL);
+
+INSERT INTO JBPM_ID_USER VALUES (1,0,'alex','password','Administrator Login','');
+INSERT INTO JBPM_ID_USER VALUES (2,0,'mike','password','Managers Login','');
+INSERT INTO JBPM_ID_USER VALUES (3,0,'peter','password','Users Login','');
+INSERT INTO JBPM_ID_USER VALUES (4,0,'mary','password','Users Login','');
+
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1,0,1,2,NULL);
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2,0,2,1,NULL);
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3,0,3,3,NULL);
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4,0,3,4,NULL);
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5,0,4,3,NULL);
+INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6,0,4,4,NULL);
+

Added: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/hsqldb.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/hsqldb.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/hsqldb.hibernate.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+	<session-factory>
+
+		<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+    <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+    <property name="hibernate.connection.url">@jdbc.url@</property>
+    <property name="hibernate.connection.username">@jdbc.username@</property>
+    <property name="hibernate.connection.password">@jdbc.password@</property>
+    <property name="hibernate.format_sql">true</property>
+
+		<mapping resource="jbpm.repository.hbm.xml" />
+		<mapping resource="jbpm.execution.hbm.xml" />
+		<mapping resource="jbpm.history.hbm.xml" />
+		<mapping resource="jbpm.task.hbm.xml" />
+		<mapping resource="jbpm.jpdl.hbm.xml" />
+		<mapping resource="jbpm.identity.hbm.xml" />
+
+	</session-factory>
+</hibernate-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/hsqldb.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/mysql.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/mysql.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/mysql.hibernate.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+	<session-factory>
+
+		<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+    <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+    <property name="hibernate.connection.url">@jdbc.url@</property>
+    <property name="hibernate.connection.username">@jdbc.username@</property>
+    <property name="hibernate.connection.password">@jdbc.password@</property>
+    <property name="hibernate.format_sql">true</property>
+
+		<mapping resource="jbpm.repository.hbm.xml" />
+		<mapping resource="jbpm.execution.hbm.xml" />
+		<mapping resource="jbpm.history.hbm.xml" />
+		<mapping resource="jbpm.task.hbm.xml" />
+		<mapping resource="jbpm.jpdl.hbm.xml" />
+		<mapping resource="jbpm.identity.hbm.xml" />
+
+	</session-factory>
+</hibernate-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/mysql.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+	<session-factory>
+
+		<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
+    <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+    <property name="hibernate.connection.url">@jdbc.url@</property>
+    <property name="hibernate.connection.username">@jdbc.username@</property>
+    <property name="hibernate.connection.password">@jdbc.password@</property>
+    <property name="hibernate.format_sql">true</property>
+
+		<mapping resource="jbpm.repository.hbm.xml" />
+		<mapping resource="jbpm.execution.hbm.xml" />
+		<mapping resource="jbpm.history.hbm.xml" />
+		<mapping resource="jbpm.task.hbm.xml" />
+		<mapping resource="jbpm.jpdl.hbm.xml" />
+		<mapping resource="jbpm.identity.hbm.xml" />
+
+	</session-factory>
+</hibernate-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/postgresql.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/postgresql.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/postgresql.hibernate.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+	<session-factory>
+
+		<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+    <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+    <property name="hibernate.connection.url">@jdbc.url@</property>
+    <property name="hibernate.connection.username">@jdbc.username@</property>
+    <property name="hibernate.connection.password">@jdbc.password@</property>
+    <property name="hibernate.format_sql">true</property>
+
+		<mapping resource="jbpm.repository.hbm.xml" />
+		<mapping resource="jbpm.execution.hbm.xml" />
+		<mapping resource="jbpm.history.hbm.xml" />
+		<mapping resource="jbpm.task.hbm.xml" />
+		<mapping resource="jbpm.jpdl.hbm.xml" />
+		<mapping resource="jbpm.identity.hbm.xml" />
+
+	</session-factory>
+</hibernate-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/postgresql.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/sybase.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/sybase.hibernate.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/sybase.hibernate.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+	<session-factory>
+
+		<property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
+    <property name="hibernate.connection.driver_class">@jdbc.driver@</property>
+    <property name="hibernate.connection.url">@jdbc.url@</property>
+    <property name="hibernate.connection.username">@jdbc.username@</property>
+    <property name="hibernate.connection.password">@jdbc.password@</property>
+    <property name="hibernate.format_sql">true</property>
+
+		<mapping resource="jbpm.repository.hbm.xml" />
+		<mapping resource="jbpm.execution.hbm.xml" />
+		<mapping resource="jbpm.history.hbm.xml" />
+		<mapping resource="jbpm.task.hbm.xml" />
+		<mapping resource="jbpm.jpdl.hbm.xml" />
+		<mapping resource="jbpm.identity.hbm.xml" />
+
+	</session-factory>
+</hibernate-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/sybase.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/hsqldb.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc/hsqldb.properties	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc/hsqldb.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,4 @@
+jdbc.driver=org.hsqldb.jdbcDriver
+jdbc.url=jdbc:hsqldb:hsql://localhost:1701
+jdbc.username=sa
+jdbc.password=


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/hsqldb.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/mysql.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc/mysql.properties	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc/mysql.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,4 @@
+jdbc.driver=com.mysql.jdbc.Driver
+jdbc.url=jdbc:mysql://localhost:3306/jbpmdb
+jdbc.username=jbpm
+jdbc.password=jbpm


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/mysql.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/oracle.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc/oracle.properties	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc/oracle.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,4 @@
+jdbc.driver=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@localhost:1521:jbpmdb
+jdbc.username=jbpm
+jdbc.password=jbpm


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/oracle.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/postgresql.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc/postgresql.properties	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc/postgresql.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,4 @@
+jdbc.driver=org.postgresql.Driver
+jdbc.url=jdbc:postgresql://localhost:5432/jbpmdb
+jdbc.username=jbpm
+jdbc.password=jbpm


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/postgresql.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/sybase.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc/sybase.properties	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc/sybase.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,5 @@
+jdbc.driver=net.sourceforge.jtds.jdbc.Driver
+# jdbc.driver=com.sybase.jdbc3.jdbc.SybDriver
+jdbc.url=jdbc:sybase:Tds:localhost:5000/jbpmdb
+jdbc.username=jbpm
+jdbc.password=jbpm


Property changes on: jbpm4/trunk/modules/distro/src/main/files/db/jdbc/sybase.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: jbpm4/trunk/modules/distro/src/main/files/db/jdbc.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/jdbc.properties	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/distro/src/main/files/db/jdbc.properties	2009-04-30 17:46:29 UTC (rev 4685)
@@ -1,4 +0,0 @@
-jdbc.driver=org.hsqldb.jdbcDriver
-jdbc.url=jdbc:hsqldb:hsql://localhost:1701
-jdbc.username=sa
-jdbc.password=

Added: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/examples/build.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/examples/build.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="jbpm.examples">
+  
+  <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
+  <property file="${user.home}/.jbpm4/build.properties" />
+
+  <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
+  <property file="${user.home}/.jbpm4/build.properties" />
+
+  <!-- DERIVED PROPERTIES -->
+  <property name="database" value="hsqldb" />
+  <property name="jbpm.version" value="4.0.0-SNAPSHOT" />
+  <property name="jbpm.filename" value="jbpm-distro-${jbpm.version}.zip" />
+  <property name="jbpm.distro.path" value="../modules/distro/target/jbpm-${jbpm.version}.zip" />
+  <property name="jbpm.home" value="${workspace}/jbpm-${jbpm.version}" />
+  <property name="jboss.version" value="5.0.0.GA" />
+  <property name="jboss.filename" value="jboss-${jboss.version}.zip" />
+  <property name="jboss.home" value="${workspace}/jboss-${jboss.version}" />
+  <property name="jboss.distro.path" value="${jboss.distro.dir}/${jboss.filename}" />
+  <property name="jboss.server.configuration" value="default" />
+  <property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
+
+  <!-- JDBC PROPERTIES -->
+  <property file="${jbpm.home}/jdbc/${database}.properties" />
+
+  <!-- ### LOG PROPERTIES ################################################# -->
+  <target name="log.properties">
+    <echo message="database: ${database}" />
+    <echo message="jdbc.driver: ${jdbc.driver}" />
+    <echo message="jdbc.url: ${jdbc.url}" />
+    <echo message="jdbc.username: ${jdbc.username}" />
+    <echo message="jbpm.version: ${jbpm.version}" />
+    <echo message="jbpm.filename: ${jbpm.filename}" />
+    <echo message="jbpm.distro.path: ${jbpm.distro.path}" />
+    <echo message="jbpm.home: ${jbpm.home}" />
+    <echo message="jboss.version: ${jboss.version}" />
+    <echo message="jboss.filename: ${jboss.filename}" />
+    <echo message="jboss.distro.path: ${jboss.distro.path}" />
+    <echo message="jboss.home: ${jboss.home}" />
+    <echo message="jboss.server.configuration: ${jboss.server.configuration}" />
+    <echo message="jboss.server.config.dir: ${jboss.server.config.dir}" />
+  </target>
+  
+  <!-- ### DEPLOY EXAMPLE BUSINESS ARCHIVES ############################### -->
+  <target name="deploy.examples" 
+          description="deploys all the example processes">
+    <path id="jbpm.libs.incl.dependencies">
+      <pathelement location="${jbpm.home}/examples/target/classes" />
+      <fileset dir="${jbpm.home}">
+        <include name="jbpm.jar" />
+      </fileset>
+      <fileset dir="${jbpm.home}/lib" />
+    </path>
+    <mkdir dir="${jbpm.home}/examples/target/classes" />
+    <javac srcdir="${jbpm.home}/examples/src"
+           destdir="${jbpm.home}/examples/target/classes"
+           classpathref="jbpm.libs.incl.dependencies" />
+    <copy todir="${jbpm.home}/examples/target/classes">
+      <fileset dir="src">
+        <exclude name="**/*.java" />
+      </fileset>
+    </copy>
+  	<copy tofile="${jbpm.home}/examples/target/classes/jbpm.hibernate.cfg.xml" overwrite="true">
+  		<filterset filtersfile="${jbpm.home}/db/jdbc/${database}.properties" />
+  		<fileset dir="${jbpm.home}/db/hibernate.cfg/${database}.hibernate.cfg.xml" />
+  	</copy>
+    <jar destfile="target/examples.bar">
+      <fileset dir="src">
+        <include name="**/*.jpdl.xml" />
+      </fileset>
+    </jar>
+    <taskdef name="jbpm-deploy"
+             classname="org.jbpm.pvm.internal.ant.JbpmDeployTask"
+           classpathref="jbpm.libs.incl.dependencies" />
+    <jbpm-deploy file="target/examples.bar" />
+  </target>
+
+</project>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -20,13 +20,15 @@
   <property name="jboss.distro.path" value="${jboss.distro.dir}/${jboss.filename}" />
   <property name="jboss.server.configuration" value="default" />
   <property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
+	
+  <!-- JDBC PROPERTIES -->
+  <property file="${jbpm.home}/jdbc/${database}.properties" />
 
+
+
   <!-- ### LOG PROPERTIES ################################################# -->
   <target name="log.properties">
     <echo message="database: ${database}" />
-    <echo message="jdbc.driver: ${jdbc.driver}" />
-    <echo message="jdbc.url: ${jdbc.url}" />
-    <echo message="jdbc.username: ${jdbc.username}" />
     <echo message="jbpm.version: ${jbpm.version}" />
     <echo message="jbpm.filename: ${jbpm.filename}" />
     <echo message="jbpm.distro.path: ${jbpm.distro.path}" />
@@ -137,7 +139,7 @@
     </copy>
 
     <copy todir="${jboss.server.config.dir}/deployers/jbpm.deployer" overwrite="true">
-      <fileset dir="${jbpm.home}/jboss/lib">
+      <fileset dir="${jbpm.home}/lib">
         <include name="jbpm-jboss5.jar"/>
       </fileset>
     </copy>

Added: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+  <import resource="jbpm.default.cfg.xml" />
+  <import resource="jbpm.tx.jta.cfg.xml" />
+  <import resource="jbpm.jpdl.cfg.xml" />
+  <import resource="jbpm.identity.cfg.xml" />
+
+  <process-engine-context>
+
+    <mail-template name="MemoTemplate">
+      <to addresses='dilbert at office, alice at work, dogbert at house' />
+      <subject>bureaucracy</subject>
+      <text>Order http://example.com/order/#{orderId} is stalled.</text>
+    </mail-template>
+
+  </process-engine-context>
+
+</jbpm-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/jbpm.cfg.xml	                        (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/jbpm.cfg.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+  <import resource="jbpm.jbossremote.cfg.xml" />
+
+</jbpm-configuration>


Property changes on: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.remote.client/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/examples/pom.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -64,12 +64,10 @@
     <dependency>
       <groupId>org.jbpm.jbpm4.dependencies.esb</groupId>
       <artifactId>test-util</artifactId>
-      <scope>test</scope>
     </dependency>
     <dependency>
     	<groupId>org.subethamail</groupId>
     	<artifactId>subethasmtp-wiser</artifactId>
-    	<scope>test</scope>
     </dependency>
   </dependencies>
 

Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="Task" xmlns="http://jbpm.org/4.0/jpdl">
-
-  <start g="20,20,48,48">
-    <transition to="review" />
-  </start>
-
-  <task name="review" g="96,16,127,52">
-    <assignment assignee="johndoe"/>    
-    <transition to="wait" />
-  </task>
-  
-  <state name="wait" g="255,16,88,52"/>
-
-</process>

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-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -31,6 +31,9 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 
+import javax.print.attribute.standard.Severity;
+
+import org.jbpm.api.Problem;
 import org.jbpm.api.activity.ActivityBehaviour;
 import org.jbpm.api.env.Environment;
 import org.jbpm.api.listener.EventListener;
@@ -44,6 +47,7 @@
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.model.ScopeElementImpl;
 import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
 import org.jbpm.pvm.internal.model.VariableOutDefinitionImpl;
 import org.jbpm.pvm.internal.model.VariableOutDefinitionSet;
@@ -59,6 +63,7 @@
 import org.jbpm.pvm.internal.xml.Bindings;
 import org.jbpm.pvm.internal.xml.Parse;
 import org.jbpm.pvm.internal.xml.Parser;
+import org.jbpm.pvm.internal.xml.ProblemImpl;
 import org.w3c.dom.Element;
 
 /**
@@ -105,7 +110,7 @@
           List<JpdlBinding> activityBindings = (List<JpdlBinding>) bindingsParser.createParse()
             .setUrl(resourceUrl)
             .execute()
-            .checkProblems("jpdl activities from "+resourceUrl.toString())
+            .checkErrors("jpdl activities from "+resourceUrl.toString())
             .getDocumentObject();
           
           for (JpdlBinding binding: activityBindings) {
@@ -128,7 +133,7 @@
           List<JpdlBinding> activityBindings = (List<JpdlBinding>) bindingsParser.createParse()
             .setUrl(resourceUrl)
             .execute()
-            .checkProblems("jpdl eventlisteners from "+resourceUrl.toString())
+            .checkErrors("jpdl eventlisteners from "+resourceUrl.toString())
             .getDocumentObject();
           
           for (JpdlBinding binding: activityBindings) {
@@ -218,33 +223,35 @@
 
   public void parseActivities(Element documentElement, Parse parse, JpdlProcessDefinition processDefinition) {
     List<Element> elements = XmlUtil.elements(documentElement);
-    for (Element element: elements) {
-    if ( !"on".equals(XmlUtil.getTagLocalName(element))
-         && !"timer".equals(XmlUtil.getTagLocalName(element))
-       ) {
+    for (Element element : elements) {
+      String tagName = XmlUtil.getTagLocalName(element);
+      if ( !"on".equals(tagName) 
+           && !"timer".equals(tagName)
+           && !"swimlane".equals(tagName)
+         ) {
         JpdlBinding activityBinding = (JpdlBinding) getBinding(element, "activity");
-        if (activityBinding!=null) {
+        if (activityBinding != null) {
           ActivityImpl activity = processDefinition.createActivity();
           parse.pushObject(activity);
           try {
             activity.setType(activityBinding.getTagName());
             activityBinding.parseName(element, activity, parse);
             activityBinding.parseTransitions(element, activity, parse, this);
-            
+
             if (XmlUtil.attributeBoolean(element, "async", false, parse, Boolean.FALSE)) {
               activity.setExecutionAsync(true);
             }
-            
+
             ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(element, parse, this);
             activity.setBehaviour(activityBehaviour);
-            
+
             parseOnEvents(element, parse, activity);
-            
+
             String g = XmlUtil.attribute(element, "g");
-            if (g!=null) {
+            if (g != null) {
               StringTokenizer stringTokenizer = new StringTokenizer(g, ",");
               ActivityCoordinatesImpl coordinates = null;
-              if (stringTokenizer.countTokens()==4) {
+              if (stringTokenizer.countTokens() == 4) {
                 try {
                   int x = Integer.parseInt(stringTokenizer.nextToken());
                   int y = Integer.parseInt(stringTokenizer.nextToken());
@@ -255,17 +262,17 @@
                   coordinates = null;
                 }
               }
-              if (coordinates!=null) {
+              if (coordinates != null) {
                 activity.setCoordinates(coordinates);
               } else {
-                parse.addProblem("invalid coordinates g=\""+g+"\" in "+activity);
+                parse.addProblem("invalid coordinates g=\"" + g + "\" in " + activity);
               }
             }
           } finally {
             parse.popObject();
           }
         } else {
-          log.debug("unrecognized activity: "+XmlUtil.getTagLocalName(element));
+          log.debug("unrecognized activity: " + tagName);
         }
       }
     }
@@ -330,7 +337,16 @@
           EventListener eventListener = (EventListener) eventBinding.parse(eventListenerElement, parse, this);
           event.createEventListenerReference(eventListener);
         } else {
-          log.debug("unrecognized event listener: "+XmlUtil.getTagLocalName(eventListenerElement));
+          String tagName = XmlUtil.getTagLocalName(eventListenerElement);
+          if ( ! ( (scopeElement instanceof TransitionImpl)
+                   && ( "condition".equals(tagName)
+                        || "timer".equals(tagName)
+                      )
+                 )
+             ) {
+            parse.addProblem("unrecognized event listener: "+tagName, null, ProblemImpl.TYPE_WARNING, eventListenerElement);
+          }
+               
         }
       }
     }

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -37,7 +37,7 @@
   public ClientProcessDefinition parseJpdl(String xmlString) {
     JpdlParser jpdlParser = new JpdlParser();
     Parse result = jpdlParser.createParse().setString(xmlString).execute();
-    return (ClientProcessDefinition)result.checkProblems("process definition xml string").getDocumentObject();
+    return (ClientProcessDefinition)result.checkErrors("process definition xml string").getDocumentObject();
   }
 
 }

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -54,7 +54,7 @@
     return (ClientProcessDefinition) jpdlParser.createParse()
                .setString(xmlString)
                .execute()
-               .checkProblems("process definition xml string")
+               .checkErrors("process definition xml string")
                .getDocumentObject();
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/AntHelper.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/AntHelper.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/AntHelper.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -33,17 +33,13 @@
 /**
  * common strategy for jbpm ant tasks to obtain a hibernate SessionFactory.
  */
-public class AntHelper {
+public abstract class AntHelper {
 
   final static Map<String, ProcessEngine> processEngines = new HashMap<String, ProcessEngine>();
 
   private static final Log log = LogFactory.getLog(AntHelper.class);
 
-  private AntHelper() {
-    // prevent instantiation
-  }
-
-  public static ProcessEngine getProcessEnging(String jbpmCfgXml) {
+  public static ProcessEngine getProcessEngine(String jbpmCfgXml) {
     ProcessEngine processEngine = (JbpmConfiguration) processEngines.get(jbpmCfgXml);
     if (processEngine == null) {
       Configuration configuration = new Configuration();

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/DeployProcessTask.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/DeployProcessTask.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/DeployProcessTask.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.ant;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.zip.ZipInputStream;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.taskdefs.MatchingTask;
-import org.apache.tools.ant.types.FileSet;
-import org.jbpm.api.Deployment;
-import org.jbpm.api.ProcessEngine;
-import org.jbpm.api.RepositoryService;
-
-/**
- * ant task for deploying process archives.
- */
-public class DeployProcessTask extends MatchingTask {
-
-  String jbpmCfg = null;
-  File process = null;
-  List fileSets = new ArrayList();
-  boolean failOnError = true;
-
-  public void execute() throws BuildException {
-    // get the JbpmConfiguration
-    ProcessEngine processEngine = AntHelper.getProcessEnging(jbpmCfg);
-    
-    // if attribute process is set, deploy that process file
-    if (process!=null) {
-      deployProcessArchive(processEngine, process);
-    }
-    
-    // loop over all files that are specified in the filesets
-    Iterator iter = fileSets.iterator();
-    while (iter.hasNext()) {
-      FileSet fileSet = (FileSet) iter.next();
-      DirectoryScanner dirScanner = fileSet.getDirectoryScanner(getProject());
-      File baseDir = dirScanner.getBasedir();
-      String[] includedFiles = dirScanner.getIncludedFiles();
-      List excludedFiles = Arrays.asList(dirScanner.getExcludedFiles());
-
-      for (int i = 0; i < includedFiles.length; i++) {
-        String fileName = includedFiles[i];
-        if (!excludedFiles.contains(fileName)) {
-          File file = new File(baseDir, fileName);
-          deployProcessArchive(processEngine, file);
-        }
-      }
-    }
-  }
-
-  private void deployProcessArchive(ProcessEngine processEngine, File processFile) {
-    RepositoryService repositoryService = processEngine.getRepositoryService();
-    Deployment deployment = repositoryService.createDeployment();
-    
-    if (processFile.getName().endsWith(".xml")) {
-      log("deploying process file "+processFile.getName());
-      deployment.addResourceFromFile(processFile);
-      
-    } else if (processFile.getName().endsWith("ar")) {
-      log("deploying business archive "+processFile.getName());
-      try {
-        FileInputStream fileInputStream = new FileInputStream(processFile);
-        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
-        deployment.addResourcesFromZipInputStream(zipInputStream);
-      } catch (Exception e) {
-        throw new BuildException("couldn't read business archive "+processFile, e);
-      }
-
-    } else {
-      throw new BuildException("unsupported extension: "+processFile+"  Only .xml files and .*ar archives are supported");
-    }
-    
-    deployment.deploy();
-  }
-
-  public void addFileset(FileSet fileSet) {
-    this.fileSets.add(fileSet);
-  }
-  public void setJbpmCfg(String jbpmCfg) {
-    this.jbpmCfg = jbpmCfg;
-  }
-  public void setProcess(File process) {
-    this.process = process;
-  }
-  public void setFailOnError(boolean failOnError) {
-    this.failOnError = failOnError;
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java (from rev 4676, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/DeployProcessTask.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.ant;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.zip.ZipInputStream;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.FileSet;
+import org.jbpm.api.Deployment;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+
+/**
+ * ant task for deploying process files and business archives.
+ */
+public class JbpmDeployTask extends MatchingTask {
+
+  String jbpmCfg = null;
+  File file = null;
+  List fileSets = new ArrayList();
+  boolean failOnError = true;
+
+  public void execute() throws BuildException {
+    Thread currentThread = Thread.currentThread();
+    ClassLoader originalClassLoader = currentThread.getContextClassLoader();
+    currentThread.setContextClassLoader(JbpmDeployTask.class.getClassLoader());
+    try {
+      // get the JbpmConfiguration
+      ProcessEngine processEngine = AntHelper.getProcessEngine(jbpmCfg);
+      
+      // if attribute process is set, deploy that process file
+      if (file!=null) {
+        deployFile(processEngine, file);
+      }
+      
+      // loop over all files that are specified in the filesets
+      Iterator iter = fileSets.iterator();
+      while (iter.hasNext()) {
+        FileSet fileSet = (FileSet) iter.next();
+        DirectoryScanner dirScanner = fileSet.getDirectoryScanner(getProject());
+        File baseDir = dirScanner.getBasedir();
+        String[] includedFiles = dirScanner.getIncludedFiles();
+        List excludedFiles = Arrays.asList(dirScanner.getExcludedFiles());
+
+        for (int i = 0; i < includedFiles.length; i++) {
+          String fileName = includedFiles[i];
+          if (!excludedFiles.contains(fileName)) {
+            File file = new File(baseDir, fileName);
+            deployFile(processEngine, file);
+          }
+        }
+      }
+      
+    } finally {
+      currentThread.setContextClassLoader(originalClassLoader);
+    }
+  }
+
+  private void deployFile(ProcessEngine processEngine, File processFile) {
+    RepositoryService repositoryService = processEngine.getRepositoryService();
+    Deployment deployment = repositoryService.createDeployment();
+    
+    if (processFile.getName().endsWith(".xml")) {
+      log("deploying process file "+processFile.getName());
+      deployment.addResourceFromFile(processFile);
+      
+    } else if (processFile.getName().endsWith("ar")) {
+      log("deploying business archive "+processFile.getName());
+      try {
+        FileInputStream fileInputStream = new FileInputStream(processFile);
+        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
+        deployment.addResourcesFromZipInputStream(zipInputStream);
+      } catch (Exception e) {
+        throw new BuildException("couldn't read business archive "+processFile, e);
+      }
+
+    } else {
+      throw new BuildException("unsupported extension: "+processFile+"  Only .xml files and .*ar archives are supported");
+    }
+    
+    deployment.deploy();
+  }
+
+  public void addFileset(FileSet fileSet) {
+    this.fileSets.add(fileSet);
+  }
+  public void setJbpmCfg(String jbpmCfg) {
+    this.jbpmCfg = jbpmCfg;
+  }
+  public void setFile(File file) {
+    this.file = file;
+  }
+  public void setFailOnError(boolean failOnError) {
+    this.failOnError = failOnError;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -167,7 +167,7 @@
       .pushObject(this)
       .setStreamSource(streamSource)
       .execute()
-      .checkProblems("jbpm configuration " + streamSource);
+      .checkErrors("jbpm configuration " + streamSource);
   }
   
   public ExecutionService getExecutionService() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -21,11 +21,9 @@
  */
 package org.jbpm.pvm.internal.cmd;
 
-import org.jbpm.api.JbpmException;
 import org.jbpm.api.cmd.Command;
 import org.jbpm.api.env.Environment;
 import org.jbpm.api.session.RepositorySession;
-import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.repository.DeploymentImpl;
 
 
@@ -36,7 +34,7 @@
 
   private static final long serialVersionUID = 1L;
   
-  private static Log log = Log.getLog(DeployCmd.class.getName());
+  // private static Log log = Log.getLog(DeployCmd.class.getName());
   
   DeploymentImpl deployment;
   
@@ -46,14 +44,6 @@
 
   public Long execute(Environment environment) throws Exception {
     RepositorySession repositorySession = environment.get(RepositorySession.class);
-    long deploymentDbid = repositorySession.deploy(deployment);
-    
-    if (deployment.hasProblems()) {
-      JbpmException jbpmException = deployment.getJbpmException();
-      log.info("problems during deployment of "+deployment+": "+jbpmException.getMessage());
-      throw  jbpmException;
-    }
-    
-    return deploymentDbid;
+    return repositorySession.deploy(deployment);
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -54,9 +54,9 @@
 
     deployerManager.deploy(deploymentImpl);
 
-    if (deploymentImpl.hasProblems()) {
+    if (deploymentImpl.hasErrors()) {
       JbpmException jbpmException = deploymentImpl.getJbpmException();
-      log.info("problems during deployment of "+deployment+": "+jbpmException.getMessage());
+      log.info("errors during deployment of "+deployment+": "+jbpmException.getMessage());
       throw  jbpmException;
     } else {
       

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -67,7 +67,7 @@
             .createParse()
             .setResource(resource)
             .execute()
-            .checkProblems("task lifecycle")
+            .checkErrors("task lifecycle")
             .getDocumentObject();
         lifeCycleProcesses.put(resource, lifeCycleProcess);
       }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -171,7 +171,7 @@
             .createParse()
             .setString(xmlString)
             .execute()
-            .checkProblems("wire definition xml string")
+            .checkErrors("wire definition xml string")
             .getDocumentObject();
   }
 
@@ -275,7 +275,7 @@
             .setUrl(resourceUrl)
             .pushObject(defaultBindings)
             .execute()
-            .checkProblems(resourceUrl.toString());
+            .checkErrors(resourceUrl.toString());
         }
       } else {
         log.trace("skipping unavailable wire bindings resource "+wireResource);

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-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -184,8 +184,8 @@
   /** throws an exception with appropriate message in case the parse contains 
    * errors or fatal errors.  This method also logs the problems with severity
    * 'warning'. */
-  public Parse checkProblems(String description) {
-    if (hasProblems()) {
+  public Parse checkErrors(String description) {
+    if (hasErrors()) {
       throw getJbpmException();
     }
     return this;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -115,8 +115,8 @@
  * provide the developer with as much feedback as possible in one parse cycle.
  * The {@link Parse#getProblems() problems} are silently captured in the parse
  * object.  If an exception is thrown by 
- * {@link #Parse#checkProblems(String, Parse)}, it will contain a report of 
- * all the parsing problems.  Alternatively, the {@link Parse#hasProblems() problems
+ * {@link Parse#checkErrors(String)}, it will contain a report of 
+ * all the parsing problems.  Alternatively, the {@link Parse#getProblems() problems
  * in the parse object} could be examined directly without the need for an exception. 
  * </p>
  *

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -118,14 +118,32 @@
     return ((problems != null) && (problems.size() > 0));
   }
 
+  /** indicates presence of errors */
+  public boolean hasErrors() {
+    if (problems==null) {
+      return false;
+    }
+    for (Problem problem: problems) {
+      if (ProblemImpl.TYPE_ERROR.equals(problem.getSeverity())) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   /** allows to provide the list object that should be used to 
    * capture the parsing problems. */
   public void setProblems(List<Problem> problems) {
     this.problems = (List)problems;
   }
   
+    
   public JbpmException getJbpmException() {
-    if (! hasProblems()) {
+    return getJbpmException(null);
+  }
+  
+  public JbpmException getJbpmException(String message) {
+    if (! hasErrors()) {
       return null;
     }
     
@@ -133,6 +151,10 @@
     
     StringBuffer errorMsg = new StringBuffer();
     if (problems!=null) {
+      if (message!=null) {
+        errorMsg.append(message);
+        errorMsg.append(": ");
+      }
       
       for (Problem p : getProblems()) {
         errorMsg.append(NEWLINE);

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java	2009-04-30 17:46:29 UTC (rev 4685)
@@ -37,7 +37,7 @@
             .createParse()
             .setString(wireDefinitionXml)
             .execute()
-            .checkProblems("wire definition xml string")
+            .checkErrors("wire definition xml string")
             .getDocumentObject();
     return new WireContext(wireDefinition);
   }

Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml	2009-04-30 06:37:19 UTC (rev 4684)
+++ jbpm4/trunk/qa/build.xml	2009-04-30 17:46:29 UTC (rev 4685)
@@ -21,9 +21,6 @@
   <!-- ### LOG PROPERTIES ################################################# -->
   <target name="log.properties">
     <echo message="database: ${database}" />
-    <echo message="jdbc.driver: ${jdbc.driver}" />
-    <echo message="jdbc.url: ${jdbc.url}" />
-    <echo message="jdbc.username: ${jdbc.username}" />
     <echo message="jbpm.version: ${jbpm.version}" />
     <echo message="jbpm.filename: ${jbpm.filename}" />
     <echo message="jbpm.distro.path: ${jbpm.distro.path}" />
@@ -54,7 +51,7 @@
     <ant antfile="${jbpm.home}/jboss/build.xml" target="reinstall.jboss" />
     <ant antfile="${jbpm.home}/jboss/build.xml" target="install.jbpm.into.jboss" />
     <ant antfile="${jbpm.home}/jboss/build.xml" target="start.jboss" />
-		<copy file="db/${database}.properties" tofile="${jbpm.home}/db/jdbc.properties" overwrite="true" />
+		<copy file="db/${database}.properties" tofile="${jbpm.home}/db/jdbc/${database}.properties" overwrite="true" />
     <ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" inheritall="false" />
 	</target>
 

Added: jbpm4/trunk/qa/test.distribution.bat
===================================================================
--- jbpm4/trunk/qa/test.distribution.bat	                        (rev 0)
+++ jbpm4/trunk/qa/test.distribution.bat	2009-04-30 17:46:29 UTC (rev 4685)
@@ -0,0 +1,2 @@
+cmd /C mvn -Pdistro clean install
+cmd /C ant -f qa/build.xml integration.testrun.setup




More information about the jbpm-commits mailing list