JBoss JBPM SVN: r5752 - jbpm3/tags.
by do-not-reply@jboss.org
Author: jcoleman(a)redhat.com
Date: 2009-10-18 02:30:10 -0400 (Sun, 18 Oct 2009)
New Revision: 5752
Added:
jbpm3/tags/jbpm-3.2.8.CR4/
Log:
Create 3.2.8 CR4 tag from 3.2-soa branch
Copied: jbpm3/tags/jbpm-3.2.8.CR4 (from rev 5751, jbpm3/branches/jbpm-3.2-soa)
16 years, 6 months
JBoss JBPM SVN: r5751 - in jbpm4/trunk/modules: db and 14 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-17 23:47:55 -0400 (Sat, 17 Oct 2009)
New Revision: 5751
Modified:
jbpm4/trunk/modules/api/.classpath
jbpm4/trunk/modules/db/.classpath
jbpm4/trunk/modules/db/.project
jbpm4/trunk/modules/enterprise/.classpath
jbpm4/trunk/modules/enterprise/.project
jbpm4/trunk/modules/examples/.classpath
jbpm4/trunk/modules/integration/console/.project
jbpm4/trunk/modules/integration/form-plugin/.project
jbpm4/trunk/modules/integration/graphView-plugin/.project
jbpm4/trunk/modules/jboss/.project
jbpm4/trunk/modules/jpdl/.classpath
jbpm4/trunk/modules/jpdl/.project
jbpm4/trunk/modules/log/.project
jbpm4/trunk/modules/pvm/.classpath
jbpm4/trunk/modules/test-base/.project
jbpm4/trunk/modules/test-cactus/.classpath
jbpm4/trunk/modules/test-db/.classpath
jbpm4/trunk/modules/test-db/.project
jbpm4/trunk/modules/test-load/.classpath
jbpm4/trunk/modules/test-load/.project
jbpm4/trunk/modules/test-pojo/.classpath
jbpm4/trunk/modules/test-pojo/.project
Log:
add maven builder to eclipse project files that were missing it
Modified: jbpm4/trunk/modules/api/.classpath
===================================================================
--- jbpm4/trunk/modules/api/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/api/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: jbpm4/trunk/modules/db/.classpath
===================================================================
--- jbpm4/trunk/modules/db/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/db/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: jbpm4/trunk/modules/db/.project
===================================================================
--- jbpm4/trunk/modules/db/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/db/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>db</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/enterprise/.classpath
===================================================================
--- jbpm4/trunk/modules/enterprise/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/enterprise/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/enterprise/.project
===================================================================
--- jbpm4/trunk/modules/enterprise/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/enterprise/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>enterprise</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>enterprise</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/examples/.classpath
===================================================================
--- jbpm4/trunk/modules/examples/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/examples/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: jbpm4/trunk/modules/integration/console/.project
===================================================================
--- jbpm4/trunk/modules/integration/console/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/integration/console/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>integration-console</name>
+ <name>console-integration</name>
<comment></comment>
<projects>
</projects>
@@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: jbpm4/trunk/modules/integration/form-plugin/.project
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/integration/form-plugin/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>integration-forms-plugin</name>
+ <name>console-form-plugin</name>
<comment></comment>
<projects>
</projects>
@@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: jbpm4/trunk/modules/integration/graphView-plugin/.project
===================================================================
--- jbpm4/trunk/modules/integration/graphView-plugin/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/integration/graphView-plugin/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>integration-graphview-plugin</name>
+ <name>console-graphview-plugin</name>
<comment></comment>
<projects>
</projects>
@@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: jbpm4/trunk/modules/jboss/.project
===================================================================
--- jbpm4/trunk/modules/jboss/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/jboss/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
Modified: jbpm4/trunk/modules/jpdl/.classpath
===================================================================
--- jbpm4/trunk/modules/jpdl/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/jpdl/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: jbpm4/trunk/modules/jpdl/.project
===================================================================
--- jbpm4/trunk/modules/jpdl/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/jpdl/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jpdl</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jpdl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/log/.project
===================================================================
--- jbpm4/trunk/modules/log/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/log/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>log</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>log</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/pvm/.classpath
===================================================================
--- jbpm4/trunk/modules/pvm/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/pvm/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/test-base/.project
===================================================================
--- jbpm4/trunk/modules/test-base/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-base/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>test-base</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>test-base</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/test-cactus/.classpath
===================================================================
--- jbpm4/trunk/modules/test-cactus/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-cactus/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/test-db/.classpath
===================================================================
--- jbpm4/trunk/modules/test-db/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-db/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/test-db/.project
===================================================================
--- jbpm4/trunk/modules/test-db/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-db/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>test-db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>test-db</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/test-load/.classpath
===================================================================
--- jbpm4/trunk/modules/test-load/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-load/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/test-classes"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: jbpm4/trunk/modules/test-load/.project
===================================================================
--- jbpm4/trunk/modules/test-load/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-load/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>test-load</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>test-load</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/trunk/modules/test-pojo/.classpath
===================================================================
--- jbpm4/trunk/modules/test-pojo/.classpath 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-pojo/.classpath 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: jbpm4/trunk/modules/test-pojo/.project
===================================================================
--- jbpm4/trunk/modules/test-pojo/.project 2009-10-18 03:26:42 UTC (rev 5750)
+++ jbpm4/trunk/modules/test-pojo/.project 2009-10-18 03:47:55 UTC (rev 5751)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>test-pojo</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>test-pojo</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
16 years, 6 months
JBoss JBPM SVN: r5750 - in jbpm3/branches/jbpm-3.2-soa: eclipse and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-17 23:26:42 -0400 (Sat, 17 Oct 2009)
New Revision: 5750
Modified:
jbpm3/branches/jbpm-3.2-soa/eclipse/readme.txt
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
[JBPM-2591] declare explicit dependency on commons-beanutils
Modified: jbpm3/branches/jbpm-3.2-soa/eclipse/readme.txt
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/eclipse/readme.txt 2009-10-18 03:26:23 UTC (rev 5749)
+++ jbpm3/branches/jbpm-3.2-soa/eclipse/readme.txt 2009-10-18 03:26:42 UTC (rev 5750)
@@ -2,25 +2,27 @@
# $Id: $
#
-1. Edit your subversion config ~/.subversion/config and set the following in each section:
+1. Edit your subversion configuration ~/.subversion/config
+Set the following properties in their corresponding section:
[miscellany]
enable-auto-props = yes
[auto-props]
-*.bat = svn:keywords=Id Revision;svn:eol-style=LF
+*.bat = svn:keywords=Id Revision;svn:eol-style=CRLF
*.java = svn:keywords=Id Revision;svn:eol-style=LF
-*.sh = svn:keywords=Id Revision;svn:eol-style=LF
+*.sh = svn:keywords=Id Revision;svn:eol-style=LF;svn:executable
*.txt = svn:keywords=Id Revision;svn:eol-style=LF
*.wsdl = svn:keywords=Id Revision;svn:eol-style=LF
*.xml = svn:keywords=Id Revision;svn:eol-style=LF
*.xsd = svn:keywords=Id Revision;svn:eol-style=LF
-2. If you are using an IDE, make sure that it refers to the same config. So,
-for example, if you are using Eclipse with Subclipse on windows, you need to
-set Team->SVN->Configuration Location to:
+2. If you are using an IDE, make sure that it refers to the same config.
+With Eclipse and Subclipse this is already the case if
+Preferences -> Team -> SVN -> Configuration location is set to
+"Use default config location"
-/home/<your user name>/.subversion
-
-3. If you are using Eclipse, set your code style to jbpm.code.templates.xml with
-Window --> Preferences --> Java --> Code Style --> Formatter --> Import
+3. If you are using Eclipse, import jbpm.code.templates.xml with
+Preferences -> Java -> Code Style -> Code Templates -> Import
+and jbpm.code.style.xml with
+Preferences -> Java -> Code Style -> Formatter -> Import
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-18 03:26:23 UTC (rev 5749)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-18 03:26:42 UTC (rev 5750)
@@ -11,7 +11,8 @@
<!-- $Id: pom.xml 7412 2008-06-06 13:42:30Z thomas.diesler(a)jboss.com $ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3</name>
@@ -47,6 +48,7 @@
<birt.version>2.2.2</birt.version>
<bsh.version>1.3.0</bsh.version>
<cactus.version>1.8.0</cactus.version>
+ <commons.beanutils.version>1.7.0</commons.beanutils.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.4</commons.io.version>
<commons.logging.version>1.1.1</commons.logging.version>
@@ -77,15 +79,15 @@
<xerces.version>2.6.2</xerces.version>
<!-- Database Driver Versions -->
- <db2jcc.version>3.1.57</db2jcc.version>
+ <db2jcc.version>3.1.57</db2jcc.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<jconnect.version>6.0.5</jconnect.version>
<jtds.version>1.2.2</jtds.version>
- <msjdbc.version>1.2.2828.100</msjdbc.version>
+ <msjdbc.version>1.2.2828.100</msjdbc.version>
<mysql.connector.version>5.0.7</mysql.connector.version>
<ojdbc.version>10.2.0.4</ojdbc.version>
<postgresql.version>8.2-504.jdbc3</postgresql.version>
- </properties>
+ </properties>
<!-- DependencyManagement -->
<dependencyManagement>
@@ -133,6 +135,11 @@
<version>${cactus.version}</version>
</dependency>
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>${commons.beanutils.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
@@ -265,9 +272,9 @@
<version>${hsqldb.version}</version>
</dependency>
<dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>${jtds.version}</version>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>${jtds.version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
16 years, 6 months
JBoss JBPM SVN: r5749 - jbpm3/branches/jbpm-3.2-soa/modules/simulation.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-17 23:26:23 -0400 (Sat, 17 Oct 2009)
New Revision: 5749
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml
Log:
[JBPM-2591] declare explicit dependency on commons-beanutils
Modified: jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml 2009-10-16 15:06:59 UTC (rev 5748)
+++ jbpm3/branches/jbpm-3.2-soa/modules/simulation/pom.xml 2009-10-18 03:26:23 UTC (rev 5749)
@@ -10,7 +10,9 @@
<!-- ====================================================================== -->
<!-- $Id$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - Simulation</name>
@@ -63,6 +65,10 @@
<!-- Compile Dependencies -->
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
<groupId>desmoj</groupId>
<artifactId>desmoj</artifactId>
</dependency>
@@ -71,6 +77,10 @@
<artifactId>dom4j</artifactId>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<exclusions>
@@ -96,10 +106,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- </dependency>
<!-- Test Dependencies -->
<dependency>
16 years, 6 months
JBoss JBPM SVN: r5748 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src/test: java/org/jbpm/mock and 4 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-16 11:06:59 -0400 (Fri, 16 Oct 2009)
New Revision: 5748
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mock/EsbActionHandler.java
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jboss/
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2094/processdefinition.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2489/processdefinition.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/actual/processdefinition.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/processdefinition.xml
Log:
move mock EsbActionHandler back to an org.jbpm package to prevent clashes with the actual org.jboss.soa.-.EsbActionHandler in SOA-P test suite runs
Copied: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mock/EsbActionHandler.java (from rev 5721, jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jboss/soa/esb/services/jbpm/actionhandlers/EsbActionHandler.java)
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mock/EsbActionHandler.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mock/EsbActionHandler.java 2009-10-16 15:06:59 UTC (rev 5748)
@@ -0,0 +1,73 @@
+/*
+ * 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.mock;
+
+import java.util.Iterator;
+import java.util.Random;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Element;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class EsbActionHandler implements ActionHandler {
+
+ private String esbCategoryName;
+ private String esbServiceName;
+ private Element bpmToEsbVars;
+ private Element esbToBpmVars;
+ private String exceptionTransition;
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = LogFactory.getLog(EsbActionHandler.class);
+
+ public void execute(ExecutionContext executionContext) {
+ log.debug("'invoking' " + esbCategoryName + "::" + esbServiceName);
+ try {
+ for (Iterator i = bpmToEsbVars.elementIterator(); i.hasNext();) {
+ Element bpmToEsbVar = (Element) i.next();
+ String var = bpmToEsbVar.attributeValue("bpm");
+ Object value = executionContext.getVariable(var);
+ log.debug("read " + value + " from variable " + var);
+ }
+ Random random = new Random();
+ for (Iterator i = esbToBpmVars.elementIterator(); i.hasNext();) {
+ Element esbToBpmVar = (Element) i.next();
+ String var = esbToBpmVar.attributeValue("bpm");
+ byte[] value = new byte[random.nextInt(2048)];
+ random.nextBytes(value);
+ executionContext.setVariable(var, value);
+ log.debug("wrote " + value.length + " bytes to variable " + var);
+ }
+ executionContext.leaveNode();
+ }
+ catch (RuntimeException e) {
+ executionContext.leaveNode(exceptionTransition);
+ }
+ }
+
+}
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/mock/EsbActionHandler.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2094/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2094/processdefinition.xml 2009-10-16 02:31:43 UTC (rev 5747)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2094/processdefinition.xml 2009-10-16 15:06:59 UTC (rev 5748)
@@ -7,7 +7,7 @@
</start-state>
<node async="true" name="Receive Order">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service1</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
<bpmToEsbVars>
@@ -21,7 +21,7 @@
</node>
<node name="Validate Order">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service2</esbCategoryName>
<esbServiceName>Service2</esbServiceName>
<bpmToEsbVars>
@@ -41,7 +41,7 @@
</fork>
<node async="true" name="Los Angeles WHSE">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service5</esbCategoryName>
<esbServiceName>Service5</esbServiceName>
<bpmToEsbVars>
@@ -55,7 +55,7 @@
</node>
<node name="Dallas WHSE">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service6</esbCategoryName>
<esbServiceName>Service6</esbServiceName>
<bpmToEsbVars>
@@ -69,7 +69,7 @@
</node>
<node async="true" name="Atlanta WHSE">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service7</esbCategoryName>
<esbServiceName>Service7</esbServiceName>
<bpmToEsbVars>
@@ -87,7 +87,7 @@
</join>
<node name="Shipment Notice">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_ResultsService
</esbCategoryName>
<esbServiceName>ResultsService</esbServiceName>
@@ -106,7 +106,7 @@
<end-state name="End"/>
<node async="true" name="Inventory Check">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service4</esbCategoryName>
<esbServiceName>Service4</esbServiceName>
<bpmToEsbVars>
@@ -120,7 +120,7 @@
</node>
<node name="Credit Check">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service3</esbCategoryName>
<esbServiceName>Service3</esbServiceName>
<bpmToEsbVars>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2489/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2489/processdefinition.xml 2009-10-16 02:31:43 UTC (rev 5747)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2489/processdefinition.xml 2009-10-16 15:06:59 UTC (rev 5748)
@@ -7,7 +7,7 @@
</start-state>
<node async="true" name="Receive Order">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service1</esbCategoryName>
<esbServiceName>Service1</esbServiceName>
<bpmToEsbVars>
@@ -21,7 +21,7 @@
</node>
<node name="Validate Order">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service2</esbCategoryName>
<esbServiceName>Service2</esbServiceName>
<bpmToEsbVars>
@@ -47,7 +47,7 @@
</state>
<node name="Dallas WHSE">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service6</esbCategoryName>
<esbServiceName>Service6</esbServiceName>
<bpmToEsbVars>
@@ -61,7 +61,7 @@
</node>
<node async="true" name="Atlanta WHSE">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service7</esbCategoryName>
<esbServiceName>Service7</esbServiceName>
<bpmToEsbVars>
@@ -79,7 +79,7 @@
</join>
<node name="Shipment Notice">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_ResultsService
</esbCategoryName>
<esbServiceName>ResultsService</esbServiceName>
@@ -98,7 +98,7 @@
<end-state name="End"/>
<node async="true" name="Inventory Check">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service4</esbCategoryName>
<esbServiceName>Service4</esbServiceName>
<bpmToEsbVars>
@@ -112,7 +112,7 @@
</node>
<node name="Credit Check">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>BPM_Orchestration2_Service3</esbCategoryName>
<esbServiceName>Service3</esbServiceName>
<bpmToEsbVars>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/actual/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/actual/processdefinition.xml 2009-10-16 02:31:43 UTC (rev 5747)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/actual/processdefinition.xml 2009-10-16 15:06:59 UTC (rev 5748)
@@ -17,7 +17,7 @@
</start-state>
<node name="Categorize Content">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>CMTE CNND</esbCategoryName>
<esbServiceName>Categorize Content</esbServiceName>
<bpmToEsbVars>
@@ -42,7 +42,7 @@
</node>
<node name="ValidateContent">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>Validate Content</esbServiceName>
<esbCategoryName>CMTE CNND</esbCategoryName>
<bpmToEsbVars>
@@ -61,7 +61,7 @@
</node>
<node name="RejectContent">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>Reject Content</esbServiceName>
<esbCategoryName>CMTE CNND</esbCategoryName>
<bpmToEsbVars>
@@ -73,7 +73,7 @@
</node>
<node name="Diff Content">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>CMTE CNND</esbCategoryName>
<esbServiceName>Diff Content</esbServiceName>
<bpmToEsbVars>
@@ -92,7 +92,7 @@
</node>
<node name="Store Content">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>Store Content</esbServiceName>
<esbCategoryName>CMTE CNND</esbCategoryName>
<bpmToEsbVars>
@@ -135,7 +135,7 @@
</decision>
<node name="Split Content">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<bpmToEsbVars>
<mapping bpm="content_file_name" esb="content_file_name"/>
<mapping bpm="content_category" esb="content_category"/>
@@ -177,7 +177,7 @@
</decision>
<node name="Diff Item">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbCategoryName>CMTE CNND</esbCategoryName>
<esbServiceName>Diff Content</esbServiceName>
<bpmToEsbVars>
@@ -216,7 +216,7 @@
</node>
<node name="Store Item">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>Store Content</esbServiceName>
<esbCategoryName>CMTE CNND</esbCategoryName>
<bpmToEsbVars>
@@ -242,7 +242,7 @@
</decision>
<node name="Convert to XML">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>Convert Content</esbServiceName>
<esbCategoryName>CMTE CNND</esbCategoryName>
<bpmToEsbVars>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/processdefinition.xml 2009-10-16 02:31:43 UTC (rev 5747)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2574/processdefinition.xml 2009-10-16 15:06:59 UTC (rev 5748)
@@ -9,7 +9,7 @@
<node name="esb">
- <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
+ <action class="org.jbpm.mock.EsbActionHandler">
<esbServiceName>
paybills
</esbServiceName>
16 years, 6 months
JBoss JBPM SVN: r5747 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/jpdl/migration and 2 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-10-15 22:31:43 -0400 (Thu, 15 Oct 2009)
New Revision: 5747
Added:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/MigrationHelper.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/AbortMigrationHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/DefaultMigrationHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationHandler.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
Removed:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/migration/InstanceMigratorTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/InstanceMigrator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationDescriptor.java
Log:
new test scenario's added for instance migration:
- no migration
- migration handler
- simple abortion
- simple migration
- correct activity mapping
- incorrect activity mapping
- absolute version range
- relative version range
- mixed version range
- wildcard
new functionality:
- user defined migration handler
- migrate a version range of the depoyed processes
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-15 22:59:55 UTC (rev 5746)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -47,6 +47,8 @@
import org.jbpm.pvm.internal.email.impl.MailTemplateRegistry;
import org.jbpm.pvm.internal.email.spi.MailProducer;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
+import org.jbpm.pvm.internal.migration.AbortMigrationHandler;
+import org.jbpm.pvm.internal.migration.DefaultMigrationHandler;
import org.jbpm.pvm.internal.migration.MigrationDescriptor;
import org.jbpm.pvm.internal.model.ActivityCoordinatesImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
@@ -72,7 +74,6 @@
import org.jbpm.pvm.internal.wire.binding.MailTemplateBinding;
import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.operation.Operation;
import org.jbpm.pvm.internal.wire.usercode.UserCodeReference;
import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Bindings;
@@ -258,7 +259,7 @@
// process migration information
Element migrationElement = XmlUtil.element(documentElement, "migrate-instances");
if (migrationElement != null) {
- parseMigrationDescriptor(migrationElement, parse, processDefinition);
+ MigrationHelper.parseMigrationDescriptor(migrationElement, parse, processDefinition);
}
} finally {
@@ -282,33 +283,14 @@
}
}
- @SuppressWarnings("unchecked")
- public void parseMigrationDescriptor(Element migrationElement, Parse parse, ProcessDefinition processDefinition) {
- Map<ProcessDefinition, MigrationDescriptor> migrations = (Map<ProcessDefinition, MigrationDescriptor>)parse.contextMapGet(Parse.CONTEXT_KEY_MIGRATIONS);
- if (migrations == null) {
- migrations = new HashMap<ProcessDefinition, MigrationDescriptor>();
- parse.contextMapPut(Parse.CONTEXT_KEY_MIGRATIONS, migrations);
- }
- MigrationDescriptor migrationDescriptor = new MigrationDescriptor();
- NodeList activityMappings = migrationElement.getElementsByTagName("activity-mapping");
- for (int i = 0; i < activityMappings.getLength(); i++) {
- Node activityMapping = activityMappings.item(i);
- if (activityMapping instanceof Element) {
- String oldName = ((Element)activityMapping).getAttribute("old-name");
- String newName = ((Element)activityMapping).getAttribute("new-name");
- migrationDescriptor.addMigrationElement(MigrationDescriptor.ACTIVITY_TYPE, oldName, newName);
- }
- }
- migrations.put(processDefinition, migrationDescriptor);
- }
-
public void parseActivities(Element documentElement, Parse parse, CompositeElementImpl compositeElement) {
List<Element> elements = XmlUtil.elements(documentElement);
for (Element nestedElement : elements) {
String tagName = XmlUtil.getTagLocalName(nestedElement);
if ("on".equals(tagName)
|| "timer".equals(tagName)
- || "swimlane".equals(tagName)) continue;
+ || "swimlane".equals(tagName)
+ || "migrate-instances".equals(tagName)) continue;
JpdlBinding activityBinding = (JpdlBinding) getBinding(nestedElement, CATEGORY_ACTIVITY);
if (activityBinding == null) {
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/MigrationHelper.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/MigrationHelper.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/MigrationHelper.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -0,0 +1,119 @@
+package org.jbpm.jpdl.internal.xml;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.pvm.internal.migration.AbortMigrationHandler;
+import org.jbpm.pvm.internal.migration.DefaultMigrationHandler;
+import org.jbpm.pvm.internal.migration.MigrationDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class MigrationHelper {
+
+ @SuppressWarnings("unchecked")
+ public static void parseMigrationDescriptor(Element migrationElement, Parse parse, ProcessDefinition processDefinition) {
+ Map<ProcessDefinition, MigrationDescriptor> migrations = (Map<ProcessDefinition, MigrationDescriptor>)parse.contextMapGet(Parse.CONTEXT_KEY_MIGRATIONS);
+ if (migrations == null) {
+ migrations = new HashMap<ProcessDefinition, MigrationDescriptor>();
+ parse.contextMapPut(Parse.CONTEXT_KEY_MIGRATIONS, migrations);
+ }
+ MigrationDescriptor migrationDescriptor = new MigrationDescriptor();
+ String action = migrationElement.getAttribute("action");
+ if ("abort".equals(action)) {
+ migrationDescriptor.addMigrationHandlerClassName(AbortMigrationHandler.class.getName());
+ } else if ("custom".equals(action)) {
+ parseMigrationHandlers(migrationElement, migrationDescriptor);
+ } else {
+ migrationDescriptor.addMigrationHandlerClassName(DefaultMigrationHandler.class.getName());
+ parseActivityMappings(migrationElement, migrationDescriptor);
+ }
+ String versions = migrationElement.getAttribute("versions");
+ if (versions != null && !"".equals(versions)) {
+ addVersionInformation(versions, migrationDescriptor);
+ }
+ migrations.put(processDefinition, migrationDescriptor);
+ }
+
+ private static void addVersionInformation(String versions, MigrationDescriptor migrationDescriptor) {
+ boolean isStartInfoRelative = false;
+ boolean isEndInfoRelative = false;
+ int startValue = -1;
+ int endValue = -1;
+ if ("*".equals(versions)) {
+ migrationDescriptor.setStartVersion(1);
+ migrationDescriptor.setEndVersion(Integer.MAX_VALUE);
+ } else {
+ int separatorIndex = versions.indexOf("..");
+ if (separatorIndex == -1)
+ throw new JbpmException("Wrong version information in migrate-instances descriptor.");
+ String start = versions.substring(0, separatorIndex).trim();
+ int minusIndex = start.indexOf('-');
+ if (minusIndex != -1) {
+ if (!"x".equals(start.substring(0, minusIndex).trim()))
+ throw new JbpmException("Relative version info should be of the form 'x - n'");
+ isStartInfoRelative = true;
+ start = start.substring(minusIndex + 1).trim();
+ }
+ try {
+ startValue = new Integer(start);
+ if (isStartInfoRelative) {
+ migrationDescriptor.setStartOffset(startValue);
+ } else {
+ migrationDescriptor.setStartVersion(startValue);
+ }
+ } catch (NumberFormatException e) {
+ throw new JbpmException("Version information should be numeric.");
+ }
+ String end = versions.substring(separatorIndex + 2).trim();
+ if ("x".equals(end)) return;
+ minusIndex = end.indexOf('-');
+ if (minusIndex != -1) {
+ if (!"x".equals(end.substring(0, minusIndex).trim()))
+ throw new JbpmException("Relative version info should be of the form 'x - n'");
+ isEndInfoRelative = true;
+ end = end.substring(minusIndex + 1).trim();
+ }
+ try {
+ endValue = new Integer(end);
+ if (isEndInfoRelative) {
+ migrationDescriptor.setEndOffset(endValue);
+ } else {
+ migrationDescriptor.setEndVersion(endValue);
+ }
+ } catch (NumberFormatException e) {
+ throw new JbpmException("Version information should be numeric.");
+ }
+ }
+ }
+
+ private static void parseActivityMappings(Element migrationElement, MigrationDescriptor migrationDescriptor) {
+ NodeList activityMappings = migrationElement.getElementsByTagName("activity-mapping");
+ for (int i = 0; i < activityMappings.getLength(); i++) {
+ Node activityMapping = activityMappings.item(i);
+ if (activityMapping instanceof Element) {
+ String oldName = ((Element)activityMapping).getAttribute("old-name");
+ String newName = ((Element)activityMapping).getAttribute("new-name");
+ migrationDescriptor.addMigrationElement(MigrationDescriptor.ACTIVITY_TYPE, oldName, newName);
+ }
+ }
+ }
+
+ private static void parseMigrationHandlers(Element migrationElement, MigrationDescriptor migrationDescriptor) {
+ NodeList migrationHandlers = migrationElement.getElementsByTagName("migration-handler");
+ for (int i = 0; i < migrationHandlers.getLength(); i++) {
+ Node migrationHandler = migrationHandlers.item(i);
+ if (migrationHandler instanceof Element) {
+ String className = ((Element)migrationHandler).getAttribute("class");
+ if (className != null && !"".equals(className)) {
+ migrationDescriptor.addMigrationHandlerClassName(className);
+ }
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/MigrationHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/migration/InstanceMigratorTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/migration/InstanceMigratorTest.java 2009-10-15 22:59:55 UTC (rev 5746)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/migration/InstanceMigratorTest.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -6,6 +6,7 @@
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.history.HistoryDetail;
+import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceMigrationImpl;
import org.jbpm.test.JbpmTestCase;
@@ -14,35 +15,42 @@
private String firstVersion =
"<process name='foobar'>" +
+ " <swimlane name='phelps' assignee='fredje'/>" +
" <start>" +
" <transition to='foo'/>" +
" </start>" +
" <state name='foo'>" +
" <transition to='bar'/>" +
" </state>" +
- " <state name='bar'>" +
+ " <task name='bar' swimlane='phelps'>" +
" <transition to='end'/>" +
- " </state>" +
+ " </task>" +
" <end name='end'/>" +
"</process>";
private String secondVersion =
"<process name='foobar'>" +
+ " <swimlane name='baltimore bullet' assignee='fredje'/>" +
" <start>" +
" <transition to='foo'/>" +
" </start>" +
" <state name='foo'>" +
- " <transition to='bar'/>" +
+ " <transition to='fu'/>" +
" </state>" +
- " <state name='bar'>" +
+ " <task name='fu' swimlane='baltimore bullet'>" +
+ " <transition name='to end' to='end'/>" +
+ " <transition name='to baz' to='baz'/>" +
+ " </task>" +
+ " <task name='baz' swimlane='baltimore bullet'>" +
" <transition to='end'/>" +
- " </state>" +
+ " </task>" +
" <end name='end'/>" +
- " <migrate-instances/>" +
+ " <migrate-instances>" +
+ " <activity-mapping old-name='bar' new-name='fu'/>" +
+ " </migrate-instances>" +
"</process>";
-
-
- public void testSimpleMigration() {
+
+ public void testHistoryProcessInstanceMigration() {
String deploymentId1 = repositoryService.createDeployment()
.addResourceFromString("foobar.jpdl.xml", firstVersion)
.deploy();
@@ -54,11 +62,6 @@
.startProcessInstanceById(processDefinition1.getId())
.findActiveExecutionIn("foo");
executionService.signalExecutionById(execution.getId());
- ProcessInstance processInstance1 = executionService
- .createProcessInstanceQuery()
- .processDefinitionId(processDefinition1.getId())
- .uniqueResult();
- assertNotNull(processInstance1.findActiveExecutionIn("bar"));
String deploymentId2 = repositoryService.createDeployment()
.addResourceFromString("foobar.jpdl.xml", secondVersion)
@@ -67,16 +70,14 @@
.createProcessDefinitionQuery()
.deploymentId(deploymentId2)
.uniqueResult();
- ProcessInstance processInstance2 = executionService
+ ProcessInstance processInstance = executionService
.createProcessInstanceQuery()
.processDefinitionId(processDefinition2.getId())
.uniqueResult();
- assertNotNull(processInstance2);
-
List<HistoryDetail> historyDetails = historyService
.createHistoryDetailQuery()
- .processInstanceId(processInstance2.getId())
+ .processInstanceId(processInstance.getId())
.list();
HistoryProcessInstanceMigrationImpl historyProcessInstanceMigration = null;
for (HistoryDetail historyDetail : historyDetails) {
@@ -92,4 +93,39 @@
}
+ public void testSwimlaneMigration() {
+
+ identityService.createUser("fredje", "Frederik", "Deburghgraeve");
+
+ String deploymentId1 = repositoryService.createDeployment()
+ .addResourceFromString("foobar.jpdl.xml", firstVersion)
+ .deploy();
+ ProcessDefinition processDefinition1 = repositoryService
+ .createProcessDefinitionQuery()
+ .deploymentId(deploymentId1)
+ .uniqueResult();
+ Execution execution = executionService
+ .startProcessInstanceById(processDefinition1.getId())
+ .findActiveExecutionIn("foo");
+ executionService.signalExecutionById(execution.getId());
+
+ Task task = taskService.createTaskQuery().assignee("fredje").uniqueResult();
+ assertNotNull(task);
+
+ String deploymentId2 = repositoryService.createDeployment()
+ .addResourceFromString("foobar.jpdl.xml", secondVersion)
+ .deploy();
+
+ taskService.completeTask(task.getId(), "to baz");
+
+ task = taskService.createTaskQuery().assignee("fredje").uniqueResult();
+ assertNotNull(task);
+
+ identityService.deleteUser("fredje");
+
+ repositoryService.deleteDeploymentCascade(deploymentId2);
+ repositoryService.deleteDeploymentCascade(deploymentId1);
+
+ }
+
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/AbortMigrationHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/AbortMigrationHandler.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/AbortMigrationHandler.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -0,0 +1,17 @@
+package org.jbpm.pvm.internal.migration;
+
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
+
+
+public class AbortMigrationHandler implements MigrationHandler {
+
+ public void migrateInstance(ProcessDefinition newProcessDefinition, ProcessInstance processInstance, MigrationDescriptor migrationDescriptor) {
+ ExecutionService executionService = EnvironmentImpl.getFromCurrent(ExecutionService.class);
+ if (executionService == null) return;
+ executionService.endProcessInstance(processInstance.getId(), "aborted");
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/AbortMigrationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/DefaultMigrationHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/DefaultMigrationHandler.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/DefaultMigrationHandler.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -0,0 +1,57 @@
+package org.jbpm.pvm.internal.migration;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.events.ProcessInstanceMigration;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+
+
+public class DefaultMigrationHandler implements MigrationHandler {
+
+ public void migrateInstance(
+ ProcessDefinition newProcessDefinition,
+ ProcessInstance processInstance,
+ MigrationDescriptor migrationDescriptor) {
+ migrateExecutions(newProcessDefinition, processInstance, migrationDescriptor);
+ logMigration(processInstance, newProcessDefinition);
+ }
+
+ private void migrateChildExecutions(
+ ProcessDefinition processDefinition,
+ Execution execution,
+ MigrationDescriptor migrationDescriptor) {
+ for (Execution child : execution.getExecutions()) {
+ migrateExecutions(processDefinition, child, migrationDescriptor);
+ }
+ }
+
+ private void migrateExecutions(ProcessDefinition processDefinition, Execution execution, MigrationDescriptor migrationDescriptor) {
+ migrateChildExecutions(processDefinition, execution, migrationDescriptor);
+ if (!(execution instanceof ExecutionImpl) || !(processDefinition instanceof ProcessDefinitionImpl))
+ return;
+ ((ExecutionImpl)execution).setProcessDefinition((ProcessDefinitionImpl)processDefinition);
+ String oldName = ((ExecutionImpl) execution).getActivityName();
+ if (oldName == null)
+ return;
+ String newName = migrationDescriptor.getNewName(MigrationDescriptor.ACTIVITY_TYPE, oldName);
+ if (newName == null)
+ newName = oldName;
+ Activity newActivity = ((ProcessDefinitionImpl) processDefinition).getActivity(newName);
+ if (newActivity != null) {
+ ((ExecutionImpl) execution).setActivity(newActivity);
+ } else {
+ throw new JbpmException("the activity " + newActivity + " could not be found in the new process definition.");
+ }
+ }
+
+ private static void logMigration(ProcessInstance processInstance, ProcessDefinition processDefinition) {
+ ProcessInstanceMigration processInstanceMigrate = new ProcessInstanceMigration(processInstance, processDefinition);
+ HistoryEvent.fire(processInstanceMigrate);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/DefaultMigrationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/InstanceMigrator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/InstanceMigrator.java 2009-10-15 22:59:55 UTC (rev 5746)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/InstanceMigrator.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -1,5 +1,6 @@
package org.jbpm.pvm.internal.migration;
+import java.util.ArrayList;
import java.util.List;
import org.jbpm.api.Execution;
@@ -7,24 +8,23 @@
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.ProcessInstanceQuery;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.history.HistoryEvent;
-import org.jbpm.pvm.internal.history.events.ProcessInstanceMigration;
-import org.jbpm.pvm.internal.model.Activity;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
+import org.jbpm.pvm.internal.util.ReflectUtil;
public class InstanceMigrator {
+ private static Log log = Log.getLog(InstanceMigrator.class.getName());
+
public static void migrateAll(ProcessDefinition processDefinition, MigrationDescriptor migrationDescriptor) {
- String oldVersionId = getOldVersionId(processDefinition.getName());
- ExecutionService executionService = (ExecutionService) EnvironmentImpl.getFromCurrent(ExecutionService.class);
- ProcessInstanceQuery processInstanceQuery = executionService
- .createProcessInstanceQuery()
- .processDefinitionId(oldVersionId);
- List<ProcessInstance> processInstances = processInstanceQuery.list();
+// String oldVersionId = getOldVersionId(processDefinition.getName());
+// ExecutionService executionService = (ExecutionService) EnvironmentImpl.getFromCurrent(ExecutionService.class);
+// ProcessInstanceQuery processInstanceQuery = executionService
+// .createProcessInstanceQuery()
+// .processDefinitionId(oldVersionId);
+// List<ProcessInstance> processInstances = processInstanceQuery.list();
+ List<ProcessInstance> processInstances = getProcessInstancesToMigrate(processDefinition.getName(), migrationDescriptor);
for (ProcessInstance processInstance : processInstances) {
migrateInstance(processDefinition, processInstance, migrationDescriptor);
}
@@ -34,44 +34,98 @@
ProcessDefinition processDefinition,
ProcessInstance processInstance,
MigrationDescriptor migrationDescriptor) {
- migrateExecutions(processDefinition, processInstance, migrationDescriptor);
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ for (String className : migrationDescriptor.getMigrationHandlerClassNames()) {
+ try {
+ Class<?> clazz = classLoader.loadClass(className);
+ MigrationHandler handler = (MigrationHandler)ReflectUtil.newInstance(clazz);
+ handler.migrateInstance(processDefinition, processInstance, migrationDescriptor);
+ } catch (ClassNotFoundException e) {
+ log.error("Class " + className + " not found on the classpath.", e);
+ }
+ }
+ //migrateExecutions(processDefinition, processInstance, migrationDescriptor);
// migrateSwimlanes(processInstance, migrationDescriptor);
// migrateVariables(processInstance, migrationDescriptor);
- logMigration(processInstance, processDefinition);
+ //logMigration(processInstance, processDefinition);
}
private static void migrateExecutions(ProcessDefinition processDefinition, Execution execution, MigrationDescriptor migrationDescriptor) {
+ migrateChildExecutions(processDefinition, execution, migrationDescriptor);
+// if (!(execution instanceof ExecutionImpl) || !(processDefinition instanceof ProcessDefinitionImpl))
+// return;
+// ((ExecutionImpl)execution).setProcessDefinition((ProcessDefinitionImpl)processDefinition);
+// String oldName = ((ExecutionImpl) execution).getActivityName();
+// if (oldName == null)
+// return;
+// String newName = migrationDescriptor.getNewName(MigrationDescriptor.ACTIVITY_TYPE, oldName);
+// if (newName == null)
+// return;
+// Activity newActivity = ((ProcessDefinitionImpl) processDefinition).getActivity(newName);
+// if (newActivity != null) {
+// ((ExecutionImpl) execution).setActivity(newActivity);
+// }
+ }
+
+ private static void migrateChildExecutions(ProcessDefinition processDefinition, Execution execution, MigrationDescriptor migrationDescriptor) {
for (Execution child : execution.getExecutions()) {
migrateExecutions(processDefinition, child, migrationDescriptor);
}
- if (!(execution instanceof ExecutionImpl) || !(processDefinition instanceof ProcessDefinitionImpl))
- return;
- ((ExecutionImpl)execution).setProcessDefinition((ProcessDefinitionImpl)processDefinition);
- String oldName = ((ExecutionImpl) execution).getActivityName();
- if (oldName == null)
- return;
- String newName = migrationDescriptor.getNewName(MigrationDescriptor.ACTIVITY_TYPE, oldName);
- if (newName == null)
- return;
- Activity newActivity = ((ProcessDefinitionImpl) processDefinition).getActivity(newName);
- if (newActivity != null) {
- ((ExecutionImpl) execution).setActivity(newActivity);
- }
}
- private static void logMigration(ProcessInstance processInstance, ProcessDefinition processDefinition) {
- ProcessInstanceMigration processInstanceMigrate = new ProcessInstanceMigration(processInstance, processDefinition);
- HistoryEvent.fire(processInstanceMigrate);
+// private static void logMigration(ProcessInstance processInstance, ProcessDefinition processDefinition) {
+// ProcessInstanceMigration processInstanceMigrate = new ProcessInstanceMigration(processInstance, processDefinition);
+// HistoryEvent.fire(processInstanceMigrate);
+// }
+
+ private static List<ProcessInstance> getProcessInstancesToMigrate(String processDefinitionName, MigrationDescriptor migrationDescriptor) {
+ List<ProcessInstance> result = new ArrayList<ProcessInstance>();
+ ExecutionService executionService = (ExecutionService) EnvironmentImpl.getFromCurrent(ExecutionService.class);
+ List<ProcessDefinition> processesToMigrate = getProcessesToMigrate(processDefinitionName, migrationDescriptor);
+ for (ProcessDefinition processDefinition : processesToMigrate) {
+ result.addAll(
+ executionService
+ .createProcessInstanceQuery()
+ .processDefinitionId(processDefinition.getId()).list());
+ }
+ return result;
}
- private static String getOldVersionId(String processDefinitionName) {
+ private static List<ProcessDefinition> getProcessesToMigrate(String processDefinitionName, MigrationDescriptor migrationDescriptor) {
RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
- ProcessDefinition process = repositorySession.createProcessDefinitionQuery().processDefinitionName(processDefinitionName).orderDesc(
- ProcessDefinitionQuery.PROPERTY_VERSION).page(1, 1).uniqueResult();
- if (process != null) {
- return process.getId();
+ List<ProcessDefinition> processDefinitions = repositorySession
+ .createProcessDefinitionQuery()
+ .processDefinitionName(processDefinitionName)
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .list();
+ int startIndex = calculateStartIndex(processDefinitions.size() - 1, migrationDescriptor);
+ int endIndex = calculateEndIndex(processDefinitions.size() - 1, migrationDescriptor);
+ if (startIndex > endIndex) startIndex = endIndex;
+ return processDefinitions.subList(startIndex, endIndex);
+ }
+
+ private static int calculateStartIndex(int max, MigrationDescriptor migrationDescriptor) {
+ int result = max - 1;
+ if (migrationDescriptor.getStartVersion() != -1) {
+ result = migrationDescriptor.getStartVersion() - 1;
+ } else if (migrationDescriptor.getStartOffset() != -1) {
+ result = max - migrationDescriptor.getStartOffset();
}
- return null;
+ if (result < 0) result = 0;
+ if (result > max - 1) result = max - 1;
+ return result;
}
-
+
+ private static int calculateEndIndex(int max, MigrationDescriptor migrationDescriptor) {
+ int result = max;
+ if (migrationDescriptor.getEndVersion() != -1) {
+ result = migrationDescriptor.getEndVersion();
+ } else if (migrationDescriptor.getEndOffset() != -1) {
+ result = max - migrationDescriptor.getEndOffset() + 1;
+ }
+ if (result < 1) result = 1;
+ if (result > max - 1) result = max;
+ return result;
+ }
+
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationDescriptor.java 2009-10-15 22:59:55 UTC (rev 5746)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationDescriptor.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -1,6 +1,8 @@
package org.jbpm.pvm.internal.migration;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
public class MigrationDescriptor {
@@ -10,6 +12,13 @@
public static final String SWIMLANE_TYPE = "org.jbpm.pvm.internal.migration.swimlane";
private Map<String, Map<String, String>> migrationMap = new HashMap<String, Map<String, String>>();
+ private List<String> migrationHandlerClassNames = new ArrayList<String>();
+
+ private int startOffset = -1;
+ private int endOffset = -1;
+
+ private int startVersion = -1;
+ private int endVersion = -1;
public void addMigrationElement(String type, String oldName, String newName) {
Map<String, String> typeMap = migrationMap.get(type);
@@ -28,5 +37,45 @@
}
return result;
}
+
+ public void addMigrationHandlerClassName(String className) {
+ migrationHandlerClassNames.add(className);
+ }
+
+ public List<String> getMigrationHandlerClassNames() {
+ return migrationHandlerClassNames;
+ }
+
+ public int getStartOffset() {
+ return startOffset;
+ }
+
+ public void setStartOffset(int startOffset) {
+ this.startOffset = startOffset;
+ }
+
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+ public void setEndOffset(int endOffset) {
+ this.endOffset = endOffset;
+ }
+
+ public int getStartVersion() {
+ return startVersion;
+ }
+
+ public void setStartVersion(int startVersion) {
+ this.startVersion = startVersion;
+ }
+
+ public int getEndVersion() {
+ return endVersion;
+ }
+
+ public void setEndVersion(int endVersion) {
+ this.endVersion = endVersion;
+ }
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationHandler.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationHandler.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -0,0 +1,14 @@
+package org.jbpm.pvm.internal.migration;
+
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessInstance;
+
+
+public interface MigrationHandler {
+
+ void migrateInstance(
+ ProcessDefinition newProcessDefinition,
+ ProcessInstance processInstance,
+ MigrationDescriptor migrationDescriptor);
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/migration/MigrationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java 2009-10-15 22:59:55 UTC (rev 5746)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -1,94 +0,0 @@
-package org.jbpm.test.migration;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.test.JbpmTestCase;
-
-
-public class InstanceMigratorTest extends JbpmTestCase {
-
- private String firstVersion =
- "<process name='foobar'>" +
- " <start>" +
- " <transition to='foo'/>" +
- " </start>" +
- " <state name='foo'>" +
- " <transition to='bar'/>" +
- " </state>" +
- " <state name='bar'>" +
- " <transition to='end'/>" +
- " </state>" +
- " <end name='end'/>" +
- "</process>";
-
- private String secondVersion =
- "<process name='foobar'>" +
- " <start>" +
- " <transition to='foo'/>" +
- " </start>" +
- " <state name='foo'>" +
- " <transition to='fu'/>" +
- " </state>" +
- " <state name='fu'>" +
- " <transition name='to end' to='end'/>" +
- " <transition name='to baz' to='baz'/>" +
- " </state>" +
- " <state name='baz'>" +
- " <transition to='end'/>" +
- " </state>" +
- " <end name='end'/>" +
- " <migrate-instances>" +
- " <activity-mapping old-name='bar' new-name='fu'/>" +
- " </migrate-instances>" +
- "</process>";
-
-
- public void testSimpleMigration() {
- String deploymentId1 = repositoryService.createDeployment()
- .addResourceFromString("foobar.jpdl.xml", firstVersion)
- .deploy();
- ProcessDefinition processDefinition1 = repositoryService
- .createProcessDefinitionQuery()
- .deploymentId(deploymentId1)
- .uniqueResult();
- Execution execution = executionService
- .startProcessInstanceById(processDefinition1.getId())
- .findActiveExecutionIn("foo");
- executionService.signalExecutionById(execution.getId());
- ProcessInstance processInstance1 = executionService
- .createProcessInstanceQuery()
- .processDefinitionId(processDefinition1.getId())
- .uniqueResult();
- execution = processInstance1.findActiveExecutionIn("bar");
- assertNotNull(execution);
-
- String deploymentId2 = repositoryService.createDeployment()
- .addResourceFromString("foobar.jpdl.xml", secondVersion)
- .deploy();
- ProcessDefinition processDefinition2 = repositoryService
- .createProcessDefinitionQuery()
- .deploymentId(deploymentId2)
- .uniqueResult();
- ProcessInstance processInstance2 = executionService
- .createProcessInstanceQuery()
- .processDefinitionId(processDefinition2.getId())
- .uniqueResult();
- execution = processInstance2.findActiveExecutionIn("fu");
- assertNotNull(execution);
-
- executionService.signalExecutionById(execution.getId(), "to baz");
-
- processInstance2 = executionService
- .createProcessInstanceQuery()
- .processDefinitionId(processDefinition2.getId())
- .uniqueResult();
- execution = processInstance2.findActiveExecutionIn("baz");
- assertNotNull(execution);
-
- repositoryService.deleteDeploymentCascade(deploymentId2);
- repositoryService.deleteDeploymentCascade(deploymentId1);
-
- }
-
-}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java 2009-10-16 02:31:43 UTC (rev 5747)
@@ -0,0 +1,437 @@
+package org.jbpm.test.migration;
+
+import java.util.HashSet;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.pvm.internal.migration.MigrationDescriptor;
+import org.jbpm.pvm.internal.migration.MigrationHandler;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class InstanceMigratorTest extends JbpmTestCase {
+
+ private String originalVersion =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ "</process>";
+
+ private String versionWithMigrationHandler =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances action='custom'>" +
+ " <migration-handler class='org.jbpm.test.migration.InstanceMigratorTest$TestHandler'/>" +
+ " </migrate-instances>" +
+ "</process>";
+
+ private String versionWithSimpleAbortion =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances action='abort'/>" +
+ "</process>";
+
+ private String versionWithSimpleMigration =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances/>" +
+ "</process>";
+
+ private String versionWithCorrectMappings =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='d'/>" +
+ " </state>" +
+ " <state name='d'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances>" +
+ " <activity-mapping old-name='b' new-name='a'/>" +
+ " <activity-mapping old-name='c' new-name='d'/>" +
+ " </migrate-instances>" +
+ "</process>";
+
+ private String versionWithIncorrectMappings =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='d'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances>" +
+ " <activity-mapping old-name='a' new-name='z'/>" +
+ " <activity-mapping old-name='b' new-name='c'/>" +
+ " </migrate-instances>" +
+ "</process>";
+
+ private String versionWithAbsoluteVersionRange =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances versions='2..3'/>" +
+ "</process>";
+
+ private String versionWithRelativeVersionRange =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances versions='x-2..x'/>" +
+ "</process>";
+
+ private String versionWithMixedVersionRange =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances versions='1..x-3'/>" +
+ "</process>";
+
+ private String versionWithWildcardVersionRange =
+ "<process name='foobar'>" +
+ " <start>" +
+ " <transition to='a'/>" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'/>" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c'/>" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='end'/>" +
+ " </state>" +
+ " <end name='end'/>" +
+ " <migrate-instances versions='*'/>" +
+ "</process>";
+
+ private static HashSet<String> PROCESS_INSTANCES_SET = new HashSet<String>();
+
+ public static class TestHandler implements MigrationHandler {
+ public void migrateInstance(
+ ProcessDefinition processDefinition,
+ ProcessInstance processInstance,
+ MigrationDescriptor migrationDescriptor) {
+ PROCESS_INSTANCES_SET.add(processInstance.getId());
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ PROCESS_INSTANCES_SET.clear();
+ super.tearDown();
+ }
+
+
+ private ProcessDefinition deployProcessDefinition(String name, String processDefinitionXml) {
+ String deploymentId = repositoryService
+ .createDeployment()
+ .addResourceFromString(name + ".jpdl.xml", processDefinitionXml)
+ .deploy();
+ return repositoryService
+ .createProcessDefinitionQuery()
+ .deploymentId(deploymentId)
+ .uniqueResult();
+ }
+
+ private ProcessInstance startAndSignal(ProcessDefinition processDefinition, String endActivityName) {
+ ProcessInstance result = executionService
+ .startProcessInstanceById(processDefinition.getId());
+ while (result.findActiveExecutionIn(endActivityName) == null) {
+ result = executionService.signalExecutionById(result.getId());
+ }
+ return result;
+ }
+
+
+ public void testNoMigration() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessInstance pi2 = startAndSignal(pd1, "b");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", originalVersion);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ assertEquals(pd1.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd1.getId(), pi2.getProcessDefinitionId());
+ assertTrue(pi1.findActiveActivityNames().contains("a"));
+ assertTrue(pi2.findActiveActivityNames().contains("b"));
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ }
+
+ public void testMigrationHandler() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessInstance pi2 = startAndSignal(pd1, "b");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", versionWithMigrationHandler);
+ assertTrue(PROCESS_INSTANCES_SET.contains(pi1.getId()));
+ assertTrue(PROCESS_INSTANCES_SET.contains(pi2.getId()));
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ }
+
+ public void testSimpleAbortion() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessInstance pi2 = startAndSignal(pd1, "b");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", versionWithSimpleAbortion);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ assertNull(pi1);
+ assertNull(pi2);
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ }
+
+ public void testSimpleMigration() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessInstance pi2 = startAndSignal(pd1, "b");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", versionWithSimpleMigration);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ assertEquals(pd2.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd2.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pi1, pi1.findActiveExecutionIn("a"));
+ assertEquals(pi2, pi2.findActiveExecutionIn("b"));
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ }
+
+ public void testCorrectlyMappedMigration() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessInstance pi2 = startAndSignal(pd1, "b");
+ ProcessInstance pi3 = startAndSignal(pd1, "c");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", versionWithCorrectMappings);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ assertEquals(pd2.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd2.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pd2.getId(), pi3.getProcessDefinitionId());
+ assertEquals(pi1, pi1.findActiveExecutionIn("a"));
+ assertEquals(pi2, pi2.findActiveExecutionIn("a"));
+ assertEquals(pi3, pi3.findActiveExecutionIn("d"));
+ pi1 = executionService.signalExecutionById(pi1.getId());
+ pi2 = executionService.signalExecutionById(pi2.getId());
+ pi2 = executionService.signalExecutionById(pi2.getId());
+ pi3 = executionService.signalExecutionById(pi3.getId());
+ assertEquals(pi1, pi1.findActiveExecutionIn("b"));
+ assertEquals(pi2, pi2.findActiveExecutionIn("c"));
+ assertTrue(pi3.isEnded());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ assertNull(pi3);
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ }
+
+ public void testIncorrectlyMappedMigration() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ startAndSignal(pd1, "a");
+ startAndSignal(pd1, "b");
+ try {
+ deployProcessDefinition("foobar", versionWithIncorrectMappings);
+ fail();
+ } catch (JbpmException e) {
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ }
+ }
+
+ public void testAbsoluteVersionRange() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi2 = startAndSignal(pd2, "a");
+ ProcessDefinition pd3 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi3 = startAndSignal(pd3, "a");
+ ProcessDefinition pd4 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi4 = startAndSignal(pd4, "a");
+ ProcessDefinition pd5 = deployProcessDefinition("foobar", versionWithAbsoluteVersionRange);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ pi4 = executionService.findProcessInstanceById(pi4.getId());
+ assertEquals(pd1.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi3.getProcessDefinitionId());
+ assertEquals(pd4.getId(), pi4.getProcessDefinitionId());
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd3.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd4.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd5.getDeploymentId());
+ }
+
+ public void testRelativeVersionRange() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi2 = startAndSignal(pd2, "a");
+ ProcessDefinition pd3 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi3 = startAndSignal(pd3, "a");
+ ProcessDefinition pd4 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi4 = startAndSignal(pd4, "a");
+ ProcessDefinition pd5 = deployProcessDefinition("foobar", versionWithRelativeVersionRange);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ pi4 = executionService.findProcessInstanceById(pi4.getId());
+ assertEquals(pd1.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd2.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi3.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi4.getProcessDefinitionId());
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd3.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd4.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd5.getDeploymentId());
+ }
+
+ public void testMixedVersionRange() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi2 = startAndSignal(pd2, "a");
+ ProcessDefinition pd3 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi3 = startAndSignal(pd3, "a");
+ ProcessDefinition pd4 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi4 = startAndSignal(pd4, "a");
+ ProcessDefinition pd5 = deployProcessDefinition("foobar", versionWithMixedVersionRange);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ pi4 = executionService.findProcessInstanceById(pi4.getId());
+ assertEquals(pd5.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pd3.getId(), pi3.getProcessDefinitionId());
+ assertEquals(pd4.getId(), pi4.getProcessDefinitionId());
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd3.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd4.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd5.getDeploymentId());
+ }
+
+ public void testWildcardVersionRange() {
+ ProcessDefinition pd1 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi1 = startAndSignal(pd1, "a");
+ ProcessDefinition pd2 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi2 = startAndSignal(pd2, "a");
+ ProcessDefinition pd3 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi3 = startAndSignal(pd3, "a");
+ ProcessDefinition pd4 = deployProcessDefinition("foobar", originalVersion);
+ ProcessInstance pi4 = startAndSignal(pd4, "a");
+ ProcessDefinition pd5 = deployProcessDefinition("foobar", versionWithWildcardVersionRange);
+ pi1 = executionService.findProcessInstanceById(pi1.getId());
+ pi2 = executionService.findProcessInstanceById(pi2.getId());
+ pi3 = executionService.findProcessInstanceById(pi3.getId());
+ pi4 = executionService.findProcessInstanceById(pi4.getId());
+ assertEquals(pd5.getId(), pi1.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi2.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi3.getProcessDefinitionId());
+ assertEquals(pd5.getId(), pi4.getProcessDefinitionId());
+ repositoryService.deleteDeploymentCascade(pd1.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd2.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd3.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd4.getDeploymentId());
+ repositoryService.deleteDeploymentCascade(pd5.getDeploymentId());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5746 - jbpm3/tags.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-15 18:59:55 -0400 (Thu, 15 Oct 2009)
New Revision: 5746
Added:
jbpm3/tags/jbpm-3.2.7.GA/
Log:
[JBPM-2037] Release jBPM 3.2.7.GA
Copied: jbpm3/tags/jbpm-3.2.7.GA (from rev 5745, jbpm3/tags/jbpm-3.2.7.CR3)
16 years, 6 months
JBoss JBPM SVN: r5745 - in jbpm4/trunk/modules: test-cactus/src/test/java/org/jbpm/test and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-15 10:09:10 -0400 (Thu, 15 Oct 2009)
New Revision: 5745
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/UserTransactionTest.java
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/AllIntegrationTests.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskAssigneeTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
Log:
JBPM-2524 enable user domain integration
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-10-15 07:43:28 UTC (rev 5744)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-10-15 14:09:10 UTC (rev 5745)
@@ -708,4 +708,38 @@
</para>
</section>
+ <section>
+ <title>Transactions</title>
+ <section>
+ <title>Standalone transactions</title>
+ <para>TODO</para>
+ </section>
+ <section>
+ <title>JTA transactions</title>
+ <para>TODO</para>
+ </section>
+ <section>
+ <title>User transactions</title>
+ <para>In your project you might have user domain objects
+ like e.g. an Order or Claim object in your project mapped with hibernate.
+ This section explains how to combine updates to user domain objects
+ with jBPM operations in a single transaction.
+ </para>
+ <para>Here's an example of a user command:</para>
+ <programlisting>public class MyUserCommand implements Command<Void> {
+ public Void execute(Environment environment) throws Exception {
+ // your user domain objects
+
+ // an example jBPM operation
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.signalExecutionById(executionId);
+
+ return null;
+ }
+}</programlisting>
+ <para>Then such commands can be executed by the ProcessEngine:</para>
+ <programlisting>processEngine.execute(new MyUserCommand());</programlisting>
+ </section>
+ </section>
+
</chapter>
Modified: jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/AllIntegrationTests.java
===================================================================
--- jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/AllIntegrationTests.java 2009-10-15 07:43:28 UTC (rev 5744)
+++ jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/AllIntegrationTests.java 2009-10-15 14:09:10 UTC (rev 5745)
@@ -116,6 +116,7 @@
suite.addTestSuite(org.jbpm.test.task.TaskVariablesTest.class);
suite.addTestSuite(org.jbpm.test.timer.TaskTimerTaskTest.class);
suite.addTestSuite(org.jbpm.test.timer.TimerTest.class);
+ suite.addTestSuite(org.jbpm.test.usertx.UserTransactionTest.class);
suite.addTestSuite(org.jbpm.test.variables.BasicVariablesTest.class);
suite.addTestSuite(org.jbpm.test.variables.VariableBasicTypesTest.class);
suite.addTestSuite(org.jbpm.test.variables.VariableExpressionTest.class);
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskAssigneeTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskAssigneeTest.java 2009-10-15 07:43:28 UTC (rev 5744)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskAssigneeTest.java 2009-10-15 14:09:10 UTC (rev 5745)
@@ -21,7 +21,6 @@
*/
package org.jbpm.test.history;
-import org.jbpm.api.Execution;
import org.jbpm.api.history.HistoryActivityInstance;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-10-15 07:43:28 UTC (rev 5744)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-10-15 14:09:10 UTC (rev 5745)
@@ -23,11 +23,9 @@
import java.util.List;
-import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
-import org.jbpm.api.task.Task;
import org.jbpm.test.JbpmTestCase;
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/UserTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/UserTransactionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/UserTransactionTest.java 2009-10-15 14:09:10 UTC (rev 5745)
@@ -0,0 +1,256 @@
+/*
+ * 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.test.usertx;
+
+import java.util.List;
+
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.listener.EventListener;
+import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UserTransactionTest extends JbpmTestCase {
+
+ public static class TaskSignalCmd implements Command<Void> {
+ private static final long serialVersionUID = 1L;
+ String executionId;
+ public TaskSignalCmd(String executionId) {
+ this.executionId = executionId;
+ }
+ public Void execute(Environment environment) throws Exception {
+ TaskService taskService = environment.get(TaskService.class);
+ Task task = taskService.newTask();
+ taskService.saveTask(task);
+
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.signalExecutionById(executionId);
+
+ return null;
+ }
+ }
+
+ public void testUserTransaction() {
+ deployJpdlXmlString(
+ "<process name='UserTransaction'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b' />" +
+ " </state>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ processEngine.execute(new Command<Void>() {
+ private static final long serialVersionUID = 1L;
+ public Void execute(Environment environment) throws Exception {
+ TaskService taskService = environment.get(TaskService.class);
+ Task task = taskService.newTask();
+ taskService.saveTask(task);
+
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.startProcessInstanceByKey("UserTransaction");
+
+ return null;
+ }
+ });
+
+ List<Task> taskList = taskService.createTaskQuery().list();
+ assertEquals(1, taskList.size());
+
+ List<ProcessInstance> processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ ProcessInstance processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("a"));
+
+ processEngine.execute(new TaskSignalCmd(processInstance.getId()));
+
+ taskList = taskService.createTaskQuery().list();
+ assertEquals(2, taskList.size());
+
+ processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("b"));
+
+ // delete tasks
+ for (Task task: taskService.createTaskQuery().list()) {
+ taskService.deleteTaskCascade(task.getId());
+ }
+ }
+
+ public static class Thrower implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) throws Exception {
+ throw new Exception("regards from inside process execution");
+ }
+ }
+
+ public void testUserTransactionWithProcessException() {
+ deployJpdlXmlString(
+ "<process name='UserTransactionWithProcessException'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b'>" +
+ " <event-listener class='"+Thrower.class.getName()+"' />" +
+ " </transition>" +
+ " </state>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ processEngine.execute(new Command<Void>() {
+ private static final long serialVersionUID = 1L;
+ public Void execute(Environment environment) throws Exception {
+ TaskService taskService = environment.get(TaskService.class);
+ Task task = taskService.newTask();
+ taskService.saveTask(task);
+
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.startProcessInstanceByKey("UserTransactionWithProcessException");
+
+ return null;
+ }
+ });
+
+ List<Task> taskList = taskService.createTaskQuery().list();
+ assertEquals(1, taskList.size());
+
+ List<ProcessInstance> processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ ProcessInstance processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("a"));
+
+ try {
+ processEngine.execute(new TaskSignalCmd(processInstance.getId()));
+ fail("expected exception");
+ } catch (Exception e) {
+ // OK
+ }
+
+ taskList = taskService.createTaskQuery().list();
+ assertEquals(1, taskList.size());
+
+ processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("a"));
+
+ // delete tasks
+ for (Task task: taskService.createTaskQuery().list()) {
+ taskService.deleteTaskCascade(task.getId());
+ }
+ }
+
+ public static class SignalWithUserExceptionCmd implements Command<Void> {
+ private static final long serialVersionUID = 1L;
+ String executionId;
+ public SignalWithUserExceptionCmd(String executionId) {
+ this.executionId = executionId;
+ }
+ public Void execute(Environment environment) throws Exception {
+ TaskService taskService = environment.get(TaskService.class);
+ Task task = taskService.newTask();
+ taskService.saveTask(task);
+
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.signalExecutionById(executionId);
+
+ throw new RuntimeException("regards from inside user command");
+ }
+ }
+
+ public void testUserTransactionWithUserException() {
+ deployJpdlXmlString(
+ "<process name='UserTransaction'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b' />" +
+ " </state>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ processEngine.execute(new Command<Void>() {
+ private static final long serialVersionUID = 1L;
+ public Void execute(Environment environment) throws Exception {
+ TaskService taskService = environment.get(TaskService.class);
+ Task task = taskService.newTask();
+ taskService.saveTask(task);
+
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ executionService.startProcessInstanceByKey("UserTransaction");
+
+ return null;
+ }
+ });
+
+ List<Task> taskList = taskService.createTaskQuery().list();
+ assertEquals(1, taskList.size());
+
+ List<ProcessInstance> processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ ProcessInstance processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("a"));
+
+ try {
+ processEngine.execute(new SignalWithUserExceptionCmd(processInstance.getId()));
+ fail("expected exception");
+ } catch (Exception e) {
+ // OK
+ }
+
+ taskList = taskService.createTaskQuery().list();
+ assertEquals(1, taskList.size());
+
+ processInstanceList = executionService.createProcessInstanceQuery().list();
+ assertEquals(1, processInstanceList.size());
+
+ processInstance = processInstanceList.get(0);
+ assertTrue(processInstance.isActive("a"));
+
+ // delete tasks
+ for (Task task: taskService.createTaskQuery().list()) {
+ taskService.deleteTaskCascade(task.getId());
+ }
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/usertx/UserTransactionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5744 - in jbpm3/branches/jbpm-3.2-soa: hudson and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-15 03:43:28 -0400 (Thu, 15 Oct 2009)
New Revision: 5744
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml
jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
Log:
[JBPM-2582] put correct delimiters in sql scripts;
switch to jconnect as jtds does not inform correctly about foreign keys
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-10-15 07:43:15 UTC (rev 5743)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-10-15 07:43:28 UTC (rev 5744)
@@ -61,7 +61,7 @@
#
cd $JBPMDIR
export JAVA_HOME=$JAVA_BT_HOME
-MVN_CMD="mvn -U $MVN_OPTS -Pdistro,soa,update clean install"
+MVN_CMD="mvn -U $MVN_OPTS -Pdistro,soa clean install"
echo $MVN_CMD; $MVN_CMD; MVN_STATUS=$?
if [ $MVN_STATUS -ne 0 ]; then
echo maven exit status $MVN_STATUS
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml 2009-10-15 07:43:15 UTC (rev 5743)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml 2009-10-15 07:43:28 UTC (rev 5744)
@@ -1,5 +1,8 @@
-<profilesXml xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
+<?xml version="1.0"?>
+<profilesXml
+ xmlns="http://maven.apache.org/PROFILES/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
<profiles>
<profile>
<id>qa-local</id>
@@ -13,46 +16,46 @@
<properties>
<jdbc.db2.server>localhost</jdbc.db2.server>
<jdbc.db2.port>50000</jdbc.db2.port>
- <jdbc.db2.database>jbpmtest</jdbc.db2.database>
+ <jdbc.db2.database>jbpm3</jdbc.db2.database>
<jdbc.db2.url>jdbc:db2://${jdbc.db2.server}:${jdbc.db2.port}/${jdbc.db2.database}</jdbc.db2.url>
- <jdbc.db2.username>jbpmtest</jdbc.db2.username>
- <jdbc.db2.password>jbpmtest</jdbc.db2.password>
+ <jdbc.db2.username>jbpm3</jdbc.db2.username>
+ <jdbc.db2.password>jbpm3</jdbc.db2.password>
<jdbc.mssql.server>localhost</jdbc.mssql.server>
<jdbc.mssql.port>3918</jdbc.mssql.port>
- <jdbc.mssql.database>jbpmtest</jdbc.mssql.database>
+ <jdbc.mssql.database>jbpm3</jdbc.mssql.database>
<jdbc.mssql.url>jdbc:sqlserver://${jdbc.mssql.server}:${jdbc.mssql.port};databaseName=${jdbc.mssql.database}</jdbc.mssql.url>
- <jdbc.mssql.username>jbpmtest</jdbc.mssql.username>
- <jdbc.mssql.password>jbpmtest</jdbc.mssql.password>
+ <jdbc.mssql.username>jbpm3</jdbc.mssql.username>
+ <jdbc.mssql.password>jbpm3</jdbc.mssql.password>
<jdbc.mysql.server>localhost</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
- <jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
+ <jdbc.mysql.database>jbpm3</jdbc.mysql.database>
<jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
- <jdbc.mysql.username>jbpmtest</jdbc.mysql.username>
- <jdbc.mysql.password></jdbc.mysql.password>
+ <jdbc.mysql.username>jbpm3</jdbc.mysql.username>
+ <jdbc.mysql.password>jbpm3</jdbc.mysql.password>
<jdbc.oracle.server>localhost</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
<jdbc.oracle.database>XE</jdbc.oracle.database>
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
- <jdbc.oracle.username>jbpmtest</jdbc.oracle.username>
- <jdbc.oracle.password>jbpmtest</jdbc.oracle.password>
+ <jdbc.oracle.username>jbpm3</jdbc.oracle.username>
+ <jdbc.oracle.password>jbpm3</jdbc.oracle.password>
<jdbc.postgresql.server>localhost</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
- <jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
+ <jdbc.postgresql.database>jbpm3</jdbc.postgresql.database>
<jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
- <jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
- <jdbc.postgresql.password></jdbc.postgresql.password>
+ <jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
+ <jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
<jdbc.sybase.server>localhost</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
- <jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
- <jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
- <jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
- <jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
+ <jdbc.sybase.database>jbpm3</jdbc.sybase.database>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
+ <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
+ <jdbc.sybase.password>jbpm3</jdbc.sybase.password>
+ <jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
</properties>
</profile>
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml 2009-10-15 07:43:15 UTC (rev 5743)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml 2009-10-15 07:43:28 UTC (rev 5744)
@@ -1,5 +1,8 @@
-<profilesXml xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
+<?xml version="1.0"?>
+<profilesXml
+ xmlns="http://maven.apache.org/PROFILES/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
<profiles>
<profile>
<id>qa-redhat</id>
@@ -49,10 +52,10 @@
<jdbc.sybase.server>vmg07.mw.lab.eng.bos.redhat.com</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpm3</jdbc.sybase.database>
- <jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
<jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
<jdbc.sybase.password>jbpm3xa</jdbc.sybase.password>
- <jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
+ <jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
</properties>
</profile>
Modified: jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2009-10-15 07:43:15 UTC (rev 5743)
+++ jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2009-10-15 07:43:28 UTC (rev 5744)
@@ -1,9 +1,10 @@
-<profilesXml xmlns="http://maven.apache.org/POM/4.0.0"
+<?xml version="1.0"?>
+<profilesXml
+ xmlns="http://maven.apache.org/PROFILES/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/profiles-1.0.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
<profiles>
- <!-- This profile can also be defined in ~/.m2/settings.xml -->
+ <!-- This profile can also be defined in ~/.m2/settings.xml -->
<profile>
<id>dev-local</id>
@@ -20,10 +21,10 @@
<jdbc.db2.server>localhost</jdbc.db2.server>
<jdbc.db2.port>50000</jdbc.db2.port>
- <jdbc.db2.database>jbpmtest</jdbc.db2.database>
+ <jdbc.db2.database>jbpm3</jdbc.db2.database>
<jdbc.db2.url>jdbc:db2://${jdbc.db2.server}:${jdbc.db2.port}/${jdbc.db2.database}</jdbc.db2.url>
- <jdbc.db2.username>jbpmtest</jdbc.db2.username>
- <jdbc.db2.password>jbpmtest</jdbc.db2.password>
+ <jdbc.db2.username>jbpm3</jdbc.db2.username>
+ <jdbc.db2.password>jbpm3</jdbc.db2.password>
<jdbc.db2.driver>com.ibm.db2.jcc.DB2Driver</jdbc.db2.driver>
<jdbc.mssql.server>dev30.qa.atl.jboss.com</jdbc.mssql.server>
@@ -36,35 +37,35 @@
<jdbc.mysql.server>localhost</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
- <jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
+ <jdbc.mysql.database>jbpm3</jdbc.mysql.database>
<jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
- <jdbc.mysql.username>jbpmtest</jdbc.mysql.username>
- <jdbc.mysql.password>jbpmtest</jdbc.mysql.password>
+ <jdbc.mysql.username>jbpm3</jdbc.mysql.username>
+ <jdbc.mysql.password>jbpm3</jdbc.mysql.password>
<jdbc.mysql.driver>com.mysql.jdbc.Driver</jdbc.mysql.driver>
<jdbc.oracle.server>localhost</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
<jdbc.oracle.database>XE</jdbc.oracle.database>
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
- <jdbc.oracle.username>jbpmtest</jdbc.oracle.username>
- <jdbc.oracle.password>jbpmtest</jdbc.oracle.password>
+ <jdbc.oracle.username>jbpm3</jdbc.oracle.username>
+ <jdbc.oracle.password>jbpm3</jdbc.oracle.password>
<jdbc.oracle.driver>oracle.jdbc.driver.OracleDriver</jdbc.oracle.driver>
<jdbc.postgresql.server>localhost</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
- <jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
+ <jdbc.postgresql.database>jbpm3</jdbc.postgresql.database>
<jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
- <jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
- <jdbc.postgresql.password>jbpmtest</jdbc.postgresql.password>
+ <jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
+ <jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
<jdbc.postgresql.driver>org.postgresql.Driver</jdbc.postgresql.driver>
<jdbc.sybase.server>localhost</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
- <jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
- <jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
- <jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
- <jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
+ <jdbc.sybase.database>jbpm3</jdbc.sybase.database>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
+ <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
+ <jdbc.sybase.password>jbpm3</jdbc.sybase.password>
+ <jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
<altDeploymentRepository>repository.jboss.org::default::file:${user.home}/jbpm/repository</altDeploymentRepository>
16 years, 6 months
JBoss JBPM SVN: r5743 - in jbpm3/branches/jbpm-3.2-soa/modules: core/src/main/java/org/jbpm/db and 4 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-15 03:43:15 -0400 (Thu, 15 Oct 2009)
New Revision: 5743
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/StartJBossTask.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/jpdl/xml/JpdlXmlWriter.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/IoUtil.java
jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
Log:
[JBPM-2582] put correct delimiters in sql scripts;
switch to jconnect as jtds does not inform correctly about foreign keys
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java 2009-10-15 07:43:15 UTC (rev 5743)
@@ -30,9 +30,11 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.SQLExec.DelimiterType;
import org.hibernate.cfg.Configuration;
import org.jbpm.db.JbpmSchema;
+import org.jbpm.util.IoUtil;
public class JbpmSchemaTask extends Task {
@@ -40,7 +42,8 @@
String properties;
String action = "create";
String output;
- String delimiter;
+ String delimiter = ";";
+ String delimiterType = DelimiterType.NORMAL;
public void execute() throws BuildException {
// Create schema tool
@@ -93,7 +96,8 @@
Configuration configuration = AntHelper.getConfiguration(config, properties);
JbpmSchema jbpmSchema = new JbpmSchema(configuration);
- jbpmSchema.setDelimiter(delimiter);
+ jbpmSchema.setDelimiter(DelimiterType.ROW.equals(delimiterType) ? IoUtil.lineSeparator
+ + delimiter : delimiter);
return jbpmSchema;
}
@@ -123,6 +127,10 @@
this.delimiter = delimiter;
}
+ public void setDelimiterType(DelimiterType delimiterType) {
+ this.delimiterType = delimiterType.getValue();
+ }
+
public void setOutput(String output) {
this.output = output;
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/StartJBossTask.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/StartJBossTask.java 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/StartJBossTask.java 2009-10-15 07:43:15 UTC (rev 5743)
@@ -21,45 +21,45 @@
*/
package org.jbpm.ant;
+import java.io.File;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
public class StartJBossTask extends Task {
-
+
private static final String END_MESSAGE = " Started in ";
-
+
String configuration = null;
public void execute() throws BuildException {
try {
// get some environment variableInstances
- String fileSeparator = System.getProperty( "file.separator" );
- String jbossHome = getProject().getProperty( "jboss.home" );
- String os = getProject().getProperty( "os.name" ).toLowerCase();
-
+ char fileSeparator = File.separatorChar;
+ boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+
// build the command string
- String command = null;
- if ( os.indexOf( "windows" ) != -1 ) {
- command = jbossHome + fileSeparator + "bin" + fileSeparator + "run.bat " + getConfigParameter();
- } else if ( os.indexOf( "linux" ) != -1 ) {
- command = jbossHome + fileSeparator + "bin" + fileSeparator + "run.sh " + getConfigParameter();
- } else {
- throw new BuildException( "os '" + os + "' not supported in the startjboss task." );
- }
+ String command = getProject().getProperty("jboss.home")
+ + fileSeparator
+ + "bin"
+ + fileSeparator
+ + (isWindows ? "run.bat" : "run.sh")
+ + getConfigParameter();
// launch the command and wait till the END_MESSAGE appears
Thread launcher = new Launcher(this, command, END_MESSAGE);
launcher.start();
launcher.join();
-
- } catch (Exception e) {
+
+ }
+ catch (Exception e) {
e.printStackTrace();
}
}
-
+
String getConfigParameter() {
- if (configuration==null) return "";
- return "-c "+configuration;
+ if (configuration == null) return "";
+ return "-c " + configuration;
}
public void setConfiguration(String configuration) {
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-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java 2009-10-15 07:43:15 UTC (rev 5743)
@@ -58,6 +58,7 @@
import org.hibernate.util.JDBCExceptionReporter;
import org.jbpm.JbpmException;
+import org.jbpm.util.IoUtil;
/**
* utilities for the jBPM database schema.
@@ -244,11 +245,10 @@
}
public void writeSql(Writer writer, String[] script) throws IOException {
- String lineSeparator = System.getProperty("line.separator");
for (int i = 0; i < script.length; i++) {
writer.write(script[i]);
if (delimiter != null) writer.write(delimiter);
- writer.write(lineSeparator);
+ writer.write(IoUtil.lineSeparator);
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlWriter.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlWriter.java 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlWriter.java 2009-10-15 07:43:15 UTC (rev 5743)
@@ -47,6 +47,7 @@
import org.jbpm.graph.node.ProcessFactory;
import org.jbpm.graph.node.StartState;
import org.jbpm.jpdl.JpdlException;
+import org.jbpm.util.IoUtil;
/**
* Class for writing process definitions to character streams.
@@ -115,8 +116,8 @@
private Document createDomTree(ProcessDefinition processDefinition) {
Document document = DocumentHelper.createDocument();
- Element root = null;
+ Element root;
if (useNamespace)
root = document.addElement("process-definition", jbpmNamespace.getURI());
else
@@ -144,7 +145,7 @@
writeActions(root, namedProcessActions);
}
- root.addText(System.getProperty("line.separator"));
+ root.addText(IoUtil.lineSeparator);
return document;
}
@@ -253,7 +254,7 @@
}
private void writeComment(Element element, String comment) {
- element.addText(System.getProperty("line.separator"));
+ element.addText(IoUtil.lineSeparator);
element.addComment(" " + comment + " ");
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/IoUtil.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2009-10-15 07:43:15 UTC (rev 5743)
@@ -25,11 +25,20 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
public class IoUtil {
- private static final int BUFFERSIZE = 4096;
+ private static final int BUFFER_SIZE = 4096;
+ public static final String lineSeparator = (String) AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty("line.separator");
+ }
+ });
+
// hide default constructor
private IoUtil() {
}
@@ -42,7 +51,7 @@
public static int transfer(InputStream in, OutputStream out) throws IOException {
int total = 0;
- byte[] buffer = new byte[BUFFERSIZE];
+ byte[] buffer = new byte[BUFFER_SIZE];
for (int bytesRead; (bytesRead = in.read(buffer)) != -1; total += bytesRead) {
out.write(buffer, 0, bytesRead);
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-15 07:43:15 UTC (rev 5743)
@@ -64,7 +64,7 @@
<executions>
<execution>
<id>update-schema</id>
- <phase>process-resources</phase>
+ <phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
@@ -98,6 +98,11 @@
<scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>com.sybase</groupId>
+ <artifactId>jconnect</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<scope>runtime</scope>
@@ -181,7 +186,7 @@
<executions>
<execution>
<id>create-drop-schema</id>
- <phase>generate-resources</phase>
+ <phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-15 00:04:47 UTC (rev 5742)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-15 07:43:15 UTC (rev 5743)
@@ -45,23 +45,21 @@
action="create" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.mysql.sql"
config="hibernate.cfg.mysql.xml"
- action="create"
- delimiter=";" />
+ action="create" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.oracle.sql"
config="hibernate.cfg.oracle.xml"
- action="create"
- delimiter=";" />
+ action="create" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.postgresql.sql"
config="hibernate.cfg.postgresql.xml"
- action="create"
- delimiter=";" />
+ action="create" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.sapdb.sql"
config="hibernate.cfg.sapdb.xml"
action="create" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.sybase.sql"
config="hibernate.cfg.sybase.xml"
- action="create" />
- <concat destfile="${project.output.dir}/jbpm.jpdl.sybase.sql" append="yes">go</concat>
+ action="create"
+ delimiter="go"
+ delimiterType="row" />
</target>
<target name="drop-schema" depends="init" description="Generate schema drop scripts">
@@ -76,40 +74,39 @@
action="drop" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.mysql.drop.sql"
config="hibernate.cfg.mysql.xml"
- action="drop"
- delimiter=";" />
+ action="drop" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.oracle.drop.sql"
config="hibernate.cfg.oracle.xml"
- action="drop"
- delimiter=";" />
+ action="drop" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.postgresql.drop.sql"
config="hibernate.cfg.postgresql.xml"
- action="drop"
- delimiter=";" />
+ action="drop" />
<jbpmschema output="${project.output.dir}/jbpm.jpdl.sybase.drop.sql"
config="hibernate.cfg.sybase.xml"
- action="drop" />
- <concat destfile="${project.output.dir}/jbpm.jpdl.sybase.drop.sql" append="yes">go</concat>
+ action="drop"
+ delimiter="go"
+ delimiterType="row" />
</target>
<target name="update-schema" depends="init" description="Generate schema update scripts">
- <generate-update-script db="db2" delimiter=";" />
- <generate-update-script db="mssql" delimiter=";" />
- <generate-update-script db="mysql" delimiter=";" />
- <generate-update-script db="oracle" delimiter=";" />
- <generate-update-script db="postgresql" delimiter=";" />
- <generate-update-script db="sybase" />
+ <!--generate-update-script db="db2" /-->
+ <!--generate-update-script db="mssql" /-->
+ <generate-update-script db="mysql" />
+ <!--generate-update-script db="oracle" /-->
+ <generate-update-script db="postgresql" />
+ <generate-update-script db="sybase" delimiter="go" delimitertype="row" />
</target>
<macrodef name="generate-update-script">
<attribute name="db" />
- <attribute name="delimiter" />
+ <attribute name="delimiter" default=";" />
+ <attribute name="delimitertype" default="normal" />
+
<sequential>
<hbproperties config="hibernate.cfg.(a){db}.xml"
prefix="@{db}."
includes="hibernate\.connection\..*" />
- <echo>Dropping current schema @{db}</echo>
<sql src="${project.output.dir}/jbpm.jpdl.(a){db}.drop.sql"
url="${(a){db}.hibernate.connection.url}"
driver="${(a){db}.hibernate.connection.driver_class}"
@@ -117,9 +114,10 @@
password="${(a){db}.hibernate.connection.password}"
classpathref="maven.runtime.classpath"
autocommit="yes"
- onerror="continue" />
+ onerror="continue"
+ delimiter="@{delimiter}"
+ delimitertype="@{delimitertype}" />
- <echo>Creating previous schema @{db}</echo>
<sql src="${previous.version.dir}/jbpm.jpdl.(a){db}.sql"
url="${(a){db}.hibernate.connection.url}"
driver="${(a){db}.hibernate.connection.driver_class}"
@@ -127,33 +125,27 @@
password="${(a){db}.hibernate.connection.password}"
classpathref="maven.runtime.classpath"
autocommit="yes"
- onerror="continue" />
+ onerror="continue"
+ delimiter="@{delimiter}"
+ delimitertype="@{delimitertype}" />
- <echo>Generating update script @{db}</echo>
+ <echo>Generating @{db} update schema</echo>
<jbpmschema output="${project.output.dir}/jbpm.jpdl.(a){db}.update.sql"
config="hibernate.cfg.(a){db}.xml"
action="update"
- delimiter="@{delimiter}" />
+ delimiter="@{delimiter}"
+ delimitertype="@{delimitertype}" />
- <echo>Dropping previous schema @{db}</echo>
- <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.drop.sql"
+ <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.update.sql"
url="${(a){db}.hibernate.connection.url}"
driver="${(a){db}.hibernate.connection.driver_class}"
userid="${(a){db}.hibernate.connection.username}"
password="${(a){db}.hibernate.connection.password}"
- classpathref="maven.compile.classpath"
- autocommit="yes"
- onerror="continue" />
-
- <echo>Creating current schema @{db}</echo>
- <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.sql"
- url="${(a){db}.hibernate.connection.url}"
- driver="${(a){db}.hibernate.connection.driver_class}"
- userid="${(a){db}.hibernate.connection.username}"
- password="${(a){db}.hibernate.connection.password}"
classpathref="maven.runtime.classpath"
autocommit="yes"
- onerror="continue" />
+ onerror="continue"
+ delimiter="@{delimiter}"
+ delimitertype="@{delimitertype}" />
</sequential>
</macrodef>
</project>
16 years, 6 months