[jbpm-commits] JBoss JBPM SVN: r5175 - in jbpm4/trunk/modules: examples/src/test/resources/org/jbpm/examples/timer/transition and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jul 1 09:24:21 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-07-01 09:24:21 -0400 (Wed, 01 Jul 2009)
New Revision: 5175

Removed:
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/timer/transition/process.png
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCandidatesTest.java
Log:
JBPM-2376 added docs and test for putting a task back in the group

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java	2009-07-01 10:59:55 UTC (rev 5174)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java	2009-07-01 13:24:21 UTC (rev 5175)
@@ -64,6 +64,10 @@
 
   /** taking this task will prevent all other candidates from 
    * taking and working on this task. 
+   * The inverse operation of putting the task back into the group
+   * for someone else to take it, can be done by providing a null value 
+   * for userId in the {@link #assignTask(String, String)} method:
+   * <code>taskService.assignTask(taskId, null);</code>
    * @throws JbpmException if this task already has been taken. */
   void takeTask(String taskId, String userId);
 

Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/timer/transition/process.png
===================================================================
(Binary files differ)

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCandidatesTest.java	2009-07-01 10:59:55 UTC (rev 5174)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCandidatesTest.java	2009-07-01 13:24:21 UTC (rev 5175)
@@ -177,6 +177,37 @@
     assertTrue(processInstance.isActive("wait"));
   }
 
+  public void testCandidatePutsTaskBackInGroup() {
+    deployJpdlXmlString(
+      "<process name='CandidatePutsTaskBackInGroup'>" +
+      "  <start>" +
+      "    <transition to='review' />" +
+      "  </start>" +
+      "  <task name='review' " +
+      "        candidate-groups='sales-dept'>" +
+      "    <transition to='wait' />" +
+      "  </task>" +
+      "  <state name='wait'/>" +
+      "</process>"
+    );
+    
+    ProcessInstance processInstance = executionService.startProcessInstanceByKey("CandidatePutsTaskBackInGroup");
+    String pid = processInstance.getId();
+    
+    Task task = taskService.createTaskQuery().processInstanceId(pid).uniqueResult();
+    assertNull(task.getAssignee());
+
+    taskService.takeTask(task.getId(), "johndoe");
+    
+    task = taskService.createTaskQuery().processInstanceId(pid).uniqueResult();
+    assertEquals("johndoe", task.getAssignee());
+
+    taskService.assignTask(task.getId(), null);
+    
+    task = taskService.getTask(task.getId());
+    assertNull(task.getAssignee());
+  }
+
   public void testDoubleTake() {
     deployJpdlXmlString(
       "<process name='DoubleTake'>" +




More information about the jbpm-commits mailing list