[jbpm-commits] JBoss JBPM SVN: r4327 - in jbpm4/trunk: .settings and 47 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Mar 25 08:56:01 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-03-25 08:56:01 -0400 (Wed, 25 Mar 2009)
New Revision: 4327

Added:
   jbpm4/trunk/.settings/
   jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/api/.settings/
   jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs
   jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/devguide/.settings/
   jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/enterprise/.settings/
   jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/examples/.settings/
   jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/integration/console/.settings/
   jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/integration/jboss4/.settings/
   jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/integration/jboss5/.settings/
   jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/integration/spi/.settings/
   jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/jpdl/.settings/
   jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/log/.settings/
   jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/pvm/.settings/
   jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
   jbpm4/trunk/modules/test-base/.settings/
   jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
   jbpm4/trunk/modules/test-load/.settings/
   jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs
   jbpm4/trunk/modules/test-pojo/.settings/
   jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
Modified:
   jbpm4/trunk/modules/api/.classpath
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
   jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
   jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
   jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
   jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
Log:
task fixes, attempt to control mavens build mania in eclipse, start of alternative deployment 

Added: jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:34 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/api/.classpath
===================================================================
--- jbpm4/trunk/modules/api/.classpath	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/.classpath	2009-03-25 12:56:01 UTC (rev 4327)
@@ -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 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"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,5 @@
+#Wed Mar 25 11:04:52 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:03:42 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,11 +47,11 @@
   Task newTask();
 
   /** Creates a new subtask for the given task.
-   * Make sure that the parent task is saved before the 
+   * Make sure that the super task is saved before the 
    * {@link Task#getDbid() dbid} is taken.
    * The returned task will be transient.
    * Use {@link #saveTask(Task)} to persist the task. */
-  Task newTask(long parentTaskDbid);
+  Task newTask(long superTaskDbid);
 
   /** Saves the given task to persistent storage. 
    * @return the taskDbid */

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -37,4 +37,6 @@
   void saveTask(Task task);
 
   void deletingExecution(Execution execution);
+
+  Task findTaskByExecution(Execution execution);
 }

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.task;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DefaultTaskHandler implements TaskHandler {
-
-  public boolean executionCreateTask(OpenTask task) {
-    assign(task);
-    task.historyTaskStart();
-    return true;
-  }
-
-  protected void assign(OpenTask task) {
-  }
-
-  public void executionSignal(OpenTask task) {
-    task.setSignalling(false);
-  }
-
-  public void taskCancel(OpenTask task, String reason) {
-    task.historyTaskCancel(reason);
-  }
-
-  public void taskComplete(OpenTask task, String outcome) {
-    task.historyTaskComplete(outcome);
-    
-    if (task.isSignalling()) {
-      task.getExecution().signal(outcome);
-    }
-  }
-
-  public void taskSubTaskComplete(OpenTask task, OpenTask subTask) {
-  }
-}

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -45,4 +45,6 @@
 
   boolean isSignalling();
   void setSignalling(boolean isSignalling);
+  
+  void cancel(String reason);
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -22,15 +22,53 @@
 package org.jbpm.task;
 
 
-
-/**
+/** for advanced task customization.
+ * 
+ * The default implementation can be found in {@link DefaultTaskHandler}.
+ * 
  * @author Tom Baeyens
  */
-public interface TaskHandler {
+public class TaskHandler {
 
-  boolean executionCreateTask(OpenTask task);
-  void executionSignal(OpenTask task);
-  void taskComplete(OpenTask task, String outcome);
-  void taskCancel(OpenTask task, String reason);
-  void taskSubTaskComplete(OpenTask task, OpenTask subTask);
+  /** is called after the task is created according 
+   * to the task definition.  This method allows to 
+   * create subtasks.
+   * @return indicates if the process execution should wait. */
+  public boolean executionCreateTask(OpenTask task) {
+    task.historyTaskStart();
+    return true;
+  }
+  
+  /** is called when the related execution gets a 
+   * signal.  this method must either 
+   * {@link OpenTask#setSignalling(boolean) remove signalling} from this task
+   * or {@link OpenTask#cancel(String) cancel} it. */
+  public void executionSignal(OpenTask task) {
+    task.setSignalling(false);
+  }
+  
+  /** is called when this task is cancelled. */ 
+  public void taskCancel(OpenTask task, String reason) {
+    task.historyTaskCancel(reason);
+  }
+  
+  /** is called when this task completes.  The default behaviour 
+   * will send a signal to the execution if this task is still signalling. */
+  public void taskComplete(OpenTask task, String outcome) {
+    task.historyTaskComplete(outcome);
+    
+    if (task.isSignalling()) {
+      task.getExecution().signal(outcome);
+    }
+  }
+
+  /** is called when a subtask completes.  this can be used to 
+   * prematurely signal the execution. e.g. for "5 out of 7" scenarios.*/
+  public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+  }
+  
+  /** is called when a variable is updated.  This can be used to 
+   * propagate the execution based on availability of variables. */
+  public void taskVariableUpdate(OpenTask task, String key, Object value) {
+  }
 }

Added: jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:24 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml	2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
     <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
 
     <many-to-one name="assignmentHandlerDescriptor"
