[jbpm-commits] JBoss JBPM SVN: r4356 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/task and 28 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Mar 30 09:27:06 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-03-30 09:27:06 -0400 (Mon, 30 Mar 2009)
New Revision: 4356

Added:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java
   jbpm4/trunk/modules/db/jbpm4-db.iml
   jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
   jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
   jbpm4/trunk/modules/examples/jbpm4-examples.iml
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
   jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/integration/console/integration-console.iml
   jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
   jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
   jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml
   jbpm4/trunk/modules/integration/spi/integration-spi.iml
   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/AssignTaskCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.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/task/TaskQueryImpl.java
   jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/test-db/jbpm4-test-db.iml
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
   jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Log:
Use IdendityRef where appropriate. Query tasks by Participation.

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,12 +22,17 @@
 package org.jbpm;
 
 import java.util.List;
+import java.util.Set;
 
 import org.jbpm.task.Task;
+import org.jbpm.task.IdentityRef;
+import org.jbpm.task.UserRef;
+import org.jbpm.task.GroupRef;
 
 
 /**
  * @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun at jboss.com>
  */
 public interface TaskQuery {
   
@@ -38,17 +43,26 @@
   public static final String PROPERTY_PRIORITY = "priority";
   public static final String PROPERTY_PROGRESS = "progress";
 
-  /** only find tasks for which the given user is the assignee */
+  /**
+   * only find tasks for which the given user is the assignee
+   * */
   TaskQuery assignee(String userId);
   
-  /** only find tasks that are unassigned.  These tasks can still 
-   * potentially have candidates. */
+  /**
+   * query for tasks that are unassigned.
+   * These tasks can still potentially have candidates.
+   * */
   TaskQuery unassigned();
 
-  /** only find tasks for which the given user is a candidate */
-  TaskQuery candidate(String userId);
+  /**
+   * query by participating user and participation type
+   */
+  TaskQuery participatingUser(String participation, UserRef user);
 
-  TaskQuery candidateGroups(List<String> groups);
+  /**
+   * query by participating groups and participation type    
+   */
+  TaskQuery participatingGroups(String participation, GroupRef... groups);
 
   TaskQuery page(int firstResult, int maxResults);
   TaskQuery orderAsc(String property);

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -29,13 +29,14 @@
 import org.jbpm.model.Comment;
 import org.jbpm.task.GroupRef;
 import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
 import org.jbpm.task.Task;
 import org.jbpm.task.UserRef;
 
 /**
  * Human task management facility.
  * @author Alejandro Guizar
+ * @author Heiko Braun <heiko.braun at jboss.com>
  */
 public interface TaskService {
 
@@ -63,7 +64,7 @@
   Task getTask(long taskDbid);
 
   /** assigns this task to the given asignee. */
-  void assignTask(long taskDbid, String assigneeUserId);
+  void assignTask(long taskDbid, UserRef user);
 
   /** Deletes this task, marks the related history task as completed.
    * If the task was created in the context 
@@ -99,34 +100,34 @@
 
   /** add a role to a given task.
    * @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}  
-   * @param participation specifies the kind of involvement of the participant 
-   * in this task. see {@link Participant} for default constants. */
+   * @param participation specifies the kind of involvement of the participatingUser
+   * in this task. see {@link Participation} for default constants. */
   void addTaskParticipant(long taskDbid, IdentityRef identityRef, String participation);
 
     
   /** get roles related to a given task. */
-  List<Participant> getTaskParticipants(long taskDbid);
+  List<Participation> getTaskParticipants(long taskDbid);
   
   /** removes a role to a given task.  Nothing happens (no exception) if 
    * the role does not exist.
    * @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}  
-   * @param participation specifies the kind of involvement of the participant 
-   * in this task. see {@link Participant} for default constants. */
+   * @param participation specifies the kind of involvement of the participatingUser
+   * in this task. see {@link Participation} for default constants. */
   void removeTaskParticipant(long taskDbid, IdentityRef identityRef, String participation);
   
   /** add a role from a given swimlane.
    * @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}  
-   * @param participation specifies the kind of involvement of the participant 
-   * in this swimlane. see {@link Participant} for default constants. */
+   * @param participation specifies the kind of involvement of the participatingUser
+   * in this swimlane. see {@link Participation} for default constants. */
   void addSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
 
   /** get roles related to a given swimlane. */
-  List<Participant> getSwimlaneParticipants(long swimlaneDbid);
+  List<Participation> getSwimlaneParticipants(long swimlaneDbid);
 
   /** remove a role from a given swimlane.
    * @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}  
-   * @param participation specifies the kind of involvement of the participant 
-   * in this swimlane. see {@link Participant} for default constants. */
+   * @param participation specifies the kind of involvement of the participatingUser
+   * in this swimlane. see {@link Participation} for default constants. */
   void removeSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
 
   /** create a new query for tasks */
@@ -134,19 +135,26 @@
 
   /**
    * retrieves a list of tasks assigned to a particular user
+   *
+   * @see org.jbpm.TaskQuery
    */
-  List<Task> getAssigneeTaskList(String userId, int firstResult, int maxResults);
+  List<Task> findTasksByAssignment(UserRef user);
 
   /**
-   * retrieves a list of unassigned tasks for a candidate user.
-   * */
-  List<Task> getUserTaskList(String userId, int firstResult, int maxResults);
+   * retrieves a list of tasks for a user
+   * and a particular {@link org.jbpm.task.Participation} type
+   *
+   * @see org.jbpm.TaskQuery
+   */
+  List<Task> findTasksByParticipation(String participation, UserRef user);
 
   /**
-   * retrieves a list of unassigned tasks for
-   * a candidate group or a list of candidate groups.
+   * retrieves a list of tasks for a group
+   * and a particular {@link org.jbpm.task.Participation} type
+   *
+   * @see org.jbpm.TaskQuery 
    */
-  List<Task> getGroupTaskList(List<String> groupIds, int firstResult, int maxResults);
+  List<Task> findTasksByParticipation(String participation, GroupRef... groups);
 
   /** get the subtasks for this task.  Only goes one level deep at a time. */
   List<Task> getSubTasks(long taskDbid);
@@ -181,12 +189,4 @@
   /** retrieves a map of variables */
   Map<String, Object> getVariables(long taskDbid, Set<String> variableNames);
 
-
-  /** provide a userId that will be used in the next method invocation 
-   * on this service by this thread. */
-  void setUserId(String userId);
-
-  /** provide a JDBC connection that will be used in the next method 
-   * invocation on this service by this thread. */
-  void setConnection(Connection connection);
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,7 +27,14 @@
 
 
 /**
+ * references an identity. usally a user or group.
+ *
+ * @see org.jbpm.task.UserRef
+ * @see org.jbpm.task.GroupRef
+ * @see org.jbpm.task.Participation
+ *
  * @author Tom Baeyens
+ * @author Heiko Braun
  */
 public abstract class IdentityRef implements Serializable {
   

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -1,58 +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;
-
-
-/** a link to a participant (user or group) and the type of 
- * involvement of that participant.
- * 
- * @author Tom Baeyens
- */
-public interface Participant {
-
-  /** alternative owner, but as long as this person is not the owner. 
-   * This person is allowed to make comments, but nothing else. */
-  String CANDIDATE = "candidate";
-
-  /** the person with ultimate responsibility over a task. */
-  String OWNER = "owner";
-
-  /** person that will be using the result of this task.  This person is 
-   * allowed to make comments, but nothing else. */
-  String CLIENT = "client";
-
-  /** person that is allowed to watch-but-not-touch this task */
-  String VIEWER = "viewer";
-
-  /** a person that was assigned to a task, but got replaced because of 
-   * absence or another reason. This way, a trace can be left in case 
-   * this person returns and wants to take back his tasks that got 
-   * reassigned. */
-  String REPLACED_ASSIGNEE = "replaced-assignee";
-
-  long getDbid();
-
-  IdentityRef getIdentityRef();
-  
-  /** see constants for default participations */
-  String getParticipation();
-}

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java (from rev 4353, jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+
+/**
+ * a link to a participating identity (user or group) and the type of involvement.
+ * 
+ * @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ */
+public interface Participation
+{
+
+  /** alternative owner, but as long as this person is not the owner. 
+   * This person is allowed to make comments, but nothing else. */
+  String CANDIDATE = "candidate";
+
+  /** the person with ultimate responsibility over a task. */
+  String OWNER = "owner";
+
+  /** person that will be using the result of this task.  This person is 
+   * allowed to make comments, but nothing else. */
+  String CLIENT = "client";
+
+  /** person that is allowed to watch-but-not-touch this task */
+  String VIEWER = "viewer";
+
+  /** a person that was assigned to a task, but got replaced because of 
+   * absence or another reason. This way, a trace can be left in case 
+   * this person returns and wants to take back his tasks that got 
+   * reassigned. */
+  String REPLACED_ASSIGNEE = "replaced-assignee";
+
+  long getDbid();
+
+  IdentityRef getIdentityRef();
+  
+  /** see constants for default participations */
+  String getType();
+}


Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/db/jbpm4-db.iml
===================================================================
--- jbpm4/trunk/modules/db/jbpm4-db.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/db/jbpm4-db.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -12,6 +12,7 @@
     <orderEntry type="module" module-name="toplevel" />
     <orderEntry type="module" module-name="pvm" />
     <orderEntry type="module" module-name="jpdl" />
+    <orderEntry type="module" module-name="api" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: junit:junit:jar:3.8.1:compile">
         <CLASSES>

Modified: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -78,9 +78,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -138,7 +138,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -181,9 +181,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -179,9 +179,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

Modified: jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
===================================================================
--- jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -11,10 +11,11 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="gwt-server-integration" exported="" />
     <orderEntry type="module" module-name="toplevel" exported="" />
-    <orderEntry type="module" module-name="gwt-server-integration" exported="" />
     <orderEntry type="module" module-name="pvm" exported="" />
     <orderEntry type="module" module-name="gwt-rpc" exported="" />
+    <orderEntry type="module" module-name="api" exported="" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: cargo:cargo:jar:0.5:test">
         <CLASSES>

Modified: jbpm4/trunk/modules/examples/jbpm4-examples.iml
===================================================================
--- jbpm4/trunk/modules/examples/jbpm4-examples.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/jbpm4-examples.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,9 +9,10 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="toplevel" exported="" />
-    <orderEntry type="module" module-name="pvm" exported="" />
-    <orderEntry type="module" module-name="jpdl" exported="" />
+    <orderEntry type="module" module-name="toplevel" />
+    <orderEntry type="module" module-name="pvm" />
+    <orderEntry type="module" module-name="jpdl" />
+    <orderEntry type="module" module-name="api" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
         <CLASSES>
@@ -96,17 +97,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: javax.transaction:jta:jar:1.1:runtime">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
-        </SOURCES>
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: junit:junit:jar:3.8.1:runtime">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
@@ -125,15 +115,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:runtime">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:runtime">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
@@ -161,15 +142,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: antlr:antlr:jar:2.7.6:runtime">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: juel:juel-engine:jar:2.1.0:runtime">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
@@ -179,15 +151,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: asm:asm:jar:1.5.3:runtime">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: javassist:javassist:jar:3.4.GA:runtime">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
@@ -291,130 +254,166 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:runtime">
+      <library name="M2 Dep: juel:juel-impl:jar:2.1.0:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: juel:juel-impl:jar:2.1.0:runtime">
+      <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:runtime">
+      <library name="M2 Dep: org.jbpm.jbpm4.dependencies.esb:test-util:jar:4.4.0.GA:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm4/dependencies/esb/test-util/4.4.0.GA/test-util-4.4.0.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:runtime">
+      <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: cglib:cglib:jar:2.1_3:runtime">
+      <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:runtime">
+      <library name="M2 Dep: org.jboss.client:jbossall-client:jar:5.0.0.GA:compile">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/client/jbossall-client/5.0.0.GA/jbossall-client-5.0.0.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jbpm.jbpm4.dependencies.esb:test-util:jar:4.4.0.GA:test">
+      <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm4/dependencies/esb/test-util/4.4.0.GA/test-util-4.4.0.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+        </SOURCES>
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:runtime">
+      <library name="M2 Dep: log4j:log4j:jar:1.2.14:runtime">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:runtime">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:runtime">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.client:jbossall-client:jar:5.0.0.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: antlr:antlr:jar:2.7.6:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/client/jbossall-client/5.0.0.GA/jbossall-client-5.0.0.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:runtime">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: asm:asm:jar:1.5.3:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
-        </SOURCES>
+        <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: log4j:log4j:jar:1.2.14:runtime">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:test">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
         </CLASSES>
         <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:test">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
         <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
         </SOURCES>
       </library>
     </orderEntry>
+    <orderEntry type="module-library">
+      <library name="M2 Dep: cglib:cglib:jar:2.1_3:test">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:test">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:test">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,6 +27,7 @@
 
 import org.jbpm.Execution;
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -35,6 +36,8 @@
  */
 public class TaskAssigneeTest extends JbpmTestCase {
 
+  UserRef userRef = new UserRef("johndoe");
+  
   public void testTaskAssignee() {
     deployJpdlResource("org/jbpm/examples/task/assignee/process.jpdl.xml");
     
@@ -42,8 +45,8 @@
     variables.put("order", new Order("johndoe"));
     Execution execution = executionService.startProcessInstanceByKey("TaskAssignee", variables);
     String executionId = execution.getId();
-    
-    List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+
+    List<Task> taskList = taskService.findTasksByAssignment(userRef);
     assertEquals(1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());
@@ -53,7 +56,7 @@
     taskService.completeTask(task.getDbid());
     
     // verify that the task list is now empty
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(userRef);
     assertEquals(0, taskList.size());
 
     // verify that process moved to the next state

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
 /**
@@ -31,12 +32,14 @@
  */
 public class TaskAssignmentHandlerTest extends JbpmTestCase {
 
+  UserRef userRef = new UserRef("johndoe");
+
   public void testTaskAssignmentHandler() {
     deployJpdlResource("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml");
     
     executionService.startProcessInstanceByKey("TaskAssignmentHandler");
     
-    List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    List<Task> taskList = taskService.findTasksByAssignment(userRef);
     assertEquals(1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -36,7 +36,7 @@
     Execution execution = executionService.startProcessInstanceByKey("TaskCancel");
     String executionId = execution.getId();
     
-    Task task = taskService.getAssigneeTaskList("johndoe",0,1).get(0);
+    Task task = taskService.findTasksByAssignment("johndoe",0,1).get(0);
     
     executionService.signalExecutionById(executionId);
     
@@ -59,7 +59,7 @@
     taskService.submitTask(task.getDbid());
     
     // verify that the task list is now empty
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment("johndoe", 0, 10);
     assertEquals(0, taskList.size());
 
     // verify that process moved to the next state

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,10 +22,12 @@
 package org.jbpm.examples.task.candidates;
 
 import java.util.List;
-import java.util.ArrayList;
 
 import org.jbpm.Execution;
 import org.jbpm.task.Task;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.Participation;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -37,6 +39,9 @@
   public void testGroupCandidateAssignment() {
     // create johndoe and joesmoe as members of the sales-test-group group
     String salesGroupId = identityService.createGroup("sales-test-group");
+    GroupRef salesGroup = new GroupRef(salesGroupId);
+    UserRef johndoe = new UserRef("johndoe");
+    UserRef joesmoe = new UserRef("joesmoe");
 
     identityService.createUser("johndoe", "johndoe", "John", "Doe");
     identityService.createMembership("johndoe", salesGroupId);
@@ -50,30 +55,20 @@
     Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
     String executionId = execution.getId();
 
-    List<String> groupIds = new ArrayList<String>();
-    groupIds.add(salesGroupId);
-
-    List<Task> taskList = taskService.getGroupTaskList(groupIds, 0, 10);
+    List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
     assertEquals("Expected a single task being created", 1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());
-
-    taskList = taskService.getGroupTaskList(groupIds, 0, 10);
-    assertEquals("Expected a single task being created", 1, taskList.size());
-    task = taskList.get(0);
-    assertEquals("review", task.getName());
-
+  
     // lets assume that johndoe takes the task
-    taskService.assignTask(task.getDbid(), "johndoe");
+    taskService.assignTask(task.getDbid(), johndoe);
     
     // verify that the group task lists are now empty
-    taskList = taskService.getGroupTaskList(groupIds, 0, 10);
-    assertEquals("Expected a no task to remain", 0, taskList.size());
-    taskList = taskService.getGroupTaskList(groupIds, 0, 10);
-    assertEquals("Expected a no task to remain",0, taskList.size());
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
+    assertEquals("Expected a no task to remain", 0, taskList.size());   
 
     // verify that the task now shows up in the personal task list for johndoe
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("review", task.getName());
@@ -83,7 +78,7 @@
     taskService.completeTask(task.getDbid());
     
     // verify that the task list is now empty
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(0, taskList.size());
 
     // verify that process moved to the next state

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,13 +21,15 @@
  */
 package org.jbpm.examples.task.swimlane;
 
-import java.util.List;
-import java.util.ArrayList;
-
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.Participation;
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
+import java.util.List;
 
+
 /**
  * @author Tom Baeyens
  */
@@ -36,6 +38,8 @@
   public void testTaskSwimlane() {
     // create johndoe and joesmoe as members of the sales group
     String salesGroupId = identityService.createGroup("sales");
+    GroupRef salesGroup = new GroupRef(salesGroupId);
+    UserRef johndoe = new UserRef("johndoe");
 
     identityService.createUser("johndoe", "johndoe", "John", "Doe");
     identityService.createMembership("johndoe", salesGroupId);
@@ -44,20 +48,17 @@
     
     executionService.startProcessInstanceByKey("TaskSwimlane");
 
-    List<String> groupIds = new ArrayList<String>();
-    groupIds.add(salesGroupId);
-
-    List<Task> taskList = taskService.getGroupTaskList(groupIds, 0, 10);
+    List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
     assertEquals(1, taskList.size());
     Task task = taskList.get(0);
     long taskDbid = task.getDbid();
     assertEquals("enter order data", task.getName());
     assertNull(task.getAssignee());
 
-    assertEquals(0, taskService.getAssigneeTaskList("johndoe", 0, 10).size());
+    assertEquals(0, taskService.findTasksByAssignment(johndoe).size());
 
     // lets assume that johndoe takes the task
-    taskService.assignTask(taskDbid, "johndoe");
+    taskService.assignTask(taskDbid, johndoe);
     
     // the next task will be created and assigned directly to johndoe
     // this is because johndoe was the person that took the previous task 
@@ -65,10 +66,10 @@
     // to know the context of this case
     
     // we'll check that the group task lists for johndoe and joesmoe are empty
-    assertEquals(0, taskService.getGroupTaskList(groupIds, 0, 10).size());
+    assertEquals(0, taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup).size());
 
     // and that the task is directly assigned to johndoe
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("enter order data", task.getName());
@@ -77,7 +78,7 @@
     // submit the task
     taskService.completeTask(taskDbid);
 
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("calculate quote", task.getName());

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -29,6 +29,7 @@
 
 import org.jbpm.Execution;
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -40,12 +41,14 @@
   public void testTaskAssignee() {
     deployJpdlResource("org/jbpm/examples/task/variables/process.jpdl.xml");
 
-    Map<String, Object> variables = new HashMap<String, Object>(); 
+    UserRef johndoe = new UserRef("johndoe");
+
+    Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("category", "big");
     variables.put("dollars", 100000);
     Execution execution = executionService.startProcessInstanceByKey("TaskVariables", variables);
 
-    List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    List<Task> taskList = taskService.findTasksByAssignment(johndoe);
     assertFalse("Task list for assignee was empty", taskList.isEmpty());
     Task task = taskList.get(0);
     long taskDbid = task.getDbid();

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -179,9 +179,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

Modified: jbpm4/trunk/modules/integration/console/integration-console.iml
===================================================================
--- jbpm4/trunk/modules/integration/console/integration-console.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/integration-console.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,10 +9,11 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="toplevel" exported="" />
-    <orderEntry type="module" module-name="gwt-server-integration" exported="" />
-    <orderEntry type="module" module-name="pvm" exported="" />
-    <orderEntry type="module" module-name="gwt-rpc" exported="" />
+    <orderEntry type="module" module-name="gwt-server-integration" />
+    <orderEntry type="module" module-name="toplevel" />
+    <orderEntry type="module" module-name="pvm" />
+    <orderEntry type="module" module-name="gwt-rpc" />
+    <orderEntry type="module" module-name="api" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
         <CLASSES>
@@ -32,15 +33,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
@@ -69,8 +61,8 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-spi/1.0.0-SNAPSHOT/idm-spi-1.0.0-SNAPSHOT.jar!/" />
         </CLASSES>
@@ -78,19 +70,17 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: javax.transaction:jta:jar:1.1:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
-        </SOURCES>
+        <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: junit:junit:jar:3.8.1:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: junit:junit:jar:3.8.1:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
         </CLASSES>
@@ -98,8 +88,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar!/" />
         </CLASSES>
@@ -107,8 +97,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
         </CLASSES>
@@ -116,8 +106,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
         </CLASSES>
@@ -125,8 +115,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/cache/jbosscache-core/3.0.2.GA/jbosscache-core-3.0.2.GA.jar!/" />
         </CLASSES>
@@ -134,26 +124,26 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: antlr:antlr:jar:2.7.6:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: juel:juel-engine:jar:2.1.0:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: juel:juel-engine:jar:2.1.0:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: antlr:antlr:jar:2.7.6:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: asm:asm:jar:1.5.3:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: asm:asm:jar:1.5.3:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
         </CLASSES>
@@ -161,8 +151,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: javassist:javassist:jar:3.4.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: javassist:javassist:jar:3.4.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
         </CLASSES>
@@ -170,8 +160,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0-SNAPSHOT:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0-SNAPSHOT:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-api/1.0.0-SNAPSHOT/idm-api-1.0.0-SNAPSHOT.jar!/" />
         </CLASSES>
@@ -179,8 +169,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/" />
         </CLASSES>
@@ -188,8 +178,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0-SNAPSHOT:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0-SNAPSHOT:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm/1.0.0-SNAPSHOT/idm-1.0.0-SNAPSHOT.jar!/" />
         </CLASSES>
@@ -197,35 +187,35 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: juel:juel:jar:2.1.0:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0-SNAPSHOT:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0-SNAPSHOT/idm-common-1.0.0-SNAPSHOT.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: juel:juel:jar:2.1.0:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0-SNAPSHOT:provided">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0-SNAPSHOT/idm-common-1.0.0-SNAPSHOT.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jgroups/jgroups/2.6.7.GA/jgroups-2.6.7.GA.jar!/" />
         </CLASSES>
@@ -235,17 +225,26 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:provided">
         <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:provided">
+        <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.8/jaxb-impl-2.1.8.jar!/" />
         </CLASSES>
         <JAVADOC />
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
         </CLASSES>
@@ -253,8 +252,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar!/" />
         </CLASSES>
@@ -262,8 +261,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: juel:juel-impl:jar:2.1.0:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: juel:juel-impl:jar:2.1.0:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
         </CLASSES>
@@ -271,8 +270,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
         </CLASSES>
@@ -280,8 +279,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
         </CLASSES>
@@ -291,8 +290,8 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: cglib:cglib:jar:2.1_3:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: cglib:cglib:jar:2.1_3:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
         </CLASSES>
@@ -300,8 +299,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
         </CLASSES>
@@ -309,8 +308,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
         </CLASSES>
@@ -320,8 +319,8 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
         </CLASSES>
@@ -329,8 +328,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
         </CLASSES>
@@ -338,8 +337,8 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
         </CLASSES>
@@ -349,8 +348,8 @@
         </SOURCES>
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: log4j:log4j:jar:1.2.14:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: log4j:log4j:jar:1.2.14:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
         </CLASSES>

Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -120,10 +120,10 @@
     task.setProcessId( execution.getProcessInstance().getProcessInstance().getId() );
 
 
-    // participants
-    for(Participant p0 : cast.getParticipants())
+    // participations
+    for(Participation p0 : cast.getParticipations())
     {
-      if(p0.getParticipation().equals(Participant.CANDIDATE))
+      if(p0.getType().equals(Participation.CANDIDATE))
       {
         IdentityRef idRef = p0.getIdentityRef();
         ParticipantRef participant = new ParticipantRef("candidate", idRef.getId());
@@ -144,7 +144,7 @@
       }
       else
       {
-        throw new IllegalArgumentException("Unknown participation type: " +p0.getParticipation());        
+        throw new IllegalArgumentException("Unknown participation type: " +p0.getType());
       }
 
     }

Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -51,12 +51,13 @@
     TaskService taskService = this.processEngine.get(TaskService.class);
     List<TaskRef> results = new ArrayList<TaskRef>();
 
-    if(null==participationType || participationType.equals(Participant.CANDIDATE))
+    if(null==participationType || participationType.equals(Participation.CANDIDATE))
     {
       // TODO: Paging
-      List<Task> assignedTasks = taskService.getAssigneeTaskList(idRef, 0 , 100);
-      List<Task> userTasks = taskService.getUserTaskList(idRef, 0 , 100);
-      List<Task> groupTasks = taskService.getGroupTaskList(getGroupIdsForIdentityRef(idRef), 0 , 100);
+      UserRef user = new UserRef(idRef);
+      List<Task> assignedTasks = taskService.findTasksByAssignment(user);
+      List<Task> userTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, user);
+      List<Task> groupTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, new GroupRef(idRef));
 
       adoptTasks(assignedTasks, results);
       adoptTasks(userTasks, results);
@@ -101,13 +102,13 @@
   public void assignTask(long taskId, String idRef)
   {
     TaskService taskService = this.processEngine.get(TaskService.class);
-    taskService.assignTask(taskId, idRef);
+    taskService.assignTask(taskId, new UserRef(idRef));
   }
 
   public void releaseTask(long taskId)
   {
     TaskService taskService = this.processEngine.get(TaskService.class);
-    taskService.assignTask(taskId, null);
+    taskService.assignTask(taskId, null);    // TODO: verify API usage
   }
 
   public void completeTask(long taskId, String outcome)

Modified: jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -12,7 +12,7 @@
     <orderEntry type="module" module-name="toplevel" exported="" />
     <orderEntry type="module" module-name="pvm" exported="" />
     <orderEntry type="module" module-name="jpdl" exported="" />
-    <orderEntry type="module" module-name="integration-spi" exported="" />
+    <orderEntry type="module" module-name="api" exported="" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:compile">
         <CLASSES>
@@ -217,15 +217,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: org.jboss.man:jboss-metatype:jar:2.0.0.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar!/" />

Modified: jbpm4/trunk/modules/integration/spi/integration-spi.iml
===================================================================
--- jbpm4/trunk/modules/integration/spi/integration-spi.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/spi/integration-spi.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,9 +9,10 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="toplevel" exported="" />
-    <orderEntry type="module" module-name="pvm" exported="" />
-    <orderEntry type="module" module-name="jpdl" exported="" />
+    <orderEntry type="module" module-name="toplevel" />
+    <orderEntry type="module" module-name="pvm" />
+    <orderEntry type="module" module-name="jpdl" />
+    <orderEntry type="module" module-name="api" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
         <CLASSES>
@@ -438,15 +439,6 @@
       </library>
     </orderEntry>
     <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library" exported="">
       <library name="M2 Dep: org.jboss.man:jboss-metatype:jar:2.0.0.GA:provided">
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar!/" />
@@ -1089,15 +1081,13 @@
         <SOURCES />
       </library>
     </orderEntry>
-    <orderEntry type="module-library" exported="">
-      <library name="M2 Dep: javax.transaction:jta:jar:1.1:compile">
+    <orderEntry type="module-library">
+      <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
         <CLASSES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES>
-          <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
-        </SOURCES>
+        <SOURCES />
       </library>
     </orderEntry>
     <orderEntryProperties />

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,7 +32,7 @@
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
 import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
 import org.jbpm.pvm.internal.task.SwimlaneImpl;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
@@ -93,8 +93,8 @@
       
       // copy the swimlane assignments to the task
       task.setAssignee(swimlane.getAssignee());
-      for (ParticipantImpl participant: swimlane.getParticipants()) {
-        task.addParticipant(participant.getIdentityRef(), participant.getParticipation());
+      for (ParticipationImpl participant: swimlane.getParticipations()) {
+        task.addParticipant(participant.getIdentityRef(), participant.getType());
       }
     }
 
@@ -123,7 +123,7 @@
                                       assignableDefinition.getCandidateUsersExpressionLanguage());
       StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
       while (tokenizer.hasMoreTokens()) {
-        String candidateUser = tokenizer.nextToken();
+        String candidateUser = tokenizer.nextToken().trim();
         assignable.addCandidateUser(candidateUser);
       }
     }

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -179,9 +179,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,6 +22,7 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.JbpmException;
+import org.jbpm.task.UserRef;
 import org.jbpm.env.Environment;
 import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.session.TaskDbSession;
@@ -35,11 +36,11 @@
   private static final long serialVersionUID = 1L;
   
   protected long taskDbid;
-  protected String assigneeUserId;
+  protected UserRef userRef;
 
-  public AssignTaskCmd(long taskDbid, String assigneeUserId) {
+  public AssignTaskCmd(long taskDbid, UserRef user) {
     this.taskDbid = taskDbid;
-    this.assigneeUserId = assigneeUserId;
+    this.userRef = user;
   }
 
   public Void execute(Environment environment) {
@@ -48,7 +49,7 @@
     if (task==null) {
       throw new JbpmException("task "+taskDbid+" does not exist");
     }
-    task.setAssignee(assigneeUserId, true);
+    task.setAssignee(userRef.getId(), true);
     return null;
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,16 +26,15 @@
 import org.hibernate.Query;
 import org.hibernate.Session;
 import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
 import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
-import org.jbpm.task.Participant;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
+import org.jbpm.task.Participation;
 
 
 /**
  * @author Tom Baeyens
  */
-public class GetParticipantsCmd extends AbstractCommand<List<Participant>> {
+public class GetParticipantsCmd extends AbstractCommand<List<Participation>> {
   
   private static final long serialVersionUID = 1L;
 
@@ -47,10 +46,10 @@
     this.swimlaneDbid = swimlaneDbid;
   }
 
-  public List<Participant> execute(Environment environment) throws Exception {
+  public List<Participation> execute(Environment environment) throws Exception {
     StringBuffer hql = new StringBuffer();
     hql.append("select role from ");
-    hql.append(ParticipantImpl.class.getName());
+    hql.append(ParticipationImpl.class.getName());
     hql.append(" as role where ");
     
     if (taskDbid!=null) {
@@ -73,7 +72,7 @@
       query.setLong("swimlaneDbid", swimlaneDbid);
     } 
 
-    List<Participant> participants = query.list();
-    return participants;
+    List<Participation> participations = query.list();
+    return participations;
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,9 +26,8 @@
 
 import org.hibernate.Session;
 import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
 import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
 import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.task.IdentityRef;
 
@@ -43,13 +42,13 @@
   protected Long taskDbid;
   protected Long swimlaneDbid;
   protected IdentityRef identityRef;
-  protected String participation;
+  protected String participationType;
   
-  public RemoveParticipantCmd(Long taskDbid, Long swimlaneDbid, IdentityRef identityRef, String participation) {
+  public RemoveParticipantCmd(Long taskDbid, Long swimlaneDbid, IdentityRef identityRef, String participationType) {
     this.swimlaneDbid = swimlaneDbid;
     this.taskDbid = taskDbid;
     this.identityRef = identityRef;
-    this.participation = participation;
+    this.participationType = participationType;
   }
 
   public Object execute(Environment environment) throws Exception {
@@ -62,10 +61,10 @@
         throw new JbpmException("task "+taskDbid+" was not found");
       }
 
-      Set<ParticipantImpl> participants = new HashSet<ParticipantImpl>(task.getParticipants());
-      for (ParticipantImpl participant : participants) {
+      Set<ParticipationImpl> participants = new HashSet<ParticipationImpl>(task.getParticipations());
+      for (ParticipationImpl participant : participants) {
         if ( participant.getIdentityRef().equals(identityRef)
-             && participant.getParticipation().equals(participation)
+             && participant.getType().equals(participationType)
            ) {
           task.removeParticipant(participant);
         }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,15 +21,15 @@
  */
 package org.jbpm.pvm.internal.identity.impl;
 
-import java.util.List;
-
 import org.hibernate.Query;
 import org.hibernate.Session;
 import org.jbpm.identity.Group;
 import org.jbpm.identity.User;
 import org.jbpm.pvm.internal.identity.spi.IdentitySession;
 
+import java.util.List;
 
+
 /**
  * @author Tom Baeyens
  */
@@ -37,16 +37,18 @@
   
   protected Session session;
 
-  public void createUser(String userName, String password, String givenName, String familyName) {
+  public String createUser(String userName, String password, String givenName, String familyName) {
     UserImpl user = new UserImpl();
     user.setId(userName);
     user.setPassword(password);
     user.setGivenName(givenName);
     user.setFamilyName(familyName);
     session.save(user);
+    
+    return user.getId();
   }
 
-  public UserImpl findUserById(String userId) {
+  public User findUserById(String userId) {
     UserImpl user = (UserImpl) session.createQuery(
       "select user " +
       "from "+UserImpl.class.getName()+" as user " +
@@ -62,7 +64,7 @@
   }
 
   public void deleteUser(String userId) {
-    UserImpl user = findUserById(userId);
+    User user = findUserById(userId);
     session.delete(user);
   }
 
@@ -123,7 +125,7 @@
   }
 
   public void createMembership(String userId, String groupId, String role) {
-    UserImpl user = findUserById(userId);
+    User user = findUserById(userId);
     GroupImpl group = findGroupById(groupId);
     
     MembershipImpl membership = new MembershipImpl();

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -61,7 +61,7 @@
     transaction.enlistResource(identitySessionResource);
   }
 
-  public void createUser(String userName, String password, String givenName, String lastName) {
+  public String createUser(String userName, String password, String givenName, String lastName) {
     try {
       Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
       
@@ -76,6 +76,9 @@
     } catch (IdentityException e) {
       throw new JbpmException("couldn't create user "+userName, e);
     }
+
+    throw new RuntimeException("Not yet implemented");
+    // TODO: create and return user
   }
 
   public List<User> findUsers() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,7 +21,10 @@
  */
 package org.jbpm.pvm.internal.identity.impl;
 
+import org.jbpm.identity.User;
+import org.jbpm.identity.Group;
 
+
 /**
  * @author Tom Baeyens
  */
@@ -30,23 +33,23 @@
   protected long dbid;
   protected int dbversion;
 
-  protected UserImpl user;
-  protected GroupImpl group;
+  protected User user;
+  protected Group group;
   protected String role;
   
-  public UserImpl getUser() {
+  public User getUser() {
     return user;
   }
   
-  public void setUser(UserImpl user) {
+  public void setUser(User user) {
     this.user = user;
   }
   
-  public GroupImpl getGroup() {
+  public Group getGroup() {
     return group;
   }
   
-  public void setGroup(GroupImpl group) {
+  public void setGroup(Group group) {
     this.group = group;
   }
   

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -33,7 +33,7 @@
 public interface IdentitySession {
 
   /** create a new user */
-  void createUser(String userId, String password, String givenName, String familyName);
+  String createUser(String userId, String password, String givenName, String familyName);
   
   /** lookup a user 
    * @return the user or null if no such user exists */

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,12 +32,11 @@
 import org.jbpm.pvm.internal.cmd.*;
 import org.jbpm.pvm.internal.task.TaskImpl;
 import org.jbpm.pvm.internal.task.TaskQueryImpl;
-import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.Task;
+import org.jbpm.task.*;
 
 /**
  * @author Alejandro Guizar, Tom Baeyens
+ * @author Heiko Braun <heiko.braun at jboss.com>
  */
 public class TaskServiceImpl extends AbstractServiceImpl implements TaskService {
 
@@ -70,7 +69,7 @@
   public void completeTask(long taskDbid) {
     completeTask(taskDbid, null);
   }
-  
+
   public void completeTask(long taskDbid, String outcome) {
     CompleteTaskCmd cmd = new CompleteTaskCmd(taskDbid, outcome);
     commandService.execute(cmd);
@@ -81,7 +80,7 @@
     commandService.execute(cmd);
   }
 
-  public List<Participant> getTaskParticipants(long taskDbid) {
+  public List<Participation> getTaskParticipants(long taskDbid) {
     GetParticipantsCmd cmd = new GetParticipantsCmd(taskDbid, null);
     return commandService.execute(cmd);
   }
@@ -96,7 +95,7 @@
     commandService.execute(cmd);
   }
 
-  public List<Participant> getSwimlaneParticipants(long swimlaneDbid) {
+  public List<Participation> getSwimlaneParticipants(long swimlaneDbid) {
     GetParticipantsCmd cmd = new GetParticipantsCmd(null, swimlaneDbid);
     return commandService.execute(cmd);
   }
@@ -106,31 +105,29 @@
     commandService.execute(cmd);
   }
 
-  public List<Task> getAssigneeTaskList(String identityRefId, int firstResult, int maxResults) {
+  public List<Task> findTasksByAssignment(UserRef user) {
     return createTaskQuery()
-      .assignee(identityRefId)
-      .orderDesc(TaskQuery.PROPERTY_PRIORITY)
-      .page(firstResult, maxResults)
-      .execute();
+        .assignee(user.getId())
+        .orderDesc(TaskQuery.PROPERTY_PRIORITY)        
+        .execute();
   }
 
-  public List<Task> getUserTaskList(String userId, int firstResult, int maxResults)
+  public List<Task> findTasksByParticipation(String participation, UserRef user)
   {
-     return createTaskQuery()
-      .unassigned()
-      .candidate(userId)
-      .orderDesc(TaskQuery.PROPERTY_PRIORITY)
-      .page(firstResult, maxResults)
-      .execute();
+    return createTaskQuery()
+        .unassigned()
+        .participatingUser(Participation.CANDIDATE, user)
+        .orderDesc(TaskQuery.PROPERTY_PRIORITY)        
+        .execute();
   }
 
-  public List<Task> getGroupTaskList(List<String> groupIds, int firstResult, int maxResults) {
+  public List<Task> findTasksByParticipation(String participation, GroupRef... groups)
+  {
     return createTaskQuery()
-      .unassigned()
-      .candidateGroups(groupIds)
-      .orderDesc(TaskQuery.PROPERTY_PRIORITY)
-      .page(firstResult, maxResults)
-      .execute();
+        .unassigned()
+        .participatingGroups(Participation.CANDIDATE, groups)
+        .orderDesc(TaskQuery.PROPERTY_PRIORITY)
+        .execute();
   }
 
   public TaskQuery createTaskQuery() {
@@ -167,8 +164,8 @@
     return commandService.execute(cmd);
   }
 
-  public void assignTask(long taskDbid, String assigneeUserId) {
-    AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, assigneeUserId);
+  public void assignTask(long taskDbid, UserRef user) {
+    AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, user);
     addTxWireObjects(cmd);
     commandService.execute(cmd);
   }

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.task;
-
-import java.io.Serializable;
-
-import org.jbpm.JbpmException;
-import org.jbpm.task.Assignable;
-import org.jbpm.task.GroupRef;
-import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.UserRef;
-
-
-/** the relation between a task and a person.
- * @author Tom Baeyens
- */
-public class ParticipantImpl implements Serializable, Participant {
-
-  private static final long serialVersionUID = 1L;
-
-  protected long dbid;
-  protected int dbversion;
-  
-  protected String userId;
-  protected String groupId; 
-  protected String participation;
-  protected TaskImpl task;
-  protected SwimlaneImpl swimlane;
-  
-  public ParticipantImpl() {
-  }
-  
-  public ParticipantImpl(IdentityRef identityRef, String participation) {
-    setIdentityRef(identityRef);
-    this.participation = participation;
-  }
-  
-  public IdentityRef getIdentityRef() {
-    if (userId!=null) {
-      return new UserRef(userId);
-    }
-    return new GroupRef(groupId);
-  }
-
-  public void setIdentityRef(IdentityRef identityRef) {
-    if (identityRef==null) {
-      throw new JbpmException("identityRef is null");
-    }
-
-    if (identityRef instanceof UserRef) {
-      userId = identityRef.getId();
-    } else if (identityRef instanceof GroupRef) {
-      groupId = identityRef.getId();
-    } else {
-      throw new JbpmException("invalid identity type: "+identityRef.getClass().getName());
-    }
-  }
-
-  public TaskImpl getTask() {
-    return task;
-  }
-  public void setTask(TaskImpl task) {
-    this.task = task;
-  }
-  public long getDbid() {
-    return dbid;
-  }
-  public SwimlaneImpl getSwimlane() {
-    return swimlane;
-  }
-  public void setSwimlane(SwimlaneImpl swimlane) {
-    this.swimlane = swimlane;
-  }
-  public String getParticipation() {
-    return participation;
-  }
-  public void setParticipation(String participation) {
-    this.participation = participation;
-  }
-  public String getUserId() {
-    return userId;
-  }
-  public void setUserId(String userId) {
-    this.userId = userId;
-  }
-  public String getGroupId() {
-    return groupId;
-  }
-  public void setGroupId(String groupId) {
-    this.groupId = groupId;
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java (from rev 4353, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -0,0 +1,112 @@
+/*
+ * 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.task;
+
+import java.io.Serializable;
+
+import org.jbpm.JbpmException;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.IdentityRef;
+import org.jbpm.task.Participation;
+import org.jbpm.task.UserRef;
+
+
+/** the relation between a task and a person.
+ * @author Tom Baeyens
+ */
+public class ParticipationImpl implements Serializable, Participation
+{
+
+  private static final long serialVersionUID = 1L;
+
+  protected long dbid;
+  protected int dbversion;
+  
+  protected String userId;
+  protected String groupId; 
+  protected String participation;
+  protected TaskImpl task;
+  protected SwimlaneImpl swimlane;
+  
+  public ParticipationImpl() {
+  }
+  
+  public ParticipationImpl(IdentityRef identityRef, String participation) {
+    setIdentityRef(identityRef);
+    this.participation = participation;
+  }
+  
+  public IdentityRef getIdentityRef() {
+    if (userId!=null) {
+      return new UserRef(userId);
+    }
+    return new GroupRef(groupId);
+  }
+
+  public void setIdentityRef(IdentityRef identityRef) {
+    if (identityRef==null) {
+      throw new JbpmException("identityRef is null");
+    }
+
+    if (identityRef instanceof UserRef) {
+      userId = identityRef.getId();
+    } else if (identityRef instanceof GroupRef) {
+      groupId = identityRef.getId();
+    } else {
+      throw new JbpmException("invalid identity type: "+identityRef.getClass().getName());
+    }
+  }
+
+  public TaskImpl getTask() {
+    return task;
+  }
+  public void setTask(TaskImpl task) {
+    this.task = task;
+  }
+  public long getDbid() {
+    return dbid;
+  }
+  public SwimlaneImpl getSwimlane() {
+    return swimlane;
+  }
+  public void setSwimlane(SwimlaneImpl swimlane) {
+    this.swimlane = swimlane;
+  }
+  public String getType() {
+    return participation;
+  }
+  public void setParticipation(String participation) {
+    this.participation = participation;
+  }
+  public String getUserId() {
+    return userId;
+  }
+  public void setUserId(String userId) {
+    this.userId = userId;
+  }
+  public String getGroupId() {
+    return groupId;
+  }
+  public void setGroupId(String groupId) {
+    this.groupId = groupId;
+  }
+}


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,7 +24,7 @@
 import java.io.Serializable;
 
 /**
- * is a process role (aka participant).
+ * is a process role (aka participatingUser).
  */
 public class SwimlaneDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,7 +32,7 @@
 import org.jbpm.task.Assignable;
 import org.jbpm.task.GroupRef;
 import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
 import org.jbpm.task.Swimlane;
 import org.jbpm.task.UserRef;
 
@@ -48,7 +48,7 @@
   protected String name = null;
   protected String assignee = null;
   protected ExecutionImpl execution = null;
-  protected Set<ParticipantImpl> participants = null;
+  protected Set<ParticipationImpl> participations = null;
   protected SwimlaneDefinitionImpl swimlaneDefinition = null;
   
   // assignment methods ///////////////////////////////////////////////////////
@@ -61,50 +61,50 @@
     this.assignee = assignee;
   }
 
-  // participants /////////////////////////////////////////////////////////////
+  // participations /////////////////////////////////////////////////////////////
   
-  public Set<ParticipantImpl> getParticipants() {
-    if (participants==null) {
+  public Set<ParticipationImpl> getParticipations() {
+    if (participations ==null) {
       return Collections.emptySet();
     }
-    return participants;
+    return participations;
   }
 
-  public Participant addParticipant(IdentityRef identityRef, String participation) {
+  public Participation addParticipant(IdentityRef identityRef, String participation) {
     if (identityRef==null) {
       throw new JbpmException("identityRef is null");
     }
     if (participation==null) {
       throw new JbpmException("participation is null");
     }
-    return addParticipant(new ParticipantImpl(identityRef, participation));
+    return addParticipant(new ParticipationImpl(identityRef, participation));
   }
   
   public void addCandidateGroup(String groupId) {
-    addParticipant(new GroupRef(groupId), Participant.CANDIDATE);
+    addParticipant(new GroupRef(groupId), Participation.CANDIDATE);
   }
 
   public void addCandidateUser(String userId) {
-    addParticipant(new UserRef(userId), Participant.CANDIDATE);
+    addParticipant(new UserRef(userId), Participation.CANDIDATE);
   }
 
-  private Participant addParticipant(ParticipantImpl participant) {
+  private Participation addParticipant(ParticipationImpl participant) {
     participant.setSwimlane(this);
-    if (participants==null) {
-      participants = new HashSet<ParticipantImpl>();
+    if (participations ==null) {
+      participations = new HashSet<ParticipationImpl>();
     }
-    participants.add(participant);
+    participations.add(participant);
     return participant;
   }
 
-  public void removeParticipant(ParticipantImpl participant) {
+  public void removeParticipant(ParticipationImpl participant) {
     if (participant==null) {
       throw new JbpmException("participant is null");
     }
-    if ( (participants!=null)
-         && (participants.remove(participant))
+    if ( (participations !=null)
+         && (participations.remove(participant))
        ) {
-      ((ParticipantImpl)participant).setSwimlane(null);
+      ((ParticipationImpl)participant).setSwimlane(null);
     }
   }
   

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -48,7 +48,7 @@
 import org.jbpm.task.GroupRef;
 import org.jbpm.task.IdentityRef;
 import org.jbpm.task.OpenTask;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
 import org.jbpm.task.Swimlane;
 import org.jbpm.task.Task;
 import org.jbpm.task.TaskHandler;
@@ -73,7 +73,7 @@
 
   protected String assignee;
   protected String nomination;
-  protected Set<ParticipantImpl> participants;
+  protected Set<ParticipationImpl> participations;
 
   protected Date create;
   protected Date dueDate;
@@ -126,64 +126,64 @@
     }
   }
 
-  // participants /////////////////////////////////////////////////////////////
+  // participations /////////////////////////////////////////////////////////////
 
   // TODO: Why does it return the impl. not the interface?
-  public Set<ParticipantImpl> getParticipants() {
-    if (participants==null) {
+  public Set<ParticipationImpl> getParticipations() {
+    if (participations ==null) {
       return Collections.emptySet();
     }
-    return participants;
+    return participations;
   }
 
-  public Set<ParticipantImpl> getAllParticipants() {
-    Set<ParticipantImpl> allRoles = null;
-    if (participants!=null) {
-      allRoles = new HashSet<ParticipantImpl>(participants);
+  public Set<ParticipationImpl> getAllParticipants() {
+    Set<ParticipationImpl> allRoles = null;
+    if (participations !=null) {
+      allRoles = new HashSet<ParticipationImpl>(participations);
     } else {
-      allRoles = new HashSet<ParticipantImpl>();
+      allRoles = new HashSet<ParticipationImpl>();
     }
     if (swimlane!=null) {
-      allRoles.addAll((Set)swimlane.getParticipants());
+      allRoles.addAll((Set)swimlane.getParticipations());
     }
     return allRoles;
   }
 
-  public Participant addParticipant(IdentityRef identityRef, String participation) {
+  public Participation addParticipant(IdentityRef identityRef, String participation) {
     if (identityRef==null) {
       throw new JbpmException("identityRef is null");
     }
     if (participation==null) {
       throw new JbpmException("participation is null");
     }
-    return addParticipant(new ParticipantImpl(identityRef, participation));
+    return addParticipant(new ParticipationImpl(identityRef, participation));
   }
   
   public void addCandidateGroup(String groupId) {
-    addParticipant(new GroupRef(groupId), Participant.CANDIDATE);
+    addParticipant(new GroupRef(groupId), Participation.CANDIDATE);
   }
 
   public void addCandidateUser(String userId) {
-    addParticipant(new UserRef(userId), Participant.CANDIDATE);
+    addParticipant(new UserRef(userId), Participation.CANDIDATE);
   }
 
-  private Participant addParticipant(ParticipantImpl participant) {
+  private Participation addParticipant(ParticipationImpl participant) {
     participant.setTask(this);
-    if (participants==null) {
-      participants = new HashSet<ParticipantImpl>();
+    if (participations ==null) {
+      participations = new HashSet<ParticipationImpl>();
     }
-    participants.add(participant);
+    participations.add(participant);
     return participant;
   }
 
-  public void removeParticipant(ParticipantImpl participant) {
+  public void removeParticipant(ParticipationImpl participant) {
     if (participant==null) {
       throw new JbpmException("participant is null");
     }
-    if ( (participants!=null)
-         && (participants.remove(participant))
+    if ( (participations !=null)
+         && (participations.remove(participant))
        ) {
-      ((ParticipantImpl)participant).setTask(null);
+      ((ParticipationImpl)participant).setTask(null);
     }
   }
   
@@ -443,8 +443,8 @@
   public void setSuperTaskDbid(Long parentTaskDbid) {
     this.superTaskDbid = parentTaskDbid;
   }
-  public void setParticipants(Set<ParticipantImpl> participants) {
-    this.participants = participants;
+  public void setParticipations(Set<ParticipationImpl> participations) {
+    this.participations = participations;
   }
   public void setState(String state) {
     this.state = state;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,13 +26,17 @@
 import org.jbpm.cmd.CommandService;
 import org.jbpm.pvm.internal.query.AbstractQuery;
 import org.jbpm.pvm.internal.query.Page;
-import org.jbpm.task.Task;
+import org.jbpm.task.*;
 
 import java.util.List;
+import java.util.Set;
+import java.util.ArrayList;
+import java.util.HashSet;
 
 
 /**
  * @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun at jboss.com>
  */
 public class TaskQueryImpl extends AbstractQuery implements TaskQuery {
 
@@ -41,10 +45,9 @@
   private static final String UNASSIGNED = "unassigned";
 
   protected String assignee = null;
-  protected String candidate = null;
+  
+  protected Set<Participation> participations = new HashSet<Participation>();
 
-  protected List<String> groupIds = null;
-
   public TaskQueryImpl(CommandService commandService) {
     super(commandService);
   }
@@ -53,19 +56,20 @@
     this.assignee = assignee;
     return this;
   }
-
-  public TaskQuery candidate(String userId) {
-    this.candidate = userId;
+  
+  public TaskQuery participatingUser(String participation, UserRef user)
+  {    
+    this.participations.add(new ParticipationImpl(user, participation));
     return this;
   }
 
-  public TaskQuery candidateGroups(List<String> groups)
+  public TaskQuery participatingGroups(String participation, GroupRef... groups)
   {
-    if(candidate!=null)
-      throw new IllegalArgumentException("Illegal query: Can either select by candiate or candidateGroup, not both");
-
-    this.groupIds = groups;
-    return this;
+    for(GroupRef g : groups)
+    {
+       this.participations.add(new ParticipationImpl(g, participation));
+    }
+    return this;  
   }
 
   public TaskQuery unassigned() {
@@ -97,13 +101,26 @@
       query.setString("assignee", assignee);
     }
 
-    if(candidate!=null)
-    {
-      query.setString("candidate", candidate);
-    }
+    if(participations.size() > 0)
+    {      
+      Participation participation = participations.iterator().next();
+      IdentityRef idRef = participation.getIdentityRef();
 
-    if (groupIds!=null) {
-      query.setParameterList("groupIds", groupIds);
+      query.setString("participation", participation.getType());
+      if(idRef instanceof UserRef)
+      {
+        query.setString("userId", idRef.getId());
+      }
+      else
+      {
+        List<String> groupIds = new ArrayList<String>();
+        for(Participation p : participations)
+        {
+          groupIds.add(p.getIdentityRef().getId());
+        }
+        
+        query.setParameterList("groupIds", groupIds);
+      }
     }
   }
 
@@ -114,21 +131,23 @@
     hql.append(TaskImpl.class.getName());
     hql.append(" as task ");
 
-    // participants
-    if(candidate!=null || groupIds!=null)
+    // participations
+    if(participations.size() > 0)
     {
       hql.append(", ");
-      hql.append(ParticipantImpl.class.getName());
+      hql.append(ParticipationImpl.class.getName());
       hql.append(" as participant ");
 
       appendWhereClause("participant.task = task ", hql);
-      appendWhereClause("participant.participation = 'candidate' ", hql);
+      appendWhereClause("participant.participation = :participation ", hql);
 
-      if(candidate!=null)
+      Participation sample = participations.iterator().next();
+      if(sample.getIdentityRef() instanceof UserRef)
       {
-        appendWhereClause("(participant.userId = :candidate)", hql);
+        appendWhereClause("(participant.userId = :userId)", hql);
       }
-      else if (groupIds!=null && !groupIds.isEmpty()) {
+      else
+      {
         appendWhereClause("(participant.groupId in (:groupIds) ) ", hql);
       }
     }

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -179,9 +179,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

Modified: jbpm4/trunk/modules/test-db/jbpm4-test-db.iml
===================================================================
--- jbpm4/trunk/modules/test-db/jbpm4-test-db.iml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/jbpm4-test-db.iml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -17,6 +17,7 @@
     <orderEntry type="module" module-name="toplevel" exported="" />
     <orderEntry type="module" module-name="pvm" exported="" />
     <orderEntry type="module" module-name="jpdl" exported="" />
+    <orderEntry type="module" module-name="api" exported="" />
     <orderEntry type="module-library" exported="">
       <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
         <CLASSES>

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,6 +27,8 @@
 
 import org.jbpm.Execution;
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
+import org.jbpm.task.Participation;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -35,6 +37,9 @@
  */
 public class TaskCandidatesTest extends JbpmTestCase {
 
+  UserRef johndoe = new UserRef("johndoe");
+  UserRef joesmoe = new UserRef("joesmoe");
+  
   public void testCommaSeparatedTaskCandidates() {
     deployJpdlXmlString(
       "<process name='TaskCandidates'>" +
@@ -51,28 +56,28 @@
     
     Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
     String executionId = execution.getId();
-    
-    List<Task> taskList = taskService.getUserTaskList("johndoe", 0, 10);
+
+    List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
     assertEquals(1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());
 
-    taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("review", task.getName());
 
     // lets assume that johndoe takes the task
-    taskService.assignTask(task.getDbid(), "johndoe");
+    taskService.assignTask(task.getDbid(), johndoe);
     
     // verify that the group task lists are now empty
-    taskList = taskService.getUserTaskList("johndoe", 0, 10);
+    taskList =taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
     assertEquals(0, taskList.size());
-    taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
     assertEquals(0, taskList.size());
 
     // verify that the task now shows up in the personal task list for johndoe
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("review", task.getName());
@@ -82,7 +87,7 @@
     taskService.completeTask(task.getDbid());
     
     // verify that the task list is now empty
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(0, taskList.size());
 
     // verify that process moved to the next state
@@ -110,27 +115,27 @@
     Execution execution = executionService.startProcessInstanceByKey("TaskCandidates", variables);
     String executionId = execution.getId();
     
-    List<Task> taskList = taskService.getUserTaskList("johndoe", 0, 10);
+    List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
     assertEquals(1, taskList.size());
     Task task = taskList.get(0);
     assertEquals("review", task.getName());
 
-    taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("review", task.getName());
 
     // take the task
-    taskService.assignTask(task.getDbid(), "johndoe");
+    taskService.assignTask(task.getDbid(), johndoe);
     
     // verify that the group task lists are now empty
-    taskList = taskService.getUserTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
     assertEquals(0, taskList.size());
-    taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+    taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
     assertEquals(0, taskList.size());
 
     // verify that the task now shows up in the personal task list for johndoe
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(1, taskList.size());
     task = taskList.get(0);
     assertEquals("review", task.getName());
@@ -140,7 +145,7 @@
     taskService.completeTask(task.getDbid());
     
     // verify that the task list is now empty
-    taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(johndoe);
     assertEquals(0, taskList.size());
 
     // verify that process moved to the next state

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -32,6 +33,9 @@
  */
 public class TaskListTest extends JbpmTestCase {
 
+  UserRef johndoe = new UserRef("johndoe");
+  UserRef joesmoe = new UserRef("joesmoe");
+  
   public void testPersonalTaskList() {
     Task task = taskService.newTask();
     task.setName("do laundry");
@@ -53,13 +57,13 @@
     task.setAssignee("joesmoe");
     saveAndRegisterTask(task);
 
-    List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+    List<Task> taskList = taskService.findTasksByAssignment(johndoe);
     assertNotNull(taskList);
     
     assertEquals("do laundry", taskList.get(0).getName());
     assertEquals(1, taskList.size());
 
-    taskList = taskService.getAssigneeTaskList("joesmoe", 0, 10);
+    taskList = taskService.findTasksByAssignment(joesmoe);
     assertNotNull(taskList);
     
     assertContainsTask(taskList, "get good idea");
@@ -100,7 +104,7 @@
     task.setPriority(10);
     saveAndRegisterTask(task);
 
-    List<Task> taskList = taskService.getAssigneeTaskList("joesmoe", 0, 10);
+    List<Task> taskList = taskService.findTasksByAssignment(joesmoe);
     assertNotNull(taskList);
     
     // default sort order is based on the priority

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java	2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,7 +27,7 @@
 
 import org.jbpm.task.GroupRef;
 import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
 import org.jbpm.task.Task;
 import org.jbpm.task.UserRef;
 import org.jbpm.test.JbpmTestCase;
@@ -43,15 +43,15 @@
     task.setName("do laundry");
     long taskDbid = saveAndRegisterTask(task);
     
-    taskService.addTaskParticipant(taskDbid, new UserRef("johndoe"), Participant.CANDIDATE);
-    taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.CANDIDATE);
-    taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.OWNER);
-    taskService.addTaskParticipant(taskDbid, new GroupRef("losers"), Participant.CANDIDATE);
-    taskService.addTaskParticipant(taskDbid, new GroupRef("dummies"), Participant.CANDIDATE);
+    taskService.addTaskParticipant(taskDbid, new UserRef("johndoe"), Participation.CANDIDATE);
+    taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.CANDIDATE);
+    taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.OWNER);
+    taskService.addTaskParticipant(taskDbid, new GroupRef("losers"), Participation.CANDIDATE);
+    taskService.addTaskParticipant(taskDbid, new GroupRef("dummies"), Participation.CANDIDATE);
     
-    List<Participant> taskParticipants = taskService.getTaskParticipants(taskDbid);
+    List<Participation> taskParticipations = taskService.getTaskParticipants(taskDbid);
 
-    Set<IdentityRef> candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.CANDIDATE);
+    Set<IdentityRef> candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.CANDIDATE);
 
     Set<IdentityRef> expectedIdentityRefs = new HashSet<IdentityRef>();
     expectedIdentityRefs.add(new UserRef("johndoe"));
@@ -61,20 +61,20 @@
 
     assertEquals(expectedIdentityRefs, candidateIdentityRefs);
     
-    candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.OWNER);
+    candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.OWNER);
 
     expectedIdentityRefs = new HashSet<IdentityRef>();
     expectedIdentityRefs.add(new UserRef("joesmoe"));
 
     assertEquals(expectedIdentityRefs, candidateIdentityRefs);
     
-    taskService.removeTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.OWNER);
-    taskService.removeTaskParticipant(taskDbid, new GroupRef("losers"), Participant.CANDIDATE);
+    taskService.removeTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.OWNER);
+    taskService.removeTaskParticipant(taskDbid, new GroupRef("losers"), Participation.CANDIDATE);
 
     
-    taskParticipants = taskService.getTaskParticipants(taskDbid);
+    taskParticipations = taskService.getTaskParticipants(taskDbid);
 
-    candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.CANDIDATE);
+    candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.CANDIDATE);
 
     expectedIdentityRefs = new HashSet<IdentityRef>();
     expectedIdentityRefs.add(new UserRef("johndoe"));
@@ -83,18 +83,18 @@
 
     assertEquals(expectedIdentityRefs, candidateIdentityRefs);
     
-    candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.OWNER);
+    candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.OWNER);
 
     expectedIdentityRefs = new HashSet<IdentityRef>();
 
     assertEquals(expectedIdentityRefs, candidateIdentityRefs);
   }
 
-  public Set<IdentityRef> getIdentityRefs(List<Participant> taskParticipants, String participation) {
+  public Set<IdentityRef> getIdentityRefs(List<Participation> taskParticipations, String participation) {
     Set<IdentityRef> identityRefs = new HashSet<IdentityRef>();
-    for (Participant participant: taskParticipants) {
-      if (participation.equals(participant.getParticipation())) {
-        identityRefs.add(participant.getIdentityRef());
+    for (Participation p : taskParticipations) {
+      if (participation.equals(p.getType())) {
+        identityRefs.add(p.getIdentityRef());
       }
     }
     return identityRefs;

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-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
     <property name="description" column="DESCR_"/>
     <property name="assignee" column="ASSIGNEE_"/>
     
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="TASK_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
     <property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
   </class>
   
   <!-- ### PARTICIPANT #################################################### -->
-  <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+  <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
     <id name="dbid" column="DBID_">
       <generator class="native" />
     </id>
@@ -179,9 +179,9 @@
                  column="EXECUTION_" 
                  foreign-key="none" />
 
-    <set name="participants" cascade="all-delete-orphan">
+    <set name="participations" cascade="all-delete-orphan">
       <key column="SWIMLANE_" />
-      <one-to-many class="ParticipantImpl" />
+      <one-to-many class="ParticipationImpl" />
     </set>
     
   </class>

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	2009-03-30 13:27:06 UTC (rev 4356)
@@ -250,7 +250,7 @@
     external participant notifies the process system that the activity is 
     completed.  So an execution is either executing or waiting on an external 
     participant.  Typically, you'll see that the processes are mostly 
-    waiting for external participants.  Especially humans tend to be slow :-)
+    waiting for external participations.  Especially humans tend to be slow :-)
     The time consumed by the process system between two wait states is 
     typically very small.
     </para>




More information about the jbpm-commits mailing list