[jbpm-commits] JBoss JBPM SVN: r5222 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/task and 5 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Jul 4 07:53:02 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-07-04 07:53:02 -0400 (Sat, 04 Jul 2009)
New Revision: 5222
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTask.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/OpenTask.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.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/TaskHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
Log:
JBPM-2336 fix task delete mismatch
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-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -21,6 +21,7 @@
*/
package org.jbpm.api;
+import org.jbpm.api.history.HistoryActivityInstance;
import org.jbpm.api.model.Comment;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
@@ -85,22 +86,17 @@
void completeTask(String taskId, String outcome);
/** Deletes the task without completing it.
- * If this task was created in the context of a process execution, one
- * of three things might happen depending on configurations of the task
- * in the process definition:
- * a) process executions resumes
- * b) whole process execution is cancelled as well.
- * c) exception is thrown */
+ * If this task was created in the context of a process execution,
+ * the execution remains active and the {@link ExecutionService#signalExecutionById(String)}
+ * is to be given explicitly. */
void deleteTask(String taskId);
/** Deletes the task without completing indicating the reason. Example reasons
- * could be: "failed", "error", "exited", "obsolete" or "deleted".
- * If this task was created in the context of a process execution, one
- * of three things might happen depending on configurations of the task
- * in the process definition:
- * a) process executions resumes
- * b) whole process execution is cancelled as well.
- * c) exception is thrown */
+ * could be: "failed", "error", "exited", "obsolete" or "deleted".
+ * The reason ends up as the state in the {@link HistoryActivityInstance}.
+ * If this task was created in the context of a process execution,
+ * the execution remains active and the {@link ExecutionService#signalExecutionById(String)}
+ * is to be given explicitly. */
void deleteTask(String taskId, String reason);
/** add a role to a given task.
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/OpenTask.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/OpenTask.java 2009-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/OpenTask.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -1,53 +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.api.task;
-
-import org.jbpm.api.model.OpenExecution;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface OpenTask extends Task, Assignable {
-
- OpenExecution getExecution();
-
- OpenTask createSubTask();
- OpenTask createSubTask(String name);
-
- /** fires a history event that marks the start of this task. */
- void historyTaskStart();
-
- /** fires a history event that marks the assignment of this task. */
- void historyTaskAssign(String userId);
-
- /** fires a history event that marks the completion of this task. */
- void historyTaskComplete(String outcome);
-
- /** fires a history event that marks the cancellation of this task. */
- void historyTaskCancel(String reason);
-
- boolean isSignalling();
- void setSignalling(boolean isSignalling);
-
- void cancel(String reason);
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java 2009-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -1,59 +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.cmd;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-/**
- * @author Alejandro Guizar
- */
-public class CancelTaskCmd extends AbstractCommand<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String taskId;
- protected String reason;
-
- public CancelTaskCmd(String taskId) {
- this.taskId = taskId;
- }
-
- public CancelTaskCmd(String taskId, String reason) {
- this.taskId = taskId;
- this.reason = reason;
- }
-
- public Void execute(Environment environment) throws Exception {
- DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, Long.parseLong(taskId));
- if (task!=null) {
- task.cancel(reason);
- dbSession.delete(task);
- } else {
- throw new JbpmException("task "+taskId+" doesn't exist");
- }
- return null;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java (from rev 5219, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -0,0 +1,59 @@
+/*
+ * 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.cmd;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class DeleteTaskCmd extends AbstractCommand<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+ protected String reason;
+
+ public DeleteTaskCmd(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public DeleteTaskCmd(String taskId, String reason) {
+ this.taskId = taskId;
+ this.reason = reason;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+ if (task!=null) {
+ task.delete(reason);
+ dbSession.delete(task);
+ } else {
+ throw new JbpmException("task "+taskId+" doesn't exist");
+ }
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java 2009-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -1,51 +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.history.events;
-
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
-import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskCancel extends ActivityEnd {
-
- private static final long serialVersionUID = 1L;
-
- protected String reason;
-
- public TaskCancel(String reason) {
- this.reason = reason;
- }
-
- protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
- super.updateHistoryActivityInstance(historyActivityInstance);
-
- HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
- historyTaskInstance.setState(reason);
- }
-
- protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
- return HistoryTaskInstanceImpl.class;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java (from rev 5219, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -0,0 +1,51 @@
+/*
+ * 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.history.events;
+
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskDelete extends ActivityEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String reason;
+
+ public TaskDelete(String reason) {
+ this.reason = reason;
+ }
+
+ protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
+ super.updateHistoryActivityInstance(historyActivityInstance);
+
+ HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
+ historyTaskInstance.setState(reason);
+ }
+
+ protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
+ return HistoryTaskInstanceImpl.class;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -35,7 +35,7 @@
import org.jbpm.pvm.internal.cmd.AddReplyCommentCmd;
import org.jbpm.pvm.internal.cmd.AddTaskCommentCmd;
import org.jbpm.pvm.internal.cmd.AssignTaskCmd;
-import org.jbpm.pvm.internal.cmd.CancelTaskCmd;
+import org.jbpm.pvm.internal.cmd.DeleteTaskCmd;
import org.jbpm.pvm.internal.cmd.CompleteTaskCmd;
import org.jbpm.pvm.internal.cmd.CreateTaskQueryCmd;
import org.jbpm.pvm.internal.cmd.DeleteCommentCmd;
@@ -72,11 +72,11 @@
}
public void deleteTask(String taskId) {
- commandService.execute(new CancelTaskCmd(taskId));
+ commandService.execute(new DeleteTaskCmd(taskId));
}
public void deleteTask(String taskId, String reason) {
- commandService.execute(new CancelTaskCmd(taskId, reason));
+ commandService.execute(new DeleteTaskCmd(taskId, reason));
}
public void completeTask(String taskId) {
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTask.java (from rev 5219, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/OpenTask.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTask.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTask.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -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.pvm.internal.task;
+
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.api.task.Assignable;
+import org.jbpm.api.task.Task;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface OpenTask extends Task, Assignable {
+
+ OpenExecution getExecution();
+
+ OpenTask createSubTask();
+ OpenTask createSubTask(String name);
+
+ boolean isSignalling();
+ void setSignalling(boolean isSignalling);
+
+ void delete(String reason);
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java 2009-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskHandler.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -23,7 +23,6 @@
import java.io.Serializable;
-import org.jbpm.api.task.OpenTask;
import org.jbpm.pvm.internal.client.ClientExecution;
/** for advanced task customization.
@@ -40,7 +39,7 @@
* to the task definition. This method allows to
* create subtasks.
* @return indicates if the process execution should wait. */
- public boolean executionCreateTask(OpenTask task) {
+ public boolean executionCreateTask(TaskImpl task) {
task.historyTaskStart();
return true;
}
@@ -48,24 +47,30 @@
/** called when the related execution gets a
* signal. this method must either
* {@link OpenTask#setSignalling(boolean) remove signalling} from this task
- * or {@link OpenTask#cancel(String) cancel} it. */
- public void executionSignal(OpenTask task) {
+ * or {@link OpenTask#delete(String) cancel} it. */
+ public void executionSignal(TaskImpl task) {
task.setSignalling(false);
}
/** called when the given task is assigned to an actor. */
- public void taskAssign(OpenTask task, String userId) {
+ public void taskAssign(TaskImpl task, String userId) {
task.historyTaskAssign(userId);
}
/** called when the given task is cancelled. */
- public void taskCancel(OpenTask task, String reason) {
- task.historyTaskCancel(reason);
+ public void taskDelete(TaskImpl task, String reason) {
+ task.historyTaskDelete(reason);
+// TODO if task is deleted, the related execution should be
+// suspended. But in the API and console, there is no
+// way yet to resume individual instances.
+// if (task.getExecution()!=null) {
+// task.getExecution().suspend();
+// }
}
/** called when the given task completes. The default behaviour
* will send a signal to the execution if this task is still signalling. */
- public void taskComplete(OpenTask task, String outcome) {
+ public void taskComplete(TaskImpl task, String outcome) {
task.historyTaskComplete(outcome);
if (task.isSignalling()) {
@@ -76,11 +81,11 @@
/** is called when a subtask completes. this can be used to
* prematurely signal the execution. e.g. for "5 out of 7" scenarios.*/
- public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+ public void taskSubTaskComplete(TaskImpl task, OpenTask subTask, String outcome) {
}
/** is called when a variable is updated. This can be used to
* propagate the execution based on availability of variables. */
- public void taskVariableUpdate(OpenTask task, String key, Object value) {
+ public void taskVariableUpdate(TaskImpl task, String key, Object value) {
}
}
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-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -34,13 +34,12 @@
import org.jbpm.api.model.Comment;
import org.jbpm.api.model.Event;
import org.jbpm.api.task.Assignable;
-import org.jbpm.api.task.OpenTask;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Swimlane;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.events.TaskAssign;
-import org.jbpm.pvm.internal.history.events.TaskCancel;
+import org.jbpm.pvm.internal.history.events.TaskDelete;
import org.jbpm.pvm.internal.history.events.TaskComplete;
import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.model.CommentImpl;
@@ -202,8 +201,8 @@
getTaskHandler().taskSubTaskComplete(this, subTask, outcome);
}
- public void cancel(String reason) {
- getTaskHandler().taskCancel(this, reason);
+ public void delete(String reason) {
+ getTaskHandler().taskDelete(this, reason);
}
// state ////////////////////////////////////////////////////////////////////
@@ -334,9 +333,9 @@
}
}
- public void historyTaskCancel(String reason) {
+ public void historyTaskDelete(String reason) {
if (execution != null) {
- execution.fireHistoryEvent(new TaskCancel(reason));
+ execution.fireHistoryEvent(new TaskDelete(reason));
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-07-04 09:39:57 UTC (rev 5221)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-07-04 11:53:02 UTC (rev 5222)
@@ -22,9 +22,10 @@
package org.jbpm.test.task;
import org.jbpm.api.Execution;
-import org.jbpm.api.task.OpenTask;
import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.task.OpenTask;
import org.jbpm.pvm.internal.task.TaskHandler;
+import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.test.JbpmTestCase;
@@ -35,32 +36,32 @@
public static class ReviewHandler extends TaskHandler {
private static final long serialVersionUID = 1L;
- public boolean executionCreateTask(OpenTask task) {
+ public boolean executionCreateTask(TaskImpl task) {
task.getExecution().setVariable("isExecutionCreateTaskCalled", "true");
return super.executionCreateTask(task);
}
- public void executionSignal(OpenTask task) {
+ public void executionSignal(TaskImpl task) {
task.getExecution().setVariable("isExecutionSignalledCalled", "true");
super.executionSignal(task);
}
- public void taskCancel(OpenTask task, String reason) {
+ public void taskDelete(TaskImpl task, String reason) {
task.getExecution().setVariable("isTaskCancelCalled", "true");
- super.taskCancel(task, reason);
+ super.taskDelete(task, reason);
}
- public void taskComplete(OpenTask task, String outcome) {
+ public void taskComplete(TaskImpl task, String outcome) {
task.getExecution().setVariable("isTaskCompleteCalled", "true");
super.taskComplete(task, outcome);
}
- public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+ public void taskSubTaskComplete(TaskImpl task, OpenTask subTask, String outcome) {
task.getExecution().setVariable("isSubTaskCompleteCalled", "true");
super.taskSubTaskComplete(task, subTask, outcome);
}
- public void taskVariableUpdate(OpenTask task, String key, Object value) {
+ public void taskVariableUpdate(TaskImpl task, String key, Object value) {
task.getExecution().setVariable("isTaskVariableUpdateCalled", "true");
super.taskVariableUpdate(task, key, value);
}
More information about the jbpm-commits
mailing list