-                 column="ASSIGN_DESCR_" 
+                 column="ASSHNDLR_DESCR_" 
                  cascade="all"
                  class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
-                 foreign-key="FK_ASS_ASIGN_DESCR"
-                 index="IDX_ASS_ASIGN_DESCR" />
+                 foreign-key="FK_ASSHNDLR_DESCR"
+                 index="IDX_ASSHNDLR_DESCR" />
 
     <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
     </subclass>
@@ -38,15 +38,20 @@
   
       <property name="priority" column="PRIORITY_"/>
       <property name="dueDateDuration" column="DUEDATE_"/>
-      <property name="isBlocking" column="BLOCK_"/>
-      <property name="isSignalling" column="SIGNAL_"/>
       
+      <many-to-one name="taskHandlerDescriptor"
+                   column="TSKHNDLRDESCR_" 
+                   cascade="all"
+                   class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+                   foreign-key="FK_TSKHNDLR_DESCR"
+                   index="IDX_TSKHNDLR_DESCR" />
+
       <many-to-one name="swimlaneDefinition"
-                   column="SWIMLANE_DEF_" 
+                   column="SWIMLDEF_" 
                    cascade="all"
                    class="SwimlaneDefinitionImpl"
-                   foreign-key="FK_TSK_SWIML_DEF"
-                   index="IDX_TSK_SWIML_DEF" />
+                   foreign-key="FK_TSK_SWIMLDEF"
+                   index="IDX_TSK_SWIMLDEF" />
   
       <list name="subTaskDefinitions" cascade="all-delete-orphan">
         <key column="TASKDEF_" />
@@ -111,6 +116,12 @@
                  column="SWIMLANE_" 
                  foreign-key="FK_TASK_SWIML" />
 
+      <many-to-one name="taskDefinition"
+               column="TASKDEF_" 
+               class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+               foreign-key="FK_TSK_TASKDEF"
+               index="IDX_TSK_TASKDEF" />
+
 		<list name="comments" cascade="all-delete-orphan">
 			<key column="TASK_" />
 			<list-index column="TASK_IDX_" />

Added: jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:46 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:53 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml	2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
     <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
 
     <many-to-one name="assignmentHandlerDescriptor"
-                 column="ASSIGN_DESCR_" 
+                 column="ASSHNDLR_DESCR_" 
                  cascade="all"
                  class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
-                 foreign-key="FK_ASS_ASIGN_DESCR"
-                 index="IDX_ASS_ASIGN_DESCR" />
+                 foreign-key="FK_ASSHNDLR_DESCR"
+                 index="IDX_ASSHNDLR_DESCR" />
 
     <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
     </subclass>
@@ -38,15 +38,20 @@
   
       <property name="priority" column="PRIORITY_"/>
       <property name="dueDateDuration" column="DUEDATE_"/>
-      <property name="isBlocking" column="BLOCK_"/>
-      <property name="isSignalling" column="SIGNAL_"/>
       
+      <many-to-one name="taskHandlerDescriptor"
+                   column="TSKHNDLRDESCR_" 
+                   cascade="all"
+                   class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+                   foreign-key="FK_TSKHNDLR_DESCR"
+                   index="IDX_TSKHNDLR_DESCR" />
+
       <many-to-one name="swimlaneDefinition"
-                   column="SWIMLANE_DEF_" 
+                   column="SWIMLDEF_" 
                    cascade="all"
                    class="SwimlaneDefinitionImpl"
-                   foreign-key="FK_TSK_SWIML_DEF"
-                   index="IDX_TSK_SWIML_DEF" />
+                   foreign-key="FK_TSK_SWIMLDEF"
+                   index="IDX_TSK_SWIMLDEF" />
   
       <list name="subTaskDefinitions" cascade="all-delete-orphan">
         <key column="TASKDEF_" />
@@ -111,6 +116,12 @@
                  column="SWIMLANE_" 
                  foreign-key="FK_TASK_SWIML" />
 
+      <many-to-one name="taskDefinition"
+               column="TASKDEF_" 
+               class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+               foreign-key="FK_TSK_TASKDEF"
+               index="IDX_TSK_TASKDEF" />
+
 		<list name="comments" cascade="all-delete-orphan">
 			<key column="TASK_" />
 			<list-index column="TASK_IDX_" />

Added: jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:00 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:08 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:14 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:24 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:42 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,8 +47,8 @@
   public void execute(ActivityExecution execution) {
     JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class);
     TaskImpl task = jpdlExecution.createTask(taskDefinition);
+
     TaskHandler taskHandler = task.getTaskHandler();
-
     boolean wait = taskHandler.executionCreateTask(task);
 
     TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
@@ -67,6 +67,11 @@
     }
     
     execution.fire(signalName, activity);
+
+    TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+    TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
+    TaskHandler taskHandler = task.getTaskHandler();
+    taskHandler.executionSignal(task);
     
     Transition transition = activity.findOutgoingTransition(signalName);
     if (transition!=null) {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -67,6 +67,12 @@
         parse.addProblem("swimlane "+swimlaneName+" not declared");
       }
     }
