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

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Nov 17 04:54:09 EST 2008


Author: tom.baeyens at jboss.com
Date: 2008-11-17 04:54:08 -0500 (Mon, 17 Nov 2008)
New Revision: 2950

Added:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Role.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/Task.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Role.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/RoleType.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Assigner.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/CreateTask.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/GetTask.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/UpdateTask.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/RoleImpl.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/SwimlaneImpl.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskExecution.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskImpl.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskServiceImpl.java
   jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskDbTest.java
   jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
   jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskTest.java
Log:
task module clean up

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Task.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Task.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Task.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -1,49 +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;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/** runtime task.
- * 
- * @author Tom Baeyens
- */
-public interface Task extends Serializable {
-  
-  String getId();
-
-  String getName();
-  void setName(String name);
-
-  String getDescription();
-  void setDescription(String description);
-
-  Date getCreate();
-
-  int getPriority();
-  void setPriority(int priority);
-
-  Date getDueDate();
-  void setDueDate(Date dueDate);
-
-}
\ No newline at end of file

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -23,6 +23,9 @@
 
 import java.util.List;
 
+import org.jbpm.task.Role;
+import org.jbpm.task.Task;
+
 public interface TaskService {
 
   Task newTask(String taskId);
@@ -30,6 +33,9 @@
   void updateTask(Task task);
   void submitTask(String taskId);
   void deleteTask(String taskId);
+  
+  List<String> getCandidates(String taskId);
+  List<Role> getRoles(String taskId);
 
   /** retrieves the personal task of the given user, which might be different 
    * then the current authenticated user.  E.g. when a manager wants to 

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Role.java (from rev 2908, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Role.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Role.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Role.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -0,0 +1,43 @@
+/*
+ * 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 role that a person fullfills for a task.
+ * 
+ * @author Tom Baeyens
+ */
+public interface Role {
+
+  long getDbid();
+
+  String getIdentityId();
+  void setIdentityId(String identityId);
+
+  String getRoleType();
+  void setRoleType(String roleType);
+
+  String getDescription();
+  void setDescription(String description);
+
+  Task getTask();
+}
\ No newline at end of file


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

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java (from rev 2935, jbpm4/trunk/modules/api/src/main/java/org/jbpm/Task.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.task;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/** runtime task.
+ * 
+ * @author Tom Baeyens
+ */
+public interface Task extends Serializable {
+  
+  /** can do anything with the task */
+  String ROLETYPE_OWNER = "owner"; 
+  
+  /** alternative owner, but as long as this person is not the owner. 
+   * This person is allowed to make comments, but nothing else. */
+  String ROLETYPE_CANDIDATE = "candidate"; 
+  
+  /** person that will be using the result of this task.  This person is 
+   * allowed to make comments, but nothing else. */
+  String ROLETYPE_CLIENT = "client";
+  
+  /** person that is allowed to watch-but-not-touch this task */
+  String ROLETYPE_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 ROLETYPE_REPLACED_ASSIGNEE = "replaced-assignee";
+
+  
+  String getId();
+
+  String getName();
+  void setName(String name);
+
+  String getAssignedUserId();
+  void setAssignedUserId(String assignedUserId);
+
+  String getDescription();
+  void setDescription(String description);
+
+  Date getCreate();
+
+  int getPriority();
+  void setPriority(int priority);
+
+  Date getDueDate();
+  void setDueDate(Date dueDate);
+
+}
\ No newline at end of file


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

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Assigner.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Assigner.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Assigner.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -23,7 +23,6 @@
 
 import java.io.Serializable;
 
-import org.jbpm.Task;
 
 /** interface to delegate {@link Task} or {@link Swimlane} assignment.
  * @author Tom Baeyens

Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Role.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Role.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/Role.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -1,46 +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;
-
-import org.jbpm.Task;
-
-/** a role that a person fullfills for a task.
- * 
- * @author Tom Baeyens
- */
-public interface Role {
-
-  long getDbid();
-
-  String getIdentityId();
-  void setIdentityId(String identityId);
-
-  RoleType getRoleType();
-  void setRoleType(RoleType roleType);
-
-  String getDescription();
-  void setDescription(String description);
-
-  Task getTask();
-
-  Swimlane getSwimlane();
-}
\ No newline at end of file

Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/RoleType.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/RoleType.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/RoleType.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -1,30 +0,0 @@
-package org.jbpm.task;
-
-/** roleType of a person that is related to a task determines the 
- * privileges that are granted on the task.  */ 
-public enum RoleType {
-
-  /** can do anything with the task */
-  OWNER, 
-  
-  /** alternative owner, but as long as this person is not the owner. 
-   * This person is allowed to make comments, but nothing else. */
-  CANDIDATE, 
-  
-  /** person that will be using the result of this task.  This person is 
-   * allowed to make comments, but nothing else. */
-  CLIENT, 
-  
-  /** person that is allowed to watch-but-not-touch this task */
-  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. */
-  REPLACED_ASSIGNEE;
-
-  public String toString() {
-    return super.toString().toLowerCase().replace('_', '-');
-  }
-}
\ No newline at end of file

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/CreateTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/CreateTask.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/CreateTask.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -21,11 +21,11 @@
  */
 package org.jbpm.task.cmd;
 
-import org.jbpm.Task;
 import org.jbpm.cmd.Command;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.session.DbSession;
+import org.jbpm.task.Task;
 import org.jbpm.task.db.TaskDbSession;
 import org.jbpm.task.impl.TaskDefinitionImpl;
 import org.jbpm.task.impl.TaskImpl;

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/GetTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/GetTask.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/GetTask.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -21,10 +21,10 @@
  */
 package org.jbpm.task.cmd;
 
-import org.jbpm.Task;
 import org.jbpm.cmd.Command;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.session.DbSession;
+import org.jbpm.task.Task;
 import org.jbpm.task.impl.TaskImpl;
 
 /**

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/UpdateTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/UpdateTask.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/cmd/UpdateTask.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -21,10 +21,10 @@
  */
 package org.jbpm.task.cmd;
 
-import org.jbpm.Task;
 import org.jbpm.cmd.Command;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.session.DbSession;
+import org.jbpm.task.Task;
 
 
 /**

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/RoleImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/RoleImpl.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/RoleImpl.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -24,7 +24,6 @@
 import java.io.Serializable;
 
 import org.jbpm.task.Role;
-import org.jbpm.task.RoleType;
 
 
 /** the relation between a task and a person.
@@ -37,7 +36,7 @@
   protected long dbid;
   protected int dbversion;
   protected String identityId;
-  protected RoleType roleType;
+  protected String roleType;
   protected String description;
   protected TaskImpl task;
   protected SwimlaneImpl swimlane;
@@ -67,16 +66,16 @@
   public void setSwimlane(SwimlaneImpl swimlane) {
     this.swimlane = swimlane;
   }
-  public RoleType getRoleType() {
-    return roleType;
-  }
-  public void setRoleType(RoleType roleType) {
-    this.roleType = roleType;
-  }
   public String getIdentityId() {
     return identityId;
   }
   public void setIdentityId(String identityId) {
     this.identityId = identityId;
   }
+  public String getRoleType() {
+    return roleType;
+  }
+  public void setRoleType(String roleType) {
+    this.roleType = roleType;
+  }
 }

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/SwimlaneImpl.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/SwimlaneImpl.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -29,9 +29,9 @@
 
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.task.Role;
-import org.jbpm.task.RoleType;
 import org.jbpm.task.Swimlane;
 import org.jbpm.task.SwimlaneDefinition;
+import org.jbpm.task.Task;
 import org.jbpm.task.TaskException;
 
 /**
@@ -73,7 +73,7 @@
     }
     RoleImpl role = new RoleImpl();
     role.setIdentityId(identityId);
-    role.setRoleType(RoleType.CANDIDATE);
+    role.setRoleType(Task.ROLETYPE_CANDIDATE);
     role.setSwimlane(this);
     if (candidates==null) {
       candidates = new HashSet<RoleImpl>();

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskExecution.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskExecution.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskExecution.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -23,8 +23,8 @@
 
 import java.util.Map;
 
-import org.jbpm.Task;
 import org.jbpm.task.Swimlane;
+import org.jbpm.task.Task;
 
 /**
  * @author Tom Baeyens

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskImpl.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskImpl.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -31,7 +31,6 @@
 import java.util.Set;
 
 import org.jbpm.Execution;
-import org.jbpm.Task;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.internal.cal.Duration;
 import org.jbpm.pvm.internal.model.CommentImpl;
@@ -42,8 +41,8 @@
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.model.Comment;
 import org.jbpm.task.Role;
-import org.jbpm.task.RoleType;
 import org.jbpm.task.Swimlane;
+import org.jbpm.task.Task;
 import org.jbpm.task.TaskDefinition;
 import org.jbpm.task.TaskException;
 
@@ -187,7 +186,7 @@
     return allRoles;
   }
   
-  public Role addRole(String identityId, RoleType roleType) {
+  public Role addRole(String identityId, String roleType) {
     if (identityId==null) {
       throw new TaskException("userId is null");
     }

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskServiceImpl.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/impl/TaskServiceImpl.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -23,10 +23,10 @@
 
 import java.util.List;
 
-import org.jbpm.Task;
 import org.jbpm.TaskService;
 import org.jbpm.cmd.CommandService;
 import org.jbpm.task.Role;
+import org.jbpm.task.Task;
 import org.jbpm.task.cmd.CreateTask;
 import org.jbpm.task.cmd.DeleteTask;
 import org.jbpm.task.cmd.GetTask;

Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskDbTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskDbTest.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskDbTest.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -28,7 +28,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jbpm.Task;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.env.EnvironmentFactory;
 import org.jbpm.pvm.internal.util.Clock;

Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -25,7 +25,6 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.Task;
 import org.jbpm.cmd.Command;
 import org.jbpm.cmd.CommandService;
 import org.jbpm.pvm.env.Environment;

Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskTest.java	2008-11-17 09:24:58 UTC (rev 2949)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskTest.java	2008-11-17 09:54:08 UTC (rev 2950)
@@ -28,7 +28,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jbpm.Task;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.env.EnvironmentFactory;
 import org.jbpm.pvm.internal.util.Clock;
@@ -88,11 +87,11 @@
     assertNotNull(task.getRoles());
     assertEquals(0, task.getRoles().size());
     
-    task.addRole("john doe", RoleType.CLIENT).setDescription("uses the result");
-    task.addRole("joe smoe", RoleType.OWNER).setDescription("does what he wants");
-    task.addRole("jack black", RoleType.CANDIDATE).setDescription("can take this task");
-    task.addRole("jim slim", RoleType.VIEWER).setDescription("is allowed to see");
-    task.addRole("jeff nef", RoleType.REPLACED_ASSIGNEE).setDescription("is sick");
+    task.addRole("john doe", Task.ROLETYPE_CLIENT).setDescription("uses the result");
+    task.addRole("joe smoe", Task.ROLETYPE_OWNER).setDescription("does what he wants");
+    task.addRole("jack black", Task.ROLETYPE_CANDIDATE).setDescription("can take this task");
+    task.addRole("jim slim", Task.ROLETYPE_VIEWER).setDescription("is allowed to see");
+    task.addRole("jeff nef", Task.ROLETYPE_REPLACED_ASSIGNEE).setDescription("is sick");
     
     Set<RoleImpl> roles = task.getRoles();
     Map<String, RoleImpl> roleMap = new HashMap<String, RoleImpl>();
@@ -100,19 +99,19 @@
       roleMap.put(role.getIdentityId(), role);
     }
     
-    assertEquals(RoleType.CLIENT, roleMap.get("john doe").getRoleType());
+    assertEquals(Task.ROLETYPE_CLIENT, roleMap.get("john doe").getRoleType());
     assertEquals("uses the result", roleMap.get("john doe").getDescription());
 
-    assertEquals(RoleType.OWNER, roleMap.get("joe smoe").getRoleType());
+    assertEquals(Task.ROLETYPE_OWNER, roleMap.get("joe smoe").getRoleType());
     assertEquals("does what he wants", roleMap.get("joe smoe").getDescription());
 
-    assertEquals(RoleType.CANDIDATE, roleMap.get("jack black").getRoleType());
+    assertEquals(Task.ROLETYPE_CANDIDATE, roleMap.get("jack black").getRoleType());
     assertEquals("can take this task", roleMap.get("jack black").getDescription());
 
-    assertEquals(RoleType.VIEWER, roleMap.get("jim slim").getRoleType());
+    assertEquals(Task.ROLETYPE_VIEWER, roleMap.get("jim slim").getRoleType());
     assertEquals("is allowed to see", roleMap.get("jim slim").getDescription());
 
-    assertEquals(RoleType.REPLACED_ASSIGNEE, roleMap.get("jeff nef").getRoleType());
+    assertEquals(Task.ROLETYPE_REPLACED_ASSIGNEE, roleMap.get("jeff nef").getRoleType());
     assertEquals("is sick", roleMap.get("jeff nef").getDescription());
     
     assertEquals(5, roles.size());
@@ -135,7 +134,7 @@
     assertNotNull(task.getAllRoles());
     assertEquals(0, task.getAllRoles().size());
     
-    task.addRole("john doe", RoleType.CLIENT).setDescription("uses the result");
+    task.addRole("john doe", Task.ROLETYPE_CLIENT).setDescription("uses the result");
     
     SwimlaneImpl manager = new SwimlaneImpl();
     task.setSwimlane(manager);
@@ -144,7 +143,7 @@
     manager.createCandidate("jack black").setDescription("the pigeon");
     manager.createCandidate("jim slim").setDescription("lame duck");
     
-    task.addRole("jeff nef", RoleType.REPLACED_ASSIGNEE).setDescription("is sick");
+    task.addRole("jeff nef", Task.ROLETYPE_REPLACED_ASSIGNEE).setDescription("is sick");
     
     Set<RoleImpl> roles = task.getAllRoles();
     Map<String, RoleImpl> roleMap = new HashMap<String, RoleImpl>();
@@ -152,19 +151,19 @@
       roleMap.put(role.getIdentityId(), role);
     }
     
-    assertEquals(RoleType.CLIENT, roleMap.get("john doe").getRoleType());
+    assertEquals(Task.ROLETYPE_CLIENT, roleMap.get("john doe").getRoleType());
     assertEquals("uses the result", roleMap.get("john doe").getDescription());
 
-    assertEquals(RoleType.CANDIDATE, roleMap.get("joe smoe").getRoleType());
+    assertEquals(Task.ROLETYPE_CANDIDATE, roleMap.get("joe smoe").getRoleType());
     assertEquals("tostesteron ambition", roleMap.get("joe smoe").getDescription());
 
-    assertEquals(RoleType.CANDIDATE, roleMap.get("jack black").getRoleType());
+    assertEquals(Task.ROLETYPE_CANDIDATE, roleMap.get("jack black").getRoleType());
     assertEquals("the pigeon", roleMap.get("jack black").getDescription());
 
-    assertEquals(RoleType.CANDIDATE, roleMap.get("jim slim").getRoleType());
+    assertEquals(Task.ROLETYPE_CANDIDATE, roleMap.get("jim slim").getRoleType());
     assertEquals("lame duck", roleMap.get("jim slim").getDescription());
 
-    assertEquals(RoleType.REPLACED_ASSIGNEE, roleMap.get("jeff nef").getRoleType());
+    assertEquals(Task.ROLETYPE_REPLACED_ASSIGNEE, roleMap.get("jeff nef").getRoleType());
     assertEquals("is sick", roleMap.get("jeff nef").getDescription());
     
     assertEquals(5, roles.size());




More information about the jbpm-commits mailing list