[jbpm-commits] JBoss JBPM SVN: r5135 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/task and 24 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Jun 26 11:29:10 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-06-26 11:29:08 -0400 (Fri, 26 Jun 2009)
New Revision: 5135
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/TaskDefinition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariableNamesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
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/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.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/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/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
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/CancelTaskCmd.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/cmd/GetOutcomes.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/GetSubTasksCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.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/cmd/SaveTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.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/TaskImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/TasksJoinEndTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/EndProcessInstanceTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
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/TaskListTest.java
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/TaskQueryCandidatesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryProcessTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
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/TaskOutcomesTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
Log:
JBPM-2348 long taskDbid --> String taskId
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -40,45 +40,45 @@
* The returned task will be transient.
* Use {@link #saveTask(Task)} to persist the task. Only
* after the invocation of {@link #saveTask(Task)}, the
- * {@link Task#getDbid()} property will be initialized. */
+ * {@link Task#getId()} property will be initialized. */
Task newTask();
/** Creates a new subtask for the given task.
* Make sure that the parent task is saved before the
- * {@link Task#getDbid() dbid} is taken.
+ * {@link Task#getId() Id} is taken.
* The returned task will be transient.
* Use {@link #saveTask(Task)} to persist the task. */
- Task newTask(long parentTaskDbid);
+ Task newTask(String parentTaskId);
/** Saves the given task to persistent storage.
- * @return the taskDbid */
- long saveTask(Task task);
+ * @return the taskId */
+ String saveTask(Task task);
/** Retrieves the task with the given identifier from persistent storage.
* If no task with the given identifier exists,
* the call returns <code>null</code>. */
- Task getTask(long taskDbid);
+ Task getTask(String taskId);
/** assigns this task to the given assignee. */
- void assignTask(long taskDbid, String userId);
+ void assignTask(String taskId, String userId);
/** taking this task will prevent all other candidates from
* taking and working on this task.
* @throws JbpmException if this task already has been taken. */
- void takeTask(long taskDbid, String userId);
+ void takeTask(String taskId, String userId);
/** Deletes this task, marks the related history task as completed.
* If the task was created in the context
* of a process execution, this operation may result in a process instance
* being triggered. */
- void completeTask(long taskDbid);
+ void completeTask(String taskId);
/** Deletes this task, marks the related history task as completed
* with the specified outcome. If the task was created in the context
* of a process execution, this operation may result in a process instance
* being triggered. The outcome in that case corresponds to an outgoing
* transition in the process. */
- void completeTask(long taskDbid, String outcome);
+ 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
@@ -87,7 +87,7 @@
* a) process executions resumes
* b) whole process execution is cancelled as well.
* c) exception is thrown */
- void deleteTask(long taskDbid);
+ void deleteTask(String taskId);
/** Deletes the task without completing indicating the reason. Example reasons
* could be: "failed", "error", "exited", "obsolete" or "deleted".
@@ -97,32 +97,32 @@
* a) process executions resumes
* b) whole process execution is cancelled as well.
* c) exception is thrown */
- void deleteTask(long taskDbid, String reason);
+ void deleteTask(String taskId, String reason);
/** add a role to a given task.
* @param participation specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
- void addTaskParticipatingUser(long taskDbid, String userId, String participationType);
+ void addTaskParticipatingUser(String taskId, String userId, String participationType);
/** add a role to a given task.
* @param participation specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
- void addTaskParticipatingGroup(long taskDbid, String groupId, String participationType);
+ void addTaskParticipatingGroup(String taskId, String groupId, String participationType);
/** get roles related to a given task. */
- List<Participation> getTaskParticipations(long taskDbid);
+ List<Participation> getTaskParticipations(String taskId);
/** removes a role to a given task. Nothing happens (no exception) if
* the role does not exist.
* @param participation specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
- void removeTaskParticipatingUser(long taskDbid, String userId, String participationType);
+ void removeTaskParticipatingUser(String taskId, String userId, String participationType);
/** removes a role to a given task. Nothing happens (no exception) if
* the role does not exist.
* @param participation specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
- void removeTaskParticipatingGroup(long taskDbid, String groupId, String participationType);
+ void removeTaskParticipatingGroup(String taskId, String groupId, String participationType);
/** create a new query for tasks */
TaskQuery createTaskQuery();
@@ -136,15 +136,15 @@
List<Task> findGroupTasks(String userId);
/** get the subtasks for this task. Only goes one level deep at a time. */
- List<Task> getSubTasks(long taskDbid);
+ List<Task> getSubTasks(String taskId);
/** add a comment to a task */
- Comment addTaskComment(long taskDbid, String message);
+ Comment addTaskComment(String taskId, String message);
/** get the list of comments made to a task. this will
* fetch all the comments and recursively all replies to those
* comments. */
- List<Comment> getTaskComments(long taskDbid);
+ List<Comment> getTaskComments(String taskId);
/** add a reply to another comment */
Comment addReplyComment(String commentId, String message);
@@ -154,21 +154,21 @@
void deleteComment(String commentId);
/** creates or overwrites a variable value on the given task */
- void setVariable(long taskDbid, String name, Object value);
+ void setVariable(String taskId, String name, Object value);
/** creates or overwrites the variable values on the given task */
- void setVariables(long taskDbid, Map<String, Object> variables);
+ void setVariables(String taskId, Map<String, Object> variables);
/** retrieves a variable */
- Object getVariable(long taskDbid, String variableName);
+ Object getVariable(String taskId, String variableName);
/** all the variables visible in the given task */
- Set<String> getVariableNames(long taskDbid);
+ Set<String> getVariableNames(String taskId);
/** retrieves a map of variables */
- Map<String, Object> getVariables(long taskDbid, Set<String> variableNames);
+ Map<String, Object> getVariables(String taskId, Set<String> variableNames);
/** the set of possible valid outcomes for this task.
* An empty set means that any value is possible. */
- Set<String> getOutcomes(long taskDbid);
+ Set<String> getOutcomes(String taskId);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -33,7 +33,8 @@
public static final String STATE_OPEN = "open";
public static final String STATE_COMPLETED = "completed";
public static final String STATE_SUSPENDED = "suspended";
- long getDbid();
+
+ String getId();
String getName();
void setName(String name);
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/TaskDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/TaskDefinition.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/TaskDefinition.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -1,34 +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 java.io.Serializable;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface TaskDefinition extends Serializable {
-
- String getName();
-
-}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -37,9 +37,9 @@
String deploymentId;
- long taskLaundryDbid;
- long taskDishesDbid;
- long taskIronDbid;
+ String taskLaundryId;
+ String taskDishesId;
+ String taskIronId;
protected void setUp() throws Exception {
super.setUp();
@@ -51,25 +51,25 @@
// add task laundry
Task task = taskService.newTask();
task.setName("laundry");
- taskLaundryDbid = taskService.saveTask(task);
+ taskLaundryId = taskService.saveTask(task);
// add task dishes
task = taskService.newTask();
task.setName("dishes");
- taskDishesDbid = taskService.saveTask(task);
+ taskDishesId = taskService.saveTask(task);
// add task iron
task = taskService.newTask();
task.setName("iron");
- taskIronDbid = taskService.saveTask(task);
+ taskIronId = taskService.saveTask(task);
}
protected void tearDown() throws Exception {
repositoryService.deleteDeploymentCascade(deploymentId);
- taskService.deleteTask(taskLaundryDbid);
- taskService.deleteTask(taskDishesDbid);
- taskService.deleteTask(taskIronDbid);
+ taskService.deleteTask(taskLaundryId);
+ taskService.deleteTask(taskDishesId);
+ taskService.deleteTask(taskIronId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -37,9 +37,9 @@
String deploymentId;
- long taskLaundryDbid;
- long taskDishesDbid;
- long taskIronDbid;
+ String taskLaundryId;
+ String taskDishesId;
+ String taskIronId;
protected void setUp() throws Exception {
super.setUp();
@@ -51,25 +51,25 @@
// add task laundry
Task task = taskService.newTask();
task.setName("laundry");
- taskLaundryDbid = taskService.saveTask(task);
+ taskLaundryId = taskService.saveTask(task);
// add task dishes
task = taskService.newTask();
task.setName("dishes");
- taskDishesDbid = taskService.saveTask(task);
+ taskDishesId = taskService.saveTask(task);
// add task iron
task = taskService.newTask();
task.setName("iron");
- taskIronDbid = taskService.saveTask(task);
+ taskIronId = taskService.saveTask(task);
}
protected void tearDown() throws Exception {
repositoryService.deleteDeploymentCascade(deploymentId);
- taskService.deleteTask(taskLaundryDbid);
- taskService.deleteTask(taskDishesDbid);
- taskService.deleteTask(taskIronDbid);
+ taskService.deleteTask(taskLaundryId);
+ taskService.deleteTask(taskDishesId);
+ taskService.deleteTask(taskIronId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -65,7 +65,7 @@
Task task = taskList.get(0);
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid(), "ok");
+ taskService.completeTask(task.getId(), "ok");
// we check that the process instance has moved to the next step
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -82,7 +82,7 @@
Task task = taskList.get(0);
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid(), "nok");
+ taskService.completeTask(task.getId(), "nok");
// we check that the process instance has moved to update
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -99,7 +99,7 @@
Task task = taskList.get(0);
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid(), "reject");
+ taskService.completeTask(task.getId(), "reject");
// we check that the process instance has moved to close
processInstance = executionService.findProcessInstanceById(processInstance.getId());
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -65,10 +65,10 @@
Task task = taskList.get(0);
// the result variable is set in the task
- taskService.setVariable(task.getDbid(), "result", "ok");
+ taskService.setVariable(task.getId(), "result", "ok");
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// we check that the process instance has moved to the next step
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -85,10 +85,10 @@
Task task = taskList.get(0);
// the result variable is set in the task
- taskService.setVariable(task.getDbid(), "result", "nok");
+ taskService.setVariable(task.getId(), "result", "nok");
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// we check that the process instance has moved to update
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -105,10 +105,10 @@
Task task = taskList.get(0);
// the result variable is set in the task
- taskService.setVariable(task.getDbid(), "result", "reject");
+ taskService.setVariable(task.getId(), "result", "reject");
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// we check that the process instance has moved to close
processInstance = executionService.findProcessInstanceById(processInstance.getId());
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -71,14 +71,14 @@
// first we show that the document has been passed to the sub process instance
// and is available as a task variable
- String document = (String) taskService.getVariable(task.getDbid(), "document");
+ String document = (String) taskService.getVariable(task.getId(), "document");
assertEquals("This document describes how we can make more money...", document);
// the result variable is set in the task
- taskService.setVariable(task.getDbid(), "result", "accept");
+ taskService.setVariable(task.getId(), "result", "accept");
// the task in the sub process instance is completed
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// we check that the process instance has moved to the wait state activity
processInstance = executionService.findProcessInstanceById(processInstance.getId());
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -64,7 +64,7 @@
assertEquals("johndoe", task.getAssignee());
// submit the task
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// verify that the task list is now empty
taskList = taskService.findPersonalTasks("johndoe");
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -90,7 +90,7 @@
assertEquals(0, taskList.size());
// lets assume that johndoe takes the task
- taskService.takeTask(task.getDbid(), "johndoe");
+ taskService.takeTask(task.getId(), "johndoe");
// johndoe's and joesmoe's group task list is now empty
taskList = taskService.findGroupTasks("johndoe");
@@ -111,7 +111,7 @@
assertEquals(0, taskList.size());
// now johndoe completes the task
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// verify that the task list is now empty
taskList = taskService.findPersonalTasks("johndoe");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -124,7 +124,7 @@
assertEquals("johndoe", task.getAssignee());
// submit task
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// timer should be gone
job = managementService.createJobQuery()
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -70,14 +70,14 @@
List<Task> taskList = taskService.findGroupTasks("johndoe");
assertEquals("Expected a single task in johndoe's task list", 1, taskList.size());
Task task = taskList.get(0);
- long taskDbid = task.getDbid();
+ String taskId = task.getId();
assertEquals("enter order data", task.getName());
assertNull(task.getAssignee());
assertEquals(0, taskService.findPersonalTasks("johndoe").size());
// lets assume that johndoe takes the task
- taskService.takeTask(taskDbid, "johndoe");
+ taskService.takeTask(taskId, "johndoe");
// the next task will be created and assigned directly to johndoe
// this is because johndoe was the person that took the previous task
@@ -95,7 +95,7 @@
assertEquals("johndoe", task.getAssignee());
// submit the task
- taskService.completeTask(taskDbid);
+ taskService.completeTask(taskId);
taskList = taskService.findPersonalTasks("johndoe");
assertEquals(1, taskList.size());
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -63,9 +63,9 @@
List<Task> taskList = taskService.findPersonalTasks("johndoe");
assertFalse("Task list for assignee was empty", taskList.isEmpty());
Task task = taskList.get(0);
- long taskDbid = task.getDbid();
+ String taskId = task.getId();
- Set<String> variableNames = taskService.getVariableNames(taskDbid);
+ Set<String> variableNames = taskService.getVariableNames(taskId);
Set<String> expectedVariableNames = new HashSet<String>();
expectedVariableNames.add("category");
@@ -75,14 +75,14 @@
Map<String, Object> expectedVariables = variables;
- variables = taskService.getVariables(taskDbid, variableNames);
+ variables = taskService.getVariables(taskId, variableNames);
assertEquals(expectedVariables, variables);
variables = new HashMap<String, Object>();
variables.put("category", "small");
variables.put("lires", 923874893);
- taskService.setVariables(taskDbid, variables);
+ taskService.setVariables(taskId, variables);
expectedVariables = new HashMap<String, Object>();
expectedVariables.put("category", "small");
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -114,7 +114,7 @@
public static TaskRef adoptTask(Task t0)
{
TaskRef task = new TaskRef();
- task.setId( t0.getDbid() );
+ task.setId( ((TaskImpl)t0).getDbid() );
task.setName( t0.getName());
task.setAssignee( t0.getAssignee() );
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -101,7 +101,7 @@
try
{
TaskService taskService = this.processEngine.get(TaskService.class);
- Task t0 = taskService.getTask(taskId);
+ Task t0 = taskService.getTask(Long.toString(taskId));
return ModelAdaptor.adoptTask(t0);
}
finally{
@@ -116,7 +116,7 @@
try
{
TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, idRef);
+ taskService.assignTask(Long.toString(taskId), idRef);
}
finally{
env.close();
@@ -130,7 +130,7 @@
try
{
TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, null);
+ taskService.assignTask(Long.toString(taskId), null);
}
finally{
env.close();
@@ -145,9 +145,9 @@
{
TaskService taskService = this.processEngine.get(TaskService.class);
if(data!=null)
- taskService.setVariables(taskId, data);
+ taskService.setVariables(Long.toString(taskId), data);
- taskService.completeTask(taskId);
+ taskService.completeTask(Long.toString(taskId));
}
finally{
env.close();
@@ -162,9 +162,9 @@
{
TaskService taskService = this.processEngine.get(TaskService.class);
if(data!=null)
- taskService.setVariables(taskId, data);
+ taskService.setVariables(Long.toString(taskId), data);
- taskService.completeTask(taskId, outcome);
+ taskService.completeTask(Long.toString(taskId), outcome);
}
finally
{
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -112,7 +112,7 @@
try
{
TaskService taskService = processEngine.getTaskService();
- Task task = taskService.getTask(taskId);
+ Task task = taskService.getTask(Long.toString(taskId));
// access the processdefition
TaskImpl cast = ((TaskImpl) task);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -23,7 +23,6 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.task.IdentityRef;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.task.TaskImpl;
@@ -34,15 +33,15 @@
private static final long serialVersionUID = 1L;
- protected Long taskDbid;
- protected Long swimlaneDbid;
+ protected String taskId;
+ protected String swimlaneId;
protected String userId;
protected String groupId;
protected String type;
- public AddParticipationCmd(Long taskDbid, Long swimlaneDbid, String userId, String groupId, String type) {
- this.taskDbid = taskDbid;
- this.swimlaneDbid = swimlaneDbid;
+ public AddParticipationCmd(String taskId, String swimlaneId, String userId, String groupId, String type) {
+ this.taskId = taskId;
+ this.swimlaneId = swimlaneId;
this.userId = userId;
this.groupId = groupId;
this.type = type;
@@ -51,10 +50,10 @@
public Object execute(Environment environment) throws Exception {
Session session = Environment.getFromCurrent(Session.class);
- if (taskDbid!=null) {
- TaskImpl task = (TaskImpl) session.get(TaskImpl.class, taskDbid);
+ if (taskId!=null) {
+ TaskImpl task = (TaskImpl) session.get(TaskImpl.class, Long.parseLong(taskId));
if (task==null) {
- throw new JbpmException("task "+taskDbid+" was not found");
+ throw new JbpmException("task "+taskId+" was not found");
}
task.addParticipation(userId, groupId, type);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -34,11 +34,11 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected Long taskDbid;
protected String message;
- public AddTaskCommentCmd(long taskDbid, String message) {
- this.taskDbid = taskDbid;
+ public AddTaskCommentCmd(String taskId, String message) {
+ this.taskDbid = Long.parseLong(taskId);
this.message = message;
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -34,26 +34,26 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
protected String userId;
protected boolean take;
- public AssignTaskCmd(long taskDbid, String userId) {
- this.taskDbid = taskDbid;
+ public AssignTaskCmd(String taskId, String userId) {
+ this.taskId = taskId;
this.userId = userId;
}
- public AssignTaskCmd(long taskDbid, String userId, boolean take) {
- this.taskDbid = taskDbid;
+ public AssignTaskCmd(String taskId, String userId, boolean take) {
+ this.taskId = taskId;
this.userId = userId;
this.take = take;
}
public Void execute(Environment environment) {
DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.findTaskByDbid(taskDbid);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (task==null) {
- throw new JbpmException("task "+taskDbid+" does not exist");
+ throw new JbpmException("task "+taskId+" does not exist");
}
if (take) {
task.take(userId);
Modified: 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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CancelTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -22,7 +22,6 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.task.Assignable;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
@@ -34,26 +33,26 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
protected String reason;
- public CancelTaskCmd(long taskDbid) {
- this.taskDbid = taskDbid;
+ public CancelTaskCmd(String taskId) {
+ this.taskId = taskId;
}
- public CancelTaskCmd(long taskDbid, String reason) {
- this.taskDbid = taskDbid;
+ 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, taskDbid);
+ TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (task!=null) {
task.cancel(reason);
dbSession.delete(task);
} else {
- throw new JbpmException("task "+taskDbid+" doesn't exist");
+ throw new JbpmException("task "+taskId+" doesn't exist");
}
return null;
}
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 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -32,17 +32,17 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
protected String outcome;
- public CompleteTaskCmd(long taskDbid, String outcome) {
- this.taskDbid = taskDbid;
+ public CompleteTaskCmd(String taskId, String outcome) {
+ this.taskId = taskId;
this.outcome = outcome;
}
public Void execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.findTaskByDbid(taskDbid);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (outcome==null) {
task.complete();
} else {
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java (from rev 5124, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariableNamesCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -0,0 +1,54 @@
+/*
+ * 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 java.util.Set;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.client.ClientExecution;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.session.DbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetExecutionVariableNamesCmd extends AbstractCommand<Set<String>> {
+
+ private static final long serialVersionUID = 1L;
+
+ String executionId;
+
+ public GetExecutionVariableNamesCmd(String executionId) {
+ if (executionId==null) {
+ throw new JbpmException("executionId is null");
+ }
+ this.executionId = executionId;
+ }
+
+ public Set<String> execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ ClientExecution execution = dbSession.findExecutionById(executionId);
+ return execution.getVariableKeys();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java (from rev 5124, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -0,0 +1,66 @@
+/*
+ * 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 java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.client.ClientExecution;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.session.DbSession;
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetExecutionVariablesCmd extends AbstractCommand<Map<String, Object>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String executionId;
+ protected Set<String> variableNames;
+
+ public GetExecutionVariablesCmd(String executionId, Set<String> variableNames) {
+ if (executionId==null) {
+ throw new JbpmException("executionId is null");
+ }
+ this.executionId = executionId;
+ if (variableNames==null) {
+ throw new JbpmException("variableNames is null");
+ }
+ this.variableNames = variableNames;
+ }
+
+ public Map<String, Object> execute(Environment environment) throws Exception {
+ Map<String, Object> variables = new HashMap<String, Object>();
+
+ DbSession dbSession = environment.get(DbSession.class);
+ ClientExecution execution = dbSession.findExecutionById(executionId);
+ for (String variableName : variableNames) {
+ Object value = execution.getVariable(variableName);
+ variables.put(variableName, value);
+ }
+
+ return variables;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -42,17 +42,20 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
- public GetOutcomes(long taskDbid) {
- this.taskDbid = taskDbid;
+ public GetOutcomes(String taskId) {
+ if (taskId==null) {
+ throw new JbpmException("taskId is null");
+ }
+ this.taskId = taskId;
}
public Set<String> execute(Environment environment) {
DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = dbSession.get(TaskImpl.class, taskDbid);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (task==null) {
- throw new JbpmException("task "+taskDbid+" doesn't exist");
+ throw new JbpmException("task "+taskId+" doesn't exist");
}
Set<String> outcomes = new HashSet<String>();
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -38,12 +38,15 @@
private static final long serialVersionUID = 1L;
- protected Long taskDbid;
- protected Long swimlaneDbid;
+ protected String taskId;
+ protected String swimlaneId;
- public GetParticipantsCmd(Long taskDbid, Long swimlaneDbid) {
- this.taskDbid = taskDbid;
- this.swimlaneDbid = swimlaneDbid;
+ public GetParticipantsCmd(String taskId, String swimlaneId) {
+ if (taskId==null) {
+ throw new JbpmException("taskId is null");
+ }
+ this.taskId = taskId;
+ this.swimlaneId = swimlaneId;
}
public List<Participation> execute(Environment environment) throws Exception {
@@ -52,11 +55,11 @@
hql.append(ParticipationImpl.class.getName());
hql.append(" as role where ");
- if (taskDbid!=null) {
- hql.append(" role.task.dbid = :taskDbid ");
+ if (taskId!=null) {
+ hql.append(" role.task.dbid = "+taskId+" ");
- } else if (swimlaneDbid!=null) {
- hql.append(" role.swimlane.dbid = :swimlaneDbid ");
+ } else if (swimlaneId!=null) {
+ hql.append(" role.swimlane.dbid = "+swimlaneId+" ");
} else {
throw new JbpmException("no task nor swimlane specified");
@@ -65,13 +68,6 @@
Session session = Environment.getFromCurrent(Session.class);
Query query = session.createQuery(hql.toString());
- if (taskDbid!=null) {
- query.setLong("taskDbid", taskDbid);
-
- } else if (swimlaneDbid!=null) {
- query.setLong("swimlaneDbid", swimlaneDbid);
- }
-
List<Participation> participations = query.list();
return participations;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -37,10 +37,10 @@
private static final long serialVersionUID = 1L;
- long parentTaskDbid;
+ String parentTaskId;
- public GetSubTasksCmd(long parentTaskDbid) {
- this.parentTaskDbid = parentTaskDbid;
+ public GetSubTasksCmd(String parentTaskId) {
+ this.parentTaskId = parentTaskId;
}
public List<Task> execute(Environment environment) throws Exception {
@@ -49,11 +49,9 @@
Query query = session.createQuery(
"select task " +
"from "+TaskImpl.class.getName()+" as task " +
- "where task.superTask.dbid = :parentTaskDbid"
+ "where task.superTask.dbid = "+parentTaskId+" "
);
- query.setLong("parentTaskDbid", parentTaskDbid);
-
return query.list();
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -21,9 +21,11 @@
*/
package org.jbpm.pvm.internal.cmd;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
/**
* @author Alejandro Guizar
@@ -32,14 +34,17 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
- public GetTaskCmd(long taskDbid) {
- this.taskDbid = taskDbid;
+ public GetTaskCmd(String taskId) {
+ if (taskId==null) {
+ throw new JbpmException("taskId is null");
+ }
+ this.taskId = taskId;
}
public Task execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- return dbSession.findTaskByDbid(taskDbid);
+ return dbSession.get(TaskImpl.class, Long.parseLong(taskId));
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -38,15 +38,15 @@
private static final long serialVersionUID = 1L;
- protected long taskDbid;
+ protected String taskId;
- public GetTaskCommentsCmd(long taskDbid) {
- this.taskDbid = taskDbid;
+ public GetTaskCommentsCmd(String taskId) {
+ this.taskId = taskId;
}
public List<Comment> execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = dbSession.get(TaskImpl.class, taskDbid);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (task != null) {
List<Comment> comments = task.getComments();
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -0,0 +1,55 @@
+/*
+ * 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 java.util.Set;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.client.ClientExecution;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetTaskVariableNamesCmd extends AbstractCommand<Set<String>> {
+
+ private static final long serialVersionUID = 1L;
+
+ String taskId;
+
+ public GetTaskVariableNamesCmd(String taskId) {
+ if (taskId==null) {
+ throw new JbpmException("taskId is null");
+ }
+ this.taskId = taskId;
+ }
+
+ public Set<String> execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+ return task.getVariableKeys();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -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 java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetTaskVariablesCmd extends AbstractCommand<Map<String, Object>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+ protected Set<String> variableNames;
+
+ public GetTaskVariablesCmd(String taskId, Set<String> variableNames) {
+ this.taskId = taskId;
+ this.variableNames = variableNames;
+ }
+
+ public Map<String, Object> execute(Environment environment) throws Exception {
+ Map<String, Object> variables = new HashMap<String, Object>();
+
+ DbSession dbSession = environment.get(DbSession.class);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+ for (String variableName : variableNames) {
+ Object value = task.getVariable(variableName);
+ variables.put(variableName, value);
+ }
+
+ return variables;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariableNamesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariableNamesCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariableNamesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -1,67 +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 java.util.Set;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetVariableNamesCmd extends AbstractCommand<Set<String>> {
-
- private static final long serialVersionUID = 1L;
-
- String executionId;
- long taskDbid;
-
- public GetVariableNamesCmd(String executionId) {
- if (executionId==null) {
- throw new JbpmException("executionId is null");
- }
- this.executionId = executionId;
- }
-
- public GetVariableNamesCmd(long taskDbid) {
- this.taskDbid = taskDbid;
- }
-
- public Set<String> execute(Environment environment) throws Exception {
- if (executionId!=null) {
- DbSession dbSession = environment.get(DbSession.class);
- ClientExecution execution = dbSession.findExecutionById(executionId);
- return execution.getVariableKeys();
-
- } else {
- DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.findTaskByDbid(taskDbid);
- return task.getVariableKeys();
- }
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -1,83 +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 java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class GetVariablesCmd extends AbstractCommand<Map<String, Object>> {
-
- private static final long serialVersionUID = 1L;
-
- protected String executionId;
- protected long taskDbid;
- protected Set<String> variableNames;
-
- public GetVariablesCmd(String executionId, Set<String> variableNames) {
- if (executionId==null) {
- throw new JbpmException("executionId is null");
- }
- this.executionId = executionId;
- if (variableNames==null) {
- throw new JbpmException("variableNames is null");
- }
- this.variableNames = variableNames;
- }
-
- public GetVariablesCmd(long taskDbid, Set<String> variableNames) {
- this.taskDbid = taskDbid;
- this.variableNames = variableNames;
- }
-
- public Map<String, Object> execute(Environment environment) throws Exception {
- Map<String, Object> variables = new HashMap<String, Object>();
-
- if (executionId!=null) {
- DbSession dbSession = environment.get(DbSession.class);
- ClientExecution execution = dbSession.findExecutionById(executionId);
- for (String variableName : variableNames) {
- Object value = execution.getVariable(variableName);
- variables.put(variableName, value);
- }
-
- } else {
- DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.findTaskByDbid(taskDbid);
- for (String variableName : variableNames) {
- Object value = task.getVariable(variableName);
- variables.put(variableName, value);
- }
- }
-
- return variables;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -35,8 +35,10 @@
protected Long parentTaskDbid;
- public NewTaskCmd(Long parentTaskDbid) {
- this.parentTaskDbid = parentTaskDbid;
+ public NewTaskCmd(String parentTaskId) {
+ if (parentTaskId!=null) {
+ this.parentTaskDbid = Long.parseLong(parentTaskId);
+ }
}
public Task execute(Environment environment) throws Exception {
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -39,14 +39,14 @@
private static final long serialVersionUID = 1L;
protected Long taskDbid;
- protected Long swimlaneDbid;
+ protected Long swimlaneId;
protected String userId;
protected String groupId;
protected String participationType;
- public RemoveParticipantCmd(Long taskDbid, Long swimlaneDbid, String userId, String groupId, String participationType) {
- this.swimlaneDbid = swimlaneDbid;
- this.taskDbid = taskDbid;
+ public RemoveParticipantCmd(String taskId, String swimlaneId, String userId, String groupId, String participationType) {
+ this.swimlaneId = (swimlaneId!=null ? Long.parseLong(swimlaneId) : null );
+ this.taskDbid = (taskId!=null ? Long.parseLong(taskId) : null );
this.userId = userId;
this.groupId = groupId;
this.participationType = participationType;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -28,7 +28,7 @@
/**
* @author Alejandro Guizar
*/
-public class SaveTaskCmd extends AbstractCommand<Long> {
+public class SaveTaskCmd extends AbstractCommand<String> {
private static final long serialVersionUID = 1L;
@@ -38,11 +38,11 @@
this.task = task;
}
- public Long execute(Environment environment) throws Exception {
+ public String execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
dbSession.saveTask(task);
- return task.getDbid();
+ return task.getId();
}
}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java (from rev 5124, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -0,0 +1,55 @@
+/*
+ * 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.client.ClientExecution;
+import org.jbpm.pvm.internal.env.Environment;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SetExecutionVariablesCmd extends VariablesCmd<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String executionId = null;
+
+ public SetExecutionVariablesCmd(String executionId) {
+ if (executionId==null) {
+ throw new JbpmException("executionId is null");
+ }
+ this.executionId = executionId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ ClientExecution execution = getExecution(environment, executionId);
+ execution.setVariables(variables);
+
+ return null;
+ }
+
+ public String getExecutionId() {
+ return executionId;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -0,0 +1,53 @@
+/*
+ * 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 Tom Baeyens
+ */
+public class SetTaskVariablesCmd extends VariablesCmd<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+
+ public SetTaskVariablesCmd(String taskId) {
+ if (taskId==null) {
+ throw new JbpmException("taskId is null");
+ }
+ this.taskId = taskId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+ task.setVariables(variables);
+
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -1,69 +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.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class SetVariablesCmd extends VariablesCmd<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String executionId = null;
- protected long taskDbid;
-
- public SetVariablesCmd(String executionId) {
- if (executionId==null) {
- throw new JbpmException("executionId is null");
- }
- this.executionId = executionId;
- }
-
- public SetVariablesCmd(long taskDbid) {
- this.taskDbid = taskDbid;
- }
-
- public Void execute(Environment environment) throws Exception {
- if (executionId!=null) {
- ClientExecution execution = getExecution(environment, executionId);
- execution.setVariables(variables);
-
- } else {
- DbSession dbSession = environment.get(DbSession.class);
- TaskImpl task = (TaskImpl) dbSession.findTaskByDbid(taskDbid);
- task.setVariables(variables);
- }
-
- return null;
- }
-
- public String getExecutionId() {
- return executionId;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -30,6 +30,8 @@
*/
public class HistoryDecisionInstanceImpl extends HistoryAutomaticInstanceImpl {
+ private static final long serialVersionUID = 1L;
+
public HistoryDecisionInstanceImpl() {
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -36,6 +36,8 @@
*/
public class HistoryProcessInstanceImpl implements HistoryProcessInstance, Serializable {
+ private static final long serialVersionUID = 1L;
+
protected long dbid;
protected int dbversion;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -63,13 +63,15 @@
}
String executionPart = null;
- if ( (parent==null)
- && (execution.getKey()!=null)
+ if ( (parent==null)
+ && (execution.getKey()!=null)
) {
executionPart = execution.getKey();
+ } else if (execution.getName()!=null) {
+ executionPart = execution.getName();
+
} else {
-
executionPart = Long.toString(execution.getDbid());
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -62,7 +62,7 @@
if (dbSession==null) {
throw new JbpmException("no "+DbSession.class.getName()+" available in the environment for reloading the execution");
}
- execution = dbSession.get(ExecutionImpl.class, execution.getDbid());
+ execution = dbSession.get(ExecutionImpl.class, execution.getId());
exceptionHandler.executeHandler(execution, exception);
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -1035,11 +1035,11 @@
return subProcessInstance;
}
- public ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition) {
- return beginSubProcessInstance(processDefinition, null);
+ public ClientProcessInstance startSubProcessInstance(ClientProcessDefinition processDefinition) {
+ return startSubProcessInstance(processDefinition, null);
}
- public ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition, String key) {
+ public ClientProcessInstance startSubProcessInstance(ClientProcessDefinition processDefinition, String key) {
createSubProcessInstance(processDefinition, key);
subProcessInstance.start();
return subProcessInstance;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -111,8 +111,6 @@
Task createTask();
- Task findTaskByDbid(long taskDbid);
-
void saveTask(Task task);
Task findTaskByExecution(Execution execution);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -33,9 +33,9 @@
import org.jbpm.pvm.internal.cmd.DeleteProcessInstance;
import org.jbpm.pvm.internal.cmd.EndProcessInstance;
import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
-import org.jbpm.pvm.internal.cmd.GetVariableNamesCmd;
-import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.GetExecutionVariableNamesCmd;
+import org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd;
+import org.jbpm.pvm.internal.cmd.SetExecutionVariablesCmd;
import org.jbpm.pvm.internal.cmd.SignalCmd;
import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
import org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd;
@@ -123,26 +123,26 @@
public Object getVariable(String executionId, String variableName) {
Set<String> variableNames = new HashSet<String>();
variableNames.add(variableName);
- Map<String, Object> variables = commandService.execute(new GetVariablesCmd(executionId, variableNames));
+ Map<String, Object> variables = commandService.execute(new GetExecutionVariablesCmd(executionId, variableNames));
return variables.get(variableName);
}
public Set<String> getVariableNames(String executionId) {
- return commandService.execute(new GetVariableNamesCmd(executionId));
+ return commandService.execute(new GetExecutionVariableNamesCmd(executionId));
}
public Map<String, Object> getVariables(String executionId, Set<String> variableNames) {
- return commandService.execute(new GetVariablesCmd(executionId, variableNames));
+ return commandService.execute(new GetExecutionVariablesCmd(executionId, variableNames));
}
public void setVariable(String executionId, String name, Object value) {
- SetVariablesCmd cmd = new SetVariablesCmd(executionId);
+ SetExecutionVariablesCmd cmd = new SetExecutionVariablesCmd(executionId);
cmd.addVariable(name, value);
commandService.execute(cmd);
}
public void setVariables(String executionId, Map<String, ?> variables) {
- SetVariablesCmd cmd = new SetVariablesCmd(executionId);
+ SetExecutionVariablesCmd cmd = new SetExecutionVariablesCmd(executionId);
cmd.setVariables(variables);
commandService.execute(cmd);
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -29,8 +29,27 @@
import org.jbpm.api.TaskQuery;
import org.jbpm.api.TaskService;
import org.jbpm.api.model.Comment;
-import org.jbpm.api.task.*;
-import org.jbpm.pvm.internal.cmd.*;
+import org.jbpm.api.task.Participation;
+import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.cmd.AddParticipationCmd;
+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.CompleteTaskCmd;
+import org.jbpm.pvm.internal.cmd.CreateTaskQueryCmd;
+import org.jbpm.pvm.internal.cmd.DeleteCommentCmd;
+import org.jbpm.pvm.internal.cmd.GetOutcomes;
+import org.jbpm.pvm.internal.cmd.GetParticipantsCmd;
+import org.jbpm.pvm.internal.cmd.GetSubTasksCmd;
+import org.jbpm.pvm.internal.cmd.GetTaskCmd;
+import org.jbpm.pvm.internal.cmd.GetTaskCommentsCmd;
+import org.jbpm.pvm.internal.cmd.GetTaskVariableNamesCmd;
+import org.jbpm.pvm.internal.cmd.GetTaskVariablesCmd;
+import org.jbpm.pvm.internal.cmd.NewTaskCmd;
+import org.jbpm.pvm.internal.cmd.RemoveParticipantCmd;
+import org.jbpm.pvm.internal.cmd.SaveTaskCmd;
+import org.jbpm.pvm.internal.cmd.SetTaskVariablesCmd;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.task.TaskQueryImpl;
@@ -44,48 +63,48 @@
return commandService.execute(new NewTaskCmd(null));
}
- public Task getTask(long taskDbid) {
- return commandService.execute(new GetTaskCmd(taskDbid));
+ public Task getTask(String taskId) {
+ return commandService.execute(new GetTaskCmd(taskId));
}
- public long saveTask(Task task) {
+ public String saveTask(Task task) {
return commandService.execute(new SaveTaskCmd((TaskImpl) task));
}
- public void deleteTask(long taskDbid) {
- commandService.execute(new CancelTaskCmd(taskDbid));
+ public void deleteTask(String taskId) {
+ commandService.execute(new CancelTaskCmd(taskId));
}
- public void deleteTask(long taskDbid, String reason) {
- commandService.execute(new CancelTaskCmd(taskDbid, reason));
+ public void deleteTask(String taskId, String reason) {
+ commandService.execute(new CancelTaskCmd(taskId, reason));
}
- public void completeTask(long taskDbid) {
- completeTask(taskDbid, null);
+ public void completeTask(String taskId) {
+ completeTask(taskId, null);
}
- public void completeTask(long taskDbid, String outcome) {
- commandService.execute(new CompleteTaskCmd(taskDbid, outcome));
+ public void completeTask(String taskId, String outcome) {
+ commandService.execute(new CompleteTaskCmd(taskId, outcome));
}
- public void addTaskParticipatingUser(long taskDbid, String userId, String participation) {
- commandService.execute(new AddParticipationCmd(taskDbid, null, userId, null, participation));
+ public void addTaskParticipatingUser(String taskId, String userId, String participation) {
+ commandService.execute(new AddParticipationCmd(taskId, null, userId, null, participation));
}
- public void addTaskParticipatingGroup(long taskDbid, String groupId, String participation) {
- commandService.execute(new AddParticipationCmd(taskDbid, null, null, groupId, participation));
+ public void addTaskParticipatingGroup(String taskId, String groupId, String participation) {
+ commandService.execute(new AddParticipationCmd(taskId, null, null, groupId, participation));
}
- public List<Participation> getTaskParticipations(long taskDbid) {
- return commandService.execute(new GetParticipantsCmd(taskDbid, null));
+ public List<Participation> getTaskParticipations(String taskId) {
+ return commandService.execute(new GetParticipantsCmd(taskId, null));
}
- public void removeTaskParticipatingUser(long taskDbid, String userId, String participation) {
- commandService.execute(new RemoveParticipantCmd(taskDbid, null, userId, null, participation));
+ public void removeTaskParticipatingUser(String taskId, String userId, String participation) {
+ commandService.execute(new RemoveParticipantCmd(taskId, null, userId, null, participation));
}
- public void removeTaskParticipatingGroup(long taskDbid, String groupId, String participation) {
- commandService.execute(new RemoveParticipantCmd(taskDbid, null, null, groupId, participation));
+ public void removeTaskParticipatingGroup(String taskId, String groupId, String participation) {
+ commandService.execute(new RemoveParticipantCmd(taskId, null, null, groupId, participation));
}
@@ -109,20 +128,20 @@
return query;
}
- public List<Task> getSubTasks(long taskDbid) {
- return commandService.execute(new GetSubTasksCmd(taskDbid));
+ public List<Task> getSubTasks(String taskId) {
+ return commandService.execute(new GetSubTasksCmd(taskId));
}
- public Task newTask(long parentTaskDbid) {
- return commandService.execute(new NewTaskCmd(parentTaskDbid));
+ public Task newTask(String parentTaskId) {
+ return commandService.execute(new NewTaskCmd(parentTaskId));
}
- public Comment addTaskComment(long taskDbid, String message) {
- return commandService.execute(new AddTaskCommentCmd(taskDbid, message));
+ public Comment addTaskComment(String taskId, String message) {
+ return commandService.execute(new AddTaskCommentCmd(taskId, message));
}
- public List<Comment> getTaskComments(long taskDbid) {
- return commandService.execute(new GetTaskCommentsCmd(taskDbid));
+ public List<Comment> getTaskComments(String taskId) {
+ return commandService.execute(new GetTaskCommentsCmd(taskId));
}
public void deleteComment(String commentId) {
@@ -133,43 +152,43 @@
return commandService.execute(new AddReplyCommentCmd(commentId, message));
}
- public void assignTask(long taskDbid, String userId) {
- commandService.execute(new AssignTaskCmd(taskDbid, userId));
+ public void assignTask(String taskId, String userId) {
+ commandService.execute(new AssignTaskCmd(taskId, userId));
}
- public void takeTask(long taskDbid, String userId) {
- commandService.execute(new AssignTaskCmd(taskDbid, userId, true));
+ public void takeTask(String taskId, String userId) {
+ commandService.execute(new AssignTaskCmd(taskId, userId, true));
}
- public Object getVariable(long taskDbid, String variableName) {
+ public Object getVariable(String taskId, String variableName) {
Set<String> variableNames = new HashSet<String>();
variableNames.add(variableName);
- GetVariablesCmd cmd = new GetVariablesCmd(taskDbid, variableNames);
+ GetTaskVariablesCmd cmd = new GetTaskVariablesCmd(taskId, variableNames);
Map<String, Object> variables = commandService.execute(cmd);
return variables.get(variableName);
}
- public Set<String> getVariableNames(long taskDbid) {
- return commandService.execute(new GetVariableNamesCmd(taskDbid));
+ public Set<String> getVariableNames(String taskDbid) {
+ return commandService.execute(new GetTaskVariableNamesCmd(taskDbid));
}
- public Map<String, Object> getVariables(long taskDbid, Set<String> variableNames) {
- return commandService.execute(new GetVariablesCmd(taskDbid, variableNames));
+ public Map<String, Object> getVariables(String taskDbid, Set<String> variableNames) {
+ return commandService.execute(new GetTaskVariablesCmd(taskDbid, variableNames));
}
- public void setVariable(long taskDbid, String name, Object value) {
- SetVariablesCmd cmd = new SetVariablesCmd(taskDbid);
+ public void setVariable(String taskDbid, String name, Object value) {
+ SetTaskVariablesCmd cmd = new SetTaskVariablesCmd(taskDbid);
cmd.addVariable(name, value);
commandService.execute(cmd);
}
- public void setVariables(long taskDbid, Map<String, Object> variables) {
- SetVariablesCmd cmd = new SetVariablesCmd(taskDbid);
+ public void setVariables(String taskDbid, Map<String, Object> variables) {
+ SetTaskVariablesCmd cmd = new SetTaskVariablesCmd(taskDbid);
cmd.setVariables(variables);
commandService.execute(cmd);
}
- public Set<String> getOutcomes(long taskDbid) {
- return commandService.execute(new GetOutcomes(taskDbid));
+ public Set<String> getOutcomes(String taskId) {
+ return commandService.execute(new GetOutcomes(taskId));
}
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -371,12 +371,14 @@
this.taskDefinitionName = taskDefinition.getName();
}
+ // customized getters and setters //////////////////////////////////////////
+
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
// getters and setters //////////////////////////////////////////////////////
- public long getDbid() {
- return dbid;
- }
-
public String getName() {
return name;
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -101,8 +101,8 @@
// Uncomment these lines to make the test fail
for (Task task : tasksForRequester) {
- taskService.takeTask(task.getDbid(), requester);
- taskService.completeTask(task.getDbid(), "Approve");
+ taskService.takeTask(task.getId(), requester);
+ taskService.completeTask(task.getId(), "Approve");
}
// Adding a state after joing and executing these lines works ...
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/TasksJoinEndTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/TasksJoinEndTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/TasksJoinEndTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -84,7 +84,7 @@
log.debug("");
log.debug("");
- taskService.completeTask(tasks.get(0).getDbid());
+ taskService.completeTask(tasks.get(0).getId());
log.debug("");
log.debug("");
@@ -92,6 +92,6 @@
log.debug("");
log.debug("");
- taskService.completeTask(tasks.get(1).getDbid());
+ taskService.completeTask(tasks.get(1).getId());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -11,9 +11,9 @@
public class HqlEventListenerTest extends JbpmTestCase {
- long taskLaundryDbid;
- long taskDishesDbid;
- long taskIronDbid;
+ String taskLaundryId;
+ String taskDishesId;
+ String taskIronId;
protected void setUp() throws Exception {
super.setUp();
@@ -21,23 +21,23 @@
// add task laundry
Task task = taskService.newTask();
task.setName("laundry");
- taskLaundryDbid = taskService.saveTask(task);
+ taskLaundryId = taskService.saveTask(task);
// add task dishes
task = taskService.newTask();
task.setName("dishes");
- taskDishesDbid = taskService.saveTask(task);
+ taskDishesId = taskService.saveTask(task);
// add task iron
task = taskService.newTask();
task.setName("iron");
- taskIronDbid = taskService.saveTask(task);
+ taskIronId = taskService.saveTask(task);
}
protected void tearDown() throws Exception {
- taskService.deleteTask(taskLaundryDbid);
- taskService.deleteTask(taskDishesDbid);
- taskService.deleteTask(taskIronDbid);
+ taskService.deleteTask(taskLaundryId);
+ taskService.deleteTask(taskDishesId);
+ taskService.deleteTask(taskIronId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/EndProcessInstanceTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/EndProcessInstanceTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -87,7 +87,7 @@
Task task = taskService.createTaskQuery()
.processInstanceId(pi.getId())
.uniqueResult();
- taskService.completeTask(task.getDbid(), "Reject (risk)");
+ taskService.completeTask(task.getId(), "Reject (risk)");
assertProcessInstanceEnded(pi);
// Check the state of the process instance
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -95,7 +95,7 @@
Task task = taskService.createTaskQuery()
.processInstanceId(pi.getId())
.uniqueResult();
- taskService.completeTask(task.getDbid(), "TYPO");
+ taskService.completeTask(task.getId(), "TYPO");
HistoryProcessInstance historyPi = historyService.createHistoryProcessInstanceQuery()
.processInstanceId(pi.getId())
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/SubTaskTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -41,7 +41,7 @@
Task task = taskService.newTask();
task.setName("clean da house");
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
// create 3 sub tasks:
// * clean da house
@@ -49,21 +49,21 @@
// * laundry
// * sweep floor
- Task subTask = taskService.newTask(taskDbid);
+ Task subTask = taskService.newTask(taskId);
subTask.setName("dishes");
- long dishesTaskDbid = taskService.saveTask(subTask);
+ String dishesTaskId = taskService.saveTask(subTask);
- subTask = taskService.newTask(taskDbid);
+ subTask = taskService.newTask(taskId);
subTask.setName("laundry");
- long laundryTaskDbid = taskService.saveTask(subTask);
+ String laundryTaskId = taskService.saveTask(subTask);
- subTask = taskService.newTask(taskDbid);
+ subTask = taskService.newTask(taskId);
subTask.setName("sweep floor");
- long sweepFloorTaskDbid = taskService.saveTask(subTask);
+ String sweepFloorTaskId = taskService.saveTask(subTask);
// verify 3 sub tasks of clean da house
- List<Task> subTasks = taskService.getSubTasks(taskDbid);
+ List<Task> subTasks = taskService.getSubTasks(taskId);
Set<String> subTaskNames = getTaskNames(subTasks);
Set<String> expectedTaskNames = new HashSet<String>();
@@ -83,21 +83,21 @@
// * scrub
// now second level subtasks under sweep floor
- subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask = taskService.newTask(sweepFloorTaskId);
subTask.setName("find broom");
taskService.saveTask(subTask);
- subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask = taskService.newTask(sweepFloorTaskId);
subTask.setName("find water");
taskService.saveTask(subTask);
- subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask = taskService.newTask(sweepFloorTaskId);
subTask.setName("scrub");
taskService.saveTask(subTask);
// verify all the sub tasks of 'clean da house' and 'sweep floor'
- subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskId));
expectedTaskNames = new HashSet<String>();
expectedTaskNames.add("dishes");
@@ -106,7 +106,7 @@
assertEquals(expectedTaskNames, subTaskNames);
- subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskId));
expectedTaskNames = new HashSet<String>();
expectedTaskNames.add("find broom");
@@ -116,11 +116,11 @@
assertEquals(expectedTaskNames, subTaskNames);
// delete task dishes
- taskService.deleteTask(dishesTaskDbid);
+ taskService.deleteTask(dishesTaskId);
// verify all the sub tasks of 'clean da house' and 'sweep floor'
- subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskId));
expectedTaskNames = new HashSet<String>();
expectedTaskNames.add("laundry");
@@ -128,7 +128,7 @@
assertEquals(expectedTaskNames, subTaskNames);
- subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskId));
expectedTaskNames = new HashSet<String>();
expectedTaskNames.add("find broom");
@@ -139,20 +139,20 @@
// delete laundry and delete sweep floor
// NOTE: deleting sweep floor should recursively delete the subtasks
- taskService.deleteTask(laundryTaskDbid);
- taskService.deleteTask(sweepFloorTaskDbid);
+ taskService.deleteTask(laundryTaskId);
+ taskService.deleteTask(sweepFloorTaskId);
- subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskId));
expectedTaskNames = new HashSet<String>();
assertEquals(expectedTaskNames, subTaskNames);
- subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskId));
expectedTaskNames = new HashSet<String>();
assertEquals(expectedTaskNames, subTaskNames);
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
}
private Set<String> getTaskNames(List<Task> tasks) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -36,21 +36,21 @@
public void testComments() {
Task task = taskService.newTask();
task.setName("clean da house");
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
// what a party yesterday
// - what! you had a party while i was out ?!
// - euh yes. it was a great party :-)
// i'll clean up the mess
- Comment comment = taskService.addTaskComment(taskDbid, "what a party yesterday");
+ Comment comment = taskService.addTaskComment(taskId, "what a party yesterday");
String whatAPartyId = comment.getId();
comment = taskService.addReplyComment(whatAPartyId, "what! you had a party while i was out ?!");
String youHadAPartyId = comment.getId();
taskService.addReplyComment(youHadAPartyId, "euh yes. it was a great party :-)");
- taskService.addTaskComment(taskDbid, "i'll clean up the mess");
+ taskService.addTaskComment(taskId, "i'll clean up the mess");
- List<Comment> taskComments = taskService.getTaskComments(taskDbid);
+ List<Comment> taskComments = taskService.getTaskComments(taskId);
assertEquals("what a party yesterday", taskComments.get(0).getMessage());
assertEquals("i'll clean up the mess", taskComments.get(1).getMessage());
@@ -62,16 +62,16 @@
taskService.deleteComment(whatAPartyId);
- taskComments = taskService.getTaskComments(taskDbid);
+ taskComments = taskService.getTaskComments(taskId);
assertEquals("i'll clean up the mess", taskComments.get(0).getMessage());
// the following should delete the remaining comment. if not, this
// will show up as a fixme.
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
}
public void testGetTaskCommentsWithUnexistingTaskId() {
- List<Comment> comments = taskService.getTaskComments(-1234L);
+ List<Comment> comments = taskService.getTaskComments("-1234");
assertTrue(comments.isEmpty());
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCreateUpdateDeleteTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -35,39 +35,39 @@
public void testNewTask() {
// creation of a new non-persisted task
Task task = taskService.newTask();
- task = taskService.getTask(task.getDbid());
+ task = taskService.getTask(task.getId());
assertNull(task);
}
public void testSaveTask() {
Task task = taskService.newTask();
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
// task was made persistent
- task = taskService.getTask(taskDbid);
+ task = taskService.getTask(taskId);
assertNotNull("expected non-null task", task);
// make some change
Date dueDate = new Date();
task.setDueDate(dueDate);
taskService.saveTask(task);
// verify change is applied
- task = taskService.getTask(taskDbid);
+ task = taskService.getTask(taskId);
// task.getDueDate() return an java.sql.Timestamp
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
assertEquals(df.format(dueDate), df.format(task.getDueDate()));
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
}
public void testDeleteTask() {
Task task = taskService.newTask();
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
// task was made persistent
- assertNotNull("expected non-null task", taskService.getTask(taskDbid));
+ assertNotNull("expected non-null task", taskService.getTask(taskId));
// delete task and verify it does not exist
- taskService.deleteTask(taskDbid);
- task = taskService.getTask(taskDbid);
+ taskService.deleteTask(taskId);
+ task = taskService.getTask(taskId);
assertNull("expected null, but was " + task, task);
}
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -85,18 +85,18 @@
Task task = taskService.createTaskQuery().list().get(0);
- long taskDbid = task.getDbid();
- taskService.setVariable(taskDbid, "checked", "true");
+ String taskId = task.getId();
+ taskService.setVariable(taskId, "checked", "true");
assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
- Task subTask = taskService.newTask(taskDbid);
- long subTaskDbid = taskService.saveTask(subTask);
- taskService.completeTask(subTaskDbid);
+ Task subTask = taskService.newTask(taskId);
+ String subTaskId = taskService.saveTask(subTask);
+ taskService.completeTask(subTaskId);
assertEquals("true", executionService.getVariable(processInstanceId, "isSubTaskCompleteCalled"));
- taskService.completeTask(taskDbid);
+ taskService.completeTask(taskId);
assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCompleteCalled"));
}
@@ -118,9 +118,9 @@
String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
Task task = taskService.createTaskQuery().list().get(0);
- long taskDbid = task.getDbid();
+ String taskId = task.getId();
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCancelCalled"));
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -40,22 +40,22 @@
Task task = taskService.newTask();
task.setName("do laundry");
task.setAssignee("johndoe");
- long laundryTaskDbid = taskService.saveTask(task);
+ String laundryTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("get good idea");
task.setAssignee("joesmoe");
- long ideaTaskDbid = taskService.saveTask(task);
+ String ideaTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setAssignee("joesmoe");
- long capitalTaskDbid = taskService.saveTask(task);
+ String capitalTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
- long startBusinessTaskDbid = taskService.saveTask(task);
+ String startBusinessTaskId = taskService.saveTask(task);
List<Task> taskList = taskService.findPersonalTasks("johndoe");
assertNotNull(taskList);
@@ -72,10 +72,10 @@
assertEquals(3, taskList.size());
- taskService.deleteTask(startBusinessTaskDbid);
- taskService.deleteTask(capitalTaskDbid);
- taskService.deleteTask(ideaTaskDbid);
- taskService.deleteTask(laundryTaskDbid);
+ taskService.deleteTask(startBusinessTaskId);
+ taskService.deleteTask(capitalTaskId);
+ taskService.deleteTask(ideaTaskId);
+ taskService.deleteTask(laundryTaskId);
}
public void testPersonalTaskListDefaultSortOrder() {
@@ -83,31 +83,31 @@
task.setName("get good idea");
task.setAssignee("joesmoe");
task.setPriority(3);
- long ideaTaskDbid = taskService.saveTask(task);
+ String ideaTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setAssignee("joesmoe");
task.setPriority(2);
- long capitalTaskDbid = taskService.saveTask(task);
+ String capitalTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(1);
- long startBusinessTaskDbid = taskService.saveTask(task);
+ String startBusinessTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("take a day off");
task.setAssignee("joesmoe");
task.setPriority(-5);
- long dayOffTaskDbid = taskService.saveTask(task);
+ String dayOffTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("make profit");
task.setAssignee("joesmoe");
task.setPriority(10);
- long profitTaskDbid = taskService.saveTask(task);
+ String profitTaskId = taskService.saveTask(task);
List<Task> taskList = taskService.findPersonalTasks("joesmoe");
assertNotNull(taskList);
@@ -121,10 +121,10 @@
assertEquals(5, taskList.size());
- taskService.deleteTask(profitTaskDbid);
- taskService.deleteTask(dayOffTaskDbid);
- taskService.deleteTask(startBusinessTaskDbid);
- taskService.deleteTask(capitalTaskDbid);
- taskService.deleteTask(ideaTaskDbid);
+ taskService.deleteTask(profitTaskId);
+ taskService.deleteTask(dayOffTaskId);
+ taskService.deleteTask(startBusinessTaskId);
+ taskService.deleteTask(capitalTaskId);
+ taskService.deleteTask(ideaTaskId);
}
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -38,15 +38,15 @@
public void testTaskParticipants() {
Task task = taskService.newTask();
task.setName("do laundry");
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
- taskService.addTaskParticipatingUser(taskDbid, "johndoe", Participation.CANDIDATE);
- taskService.addTaskParticipatingUser(taskDbid, "joesmoe", Participation.CANDIDATE);
- taskService.addTaskParticipatingUser(taskDbid, "joesmoe", Participation.OWNER);
- taskService.addTaskParticipatingGroup(taskDbid, "losers", Participation.CANDIDATE);
- taskService.addTaskParticipatingGroup(taskDbid, "dummies", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskId, "johndoe", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskId, "joesmoe", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskId, "joesmoe", Participation.OWNER);
+ taskService.addTaskParticipatingGroup(taskId, "losers", Participation.CANDIDATE);
+ taskService.addTaskParticipatingGroup(taskId, "dummies", Participation.CANDIDATE);
- List<Participation> taskParticipations = taskService.getTaskParticipations(taskDbid);
+ List<Participation> taskParticipations = taskService.getTaskParticipations(taskId);
Set<String> candidateUserIds = extractParticipatingUserIds(taskParticipations, Participation.CANDIDATE);
Set<String> ownerUserIds = extractParticipatingUserIds(taskParticipations, Participation.OWNER);
@@ -69,10 +69,10 @@
assertEquals(expectedIds, candidateGroupIds);
- taskService.removeTaskParticipatingUser(taskDbid, "joesmoe", Participation.OWNER);
- taskService.removeTaskParticipatingGroup(taskDbid, "losers", Participation.CANDIDATE);
+ taskService.removeTaskParticipatingUser(taskId, "joesmoe", Participation.OWNER);
+ taskService.removeTaskParticipatingGroup(taskId, "losers", Participation.CANDIDATE);
- taskParticipations = taskService.getTaskParticipations(taskDbid);
+ taskParticipations = taskService.getTaskParticipations(taskId);
candidateUserIds = extractParticipatingUserIds(taskParticipations, Participation.CANDIDATE);
ownerUserIds = extractParticipatingUserIds(taskParticipations, Participation.OWNER);
@@ -93,7 +93,7 @@
assertEquals(expectedIds, candidateGroupIds);
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
}
public Set<String> extractParticipatingUserIds(List<Participation> taskParticipations, String participationType) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -66,23 +66,23 @@
// this is the task we'll be looking for
Task task = taskService.newTask();
task.setName("do laundry");
- long taskDbid = taskService.saveTask(task);
- taskService.addTaskParticipatingUser(taskDbid, "johndoe", Participation.CANDIDATE);
+ String taskId = taskService.saveTask(task);
+ taskService.addTaskParticipatingUser(taskId, "johndoe", Participation.CANDIDATE);
// this tasks are a diversion to see if the query only selects the above task
task = taskService.newTask();
task.setName("dishes");
task.setAssignee("johndoe");
- long johnsOtherTaskDbid = taskService.saveTask(task);
+ String johnsOtherTaskId = taskService.saveTask(task);
// this tasks are a diversion to see if the query only selects the above task
task = taskService.newTask();
task.setName("dishes");
- long joesOtherTaskDbid = taskService.saveTask(task);
+ String joesOtherTaskId = taskService.saveTask(task);
List<Task> groupTasks = taskService.findGroupTasks("johndoe");
assertEquals(1, groupTasks.size());
- assertEquals(taskDbid, groupTasks.get(0).getDbid());
+ assertEquals(taskId, groupTasks.get(0).getId());
groupTasks = taskService.findGroupTasks("joesmoe");
assertEquals(0, groupTasks.size());
@@ -90,41 +90,41 @@
groupTasks = taskService.findGroupTasks("jackblack");
assertEquals(0, groupTasks.size());
- taskService.deleteTask(taskDbid);
- taskService.deleteTask(johnsOtherTaskDbid);
- taskService.deleteTask(joesOtherTaskDbid);
+ taskService.deleteTask(taskId);
+ taskService.deleteTask(johnsOtherTaskId);
+ taskService.deleteTask(joesOtherTaskId);
}
public void testGroupCandidate() {
Task task = taskService.newTask();
task.setName("do laundry");
- long taskDbid = taskService.saveTask(task);
- taskService.addTaskParticipatingGroup(taskDbid, salesGroupId, Participation.CANDIDATE);
+ String taskId = taskService.saveTask(task);
+ taskService.addTaskParticipatingGroup(taskId, salesGroupId, Participation.CANDIDATE);
// this tasks are a diversion to see if the query only selects the above task
task = taskService.newTask();
task.setName("dishes");
task.setAssignee("johndoe");
- long johnsOtherTaskDbid = taskService.saveTask(task);
+ String johnsOtherTaskId = taskService.saveTask(task);
// this tasks are a diversion to see if the query only selects the above task
task = taskService.newTask();
task.setName("dishes");
- long joesOtherTaskDbid = taskService.saveTask(task);
+ String joesOtherTaskId = taskService.saveTask(task);
List<Task> groupTasks = taskService.findGroupTasks("johndoe");
assertEquals(1, groupTasks.size());
- assertEquals(taskDbid, groupTasks.get(0).getDbid());
+ assertEquals(taskId, groupTasks.get(0).getId());
groupTasks = taskService.findGroupTasks("joesmoe");
assertEquals(1, groupTasks.size());
- assertEquals(taskDbid, groupTasks.get(0).getDbid());
+ assertEquals(taskId, groupTasks.get(0).getId());
groupTasks = taskService.findGroupTasks("jackblack");
assertEquals(0, groupTasks.size());
- taskService.deleteTask(taskDbid);
- taskService.deleteTask(johnsOtherTaskDbid);
- taskService.deleteTask(joesOtherTaskDbid);
+ taskService.deleteTask(taskId);
+ taskService.deleteTask(johnsOtherTaskId);
+ taskService.deleteTask(joesOtherTaskId);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryProcessTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryProcessTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -104,7 +104,7 @@
Set<String> taskNames = new HashSet<String>();
for (Task task: parisTasks) {
taskNames.add(task.getName());
- assertEquals("Paris", taskService.getVariable(task.getDbid(), "destination"));
+ assertEquals("Paris", taskService.getVariable(task.getId(), "destination"));
}
assertEquals(expectedTaskNames, taskNames);
@@ -130,7 +130,7 @@
// we bring one process instance in task book travel
executionService.startProcessInstanceByKey("VacationTrip").getId();
- taskService.completeTask(taskService.findPersonalTasks("johndoe").get(0).getDbid());
+ taskService.completeTask(taskService.findPersonalTasks("johndoe").get(0).getId());
// and twto process instances in task select destination
executionService.startProcessInstanceByKey("VacationTrip");
@@ -196,7 +196,7 @@
// we bring one process instance in task book travel
executionService.startProcessInstanceByKey("VacationTrip").getId();
- taskService.completeTask(taskService.findPersonalTasks("johndoe").get(0).getDbid());
+ taskService.completeTask(taskService.findPersonalTasks("johndoe").get(0).getId());
// and twto process instances in task select destination
executionService.startProcessInstanceByKey("VacationTrip");
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -38,24 +38,24 @@
task.setName("do laundry");
task.setAssignee("johndoe");
task.setPriority(3);
- long laudryTaskDbid = taskService.saveTask(task);
+ String laudryTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("change dyper");
task.setAssignee("johndoe");
task.setPriority(1);
- long dyperTaskDbid = taskService.saveTask(task);
+ String dyperTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(4);
- long startBusinessTaskDbid = taskService.saveTask(task);
+ String startBusinessTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setPriority(4);
- long capitalTaskDbid = taskService.saveTask(task);
+ String capitalTaskId = taskService.saveTask(task);
List<Task> taskList = taskService
.createTaskQuery()
@@ -69,10 +69,10 @@
assertEquals(4, taskList.size());
- taskService.deleteTask(capitalTaskDbid);
- taskService.deleteTask(startBusinessTaskDbid);
- taskService.deleteTask(dyperTaskDbid);
- taskService.deleteTask(laudryTaskDbid);
+ taskService.deleteTask(capitalTaskId);
+ taskService.deleteTask(startBusinessTaskId);
+ taskService.deleteTask(dyperTaskId);
+ taskService.deleteTask(laudryTaskId);
}
public void testSimplestTaskQuerySortBy() {
@@ -80,24 +80,24 @@
task.setName("do laundry");
task.setAssignee("johndoe");
task.setPriority(3);
- long laudryTaskDbid = taskService.saveTask(task);
+ String laudryTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("change dyper");
task.setAssignee("johndoe");
task.setPriority(1);
- long dyperTaskDbid = taskService.saveTask(task);
+ String dyperTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("start new business");
task.setAssignee("joesmoe");
task.setPriority(4);
- long startBusinessTaskDbid = taskService.saveTask(task);
+ String startBusinessTaskId = taskService.saveTask(task);
task = taskService.newTask();
task.setName("find venture capital");
task.setPriority(7);
- long capitalTaskDbid = taskService.saveTask(task);
+ String capitalTaskId = taskService.saveTask(task);
List<Task> taskList = taskService
.createTaskQuery()
@@ -112,9 +112,9 @@
assertEquals(4, taskList.size());
- taskService.deleteTask(capitalTaskDbid);
- taskService.deleteTask(startBusinessTaskDbid);
- taskService.deleteTask(dyperTaskDbid);
- taskService.deleteTask(laudryTaskDbid);
+ taskService.deleteTask(capitalTaskId);
+ taskService.deleteTask(startBusinessTaskId);
+ taskService.deleteTask(dyperTaskId);
+ taskService.deleteTask(laudryTaskId);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -33,14 +33,14 @@
public void testTaskVariables() {
Task task = taskService.newTask();
task.setName("clean da house");
- long taskDbid = taskService.saveTask(task);
+ String taskId = taskService.saveTask(task);
- taskService.setVariable(taskDbid, "text", "hello");
- taskService.setVariable(taskDbid, "number", new Integer(5));
+ taskService.setVariable(taskId, "text", "hello");
+ taskService.setVariable(taskId, "number", new Integer(5));
- assertEquals("hello", taskService.getVariable(taskDbid, "text"));
- assertEquals(new Integer(5), taskService.getVariable(taskDbid, "number"));
+ assertEquals("hello", taskService.getVariable(taskId, "text"));
+ assertEquals(new Integer(5), taskService.getVariable(taskId, "number"));
- taskService.deleteTask(taskDbid);
+ taskService.deleteTask(taskId);
}
}
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-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCandidatesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -73,7 +73,7 @@
assertEquals(0, taskList.size());
// lets assume that johndoe takes the task
- taskService.takeTask(task.getDbid(), "johndoe");
+ taskService.takeTask(task.getId(), "johndoe");
// johndoe's and joesmoe's group task list is now empty
taskList = taskService.findGroupTasks("johndoe");
@@ -94,7 +94,7 @@
assertEquals(0, taskList.size());
// now johndoe completes the task
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// verify that the task list is now empty
taskList = taskService.findPersonalTasks("johndoe");
@@ -145,7 +145,7 @@
assertEquals(0, taskList.size());
// lets assume that johndoe takes the task
- taskService.takeTask(task.getDbid(), "johndoe");
+ taskService.takeTask(task.getId(), "johndoe");
// johndoe's and joesmoe's group task list is now empty
taskList = taskService.findGroupTasks("johndoe");
@@ -166,7 +166,7 @@
assertEquals(0, taskList.size());
// now johndoe completes the task
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
// verify that the task list is now empty
taskList = taskService.findPersonalTasks("johndoe");
@@ -195,12 +195,12 @@
String pid = processInstance.getId();
// both johndoe and joesmoe will see the task in their *group* task list
- long taskDbid = taskService.findGroupTasks("johndoe").get(0).getDbid();
+ String taskId = taskService.findGroupTasks("johndoe").get(0).getId();
- taskService.takeTask(taskDbid, "johndoe");
+ taskService.takeTask(taskId, "johndoe");
try {
- taskService.takeTask(taskDbid, "joesmoe");
+ taskService.takeTask(taskId, "joesmoe");
} catch (JbpmException e) {
assertTextPresent("task already taken by johndoe", e.getMessage());
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -55,7 +55,7 @@
.assignee("johndoe")
.uniqueResult();
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -83,7 +83,7 @@
.assignee("johndoe")
.uniqueResult();
- taskService.completeTask(task.getDbid());
+ taskService.completeTask(task.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -111,7 +111,7 @@
.assignee("johndoe")
.uniqueResult();
- taskService.completeTask(task.getDbid(), "theOneAndOnly");
+ taskService.completeTask(task.getId(), "theOneAndOnly");
processInstance = executionService.findProcessInstanceById(processInstance.getId());
@@ -139,7 +139,7 @@
.assignee("johndoe")
.uniqueResult();
- taskService.completeTask(task.getDbid(), "Refused");
+ taskService.completeTask(task.getId(), "Refused");
processInstance = executionService.
createProcessInstanceQuery()
@@ -170,7 +170,7 @@
.assignee("johndoe")
.uniqueResult();
- Set<String> outcomes = taskService.getOutcomes(task.getDbid());
+ Set<String> outcomes = taskService.getOutcomes(task.getId());
Set<String> expectedOutcomes = new HashSet<String>();
expectedOutcomes.add(Task.STATE_COMPLETED);
@@ -199,7 +199,7 @@
.assignee("johndoe")
.uniqueResult();
- Set<String> outcomes = taskService.getOutcomes(task.getDbid());
+ Set<String> outcomes = taskService.getOutcomes(task.getId());
Set<String> expectedOutcomes = new HashSet<String>();
expectedOutcomes.add(Task.STATE_COMPLETED);
@@ -229,7 +229,7 @@
.assignee("johndoe")
.uniqueResult();
- Set<String> outcomes = taskService.getOutcomes(task.getDbid());
+ Set<String> outcomes = taskService.getOutcomes(task.getId());
Set<String> expectedOutcomes = new HashSet<String>();
expectedOutcomes.add(Task.STATE_COMPLETED);
@@ -261,7 +261,7 @@
.assignee("johndoe")
.uniqueResult();
- Set<String> outcomes = taskService.getOutcomes(task.getDbid());
+ Set<String> outcomes = taskService.getOutcomes(task.getId());
Set<String> expectedOutcomes = new HashSet<String>();
expectedOutcomes.add(Task.STATE_COMPLETED);
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java 2009-06-26 14:12:30 UTC (rev 5134)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java 2009-06-26 15:29:08 UTC (rev 5135)
@@ -47,7 +47,7 @@
}
public void execute(ActivityExecution execution) throws Exception {
ExecutionImpl executionImpl = (ExecutionImpl) execution;
- ClientExecution subProcessInstance = executionImpl.beginSubProcessInstance(subProcess);
+ ClientExecution subProcessInstance = executionImpl.startSubProcessInstance(subProcess);
if (!subProcessInstance.isEnded()) {
execution.waitForSignal();
}
More information about the jbpm-commits
mailing list