+    
+    Element taskHandlerElement = XmlUtil.element(element, "task-handler");
+    if (taskHandlerElement!=null) {
+      ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(taskHandlerElement, parse);
+      taskDefinition.setTaskHandlerDescriptor(objectDescriptor);
+    }
 
     parseAssignmentAttributes(element, taskDefinition, parse);
     

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -70,8 +70,10 @@
   public TaskImpl createTask(TaskDefinitionImpl taskDefinition) {
     TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
     TaskImpl task = (TaskImpl) taskDbSession.createTask();
+    task.setTaskDefinition(taskDefinition);
     task.setExecution(this);
     task.setProcessInstance(processInstance);
+    task.setSignalling(true);
     
     // initialize the name
     if (taskDefinition.getName()!=null) {

Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml	2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
     <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
 
     <many-to-one name="assignmentHandlerDescriptor"
-                 column="ASSIGN_DESCR_" 
+                 column="ASSHNDLR_DESCR_" 
                  cascade="all"
                  class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
-                 foreign-key="FK_ASS_ASIGN_DESCR"
-                 index="IDX_ASS_ASIGN_DESCR" />
+                 foreign-key="FK_ASSHNDLR_DESCR"
+                 index="IDX_ASSHNDLR_DESCR" />
 
     <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
     </subclass>
@@ -38,15 +38,20 @@
   
       <property name="priority" column="PRIORITY_"/>
       <property name="dueDateDuration" column="DUEDATE_"/>
-      <property name="isBlocking" column="BLOCK_"/>
-      <property name="isSignalling" column="SIGNAL_"/>
       
+      <many-to-one name="taskHandlerDescriptor"
+                   column="TSKHNDLRDESCR_" 
+                   cascade="all"
+                   class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+                   foreign-key="FK_TSKHNDLR_DESCR"
+                   index="IDX_TSKHNDLR_DESCR" />
+
       <many-to-one name="swimlaneDefinition"
-                   column="SWIMLANE_DEF_" 
+                   column="SWIMLDEF_" 
                    cascade="all"
                    class="SwimlaneDefinitionImpl"
-                   foreign-key="FK_TSK_SWIML_DEF"
-                   index="IDX_TSK_SWIML_DEF" />
+                   foreign-key="FK_TSK_SWIMLDEF"
+                   index="IDX_TSK_SWIMLDEF" />
   
       <list name="subTaskDefinitions" cascade="all-delete-orphan">
         <key column="TASKDEF_" />
@@ -111,6 +116,12 @@
                  column="SWIMLANE_" 
                  foreign-key="FK_TASK_SWIML" />
 
+      <many-to-one name="taskDefinition"
+               column="TASKDEF_" 
+               class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+               foreign-key="FK_TSK_TASKDEF"
+               index="IDX_TSK_TASKDEF" />
+
 		<list name="comments" cascade="all-delete-orphan">
 			<key column="TASK_" />
 			<list-index column="TASK_IDX_" />

Added: jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:50 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:11:53 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -42,7 +42,7 @@
   public Task execute(Environment environment) throws Exception {
     TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
     TaskImpl task = (TaskImpl) taskDbSession.createTask();
-    task.setParentTaskDbid(parentTaskDbid);
+    task.setSuperTaskDbid(parentTaskDbid);
     return task;
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,10 +47,10 @@
   public void saveTask(Task task) {
     TaskImpl taskImpl = (TaskImpl) task;
     
-    if (taskImpl.getParentTaskDbid()!=null) {
-      TaskImpl parentTask = (TaskImpl) session.load(TaskImpl.class, taskImpl.getParentTaskDbid());
+    if (taskImpl.getSuperTaskDbid()!=null) {
+      TaskImpl parentTask = (TaskImpl) session.load(TaskImpl.class, taskImpl.getSuperTaskDbid());
       parentTask.addSubTask(taskImpl);
-      taskImpl.setParentTaskDbid(null);
+      taskImpl.setSuperTaskDbid(null);
     }
     
     if (! taskImpl.isPersisted()) {
@@ -108,4 +108,14 @@
       session.delete(task);
     }
   }
+
+  public Task findTaskByExecution(Execution execution) {
+    Query query = session.createQuery(
+      "select task " +
+      "from "+TaskImpl.class.getName()+" as task " +
+      "where task.execution = :execution"
+    );
+    query.setEntity("execution", execution);
+    return (Task) query.uniqueResult();
+  }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -27,14 +27,12 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Queue;
 import java.util.Set;
-import java.util.StringTokenizer;
 
 import org.jbpm.Execution;
 import org.jbpm.JbpmException;
@@ -62,9 +60,6 @@
 import org.jbpm.pvm.internal.history.events.ExclusiveEnd;
 import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
 import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
-import org.jbpm.pvm.internal.history.events.TaskComplete;
-import org.jbpm.pvm.internal.history.events.TaskCancel;
-import org.jbpm.pvm.internal.history.events.TaskStart;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.op.AtomicOperation;
 import org.jbpm.pvm.internal.model.op.ExecuteActivity;
@@ -73,18 +68,9 @@
 import org.jbpm.pvm.internal.model.op.ProceedToDestination;
 import org.jbpm.pvm.internal.model.op.Signal;
 import org.jbpm.pvm.internal.model.op.TakeTransition;
-import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
-import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
-import org.jbpm.pvm.internal.task.SwimlaneImpl;
-import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.pvm.internal.util.Priority;
 import org.jbpm.session.MessageSession;
-import org.jbpm.session.TaskDbSession;
-import org.jbpm.task.Assignable;
-import org.jbpm.task.Task;
 
 /**
  * @author Tom Baeyens
@@ -105,6 +91,8 @@
   public static final AtomicOperation TAKE_TRANSITION = new TakeTransition();
   public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
   
+  // persistent member fields /////////////////////////////////////////////////
+  
   /** an optional name for this execution.  can be used to 
    * differentiate concurrent paths of execution like e.g. 
    * the 'shipping' and 'billing' paths. */
@@ -122,17 +110,6 @@
   /** current activity */
   protected ActivityImpl activity;
   
-  /** transition is not to be made persistable by default */
-  protected TransitionImpl transition;
-  
-  /** the activity from which the transition was taken.  This can be different from 
-   * the transition source in case a transition of an eclosing activity was taken.
-   * transitionOrigin is not to be made persistable by default */
-  protected ActivityImpl transitionOrigin;
-
-  protected EventImpl event;
-  protected ObservableElementImpl eventSource;
-  
   /** are concurrent executions that related to this execution. */
   protected Collection<ExecutionImpl> executions;
 
@@ -159,7 +136,20 @@
   protected Date historyActivityStart;
 
   protected int priority = Priority.NORMAL;
+  
+  // transient member fields //////////////////////////////////////////////////
 
+  /** transition is not to be made persistable by default */
+  protected TransitionImpl transition;
+
+  /** the activity from which the transition was taken.  This can be different from 
+   * the transition source in case a transition of an eclosing activity was taken.
+   * transitionOrigin is not to be made persistable by default */
+  protected ActivityImpl transitionOrigin;
+
+  protected EventImpl event;
+  protected ObservableElementImpl eventSource;
+  
   /** caches the child executions by execution name.  This member might be
    * null and is only created from the executions in case its needed.  Note
    * that not all executions are forced to have a name and duplicates are allowed.
@@ -167,8 +157,6 @@
    * also updated (but a check needs to be added whether it exists). */
   protected transient Map<String, OpenExecution> executionsMap = null;
 
-  // transient members
-
   /** the queue of atomic operations to be performed for this execution. */
   protected Queue<AtomicOperation> atomicOperations;
 

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployCmd implements Command<Long> {
+
+  private static final long serialVersionUID = 1L;
+  
+  DeploymentImpl deployment;
+  
+  public DeployCmd(DeploymentImpl deployment) {
+    this.deployment = deployment;
+  }
+
+  public Long execute(Environment environment) throws Exception {
+    RepositorySession repositorySession = environment.get(RepositorySession.class);
+    return repositorySession.deploy(deployment);
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface Deployer {
+
+  boolean matches(String fileName);
+  Object deployFile(String fileName, byte[] bytes);
+
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.ProblemList;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployerManager {
+  
+  List<Deployer> deployers;
+  
+  public Object deployFile(String fileName, byte[] bytes, ProblemList problemList) {
+    for (Deployer deployer: deployers) {
+      if (deployer.matches(fileName)) {
+        return deployer.deployFile(fileName, bytes);
+      }
+    }
+    return null;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.pvm.internal.stream.StreamInput;
+
+/**
+ * @author Tom Baeyens
+ */
+public interface Deployment {
+
+  void setName(String name);
+  
+  Deployment addStreamInput(String name, StreamInput streamInput);
+  Deployment addZipInputStream(ZipInputStream zipInputStream);
+  
+  /** @return deploymentId */
+  long deploy();
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.io.ObjectStreamException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.JbpmException;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.IoUtil;
+import org.jbpm.pvm.internal.xml.ProblemList;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentImpl extends ProblemList implements Deployment {
+  
+  protected long dbid;
+  protected String name;
+  protected long timestamp;
+  
+  protected Map<String, Lob> storedFiles;
+  
+  protected Map<String, StreamInput> inputFiles;
+  protected CommandService commandService;
+
+  public DeploymentImpl(CommandService commandService) {
+    this.commandService = commandService;
+  }
+  
+  public long deploy() {
+    return commandService.execute(new DeployCmd(this));
+  }
+  public void setName(String name) {
+    this.name = name;
+  }
+  
+  public void setTimestamp(long timestamp) {
+    this.timestamp = timestamp;
+  }
+
+  public Deployment addStreamInput(String name, StreamInput streamInput) {
+    if (this.name==null) {
+      this.name = name;
+    }
+    if (inputFiles==null) {
+      inputFiles = new HashMap<String, StreamInput>();
+    }
+    inputFiles.put(name, streamInput);
+    return this;
+  }
+
+  public Deployment addZipInputStream(ZipInputStream zipInputStream) {
+    try {
+      ZipEntry zipEntry = zipInputStream.getNextEntry();
+      while(zipEntry!=null) {
+        String entryName = zipEntry.getName();
+        byte[] bytes = IoUtil.readBytes(zipInputStream);
+        if (bytes!=null) {
+          addStreamInput(entryName, new ByteArrayStreamInput(bytes));
+        }
+        zipEntry = zipInputStream.getNextEntry();
+      }
+    } catch (Exception e) {
+      throw new JbpmException("couldn't read zip archive", e);
+    }
+    return this;
+  }
+
+  protected Object writeReplace() throws ObjectStreamException {
+    if (inputFiles!=null) {
+      Map<String, StreamInput> replacedFiles = new HashMap<String, StreamInput>();
+      for (Map.Entry<String, StreamInput> entry: inputFiles.entrySet()) {
+        if (! (entry.getValue() instanceof ByteArrayStreamInput)) {
+          byte[] bytes = IoUtil.readBytes(entry.getValue().openStream());
+          replacedFiles.put(entry.getKey(), new ByteArrayStreamInput(bytes));
+        }
+      }
+      inputFiles = replacedFiles;
+    }
+    
+    commandService = null;
+
+    return this;
+  }
+
+  public long getDbid() {
+    return dbid;
+  }
+  public String getName() {
+    return name;
+  }
+  public long getTimestamp() {
+    return timestamp;
+  }
+
+  public Map<String, Lob> getStoredFiles() {
+    return storedFiles;
+  }
+  public void setStoredFiles(Map<String, Lob> storedFiles) {
+    this.storedFiles = storedFiles;
+  }
+  public Map<String, StreamInput> getInputFiles() {
+    return inputFiles;
+  }
+  public void setInputFiles(Map<String, StreamInput> inputFiles) {
+    this.inputFiles = inputFiles;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.util.Map;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositoryCache {
+
+  void store(Map<String, Object> deployedObjects);
+
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.io.InputStream;
+
+import org.jbpm.cmd.CommandService;
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryServiceImpl {
+  
+  CommandService commandService;
+  
+  public Deployment createDeployment() {
+    return new DeploymentImpl(commandService);
+  }
+  
+  public void deleteDeployment(String deploymentId) {
+  }
+  
+  public InputStream getResource(String deploymentId, String resource) {
+    return null;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.io.InputStream;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositorySession {
+
+  InputStream getResource(String deploymentId, String name);
+
+  Object getDeployedObject(String deploymentId, String name);
+
+  long deploy(DeploymentImpl deployment);
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.JbpmException;
+import org.jbpm.Problem;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.IoUtil;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositorySessionImpl implements RepositorySession {
+  
+  private static Log log = Log.getLog(RepositorySessionImpl.class.getName());
+  
+  Session session;
+  RepositoryCache repositoryCache;
+  DeployerManager deployerManager;
+
+  public long deploy(DeploymentImpl deployment) {
+    Map<String, Object> deployedObjects = new HashMap<String, Object>();
+
+    Map<String, StreamInput> inputFiles = deployment.getInputFiles();
+    if (inputFiles==null) {
+      deployment.addProblem("deployment is empty");
+
+    } else {
+      
+      Map<String, Lob> storedFiles = new HashMap<String, Lob>();
+      for (String fileName: inputFiles.keySet()) {
+        StreamInput streamInput = inputFiles.get(fileName);
+        byte[] bytes = IoUtil.readBytes(streamInput.openStream());
+        
+        Object deployedObject = deployerManager.deployFile(fileName, bytes, deployment);
+        if (deployedObject!=null) {
+          deployedObjects.put(fileName, deployedObject);
+        }
+
+        Lob lob = new Lob(bytes);
+        storedFiles.put(fileName, lob);
+      }
+      deployment.setStoredFiles(storedFiles);
+    }
+    
+    
+    if (deployment.hasProblems()) {
+      for (Problem problem: deployment.getProblems()) {
+        Throwable cause = problem.getCause();
+        if (cause!=null) {
+          log.debug("deployment exception", cause);
+        }
+      }
+      throw new JbpmException("problems during deployment: "+deployment.getProblemsText());
+    } else {
+      
+      repositoryCache.store(deployedObjects);
+      session.save(deployment);
+    }
+
+    return 0;
+  }
+
+  public Object getDeployedObject(String deploymentId, String name) {
+    return null;
+  }
+
+  public InputStream getResource(String deploymentId, String name) {
+    return null;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -25,6 +25,7 @@
 import java.util.List;
 
 import org.jbpm.pvm.internal.util.Priority;
+import org.jbpm.pvm.internal.wire.Descriptor;
 
 /**
  * defines a task and how the actor(s) must be calculated at runtime.
@@ -33,30 +34,13 @@
   
   private static final long serialVersionUID = 1L;
 
-  /** @see #isBlocking() */
-  protected boolean isBlocking;
-  
-  /** @see #isSignalling() */
-  protected boolean isSignalling = true;
-
   protected String dueDateDuration;
   protected String form;
   protected List<TaskDefinitionImpl> subTaskDefinitions;
   protected int priority = Priority.NORMAL;
   protected SwimlaneDefinitionImpl swimlaneDefinition;
+  protected Descriptor taskHandlerDescriptor;
 
-  public boolean isBlocking() {
-    return isBlocking;
-  }
-  public void setBlocking(boolean isBlocking) {
-    this.isBlocking = isBlocking;
-  }
-  public boolean isSignalling() {
-    return isSignalling;
-  }
-  public void setSignalling(boolean isSignalling) {
-    this.isSignalling = isSignalling;
-  }
   public int getPriority() {
     return priority;
   }
@@ -87,4 +71,10 @@
   public void setForm(String form) {
     this.form = form;
   }
+  public Descriptor getTaskHandlerDescriptor() {
+    return taskHandlerDescriptor;
+  }
+  public void setTaskHandlerDescriptor(Descriptor taskHandlerDescriptor) {
+    this.taskHandlerDescriptor = taskHandlerDescriptor;
+  }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -42,9 +42,9 @@
 import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.pvm.internal.util.Priority;
+import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.session.TaskDbSession;
 import org.jbpm.task.Assignable;
-import org.jbpm.task.DefaultTaskHandler;
 import org.jbpm.task.GroupRef;
 import org.jbpm.task.IdentityRef;
 import org.jbpm.task.OpenTask;
@@ -65,7 +65,7 @@
   
   private static Log log = Log.getLog(TaskImpl.class.getName());
   
-  private static final TaskHandler DEFAULT_TASK_HANDLER = new DefaultTaskHandler(); 
+  private static final TaskHandler DEFAULT_TASK_HANDLER = new TaskHandler(); 
   
   protected String id;
   protected String name;
@@ -77,7 +77,7 @@
   protected Date create;
   protected Date dueDate;
   protected Integer progress;
-  protected boolean isSignalling = true;
+  protected boolean isSignalling;
 
   // protected VariableMap variableMap;
   protected List<CommentImpl> comments;
@@ -86,16 +86,16 @@
 
   protected String state;
 
+  protected TaskDefinitionImpl taskDefinition;
   protected ExecutionImpl execution;
   protected ExecutionImpl processInstance;
-
   protected SwimlaneImpl swimlane;
   
   protected TaskImpl superTask;
   protected Set<TaskImpl> subTasks;
   
   protected Long executionDbid;
-  protected Long parentTaskDbid;
+  protected Long superTaskDbid;
   
   public TaskImpl() {
   }
@@ -193,11 +193,25 @@
 
   public void complete(String outcome) {
     getTaskHandler().taskComplete(this, outcome);
+    if (superTask!=null) {
+      superTask.subTaskComplete(this, outcome);
+    }
   }
 
+  protected void subTaskComplete(TaskImpl subTask, String outcome) {
+    getTaskHandler().taskSubTaskComplete(this, subTask, outcome);
+  }
+
   public void cancel(String reason) {
     getTaskHandler().taskCancel(this, reason);
   }
+  
+  // variables ////////////////////////////////////////////////////////////////
+  
+  public void setVariable(String key, Object value) {
+    super.setVariable(key, value);
+    getTaskHandler().taskVariableUpdate(this, key, value);
+  }
 
   // comments /////////////////////////////////////////////////////////////////
 
@@ -303,6 +317,47 @@
     return dbid!=0;
   }
 
+  public void cancelExecution(String signal) {
+    if (execution!=null){
+      execution.end("cancel");
+    }
+  }
+
+  public void historyTaskCancel(String reason) {
+    if (execution!=null){
+      execution.fireHistoryEvent(new TaskCancel(reason));
+    }
+  }
+
+  public void historyTaskComplete(String outcome) {
+    if (execution!=null){
+      execution.fireHistoryEvent(new TaskComplete(outcome));
+    }
+  }
+
+  public void historyTaskStart() {
+    if (execution!=null){
+      execution.fireHistoryEvent(new TaskStart(this));
+    }
+  }
+
+  public void signalExecution(String signalName) {
+    if (execution!=null){
+      execution.signal(signalName);
+    }
+  }
+
+  public TaskHandler getTaskHandler() {
+    if ( (taskDefinition==null)
+         || (taskDefinition.getTaskHandlerDescriptor()==null)
+       ) {
+      return DEFAULT_TASK_HANDLER;
+    }
+    
+    TaskHandler taskHandler = (TaskHandler) WireContext.create(taskDefinition.getTaskHandlerDescriptor());
+    return taskHandler;
+  }
+  
   // getters and setters //////////////////////////////////////////////////////
   
   public long getDbid() {
@@ -380,11 +435,11 @@
   public void setExecutionDbid(Long executionDbid) {
     this.executionDbid = executionDbid;
   }
-  public Long getParentTaskDbid() {
-    return parentTaskDbid;
+  public Long getSuperTaskDbid() {
+    return superTaskDbid;
   }
-  public void setParentTaskDbid(Long parentTaskDbid) {
-    this.parentTaskDbid = parentTaskDbid;
+  public void setSuperTaskDbid(Long parentTaskDbid) {
+    this.superTaskDbid = parentTaskDbid;
   }
   public void setParticipants(Set<ParticipantImpl> participants) {
     this.participants = participants;
@@ -410,38 +465,10 @@
   public void setSignalling(boolean isSignalling) {
     this.isSignalling = isSignalling;
   }
-
-  public void cancelExecution(String signal) {
-    if (execution!=null){
-      execution.end("cancel");
-    }
+  public TaskDefinitionImpl getTaskDefinition() {
+    return taskDefinition;
   }
-
-  public void historyTaskCancel(String reason) {
-    if (execution!=null){
-      execution.fireHistoryEvent(new TaskCancel(reason));
-    }
+  public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
+    this.taskDefinition = taskDefinition;
   }
-
-  public void historyTaskComplete(String outcome) {
-    if (execution!=null){
-      execution.fireHistoryEvent(new TaskComplete(outcome));
-    }
-  }
-
-  public void historyTaskStart() {
-    if (execution!=null){
-      execution.fireHistoryEvent(new TaskStart(this));
-    }
-  }
-
-  public void signalExecution(String signalName) {
-    if (execution!=null){
-      execution.signal(signalName);
-    }
-  }
-
-  public TaskHandler getTaskHandler() {
-    return DEFAULT_TASK_HANDLER;
-  }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -44,7 +44,7 @@
 
   private static final Log log = Log.getLog(ProblemList.class.getName());
 
-  protected List<ProblemImpl> problems = null;
+  protected List<ProblemImpl> problems;
 
   /** all problems encountered */
   public List<Problem> getProblems() {

Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml	2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
     <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
 
     <many-to-one name="assignmentHandlerDescriptor"
-                 column="ASSIGN_DESCR_" 
+                 column="ASSHNDLR_DESCR_" 
                  cascade="all"
                  class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
-                 foreign-key="FK_ASS_ASIGN_DESCR"
-                 index="IDX_ASS_ASIGN_DESCR" />
+                 foreign-key="FK_ASSHNDLR_DESCR"
+                 index="IDX_ASSHNDLR_DESCR" />
 
     <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
     </subclass>
@@ -38,15 +38,20 @@
   
       <property name="priority" column="PRIORITY_"/>
       <property name="dueDateDuration" column="DUEDATE_"/>
-      <property name="isBlocking" column="BLOCK_"/>
-      <property name="isSignalling" column="SIGNAL_"/>
       
+      <many-to-one name="taskHandlerDescriptor"
+                   column="TSKHNDLRDESCR_" 
+                   cascade="all"
+                   class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+                   foreign-key="FK_TSKHNDLR_DESCR"
+                   index="IDX_TSKHNDLR_DESCR" />
+
       <many-to-one name="swimlaneDefinition"
-                   column="SWIMLANE_DEF_" 
+                   column="SWIMLDEF_" 
                    cascade="all"
                    class="SwimlaneDefinitionImpl"
-                   foreign-key="FK_TSK_SWIML_DEF"
-                   index="IDX_TSK_SWIML_DEF" />
+                   foreign-key="FK_TSK_SWIMLDEF"
+                   index="IDX_TSK_SWIMLDEF" />
   
       <list name="subTaskDefinitions" cascade="all-delete-orphan">
         <key column="TASKDEF_" />
@@ -111,6 +116,12 @@
                  column="SWIMLANE_" 
                  foreign-key="FK_TASK_SWIML" />
 
+      <many-to-one name="taskDefinition"
+               column="TASKDEF_" 
+               class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+               foreign-key="FK_TSK_TASKDEF"
+               index="IDX_TSK_TASKDEF" />
+
 		<list name="comments" cascade="all-delete-orphan">
 			<key column="TASK_" />
 			<list-index column="TASK_IDX_" />

Added: jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:01 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:08 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,167 @@
+/*
+ * 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.task;
+
+import org.jbpm.Execution;
+import org.jbpm.task.OpenTask;
+import org.jbpm.task.Task;
+import org.jbpm.task.TaskHandler;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskHandlerTest extends JbpmTestCase {
+
+  static boolean isExecutionCreateTaskCalled;
+  static boolean isExecutionSignalledCalled;
+  static boolean isTaskCancelCalled;
+  static boolean isTaskCompleteCalled;
+  static boolean isSubTaskCompleteCalled;
+  static boolean isTaskVariableUpdateCalled;
+  
+  public void setUp() throws Exception {
+    super.setUp();
+
+    isExecutionCreateTaskCalled = false;
+    isExecutionSignalledCalled = false;
+    isTaskCancelCalled = false;
+    isTaskCompleteCalled = false;
+    isSubTaskCompleteCalled = false;
+    isTaskVariableUpdateCalled = false;
+  }
+
+  public static class ReviewHandler extends TaskHandler {
+    public boolean executionCreateTask(OpenTask task) {
+      isExecutionCreateTaskCalled = true;
+      return super.executionCreateTask(task);
+    }
+
+    public void executionSignal(OpenTask task) {
+      isExecutionSignalledCalled = true;
+      super.executionSignal(task);
+    }
+
+    public void taskCancel(OpenTask task, String reason) {
+      isTaskCancelCalled = true;
+      super.taskCancel(task, reason);
+    }
+
+    public void taskComplete(OpenTask task, String outcome) {
+      isTaskCompleteCalled = true;
+      super.taskComplete(task, outcome);
+    }
+
+    public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+      isSubTaskCompleteCalled = true;
+      super.taskSubTaskComplete(task, subTask, outcome);
+    }
+
+    public void taskVariableUpdate(OpenTask task, String key, Object value) {
+      isTaskVariableUpdateCalled = true;
+      super.taskVariableUpdate(task, key, value);
+    }
+  }
+
+  public void testTaskHandlerBasicScenario() {
+    deployJpdlXmlString(
+      "<process name='TaskHandler'>" +
+      "  <start>" +
+      "    <transition to='review' />" +
+      "  </start>" +
+      "  <task name='review'>" +
+      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+      "    <transition to='wait' />" +
+      "  </task>" +
+      "  <state name='wait'/>" +
+      "</process>"
+    );
+    
+    executionService.startProcessInstanceByKey("TaskHandler");
+    
+    assertTrue(isExecutionCreateTaskCalled);
+    
+    Task task = taskService.createTaskQuery().execute().get(0);
+    
+    long taskDbid = task.getDbid();
+    taskService.setVariable(taskDbid, "checked", "true");
+    
+    assertTrue(isExecutionCreateTaskCalled);
+    
+    Task subTask = taskService.newTask(taskDbid);
+    long subTaskDbid = taskService.saveTask(subTask);
+    taskService.completeTask(subTaskDbid);
+    
+    assertTrue(isSubTaskCompleteCalled);
+
+    taskService.completeTask(taskDbid);
+
+    assertTrue(isTaskCompleteCalled);
+  }
+
+  public void testTaskHandlerCancelScenario() {
+    deployJpdlXmlString(
+      "<process name='TaskHandler'>" +
+      "  <start>" +
+      "    <transition to='review' />" +
+      "  </start>" +
+      "  <task name='review'>" +
+      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+      "    <transition to='wait' />" +
+      "  </task>" +
+      "  <state name='wait'/>" +
+      "</process>"
+    );
+    
+    executionService.startProcessInstanceByKey("TaskHandler");
+    
+    Task task = taskService.createTaskQuery().execute().get(0);
+    long taskDbid = task.getDbid();
+
+    taskService.cancelTask(taskDbid);
+    
+    assertTrue(isTaskCancelCalled);
+  }
+
+  public void testTaskHandlerExecutionSignalScenario() {
+    deployJpdlXmlString(
+      "<process name='TaskHandler'>" +
+      "  <start>" +
+      "    <transition to='review' />" +
+      "  </start>" +
+      "  <task name='review'>" +
+      "    <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+      "    <transition to='wait' />" +
+      "  </task>" +
+      "  <state name='wait'/>" +
+      "</process>"
+    );
+    
+    Execution execution = executionService.startProcessInstanceByKey("TaskHandler");
+    String executionId = execution.getId();
+    
+    executionService.signalExecutionById(executionId);
+    
+    assertTrue(isExecutionSignalledCalled);
+  }
+}


Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml	2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml	2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
     <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
 
     <many-to-one name="assignmentHandlerDescriptor"
-                 column="ASSIGN_DESCR_" 
+                 column="ASSHNDLR_DESCR_" 
                  cascade="all"
                  class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
-                 foreign-key="FK_ASS_ASIGN_DESCR"
-                 index="IDX_ASS_ASIGN_DESCR" />
+                 foreign-key="FK_ASSHNDLR_DESCR"
+                 index="IDX_ASSHNDLR_DESCR" />
 
     <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
     </subclass>
@@ -38,15 +38,20 @@
   
       <property name="priority" column="PRIORITY_"/>
       <property name="dueDateDuration" column="DUEDATE_"/>
-      <property name="isBlocking" column="BLOCK_"/>
-      <property name="isSignalling" column="SIGNAL_"/>
       
+      <many-to-one name="taskHandlerDescriptor"
+                   column="TSKHNDLRDESCR_" 
+                   cascade="all"
+                   class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+                   foreign-key="FK_TSKHNDLR_DESCR"
+                   index="IDX_TSKHNDLR_DESCR" />
+
       <many-to-one name="swimlaneDefinition"
-                   column="SWIMLANE_DEF_" 
+                   column="SWIMLDEF_" 
                    cascade="all"
                    class="SwimlaneDefinitionImpl"
-                   foreign-key="FK_TSK_SWIML_DEF"
-                   index="IDX_TSK_SWIML_DEF" />
+                   foreign-key="FK_TSK_SWIMLDEF"
+                   index="IDX_TSK_SWIMLDEF" />
   
       <list name="subTaskDefinitions" cascade="all-delete-orphan">
         <key column="TASKDEF_" />
@@ -111,6 +116,12 @@
                  column="SWIMLANE_" 
                  foreign-key="FK_TASK_SWIML" />
 
+      <many-to-one name="taskDefinition"
+               column="TASKDEF_" 
+               class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+               foreign-key="FK_TSK_TASKDEF"
+               index="IDX_TSK_TASKDEF" />
+
 		<list name="comments" cascade="all-delete-orphan">
 			<key column="TASK_" />
 			<list-index column="TASK_IDX_" />

Added: jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:16 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1

Added: jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs	2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:26 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1




More information about the jbpm-commits mailing list