[jbpm-commits] JBoss JBPM SVN: r6101 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/activity and 3 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Jan 20 05:51:18 EST 2010
Author: tom.baeyens at jboss.com
Date: 2010-01-20 05:51:17 -0500 (Wed, 20 Jan 2010)
New Revision: 6101
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
Log:
JBPM-2749 fixing problem with tasks swimlane and join combination
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java 2010-01-20 10:21:31 UTC (rev 6100)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java 2010-01-20 10:51:17 UTC (rev 6101)
@@ -102,7 +102,9 @@
DbSession taskDbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
- task.setSignalling(false);
+ if (task!=null) {
+ task.setSignalling(false);
+ }
execution.setVariable("jbpm_outcome", signalName);
proceed(execution, findOutgoingSequenceFlow(execution, CONDITIONS_CHECKED));
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2010-01-20 10:21:31 UTC (rev 6100)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2010-01-20 10:51:17 UTC (rev 6101)
@@ -114,7 +114,9 @@
DbSession taskDbSession = EnvironmentImpl .getFromCurrent(DbSession.class);
TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
- task.setSignalling(false);
+ if (task!=null) {
+ task.setSignalling(false);
+ }
Transition transition = null;
List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2010-01-20 10:21:31 UTC (rev 6100)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2010-01-20 10:51:17 UTC (rev 6101)
@@ -66,7 +66,6 @@
} else {
task.complete();
}
- dbSession.delete(task);
return 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 2010-01-20 10:21:31 UTC (rev 6100)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2010-01-20 10:51:17 UTC (rev 6101)
@@ -189,6 +189,11 @@
public void complete(String outcome) {
historyTaskComplete(outcome);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
+ if (dbSession!=null){
+ dbSession.delete(this);
+ }
+
if (isSignalling()) {
ClientExecution execution = (ClientExecution) getExecution();
execution.signal(outcome);
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java 2010-01-20 10:51:17 UTC (rev 6101)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.activity.task;
+
+import java.util.List;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskSwimlaneTest extends JbpmTestCase {
+
+ public void testSwimlaneTaskEnd() {
+ deployJpdlXmlString(
+ "<process name='TaskSwimlane'> " +
+ " <swimlane name='sales representative' assignee='johndoe' />" +
+ " <start>" +
+ " <transition to='enter order data' />" +
+ " </start>" +
+ " <task name='enter order data'" +
+ " swimlane='sales representative'>" +
+ " <transition to='end'/>" +
+ " </task>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("TaskSwimlane");
+
+ List<Task> tasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(1, tasks.size());
+ Task task = tasks.get(0);
+ taskService.completeTask(task.getId());
+
+ assertEquals(0, executionService.createProcessInstanceQuery().count());
+ assertEquals(0, taskService.createTaskQuery().count());
+ }
+
+ public void testConcurrentSwimlaneTaskEnd() {
+ deployJpdlXmlString(
+ "<process name='TaskConcurrentSwimlane'> " +
+ " <swimlane name='sales representative' assignee='johndoe' />" +
+ " <start>" +
+ " <transition to='fork' />" +
+ " </start>" +
+ " <fork name='fork'>" +
+ " <transition to='enter order data' />" +
+ " <transition to='sign contract' />" +
+ " </fork>" +
+ " <task name='enter order data'" +
+ " swimlane='sales representative'>" +
+ " <transition to='join'/>" +
+ " </task>" +
+ " <task name='sign contract'" +
+ " swimlane='sales representative'>" +
+ " <transition to='join'/>" +
+ " </task>" +
+ " <join name='join'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("TaskConcurrentSwimlane");
+
+ List<Task> tasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(2, tasks.size());
+ taskService.completeTask(tasks.get(0).getId());
+ taskService.completeTask(tasks.get(1).getId());
+
+ assertEquals(0, executionService.createProcessInstanceQuery().count());
+ assertEquals(0, taskService.createTaskQuery().count());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the jbpm-commits
mailing list