JBoss JBPM SVN: r5136 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/task and 15 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-27 08:19:46 -0400 (Sat, 27 Jun 2009)
New Revision: 5136
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/FormBehaviour.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionStartFormTest.java
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/process/ProcessDefinitionStartForm.form
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinates.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/HTTP.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.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/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
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/type/Converter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DOMWriter.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
Log:
JBPM-2365 adding engine and api support for start task forms
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -22,18 +22,34 @@
package org.jbpm.api;
import java.io.InputStream;
+import java.util.List;
import org.jbpm.api.model.ActivityCoordinates;
-/**
+/** exposes the repository of deployments.
+ *
+ * <p>Deployments contain a set of named resources. Those
+ * resources can represent process definitions, forms, images and so on.
+ * </p>
+ *
+ * <p>The repository contains and manages the process definitions.
+ * </p>
+ *
* @author Tom Baeyens
*/
public interface RepositoryService {
+ /** create a new deployment. The deployment will only be deployed into
+ * the repository after invoking the {@link NewDeployment#deploy()}. */
NewDeployment createDeployment();
+ /** similar to deleting a deployment. The difference is that
+ * all the data remains in the database. So that the suspending
+ * can be undone with {@link #resumeDeployment(String)}. */
void suspendDeployment(String deploymentId);
+
+ /** resume a suspended deployment. */
void resumeDeployment(String deploymentId);
/** deletes a deployment if the process definitions don't have
@@ -45,10 +61,30 @@
* and their history information */
void deleteDeploymentCascade(String deploymentId);
+ /** obtain an InputStream to a resource in a deployment */
InputStream getResourceAsStream(String deploymentId, String resourceName);
+ /** create a query for process definitions */
ProcessDefinitionQuery createProcessDefinitionQuery();
+
+ /** create a query for deployments */
DeploymentQuery createDeploymentQuery();
+
+ /** find all the activity names of the start activities for a given
+ * process definition. Only top level activities are scanned.
+ * Every activity that doesn't have incoming transitions is considered
+ * a start activity. For the moment, jPDL only supports one
+ * start activity. Start activity names can be null. */
+ List<String> getStartActivityNames(String processDefinitionId);
+ /** the resource name for the given start activity. It is assumed that
+ * the ProcessDefinition is already retrieved. From the ProcessDefinition,
+ * the {@link ProcessDefinition#getId()} and the {@link ProcessDefinition#getDeploymentId()}
+ * can be retrieved. The activityName can be obtained via {@link #getStartActivityNames(String)}.
+ * An InputStream for the resource can be obtained with {@link #getResourceAsStream(String, String)} */
+ String getStartFormResourceName(String processDefinitionId, String activityName);
+
+ /** the coordinates for the activity on
+ * {@link ProcessDefinition#getImageResourceName() the process image}. */
ActivityCoordinates getActivityCoordinates(String processDefinitionId, String activityName);
}
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 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -53,7 +53,5 @@
int getPriority();
void setPriority(int priority);
- String getForm();
- void setForm(String form);
-
+ String getFormResourceName();
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/HTTP.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/HTTP.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/HTTP.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -78,12 +78,12 @@
conn.setRequestProperty("Connection", "Keep-Alive");
- conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);
+ conn.setRequestProperty("Content-Type", "multipart/formResourceName-data;boundary="+boundary);
dos = new DataOutputStream( conn.getOutputStream() );
dos.writeBytes(twoHyphens + boundary + lineEnd);
- dos.writeBytes("Content-Disposition: form-data; name=\"upload\";"
+ dos.writeBytes("Content-Disposition: formResourceName-data; name=\"upload\";"
+ " filename=\"" + UUID.randomUUID().toString() +"\"" + lineEnd);
dos.writeBytes(lineEnd);
@@ -92,7 +92,7 @@
bufferSize = Math.min(bytesAvailable, maxBufferSize);
buffer = new byte[bufferSize];
- // read file and write it into form...
+ // read file and write it into formResourceName...
bytesRead = inputStream.read(buffer, 0, bufferSize);
while (bytesRead > 0)
@@ -103,7 +103,7 @@
bytesRead = inputStream.read(buffer, 0, bufferSize);
}
- // send multipart form data necesssary after file data...
+ // send multipart formResourceName data necesssary after file data...
dos.writeBytes(lineEnd);
dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);
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 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -160,8 +160,8 @@
task.setDueDate(t0.getDueDate());
task.setCreateDate(t0.getCreate());
- // task form url
- String url = t0.getForm()!=null ? t0.getForm() : "";
+ // task formResourceName url
+ String url = t0.getFormResourceName()!=null ? t0.getFormResourceName() : "";
task.setUrl( url );
return task;
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -37,7 +37,7 @@
"<body>\n" +
"\n" +
"<h2>Please enter your name</h2>\n" +
- "<form action=\"${form.action}\" method=\"POST\" enctype=\"multipart/form-data\">\n" +
+ "<formResourceName action=\"${formResourceName.action}\" method=\"POST\" enctype=\"multipart/formResourceName-data\">\n" +
"<input type=\"text\" name=\"name\" value=\"\"><br/>\n" +
"Outcomes:<br/>\n" +
"<ul>\n" +
@@ -46,7 +46,7 @@
"</#list>\n" +
"</ul> \n" +
"<input type=\"submit\">\n" +
- "</form>\n" +
+ "</formResourceName>\n" +
"</body>\n" +
"</html>";
@@ -60,7 +60,7 @@
o.getValues().add("transition1");
o.getValues().add("transition2");
- ctx.put("form", f);
+ ctx.put("formResourceName", f);
ctx.put("outcome", o);
r.execute(ctx, "testRun", new ByteArrayInputStream(template.getBytes()));
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 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -153,10 +153,10 @@
Map<String, Object> renderContext = new HashMap<String,Object>();
- // form directive
+ // formResourceName directive
FormDirective formDirective = new FormDirective();
formDirective.setAction( action.toString() );
- renderContext.put("form", formDirective);
+ renderContext.put("formResourceName", formDirective);
// outcome directive
// TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartActivity.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartActivity.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -22,15 +22,25 @@
package org.jbpm.jpdl.internal.activity;
import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.task.FormBehaviour;
/**
* @author Tom Baeyens
*/
-public class StartActivity extends JpdlActivity {
+public class StartActivity extends JpdlActivity implements FormBehaviour {
private static final long serialVersionUID = 1L;
+
+ String formResourceName;
public void execute(ActivityExecution execution) {
}
+
+ public String getFormResourceName() {
+ return formResourceName;
+ }
+ public void setFormResourceName(String formResourceName) {
+ this.formResourceName = formResourceName;
+ }
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartBinding.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StartBinding.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -23,6 +23,7 @@
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -48,7 +49,11 @@
parse.addProblem("multiple start events not yet supported", element);
}
- return new StartActivity();
+ StartActivity startActivityBehaviour = new StartActivity();
+
+ startActivityBehaviour.setFormResourceName(XmlUtil.attribute(element, "form"));
+
+ return startActivityBehaviour;
}
public boolean isNameRequired() {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -456,8 +456,8 @@
String taskName = XmlUtil.attribute(element, "name");
taskDefinition.setName(taskName);
- String form = XmlUtil.attribute(element, "form");
- taskDefinition.setForm(form);
+ String form = XmlUtil.attribute(element, "formResourceName");
+ taskDefinition.setFormResourceName(form);
ProcessDefinitionImpl processDefinition = parse.findObject(ProcessDefinitionImpl.class);
if (processDefinition.getTaskDefinition(taskName)!=null) {
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinates.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinates.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinates.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.ActivityCoordinates;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.session.RepositorySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetActivityCoordinates implements Command<ActivityCoordinates> {
-
- private static final long serialVersionUID = 1L;
-
- String processDefinitionId;
- String activityName;
-
- public GetActivityCoordinates(String processDefinitionId, String activityName) {
- this.processDefinitionId = processDefinitionId;
- this.activityName = activityName;
- }
-
- public ActivityCoordinates execute(Environment environment) throws Exception {
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById(processDefinitionId);
- if (processDefinition==null) {
- throw new JbpmException("process definition "+processDefinitionId+" doesn't exist");
- }
- ActivityImpl activity = processDefinition.findActivity(activityName);
- if (activity==null) {
- throw new JbpmException("activity '"+activityName+"' doesn't exist in process definition "+processDefinitionId);
- }
- return activity.getCoordinates();
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java (from rev 5134, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinates.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.model.ActivityCoordinates;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.session.RepositorySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetActivityCoordinatesCmd implements Command<ActivityCoordinates> {
+
+ private static final long serialVersionUID = 1L;
+
+ String processDefinitionId;
+ String activityName;
+
+ public GetActivityCoordinatesCmd(String processDefinitionId, String activityName) {
+ this.processDefinitionId = processDefinitionId;
+ this.activityName = activityName;
+ }
+
+ public ActivityCoordinates execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById(processDefinitionId);
+ if (processDefinition==null) {
+ throw new JbpmException("process definition "+processDefinitionId+" doesn't exist");
+ }
+ ActivityImpl activity = processDefinition.findActivity(activityName);
+ if (activity==null) {
+ throw new JbpmException("activity '"+activityName+"' doesn't exist in process definition "+processDefinitionId);
+ }
+ return activity.getCoordinates();
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1,61 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.session.RepositorySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetStartActivityNamesCmd implements Command<List<String>> {
+
+ private static final long serialVersionUID = 1L;
+
+ String processDefinitionId;
+
+ public GetStartActivityNamesCmd(String processDefinitionId) {
+ this.processDefinitionId = processDefinitionId;
+ }
+
+ public List<String> execute(Environment environment) {
+ List<String> activityNames = new ArrayList<String>();
+
+ RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ ProcessDefinitionImpl processDefinition = repositorySession.findProcessDefinitionById(processDefinitionId);
+
+ for (ActivityImpl activity: (List<ActivityImpl>) processDefinition.getActivities()) {
+ if (activity.getIncomingTransitions().isEmpty()) {
+ activityNames.add(activity.getName());
+ }
+ }
+
+ return activityNames;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1,64 @@
+/*
+ * 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.api.activity.ActivityBehaviour;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.session.RepositorySession;
+import org.jbpm.pvm.internal.task.FormBehaviour;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetStartFormResourceNameCmd implements Command<String> {
+
+ private static final long serialVersionUID = 1L;
+
+ String processDefinitionId;
+ String activityName;
+
+ public GetStartFormResourceNameCmd(String processDefinitionId, String activityName) {
+ if (processDefinitionId==null) {
+ throw new JbpmException("processDefinitionId is null");
+ }
+ this.processDefinitionId = processDefinitionId;
+ this.activityName = activityName;
+ }
+
+ public String execute(Environment environment) {
+ RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ ProcessDefinitionImpl processDefinition = repositorySession.findProcessDefinitionById(processDefinitionId);
+
+ ActivityImpl activity = processDefinition.getActivity(activityName);
+
+ ActivityBehaviour behaviour = activity.getBehaviour();
+ if (behaviour instanceof FormBehaviour) {
+ return ((FormBehaviour)behaviour).getFormResourceName();
+ }
+
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -29,8 +29,8 @@
*
* <p>The activity supports both graph based process models as well as
* block structured (tree based) process models. First we describe
- * tranisions that can be used to form graph based process structures
- * and then we'll describe activity composition to form block structured
+ * tranisions that can be used to formResourceName graph based process structures
+ * and then we'll describe activity composition to formResourceName block structured
* process models. Both models can be combined as well.
* </p>
*
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -347,10 +347,8 @@
if (activities!=null) {
map = new HashMap<String, ActivityImpl>();
for (ActivityImpl activity: activities) {
- if (activity.getName()!=null) {
- if (! map.containsKey(activity.getName())) {
- map.put(activity.getName(), activity);
- }
+ if (! map.containsKey(activity.getName())) {
+ map.put(activity.getName(), activity);
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -38,7 +38,7 @@
/** the list of direct composite activities. Recursively contained
* activities are not included in the list.
* Beware: the actual member is returned. No copy is made. */
- List<Activity> getActivities();
+ List<? extends Activity> getActivities();
/** indicates if an activity with the given name exists directly in
* this element. Only the direct contained activities are
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -125,7 +125,7 @@
/** the list of nested activities.
* Beware: the actual member is returned. No copy is made.
*/
- public List<Activity> getActivities() {
+ public List<? extends Activity> getActivities() {
return (List) activities;
}
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 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -725,7 +725,7 @@
task.setDescription(taskDefinition.getDescription());
task.setPriority(taskDefinition.getPriority());
- task.setForm(taskDefinition.getForm());
+ task.setFormResourceName(taskDefinition.getFormResourceName());
// save task so that TaskDbSession.findTaskByExecution works for assign event listeners
dbSession.saveTask(task);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -23,6 +23,7 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import java.util.List;
import org.jbpm.api.DeploymentQuery;
import org.jbpm.api.NewDeployment;
@@ -33,8 +34,10 @@
import org.jbpm.pvm.internal.cmd.CreateDeploymentQueryCmd;
import org.jbpm.pvm.internal.cmd.CreateProcessDefinitionQueryCmd;
import org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd;
-import org.jbpm.pvm.internal.cmd.GetActivityCoordinates;
+import org.jbpm.pvm.internal.cmd.GetActivityCoordinatesCmd;
import org.jbpm.pvm.internal.cmd.GetResourceAsStreamCmd;
+import org.jbpm.pvm.internal.cmd.GetStartActivityNamesCmd;
+import org.jbpm.pvm.internal.cmd.GetStartFormResourceNameCmd;
import org.jbpm.pvm.internal.cmd.ResumeDeploymentCmd;
import org.jbpm.pvm.internal.cmd.SuspendDeploymentCmd;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
@@ -88,6 +91,14 @@
}
public ActivityCoordinates getActivityCoordinates(String processDefinitionId, String activityName) {
- return commandService.execute(new GetActivityCoordinates(processDefinitionId, activityName));
+ return commandService.execute(new GetActivityCoordinatesCmd(processDefinitionId, activityName));
}
+
+ public List<String> getStartActivityNames(String processDefinitionId) {
+ return commandService.execute(new GetStartActivityNamesCmd(processDefinitionId));
+ }
+
+ public String getStartFormResourceName(String processDefinitionId, String activityName) {
+ return commandService.execute(new GetStartFormResourceNameCmd(processDefinitionId, activityName));
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.session;
import org.jbpm.api.NewDeployment;
-import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
@@ -43,7 +43,7 @@
/** create a process definition query */
ProcessDefinitionQueryImpl createProcessDefinitionQuery();
- ClientProcessDefinition findProcessDefinitionById(String processDefinitionId);
+ ProcessDefinitionImpl findProcessDefinitionById(String processDefinitionId);
- ClientProcessDefinition findProcessDefinitionByKey(String processDefinitionKey);
+ ProcessDefinitionImpl findProcessDefinitionByKey(String processDefinitionKey);
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/FormBehaviour.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/FormBehaviour.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/FormBehaviour.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface FormBehaviour {
+
+ String getFormResourceName();
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/FormBehaviour.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -36,7 +36,7 @@
private static final long serialVersionUID = 1L;
protected String dueDateDuration;
- protected String form;
+ protected String formResourceName;
protected List<TaskDefinitionImpl> subTaskDefinitions = new ArrayList<TaskDefinitionImpl>();
protected int priority = Priority.NORMAL;
protected SwimlaneDefinitionImpl swimlaneDefinition;
@@ -66,11 +66,11 @@
public void setDueDateDuration(String dueDateDuration) {
this.dueDateDuration = dueDateDuration;
}
- public String getForm() {
- return form;
+ public String getFormResourceName() {
+ return formResourceName;
}
- public void setForm(String form) {
- this.form = form;
+ public void setFormResourceName(String form) {
+ this.formResourceName = form;
}
public Descriptor getTaskHandlerDescriptor() {
return taskHandlerDescriptor;
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 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -70,7 +70,7 @@
protected String assignee;
protected Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>();
- protected String form;
+ protected String formResourceName;
protected Date create;
protected Date dueDate;
protected Integer progress;
@@ -507,11 +507,11 @@
this.isSignalling = isSignalling;
}
- public String getForm() {
- return form;
+ public String getFormResourceName() {
+ return formResourceName;
}
- public void setForm(String form) {
- this.form = form;
+ public void setFormResourceName(String form) {
+ this.formResourceName = form;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -39,7 +39,7 @@
Object convert(Object o);
/**
- * reverts a persisted object to its original form.
+ * reverts a persisted object to its original formResourceName.
*/
Object revert(Object o);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DOMWriter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DOMWriter.java 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DOMWriter.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -15,7 +15,7 @@
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * 2. Redistributions in binary form must reproduce the above copyright
+ * 2. Redistributions in binary formResourceName must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
@@ -160,7 +160,7 @@
}
/**
- * Set wheter entities should appear in their canonical form.
+ * Set wheter entities should appear in their canonical formResourceName.
* The default is false.
*/
public DOMWriter setCanonical(boolean canonical)
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-06-26 15:29:08 UTC (rev 5135)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-06-27 12:19:46 UTC (rev 5136)
@@ -19,7 +19,7 @@
<property name="state" column="STATE_"/>
<property name="suspendHistoryState" column="SUSPHISTSTATE_" />
<property name="assignee" column="ASSIGNEE_"/>
- <property name="form" column="FORM_"/>
+ <property name="formResourceName" column="FORM_"/>
<set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionStartFormTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionStartFormTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionStartFormTest.java 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.process;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.pvm.internal.util.IoUtil;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessDefinitionStartFormTest extends JbpmTestCase {
+
+ public void testFormInUnnamedStartActivity() {
+ String deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='make print'>" +
+ " <start form='org/jbpm/test/process/ProcessDefinitionStartForm.form' />" +
+ "</process>"
+ )
+ .addResourceFromClasspath("org/jbpm/test/process/ProcessDefinitionStartForm.form")
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ ProcessDefinition processDefinition =
+ repositoryService
+ .createProcessDefinitionQuery()
+ .processDefinitionName("make print")
+ .uniqueResult();
+
+ String processDefinitionId = processDefinition.getId();
+
+ List<String> startActivityNames = repositoryService.getStartActivityNames(processDefinitionId );
+ List<String> expectedStartActivityNames = new ArrayList<String>();
+ expectedStartActivityNames.add(null);
+
+ assertEquals(expectedStartActivityNames, startActivityNames);
+
+ String startFormResourceName = repositoryService.getStartFormResourceName(processDefinitionId, null);
+
+ assertEquals("org/jbpm/test/process/ProcessDefinitionStartForm.form", startFormResourceName);
+
+ InputStream formInputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), startFormResourceName);
+
+ String formContents = new String(IoUtil.readBytes(formInputStream));
+ assertEquals("start task form", formContents);
+ }
+
+ public void testFormInNamedStartActivity() {
+ String deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='make print'>" +
+ " <start name='start' form='org/jbpm/test/process/ProcessDefinitionStartForm.form' />" +
+ "</process>"
+ )
+ .addResourceFromClasspath("org/jbpm/test/process/ProcessDefinitionStartForm.form")
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ ProcessDefinition processDefinition =
+ repositoryService
+ .createProcessDefinitionQuery()
+ .processDefinitionName("make print")
+ .uniqueResult();
+
+ String processDefinitionId = processDefinition.getId();
+
+ List<String> startActivityNames = repositoryService.getStartActivityNames(processDefinitionId );
+ List<String> expectedStartActivityNames = new ArrayList<String>();
+ expectedStartActivityNames.add("start");
+
+ assertEquals(expectedStartActivityNames, startActivityNames);
+
+ String startFormResourceName = repositoryService.getStartFormResourceName(processDefinitionId, "start");
+
+ assertEquals("org/jbpm/test/process/ProcessDefinitionStartForm.form", startFormResourceName);
+
+ InputStream formInputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), startFormResourceName);
+
+ String formContents = new String(IoUtil.readBytes(formInputStream));
+ assertEquals("start task form", formContents);
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionStartFormTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/process/ProcessDefinitionStartForm.form
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/process/ProcessDefinitionStartForm.form (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/process/ProcessDefinitionStartForm.form 2009-06-27 12:19:46 UTC (rev 5136)
@@ -0,0 +1 @@
+start task form
\ No newline at end of file
16 years, 10 months
JBoss JBPM SVN: r5135 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/task and 24 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)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();
}
16 years, 10 months
JBoss JBPM SVN: r5134 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client and 10 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-26 10:12:30 -0400 (Fri, 26 Jun 2009)
New Revision: 5134
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
Modified:
projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
Log:
Beginn work on job lists
Modified: projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-26 14:12:30 UTC (rev 5134)
@@ -2,4 +2,4 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
org.jboss.bpm.console.client.report.ReportEditor
-org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
+org.jboss.bpm.console.client.engine.EngineEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -36,8 +36,8 @@
import org.gwt.mosaic.ui.client.util.ButtonHelper;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.util.WindowUtil;
-import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
-import org.jboss.bpm.console.client.deployment.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
+import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
/**
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -35,6 +35,8 @@
{
private AbstractImagePrototype icon;
+ protected boolean initialized;
+
protected AbstractView()
{
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class DeleteDeploymentAction extends AbstractRESTAction
+{
+
+ public final static String ID = DeleteDeploymentAction.class.getName();
+
+ public DeleteDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getDeleteDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentDetailView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,199 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * Detail panel associated with a selected deployment.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class DeploymentDetailView extends CaptionLayoutPanel implements ViewInterface
+{
+ public final static String ID = DeploymentDetailView.class.getName();
+
+ private Controller controller;
+
+ private PropertyGrid grid;
+
+ private DeploymentRef currentDeployment;
+
+ private ResourcePanel resourcePanel;
+
+ ToolButton suspendBtn;
+ ToolButton resumeBtn;
+
+ public DeploymentDetailView()
+ {
+ super("Deployment details");
+ super.setStyleName("bpm-detail-panel");
+
+ grid = new PropertyGrid(new String[] {"ID:", "Name:", "Processes:"});
+ LayoutPanel propLayout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ propLayout.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+
+ suspendBtn = new ToolButton("Suspend", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Suspend deployment",
+ "Do you want to suspend this deployment? Any associated process will suspended aswell.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ SuspendDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+ resumeBtn = new ToolButton("Resume", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Resume deployment",
+ "Do you want to resume this deployment?",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ ResumeDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ );
+
+ propLayout.add(suspendBtn);
+ propLayout.add(resumeBtn);
+
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(propLayout);
+
+ // resource info
+ ScrollLayoutPanel scrollPanel = new ScrollLayoutPanel();
+ resourcePanel = new ResourcePanel();
+ scrollPanel.add(resourcePanel);
+ deck.add(scrollPanel);
+
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("Properties");
+ dropBox.addItem("Resources");
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
+
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ deck.showWidget(dropBox.getSelectedIndex());
+
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return currentDeployment;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ resourcePanel.setController(controller);
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ this.currentDeployment= deployment;
+
+ String[] values = new String[] {
+ deployment.getId(),
+ deployment.getName(),
+ deployment.getDefinitions().toString()
+ };
+
+ resumeBtn.setEnabled(deployment.isSuspended());
+ suspendBtn.setEnabled(!resumeBtn.isEnabled());
+
+ grid.update(values);
+ resourcePanel.update(deployment);
+ }
+
+ public void clearView()
+ {
+ this.currentDeployment = null;
+ grid.clear();
+ resourcePanel.clearView();
+
+ suspendBtn.setEnabled(false);
+ resumeBtn.setEnabled(false);
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,324 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+
+import java.util.List;
+import java.util.Date;
+
+/**
+ * List of deployments
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class DeploymentListView extends AbstractView
+{
+ public final static String ID = DeploymentListView.class.getName();
+
+ private Controller controller;
+
+ private boolean initialized;
+
+ private LayoutPanel deploymentList = null;
+
+ private ListBox<DeploymentRef> listBox;
+
+ private DeploymentRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<DeploymentRef> deployments = null;
+
+ public DeploymentListView()
+ {
+ super();
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Deployments");
+ setIcon(icons.deploymentIcon());
+
+ listBox = createListBox();
+
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<DeploymentRef> listBox =
+ new ListBox<DeploymentRef>(
+ new String[] {
+ "ID", "Name", "Timestamp", "Suspended"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<DeploymentRef>() {
+ public void renderCell(ListBox<DeploymentRef> listBox, int row, int column,
+ DeploymentRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 2:
+ listBox.setText(row, column, dateFormat.format(new Date(item.getTimestamp())));
+ break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.isSuspended()));
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ DeploymentRef item = listBox.getItem(index);
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, item)
+ );
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ deploymentList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ deploymentList.setPadding(0);
+ deploymentList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Delete", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ DeploymentRef deploymentRef = getSelection();
+ if(deploymentRef!=null)
+ {
+ MessageBox.confirm("Delete deployment",
+ "Do you want to delete this deployment? Any related data will be removed.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
+ {
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ DeleteDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
+ }
+ });
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a deployment");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.deploymentList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.deploymentList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(deploymentList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ /*ProcessDetailView detailsView = new ProcessDetailView();
+ controller.addView(ProcessDetailView.ID, detailsView);
+ controller.addAction(UpdateProcessDetailAction.ID, new UpdateProcessDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+ */
+
+ this.add(layout);
+
+ initialized = true;
+ }
+ }
+
+ public DeploymentRef getSelection()
+ {
+ DeploymentRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public void update(List<DeploymentRef> deployments)
+ {
+ this.deployments = deployments;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.deployments!=null)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ model.clear();
+
+ for(DeploymentRef dpl : deployments)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(dpl);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(dpl.isSuspended()==showSuspended)
+ model.add(dpl);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, null)
+ );
+ }
+ }
+
+ public void select(String deploymentId)
+ {
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ for(int i=0; i<model.size(); i++)
+ {
+ DeploymentRef ref = model.get(i);
+ if(ref.getId().equals(deploymentId))
+ {
+ listBox.setSelectedIndex(i);
+ break;
+ }
+ }
+
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Manage runtime aspects of a process engine
+ * (currently jbpm only).
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EngineEditor extends Editor
+{
+ public final static String ID = EngineEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ private DeploymentDetailView detailView;
+
+ private Map<String,Integer> view2index = new HashMap<String,Integer>();
+
+ public EngineEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // detail panel
+ detailView = new DeploymentDetailView();
+ controller.addView(DeploymentDetailView.ID, detailView);
+ this.add(detailView, new BorderLayoutData(BorderLayout.Region.SOUTH,10,200));
+
+ // create and register views
+ registerView(DeploymentListView.ID, new DeploymentListView());
+ registerView(JobListView.ID, new JobListView(appContext));
+
+ // create and register actions
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(appContext));
+ controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
+ controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction(appContext));
+ controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction(appContext));
+ controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ view2index.put(id, tabPanel.getWidgetCount());
+
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Runtime";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Runtime",
+ icons.runtimeIcon(),
+ new EngineEditorNavigation(appContext)
+ );
+ }
+
+ public void showView(String viewId)
+ {
+ if(!view2index.containsKey(viewId))
+ throw new IllegalArgumentException("Unknown view: "+viewId);
+
+ tabPanel.selectTab( view2index.get(viewId) );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class EngineEditorNavigation extends Tree
+{
+
+ public EngineEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Deployments");
+
+ TreeItem root = addItem("Process Engine");
+ TreeItem jbpmDeployments = root.addItem("Deployments");
+ TreeItem jobs = root.addItem("Jobs");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ Workspace workspace = appContext.getWorkpace();
+
+ if("Deployments".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, DeploymentListView.ID);
+ }
+ else if("Jobs".equals(treeItem.getText()))
+ {
+ workspace.showEditor(EngineEditor.ID, JobListView.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Display a list of jobs waiting for execution.<br/>
+ * I.e. pending Timers and Messages.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JobListView extends AbstractView
+{
+ public final static String ID = JobListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel jobList = null;
+
+ private ListBox<JobRef> listBox;
+
+ private JobRef selection = null;
+
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
+ private int FILTER_NONE = 10;
+ private int FILTER_TIMER = 20;
+ private int FILTER_MESSAGE = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<JobRef> jobs = null;
+
+ private ApplicationContext appContext;
+
+ public JobListView(ApplicationContext appContext)
+ {
+ setTitle("Jobs");
+ this.appContext = appContext;
+
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setIcon(icons.jobsIcon());
+
+ this.listBox = createListBox();
+ }
+
+ private ListBox createListBox()
+ {
+ final ListBox<JobRef> listBox =
+ new ListBox<JobRef>(
+ new String[] {
+ "ID", "Due Date", "Type"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<JobRef>() {
+ public void renderCell(ListBox<JobRef> listBox, int row, int column,
+ JobRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ long ts = item.getTimestamp();
+ String ds = ts > 0 ? dateFormat.format(new Date(ts)) : "";
+ listBox.setText(row, column, ds);
+ break;
+ case 2:
+ listBox.setText(row, column, item.getType());
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ JobRef item = listBox.getItem(index);
+
+ /*controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, item)
+ );*/
+ }
+ }
+ });
+
+ return listBox;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public boolean isInitialized()
+ {
+ return initialized;
+ }
+
+ public void initialize()
+ {
+ if(!initialized)
+ {
+ jobList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ jobList.setPadding(0);
+ jobList.setWidgetSpacing(0);
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ // toolbar
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Timers");
+ dropBox.addItem("Messages");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_TIMER;
+ break;
+ case 2:
+ currentFilter = FILTER_MESSAGE;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
+ this.jobList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.jobList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // layout
+ LayoutPanel layout = new LayoutPanel(new BorderLayout());
+ layout.add(jobList, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // details
+ /*JobDetailView detailsView = new JobDetailView();
+ controller.addView(JobDetailView.ID, detailsView);
+ controller.addAction(UpdateJobDetailAction.ID, new UpdateJobDetailAction());
+ layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
+ */
+
+ controller.addAction(UpdateJobsAction.ID, new UpdateJobsAction(appContext));
+
+ this.add(layout);
+
+ this.initialized = true;
+ }
+ }
+
+ public void update(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+
+ renderFiltered();
+ }
+
+ private void renderFiltered()
+ {
+ if(this.jobs!=null)
+ {
+ final DefaultListModel<JobRef> model =
+ (DefaultListModel<JobRef>) listBox.getModel();
+
+ model.clear();
+
+ for(JobRef def : jobs)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(def);
+ }
+ else
+ {
+ if(FILTER_TIMER==currentFilter
+ && def.getType().equals("timer"))
+ {
+ model.add(def);
+ }
+ else if(FILTER_MESSAGE==currentFilter
+ && def.getType().equals("message"))
+ {
+ model.add(def);
+ }
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ /* controller.handleEvent(
+ new Event(UpdateJobDetailAction.ID, null)
+ ); */
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResourcePanel.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.common.PropertyGrid;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * List resources associated with a process deployment.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ResourcePanel extends LayoutPanel
+{
+
+ private Controller controller;
+
+ private PropertyGrid propGrid;
+
+ private DeploymentRef currentDeployment = null;
+
+ private boolean initialized;
+
+ private LayoutPanel resources = new LayoutPanel();
+
+ public ResourcePanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+
+ }
+
+ private void initialize()
+ {
+ if(!initialized)
+ {
+ this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
+
+ this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+ this.add(resources, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.initialized = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(DeploymentRef deployment)
+ {
+ initialize();
+ this.currentDeployment = deployment;
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("<ul>");
+ for(String res : deployment.getResourceNames())
+ {
+ sb.append("<li>").append(res);
+ }
+ sb.append("</ul>");
+
+ HTML html = new HTML(sb.toString());
+ resources.clear();
+ resources.add(html);
+
+ propGrid.update(new String[]{deployment.getId()});
+ }
+
+ public void clearView()
+ {
+ initialize();
+ this.currentDeployment = null;
+ propGrid.clear();
+ }
+
+ private DeploymentRef getSelection()
+ {
+ return this.currentDeployment;
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ResumeDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = ResumeDeploymentAction.class.getName();
+
+ public ResumeDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getResumeDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class SuspendDeploymentAction extends AbstractRESTAction
+{
+ public final static String ID = SuspendDeploymentAction.class.getName();
+
+ public SuspendDeploymentAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getSuspendDeploymentUrl(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ // refresh view
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentDetailAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class UpdateDeploymentDetailAction implements ActionInterface
+{
+ public final static String ID = UpdateDeploymentDetailAction.class.getName();
+
+ public void execute(Controller controller, Object object)
+ {
+ DeploymentRef ref = object!=null ? (DeploymentRef)object : null;
+ DeploymentDetailView view = (DeploymentDetailView)controller.getView(DeploymentDetailView.ID);
+
+ if(null==ref)
+ {
+ // clear view
+ view.clearView();
+ }
+ else
+ {
+ // update view
+ view.update(ref);
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.json.client.JSONParser;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Updates a list of deployment and can optionally select a particular one.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class UpdateDeploymentsAction extends AbstractRESTAction
+{
+
+ public final static String ID = UpdateDeploymentsAction.class.getName();
+
+
+ public UpdateDeploymentsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getDeploymentsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
+
+ // deployment could be disabled
+ if(view!=null)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
+
+ if(null==view)
+ throw new RuntimeException("View not initialized: " + DeploymentListView.ID);
+
+ view.update(deployments);
+
+ // optional
+ String deploymentId = (String)event;
+ if(deploymentId!=null)
+ {
+ System.out.println("activate " + deploymentId);
+ view.select(deploymentId);
+ }
+
+ // refresh process definitions
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.JobRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class UpdateJobsAction extends AbstractRESTAction
+{
+ public final static String ID = UpdateJobsAction.class.getName();
+
+ public UpdateJobsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getJobsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<JobRef> jobs = DTOParser.parseJobRefList(json);
+ JobListView view = (JobListView)controller.getView(JobListView.ID);
+ view.update(jobs);
+
+ }
+}
+
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.engine;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * Cross editor view toggle.
+ * Event requires to be a deployment ID.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ViewDeploymentAction implements ActionInterface
+{
+ public final static String ID = ViewDeploymentAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public ViewDeploymentAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(Controller controller, Object object)
+ {
+ String dplId = (String)object;
+ System.out.println("view deployment " + dplId);
+
+ Workspace workspace = appContext.getWorkpace();
+ if(workspace.hasEditor(EngineEditor.ID))
+ {
+ workspace.showEditor(EngineEditor.ID);
+ }
+
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, dplId)
+ );
+
+
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -115,7 +115,17 @@
AbstractImagePrototype reportIcon();
/**
+ * @gwt.resource runtime.png
+ */
+ AbstractImagePrototype runtimeIcon();
+
+ /**
* @gwt.resource deployment.png
*/
AbstractImagePrototype deploymentIcon();
+
+ /**
+ * @gwt.resource jobs.png
+ */
+ AbstractImagePrototype jobsIcon();
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -32,7 +32,7 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
-import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
/**
@@ -61,14 +61,6 @@
{
this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
- ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
-
- Image image = icons.deploymentIcon().createImage();
- LayoutPanel imgPanel = new LayoutPanel();
- imgPanel.setStyleName("bpm-property-image");
- imgPanel.add(image);
-
- this.add(imgPanel);
this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
final Button button = new Button("View Deployment", new ClickListener(){
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-26 14:12:30 UTC (rev 5134)
@@ -2,4 +2,4 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
org.jboss.bpm.console.client.report.ReportEditor
-#org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
+#org.jboss.bpm.console.client.engine.EngineEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -73,6 +73,15 @@
return this.isInitialized;
}
+ /**
+ * should be overwritten if needed
+ * @param viewId
+ */
+ public void showView(String viewId)
+ {
+ throw new IllegalArgumentException("Illegal call. This method should be overridden.");
+ }
+
public abstract void initialize();
public abstract String getEditorId();
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -194,24 +194,29 @@
public String getDeploymentsUrl()
{
- return config.getConsoleServerUrl() + "/rs/repository/deployments";
+ return config.getConsoleServerUrl() + "/rs/engine/deployments";
}
public String getSuspendDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/suspend";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/suspend";
}
public String getResumeDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/resume";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/resume";
}
public String getDeleteDeploymentUrl(String id)
{
String encodedId = URL.encode(id);
- return config.getConsoleServerUrl() + "/rs/repository/deployment/"+encodedId+"/delete";
+ return config.getConsoleServerUrl() + "/rs/engine/deployment/"+encodedId+"/delete";
}
+
+ public String getJobsUrl()
+ {
+ return config.getConsoleServerUrl() + "/rs/engine/jobs";
+ }
}
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -65,19 +65,25 @@
return findEditor(id)!=null;
}
- public void showEditor(final String id)
+ public void showEditor(final String editorId)
{
- EditorDeck deck = findEditor(id);
+ showEditor(editorId, null);
+ }
+
+ public void showEditor(final String editorId, final String viewId)
+ {
+ EditorDeck deck = findEditor(editorId);
if(null==deck)
- throw new IllegalArgumentException("No such editor: " +id);
+ throw new IllegalArgumentException("No such editor: " +editorId);
// display editor
this.showWidget(deck.index);
deck.editor.initialize();
+ if(viewId!=null) deck.editor.showView(viewId);
DeferredCommand.addCommand(new Command() {
public void execute() {
- menu.toggle(id);
+ menu.toggle(editorId);
}
});
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -328,6 +328,8 @@
public static List<DeploymentRef> parseDeploymentRefList(JSONValue json)
{
+ ConsoleLog.debug("parse " + json);
+
List<DeploymentRef> result = new ArrayList<DeploymentRef>();
JSONArray jsonArray = JSONWalk.on(json).next("deployments").asArray();
@@ -365,4 +367,35 @@
return result;
}
+
+ public static List<JobRef> parseJobRefList(JSONValue json)
+ {
+ ConsoleLog.debug("parse " + json);
+
+ List<JobRef> result = new ArrayList<JobRef>();
+
+ JSONArray jsonArray = JSONWalk.on(json).next("jobs").asArray();
+ for (int i = 0; i < jsonArray.size(); i++)
+ {
+ JSONValue item = jsonArray.get(i);
+ String id = JSONWalk.on(item).next("id").asString();
+ String type = JSONWalk.on(item).next("type").asString();
+
+ JobRef ref = new JobRef();
+ ref.setId(id);
+ ref.setType(type);
+
+ JSONWalk.JSONWrapper tsEl = JSONWalk.on(item).next("timestamp");
+ if(tsEl!=null)
+ ref.setTimestamp(tsEl.asLong());
+
+ JSONWalk.JSONWrapper err = JSONWalk.on(item).next("errMsg");
+ if(err!=null) // optional
+ ref.setErrMsg(err.asString());
+
+ result.add(ref);
+ }
+
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -21,12 +21,14 @@
*/
package org.jboss.bpm.console.client.model;
+import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import java.util.ArrayList;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
+@XmlRootElement(name = "deploymentRef")
public class DeploymentRef
{
private String id;
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRef.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@XmlRootElement(name ="jobRef")
+public class JobRef
+{
+
+ private String id;
+ private long timestamp;
+ private String type;
+ private String errMsg;
+
+
+ public JobRef(String id, long timestamp, String type)
+ {
+ this.id = id;
+ this.timestamp = timestamp;
+ this.type = type;
+ }
+
+
+ public JobRef()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp(long timestamp)
+ {
+ this.timestamp = timestamp;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public void setError(String msg)
+ {
+ this.errMsg = msg;
+ }
+
+ public String getErrMsg()
+ {
+ return errMsg;
+ }
+
+ public void setErrMsg(String errMsg)
+ {
+ this.errMsg = errMsg;
+ }
+}
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/JobRefWrapper.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@XmlRootElement(name = "wrapper")
+public class JobRefWrapper
+{
+ List<JobRef> jobs = new ArrayList<JobRef>();
+
+
+ public JobRefWrapper()
+ {
+ }
+
+ public JobRefWrapper(List<JobRef> deployments)
+ {
+ this.jobs = deployments;
+ }
+
+ public List<JobRef> getJobs()
+ {
+ return jobs;
+ }
+
+ public void setJobs(List<JobRef> jobs)
+ {
+ this.jobs = jobs;
+ }
+
+ public int getTotalCount()
+ {
+ return jobs.size();
+ }
+}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -44,7 +44,7 @@
singletons.add(new TaskMgmtFacade());
singletons.add(new UserMgmtFacade());
singletons.add(new TestFacade());
- singletons.add(new DeploymentFacade());
+ singletons.add(new EngineFacade());
singletons.add( new ReportFacade() );
}
Deleted: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -1,147 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.server;
-
-import com.google.gson.Gson;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.console.client.model.DeploymentRef;
-import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
-import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
-import org.jboss.bpm.console.server.plugin.PluginMgr;
-
-import javax.ws.rs.*;
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Manage process deployments
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-@Path("repository")
-public class DeploymentFacade
-{
- private static final Log log = LogFactory.getLog(DeploymentFacade.class);
-
- private ProcessEnginePlugin processEnginePlugin;
-
- private ProcessEnginePlugin getDeploymentPlugin()
- {
- if(null==this.processEnginePlugin)
- {
- this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
- }
-
- return this.processEnginePlugin;
- }
-
- @GET
- @Path("deployments")
- @Produces("application/json")
- public Response getDeployments()
- {
-
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- List<DeploymentRef> dpls = dplPlugin.getDeployments();
- return createJsonResponse(
- new DeploymentRefWrapper(dpls)
- );
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
-
- }
-
- @POST
- @Path("deployment/{id}/suspend")
- @Produces("application/json")
- public Response suspendDeployment(
- @PathParam("id")
- String id
- )
- {
- return doSuspend(id, true);
- }
-
- @POST
- @Path("deployment/{id}/resume")
- @Produces("application/json")
- public Response resumeDeployment(
- @PathParam("id")
- String id
- )
- {
- return doSuspend(id, false);
- }
-
- private Response doSuspend(String id, boolean suspended)
- {
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- processEnginePlugin.suspendDeployment(id, suspended);
- return Response.ok().build();
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
- }
-
- @POST
- @Path("deployment/{id}/delete")
- @Produces("application/json")
- public Response deleteDeployment(
- @PathParam("id")
- String id
- )
- {
-
- ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
- if(processEnginePlugin !=null)
- {
- processEnginePlugin.deleteDeployment(id);
- return Response.ok().build();
- }
- else
- {
- log.error("ProcessEnginePlugin not available");
- return Response.serverError().build();
- }
-
- }
-
- private Response createJsonResponse(Object wrapper)
- {
- Gson gson = GsonFactory.createInstance();
- String json = gson.toJson(wrapper);
- return Response.ok(json).type("application/json").build();
- }
-}
Copied: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java (from rev 5126, projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java)
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java (rev 0)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -0,0 +1,172 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.server;
+
+import com.google.gson.Gson;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.JobRefWrapper;
+import org.jboss.bpm.console.server.gson.GsonFactory;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import java.util.List;
+
+/**
+ * Manage process deployments
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@Path("engine")
+public class EngineFacade
+{
+ private static final Log log = LogFactory.getLog(EngineFacade.class);
+
+ private ProcessEnginePlugin processEnginePlugin;
+
+ private ProcessEnginePlugin getDeploymentPlugin()
+ {
+ if(null==this.processEnginePlugin)
+ {
+ this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
+ }
+
+ return this.processEnginePlugin;
+ }
+
+ @GET
+ @Path("deployments")
+ @Produces("application/json")
+ public Response getDeployments()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<DeploymentRef> dpls = dplPlugin.getDeployments();
+ return createJsonResponse(
+ new DeploymentRefWrapper(dpls)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ @POST
+ @Path("deployment/{id}/suspend")
+ @Produces("application/json")
+ public Response suspendDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, true);
+ }
+
+ @POST
+ @Path("deployment/{id}/resume")
+ @Produces("application/json")
+ public Response resumeDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+ return doSuspend(id, false);
+ }
+
+ private Response doSuspend(String id, boolean suspended)
+ {
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.suspendDeployment(id, suspended);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+ }
+
+ @POST
+ @Path("deployment/{id}/delete")
+ @Produces("application/json")
+ public Response deleteDeployment(
+ @PathParam("id")
+ String id
+ )
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ processEnginePlugin.deleteDeployment(id);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+
+ @GET
+ @Path("jobs")
+ @Produces("application/json")
+ public Response getJobs()
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ List<JobRef> jobs = dplPlugin.getJobs();
+ return createJsonResponse(
+ new JobRefWrapper(jobs)
+ );
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
+}
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-06-26 12:55:00 UTC (rev 5133)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-06-26 14:12:30 UTC (rev 5134)
@@ -22,10 +22,13 @@
package org.jboss.bpm.console.server.plugin;
import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.JobRef;
import java.util.List;
/**
+ * Manages runtime aspects of the underlying process engine.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public interface ProcessEnginePlugin
@@ -35,4 +38,6 @@
void deleteDeployment(String id);
void suspendDeployment(String id, boolean isSuspended);
+
+ List<JobRef> getJobs();
}
16 years, 10 months
JBoss JBPM SVN: r5133 - jbpm4/trunk/modules/test-concurrent/src/main/java/org/jbpm/test/concurrent.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-26 08:55:00 -0400 (Fri, 26 Jun 2009)
New Revision: 5133
Modified:
jbpm4/trunk/modules/test-concurrent/src/main/java/org/jbpm/test/concurrent/SynchronizableCommandExecutor.java
Log:
Fixed change jobId long -> String
Modified: jbpm4/trunk/modules/test-concurrent/src/main/java/org/jbpm/test/concurrent/SynchronizableCommandExecutor.java
===================================================================
--- jbpm4/trunk/modules/test-concurrent/src/main/java/org/jbpm/test/concurrent/SynchronizableCommandExecutor.java 2009-06-26 12:51:27 UTC (rev 5132)
+++ jbpm4/trunk/modules/test-concurrent/src/main/java/org/jbpm/test/concurrent/SynchronizableCommandExecutor.java 2009-06-26 12:55:00 UTC (rev 5133)
@@ -54,7 +54,7 @@
private EnvironmentFactory environmentFactory;
/** The database id of the job that will be executed */
- private Long jobId;
+ private String jobId;
/** The command that will be executed */
private Command command;
@@ -89,7 +89,7 @@
*/
public SynchronizableCommandExecutor(EnvironmentFactory environmentFactory, Job job) {
this.environmentFactory = environmentFactory;
- this.jobId = job.getDbid();
+ this.jobId = job.getId();
this.threadBlocked = false;
this.synchronizations = new ArrayList<CommandExecutionSynchronization>();
16 years, 10 months
JBoss JBPM SVN: r5132 - in jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal: task and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-26 08:51:27 -0400 (Fri, 26 Jun 2009)
New Revision: 5132
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.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/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
Log:
Went over collection return values of API (JBPM-2304)
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -38,8 +38,8 @@
private static final long serialVersionUID = 1L;
protected ObjectReference<ActivityBehaviour> behaviourReference;
- protected List<TransitionImpl> outgoingTransitions;
- protected List<TransitionImpl> incomingTransitions;
+ protected List<TransitionImpl> outgoingTransitions = new ArrayList<TransitionImpl>();
+ protected List<TransitionImpl> incomingTransitions = new ArrayList<TransitionImpl>();
protected TransitionImpl defaultOutgoingTransition;
protected ActivityImpl parentActivity;
@@ -48,7 +48,8 @@
protected ActivityCoordinatesImpl coordinates;
- transient protected Map<String, TransitionImpl> outgoingTransitionsMap;
+ // Do not initialize. Caching is based on the nullity of this map
+ transient protected Map<String, TransitionImpl> outgoingTransitionsMap = null;
/**
* Use {@link ProcessDefinitionImpl#createActivity()} or {@link ActivityImpl#createActivity()} instead.
@@ -105,9 +106,6 @@
* @throws NullPointerException if transition is null.
*/
public Transition addOutgoingTransition(TransitionImpl transition) {
- if (outgoingTransitions==null) {
- outgoingTransitions = new ArrayList<TransitionImpl>();
- }
if (! outgoingTransitions.contains(transition)) {
transition.setSource(this);
transition.setSourceIndex(outgoingTransitions.size());
@@ -131,15 +129,10 @@
* leaving transitions, the transition's source will be nulled.
*/
public boolean removeOutgoingTransition(TransitionImpl transition) {
- if ( (transition!=null)
- && (outgoingTransitions!=null)
- ) {
+ if (transition!=null) {
boolean isRemoved = outgoingTransitions.remove(transition);
if (isRemoved) {
transition.setSource(null);
- if (outgoingTransitions.isEmpty()) {
- outgoingTransitions = null;
- }
clearOutgoingTransitionsMap();
}
return isRemoved;
@@ -194,7 +187,7 @@
/** indicates if this activity has leaving transitions */
public boolean hasOutgoingTransitions() {
- return ((outgoingTransitions!=null) && (!outgoingTransitions.isEmpty()));
+ return !outgoingTransitions.isEmpty();
}
/** sets the outgoingTransitions to the given list of outgoingTransitions.
@@ -205,7 +198,7 @@
* source will be nulled.
*/
public void setOutgoingTransitions(List<TransitionImpl> outgoingTransitions) {
- if (this.outgoingTransitions!=null) {
+ if (!this.outgoingTransitions.isEmpty()) {
List<TransitionImpl> removedTransitions = new ArrayList<TransitionImpl>(outgoingTransitions);
for (TransitionImpl removedTransition: removedTransitions) {
removeOutgoingTransition(removedTransition);
@@ -217,7 +210,7 @@
addOutgoingTransition(addedTransition);
}
} else {
- this.outgoingTransitions = null;
+ this.outgoingTransitions = new ArrayList<TransitionImpl>();
}
clearOutgoingTransitionsMap();
}
@@ -232,9 +225,6 @@
*/
public Transition addIncomingTransition(TransitionImpl transition) {
transition.setDestination(this);
- if (incomingTransitions==null) {
- incomingTransitions = new ArrayList<TransitionImpl>();
- }
incomingTransitions.add(transition);
return transition;
}
@@ -245,14 +235,8 @@
* @return true if a transition was removed.
*/
public boolean removeIncomingTransition(TransitionImpl transition) {
- if ( (transition!=null)
- && (incomingTransitions!=null)
- && (incomingTransitions.remove(transition))
- ) {
+ if ( (transition!=null) && (incomingTransitions.remove(transition))) {
transition.setDestination(null);
- if (incomingTransitions.isEmpty()) {
- incomingTransitions = null;
- }
return true;
}
return false;
@@ -267,7 +251,7 @@
/** indicates if this activity has arriving transitions */
public boolean hasIncomingTransitions() {
- return ((incomingTransitions!=null) && (!incomingTransitions.isEmpty()));
+ return !incomingTransitions.isEmpty();
}
@@ -278,7 +262,7 @@
* destination will be nulled.
*/
public void setIncomingTransitions(List<TransitionImpl> incomingTransitions) {
- if (this.incomingTransitions!=null) {
+ if (!this.incomingTransitions.isEmpty()) {
for (TransitionImpl removedTransition: this.incomingTransitions) {
removedTransition.setDestination(null);
}
@@ -342,11 +326,9 @@
public Map<String, Transition> getOutgoingTransitionsMap() {
if(outgoingTransitionsMap == null){
this.outgoingTransitionsMap = new HashMap<String, TransitionImpl>();
- if (outgoingTransitions!=null) {
- for (TransitionImpl transition: outgoingTransitions) {
- if (! this.outgoingTransitionsMap.containsKey(transition.getName())) {
- this.outgoingTransitionsMap.put(transition.getName(), transition);
- }
+ for (TransitionImpl transition: outgoingTransitions) {
+ if (! this.outgoingTransitionsMap.containsKey(transition.getName())) {
+ this.outgoingTransitionsMap.put(transition.getName(), transition);
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -23,14 +23,12 @@
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.jbpm.api.JbpmException;
import org.jbpm.api.model.Comment;
import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.internal.util.EqualsUtil;
@@ -43,7 +41,7 @@
protected String userId = null;
protected Date time = null;
protected String message = null;
- protected List<CommentImpl> comments = null;
+ protected List<CommentImpl> comments = new ArrayList<CommentImpl>();
public CommentImpl() {
}
@@ -64,9 +62,6 @@
if (message==null) {
throw new JbpmException("message is null");
}
- if (this.comments==null) {
- comments = new ArrayList<CommentImpl>();
- }
CommentImpl reply = new CommentImpl(message);
comments.add(reply);
return reply;
@@ -76,15 +71,12 @@
if (comment==null) {
throw new JbpmException("reply is null");
}
- if (comments!=null) {
+ if (comments.contains(comment)) {
comments.remove(comment);
}
}
public List<Comment> getComments() {
- if (comments==null) {
- return Collections.EMPTY_LIST;
- }
return (List)comments;
}
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 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -24,7 +24,6 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -109,7 +108,7 @@
protected String id;
/** are concurrent executions that related to this execution. */
- protected Collection<ExecutionImpl> executions;
+ protected Collection<ExecutionImpl> executions = new ArrayList<ExecutionImpl>();
/** the parent child relation of executions is convenient for some forms of
* concurrency. */
@@ -123,10 +122,10 @@
protected ExecutionImpl subProcessInstance;
/** swimlanes */
- protected Map<String, SwimlaneImpl> swimlanes;
+ protected Map<String, SwimlaneImpl> swimlanes = new HashMap<String, SwimlaneImpl>();
/** the free text comments users make on this execution */
- protected Set<CommentImpl> comments;
+ protected Set<CommentImpl> comments = new LinkedHashSet<CommentImpl>();
/** reference to the current activity instance history record */
protected Long historyActivityInstanceDbid;
@@ -136,7 +135,7 @@
protected int priority = Priority.NORMAL;
- protected Map<String, Variable> systemVariables;
+ protected Map<String, Variable> systemVariables = new HashMap<String, Variable>();
// persistent indicators of the current position ////////////////////////////
@@ -347,12 +346,10 @@
}
// end all child executions
- if (executions!=null) {
- // making a copy of the executions to prevent ConcurrentMoidificationException
- List<ExecutionImpl> executionsToEnd = new ArrayList<ExecutionImpl>(executions);
- for (ExecutionImpl child: executionsToEnd) {
- child.end(state);
- }
+ // making a copy of the executions to prevent ConcurrentMoidificationException
+ List<ExecutionImpl> executionsToEnd = new ArrayList<ExecutionImpl>(executions);
+ for (ExecutionImpl child: executionsToEnd) {
+ child.end(state);
}
setState(state);
@@ -812,32 +809,21 @@
// swimlanes ////////////////////////////////////////////////////////////////
public void addSwimlane(SwimlaneImpl swimlane) {
- if (swimlanes==null) {
- swimlanes = new HashMap<String, SwimlaneImpl>();
- }
swimlanes.put(swimlane.getName(), swimlane);
swimlane.setExecution(this);
}
public SwimlaneImpl getSwimlane(String swimlaneName) {
- if (swimlanes==null) {
- return null;
- }
return swimlanes.get(swimlaneName);
}
public void removeSwimlane(SwimlaneImpl swimlane) {
- swimlanes.remove(swimlane.getName());
- swimlane.setExecution(null);
+ swimlanes.remove(swimlane.getName());
+ swimlane.setExecution(null);
}
public SwimlaneImpl getInitializedSwimlane(SwimlaneDefinitionImpl swimlaneDefinition) {
String swimlaneName = swimlaneDefinition.getName();
-
- if (swimlanes==null) {
- swimlanes = new HashMap<String, SwimlaneImpl>();
- }
-
SwimlaneImpl swimlane = swimlanes.get(swimlaneName);
if (swimlane==null) {
swimlane = createSwimlane(swimlaneName);
@@ -874,9 +860,6 @@
if (comment==null) {
throw new JbpmException("comment is null");
}
- if (comments==null) {
- comments = new LinkedHashSet<CommentImpl>();
- }
comments.add(comment);
}
@@ -916,9 +899,6 @@
public void addExecution(ExecutionImpl execution) {
execution.setParent(this);
- if (executions==null) {
- executions = new ArrayList<ExecutionImpl>();
- }
executions.add(execution);
executionsMap = null;
}
@@ -930,7 +910,7 @@
}
public void removeExecution(ExecutionImpl child) {
- if (executions!=null) {
+ if (executions.contains(child)) {
if (executions.remove(child)) {
child.setParent(null);
@@ -943,9 +923,7 @@
}
public Map<String, Execution> getExecutionsMap() {
- if ( (executionsMap==null)
- && (executions!=null)
- ) {
+ if ((executionsMap==null)) {
// initialize executionsMap cache
executionsMap = new HashMap<String, Execution>();
for(ExecutionImpl execution: executions) {
@@ -982,10 +960,8 @@
activityNames.add(activityName);
}
- if (executions!=null) {
- for (ExecutionImpl childExecution: executions) {
- childExecution.addActiveActivityNames(activityNames);
- }
+ for (ExecutionImpl childExecution: executions) {
+ childExecution.addActiveActivityNames(activityNames);
}
return activityNames;
@@ -997,12 +973,10 @@
return this;
}
- if (executions!=null) {
- for (ExecutionImpl childExecution: executions) {
- ExecutionImpl found = childExecution.findActiveExecutionIn(activityName);
- if (found!=null) {
- return found;
- }
+ for (ExecutionImpl childExecution: executions) {
+ ExecutionImpl found = childExecution.findActiveExecutionIn(activityName);
+ if (found!=null) {
+ return found;
}
}
@@ -1017,15 +991,11 @@
public void createSystemVariable(String key, Object value, String typeName) {
Variable variable = createVariableObject(key, value, typeName);
-
- if (systemVariables==null) {
- systemVariables = new HashMap<String, Variable>();
- }
systemVariables.put(variable.getKey(), variable);
}
public void setSystemVariable(String key, Object value) {
- Variable variable = (systemVariables!=null ? (Variable) systemVariables.get(key) : null);
+ Variable variable = systemVariables.get(key);
if (variable!=null) {
log.debug("setting system variable '"+key+"' in '"+this+"' to value '"+value+"'");
variable.setValue(value);
@@ -1036,7 +1006,7 @@
}
public Object getSystemVariable(String key) {
- Variable variable = (systemVariables!=null ? (Variable) systemVariables.get(key) : null);
+ Variable variable = systemVariables.get(key);
if (variable!=null) {
return variable.getValue();
}
@@ -1044,7 +1014,7 @@
}
public boolean removeSystemVariable(String key) {
- if (systemVariables!=null) {
+ if (systemVariables.containsKey(key)) {
return (systemVariables.remove(key)!=null);
}
return false;
@@ -1261,9 +1231,6 @@
}
public List<Comment> getComments() {
- if (comments==null) {
- return Collections.emptyList();
- }
return new ArrayList<Comment>(comments);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -71,7 +71,7 @@
/** the activity which is executed when the process starts */
protected ActivityImpl initial;
- protected Map<String, TaskDefinitionImpl> taskDefinitions;
+ protected Map<String, TaskDefinitionImpl> taskDefinitions = new HashMap<String, TaskDefinitionImpl>();
protected String imageResourceName = null;
@@ -136,17 +136,11 @@
// task definitions /////////////////////////////////////////////////////////
public void addTaskDefinitionImpl(TaskDefinitionImpl taskDefinition) {
- if (taskDefinitions==null) {
- taskDefinitions = new HashMap<String, TaskDefinitionImpl>();
- }
taskDefinitions.put(taskDefinition.getName(), taskDefinition);
}
public TaskDefinitionImpl getTaskDefinition(String name) {
- if (taskDefinitions!=null) {
- return taskDefinitions.get(name);
- }
- return null;
+ return taskDefinitions.get(name);
}
// basic methods ////////////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeElementImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -34,8 +34,8 @@
private static final long serialVersionUID = 1L;
- protected List<VariableDefinitionImpl> variableDefinitions;
- protected Set<TimerDefinitionImpl> timerDefinitions;
+ protected List<VariableDefinitionImpl> variableDefinitions = new ArrayList<VariableDefinitionImpl>();
+ protected Set<TimerDefinitionImpl> timerDefinitions = new HashSet<TimerDefinitionImpl>();
public boolean isLocalScope() {
return hasVariableDefinitions() || hasTimerDefinitions();
@@ -44,9 +44,7 @@
// variable definitions /////////////////////////////////////////////////////
public boolean hasVariableDefinitions() {
- return ( (variableDefinitions!=null)
- && (!variableDefinitions.isEmpty())
- );
+ return !variableDefinitions.isEmpty();
}
public List<VariableDefinitionImpl> getVariableDefinitions() {
@@ -58,9 +56,6 @@
public VariableDefinitionImpl createVariableDefinition() {
VariableDefinitionImpl variableDefinition = new VariableDefinitionImpl();
- if (variableDefinitions==null) {
- variableDefinitions = new ArrayList<VariableDefinitionImpl>();
- }
variableDefinitions.add(variableDefinition);
return variableDefinition;
}
@@ -82,9 +77,6 @@
public TimerDefinitionImpl createTimerDefinition() {
TimerDefinitionImpl timerDefinition = new TimerDefinitionImpl();
- if (timerDefinitions==null) {
- timerDefinitions = new HashSet<TimerDefinitionImpl>();
- }
timerDefinitions.add(timerDefinition);
return timerDefinition;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -54,7 +54,7 @@
protected int dbversion;
protected boolean hasVariables;
- protected Map<String, Variable> variables;
+ protected Map<String, Variable> variables = new HashMap<String, Variable>();
protected String state;
protected String suspendHistoryState;
@@ -68,7 +68,6 @@
if (log.isTraceEnabled()) {
log.trace("initializing variables in scope "+scope);
}
- variables = new HashMap<String, Variable>();
for (VariableDefinitionImpl variableDefinition: variableDefinitions) {
String key = variableDefinition.getName();
Object value = variableDefinition.getInitValue(outerExecution);
@@ -84,10 +83,6 @@
public void createVariable(String key, Object value, String typeName) {
Variable variable = createVariableObject(key, value, typeName);
-
- if (variables==null) {
- variables = new HashMap<String, Variable>();
- }
variables.put(variable.getKey(), variable);
hasVariables = true;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -45,7 +45,7 @@
protected String name = null;
protected String assignee = null;
protected ExecutionImpl execution = null;
- protected Set<ParticipationImpl> participations = null;
+ protected Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>();
protected SwimlaneDefinitionImpl swimlaneDefinition = null;
// cloning //////////////////////////////////////////////////////////////////
@@ -78,9 +78,6 @@
// participations /////////////////////////////////////////////////////////////
public Set<ParticipationImpl> getParticipations() {
- if (participations ==null) {
- return Collections.emptySet();
- }
return participations;
}
@@ -98,9 +95,6 @@
private Participation addParticipation(ParticipationImpl participation) {
participation.setSwimlane(this);
- if (participations ==null) {
- participations = new HashSet<ParticipationImpl>();
- }
participations.add(participation);
return participation;
}
@@ -109,9 +103,7 @@
if (participant==null) {
throw new JbpmException("participant is null");
}
- if ( (participations !=null)
- && (participations.remove(participant))
- ) {
+ if (participations.remove(participant)) {
((ParticipationImpl)participant).setSwimlane(null);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -22,6 +22,7 @@
package org.jbpm.pvm.internal.task;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.List;
import org.jbpm.pvm.internal.util.Priority;
@@ -36,7 +37,7 @@
protected String dueDateDuration;
protected String form;
- protected List<TaskDefinitionImpl> subTaskDefinitions;
+ protected List<TaskDefinitionImpl> subTaskDefinitions = new ArrayList<TaskDefinitionImpl>();
protected int priority = Priority.NORMAL;
protected SwimlaneDefinitionImpl swimlaneDefinition;
protected Descriptor taskHandlerDescriptor;
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 12:14:40 UTC (rev 5131)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-06-26 12:51:27 UTC (rev 5132)
@@ -68,7 +68,7 @@
protected String description;
protected String assignee;
- protected Set<ParticipationImpl> participations;
+ protected Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>();
protected String form;
protected Date create;
@@ -77,7 +77,7 @@
protected boolean isSignalling;
// protected VariableMap variableMap;
- protected List<CommentImpl> comments;
+ protected List<CommentImpl> comments = new ArrayList<CommentImpl>();
protected int priority = Priority.NORMAL;
@@ -138,20 +138,14 @@
// TODO: Why does it return the impl. not the interface?
public Set<ParticipationImpl> getParticipations() {
- if (participations == null) {
- return Collections.emptySet();
- }
return participations;
}
public Set<ParticipationImpl> getAllParticipants() {
- Set<ParticipationImpl> allRoles = null;
- if (participations != null) {
+ Set<ParticipationImpl> allRoles = new HashSet<ParticipationImpl>();
+ if (!participations.isEmpty()) {
allRoles = new HashSet<ParticipationImpl>(participations);
}
- else {
- allRoles = new HashSet<ParticipationImpl>();
- }
if (swimlane != null) {
allRoles.addAll((Set) swimlane.getParticipations());
}
@@ -172,9 +166,6 @@
private Participation addParticipant(ParticipationImpl participation) {
participation.setTask(this);
- if (participations == null) {
- participations = new HashSet<ParticipationImpl>();
- }
participations.add(participation);
return participation;
}
@@ -183,7 +174,7 @@
if (participation == null) {
throw new JbpmException("participant is null");
}
- if ((participations != null) && (participations.remove(participation))) {
+ if (participations.remove(participation)) {
participation.setTask(null);
}
}
@@ -231,16 +222,10 @@
// comments /////////////////////////////////////////////////////////////////
public List<Comment> getComments() {
- if (comments == null) {
- return Collections.emptyList();
- }
return (List) comments;
}
public Comment createComment(String commentText) {
- if (comments == null) {
- comments = new ArrayList<CommentImpl>();
- }
CommentImpl comment = new CommentImpl(commentText);
comments.add(comment);
return comment;
@@ -250,7 +235,7 @@
if (comment == null) {
throw new JbpmException("comment is null");
}
- if (comments != null) {
+ if (comments.contains(comment)) {
comments.remove(comment);
}
}
16 years, 10 months
JBoss JBPM SVN: r5131 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/task and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 08:14:40 -0400 (Fri, 26 Jun 2009)
New Revision: 5131
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
Log:
JBPM-2348 long swimlaneDbid --> String swimlaneId
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java 2009-06-26 12:09:12 UTC (rev 5130)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java 2009-06-26 12:14:40 UTC (rev 5131)
@@ -30,7 +30,7 @@
*/
public interface Swimlane extends Serializable {
- long getDbid();
+ String getId();
String getName();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-06-26 12:09:12 UTC (rev 5130)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-06-26 12:14:40 UTC (rev 5131)
@@ -127,6 +127,12 @@
return "Swimlane("+name+")";
}
+ // customized getters and setters ///////////////////////////////////////////
+
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
16 years, 10 months
JBoss JBPM SVN: r5130 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/task and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 08:09:12 -0400 (Fri, 26 Jun 2009)
New Revision: 5130
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java
Log:
JBPM-2348 long participationDbid --> String participationId
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java 2009-06-26 12:04:40 UTC (rev 5129)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java 2009-06-26 12:09:12 UTC (rev 5130)
@@ -50,7 +50,7 @@
* reassigned. */
String REPLACED_ASSIGNEE = "replaced-assignee";
- long getDbid();
+ String getId();
/** userId for this participation.
* null in case this is a {@link #getGroupId() group participation}. */
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java 2009-06-26 12:04:40 UTC (rev 5129)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java 2009-06-26 12:09:12 UTC (rev 5130)
@@ -51,7 +51,15 @@
this.groupId = groupId;
this.type = type;
}
+
+ // customized getters and setters ///////////////////////////////////////////
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
public TaskImpl getTask() {
return task;
}
16 years, 10 months
JBoss JBPM SVN: r5129 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/model and 4 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 08:04:40 -0400 (Fri, 26 Jun 2009)
New Revision: 5129
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java
Log:
JBPM-2348 long commentDbid --> String commentId
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 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -147,11 +147,11 @@
List<Comment> getTaskComments(long taskDbid);
/** add a reply to another comment */
- Comment addReplyComment(long commentDbid, String message);
+ Comment addReplyComment(String commentId, String message);
/** delete a comment.
* this will recursively delete all replies to this comment. */
- void deleteComment(long commentDbid);
+ void deleteComment(String commentId);
/** creates or overwrites a variable value on the given task */
void setVariable(long taskDbid, String name, Object value);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java 2009-06-26 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -38,7 +38,7 @@
public interface Comment extends Discussable {
/** the meaningless database primary key */
- long getDbid();
+ String getId();
/** the id of the user that made this comment. The term actorId is an abstract
* reference to an entity in an external identity component. */
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java 2009-06-26 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -35,19 +35,22 @@
private static final long serialVersionUID = 1L;
- protected long commentDbid;
+ protected String commentId;
protected String message;
- public AddReplyCommentCmd(long commentDbid, String message) {
- this.commentDbid = commentDbid;
+ public AddReplyCommentCmd(String commentId, String message) {
+ if (commentId==null) {
+ throw new JbpmException("commentId is null");
+ }
+ this.commentId = commentId;
this.message = message;
}
public Comment execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- CommentImpl parentComment = dbSession.get(CommentImpl.class, commentDbid);
+ CommentImpl parentComment = dbSession.get(CommentImpl.class, Long.parseLong(commentId));
if (parentComment==null) {
- throw new JbpmException("parent comment doesn't exist: "+commentDbid);
+ throw new JbpmException("parent comment doesn't exist: "+commentId);
}
Comment replyComment = parentComment.createComment(message);
return replyComment;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java 2009-06-26 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -25,7 +25,6 @@
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskImpl;
/**
@@ -35,20 +34,23 @@
private static final long serialVersionUID = 1L;
- protected long commentDbid;
+ protected String commentId;
- public DeleteCommentCmd(long commentDbid) {
- this.commentDbid = commentDbid;
+ public DeleteCommentCmd(String commentId) {
+ if (commentId==null) {
+ throw new JbpmException("commentId is null");
+ }
+ this.commentId = commentId;
}
public Object execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- CommentImpl comment = (CommentImpl) dbSession.get(CommentImpl.class, commentDbid);
+ CommentImpl comment = (CommentImpl) dbSession.get(CommentImpl.class, Long.parseLong(commentId));
if (comment!=null) {
dbSession.delete(comment);
} else {
- throw new JbpmException("comment "+commentDbid+" doesn't exist");
+ throw new JbpmException("comment "+commentId+" doesn't exist");
}
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2009-06-26 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -100,6 +100,12 @@
return EqualsUtil.equals(this, o);
}
+ // cusomtized getters and setters ////////////////////////////////////////////
+
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
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 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -125,12 +125,12 @@
return commandService.execute(new GetTaskCommentsCmd(taskDbid));
}
- public void deleteComment(long commentDbid) {
- commandService.execute(new DeleteCommentCmd(commentDbid));
+ public void deleteComment(String commentId) {
+ commandService.execute(new DeleteCommentCmd(commentId));
}
- public Comment addReplyComment(long commentDbid, String message) {
- return commandService.execute(new AddReplyCommentCmd(commentDbid, message));
+ public Comment addReplyComment(String commentId, String message) {
+ return commandService.execute(new AddReplyCommentCmd(commentId, message));
}
public void assignTask(long taskDbid, String userId) {
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 11:51:07 UTC (rev 5128)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCommentsTest.java 2009-06-26 12:04:40 UTC (rev 5129)
@@ -43,10 +43,10 @@
// - euh yes. it was a great party :-)
// i'll clean up the mess
Comment comment = taskService.addTaskComment(taskDbid, "what a party yesterday");
- long whatAPartyDbid = comment.getDbid();
- comment = taskService.addReplyComment(whatAPartyDbid, "what! you had a party while i was out ?!");
- long youHadAPartyDbid = comment.getDbid();
- taskService.addReplyComment(youHadAPartyDbid, "euh yes. it was a great party :-)");
+ 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");
@@ -60,7 +60,7 @@
taskComments = taskComments.get(0).getComments();
assertEquals("euh yes. it was a great party :-)", taskComments.get(0).getMessage());
- taskService.deleteComment(whatAPartyDbid);
+ taskService.deleteComment(whatAPartyId);
taskComments = taskService.getTaskComments(taskDbid);
assertEquals("i'll clean up the mess", taskComments.get(0).getMessage());
16 years, 10 months
JBoss JBPM SVN: r5128 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/job and 17 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 07:51:07 -0400 (Fri, 26 Jun 2009)
New Revision: 5128
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.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/timer/event/TimerEventTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/GroupTimersTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEndCombinationTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEventListenerOnEndTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/mgmt/JobQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java
Log:
JBPM-2348 long jobDbid --> String jobId
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -37,7 +37,7 @@
* of the job fails. In case the async command executor is configured
* for this service, failing job execution will not result into an
* exception coming out of this method. */
- void executeJob(long jobDbid);
+ void executeJob(String jobId);
/** search for jobs */
JobQuery createJobQuery();
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -31,7 +31,7 @@
*/
public interface Job {
- long getDbid();
+ String getId();
String getLockOwner();
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -147,8 +147,8 @@
}
// messages can also contain a jobId property
else if (message.getObjectProperty("jobId") != null) {
- long jobId = message.getLongProperty("jobId");
- log.debug("received message with jobImpl id " + jobId);
+ String jobId = message.getStringProperty("jobId");
+ log.debug("received message with job id " + jobId);
// create a command with the given jobId
command = new ExecuteJobCmd(jobId);
}
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -31,6 +31,7 @@
import org.jbpm.api.job.Timer;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
@@ -56,7 +57,7 @@
// retrieve timer as entity bean, contact timer service
try {
- LocalTimer timerBean = timerHome.findByPrimaryKey(timer.getDbid());
+ LocalTimer timerBean = timerHome.findByPrimaryKey(((TimerImpl)timer).getDbid());
timerBean.schedule();
}
catch (FinderException e) {
@@ -66,7 +67,7 @@
public void cancel(Timer timer) {
try {
- LocalTimer timerBean = timerHome.findByPrimaryKey(timer.getDbid());
+ LocalTimer timerBean = timerHome.findByPrimaryKey(((TimerImpl)timer).getDbid());
log.debug("canceling " + timer);
/*
* EJB 2.1 section 22.4.4 If an entity bean is removed, the container must remove
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -57,7 +57,7 @@
Job job = managementService.createJobQuery()
.processInstanceId(processInstanceId)
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
processInstance = executionService.findProcessInstanceById(processInstanceId);
@@ -66,7 +66,7 @@
job = managementService.createJobQuery()
.processInstanceId(processInstanceId)
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertNull(executionService.findProcessInstanceById(processInstanceId));
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -62,11 +62,11 @@
Job job = jobs.get(0);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
job = jobs.get(1);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
Date endTime = historyService
.createHistoryProcessInstanceQuery()
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 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -88,7 +88,7 @@
assertNotNull("expected job to be non-null", job);
assertEquals(0, wiser.getMessages().size());
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
// examine produced messages
List<WiserMessage> wiserMessages = wiser.getMessages();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -59,7 +59,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -56,7 +56,7 @@
assertNull(executionService.getVariable(processInstance.getId(), "escalations"));
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals(1, executionService.getVariable(processInstance.getId(), "escalations"));
@@ -66,7 +66,7 @@
assertNotNull(job);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals(2, executionService.getVariable(processInstance.getId(), "escalations"));
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -57,7 +57,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -44,9 +44,16 @@
private static final Log log = Log.getLog(ExecuteJobCmd.class.getName());
- protected long jobDbid;
+ protected Long jobDbid;
- public ExecuteJobCmd(long jobDbid) {
+ public ExecuteJobCmd(String jobId) {
+ if (jobId==null) {
+ throw new JbpmException("jobId is null");
+ }
+ jobDbid = Long.parseLong(jobId);
+ }
+
+ public ExecuteJobCmd(Long jobDbid) {
this.jobDbid = jobDbid;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -71,7 +71,7 @@
messageProducer.close();
}
- jmsMessage.setLongProperty("jobId", message.getDbid());
+ jmsMessage.setStringProperty("jobId", message.getId());
/*
if (jobImpl.getToken()!=null) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -130,7 +130,13 @@
throw new JbpmException("couldn't serialize configuration object for "+this, e);
}
}
+
+ // customized getters and setters ///////////////////////////////////////////
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -33,8 +33,8 @@
*/
public class ManagementServiceImpl extends AbstractServiceImpl implements ManagementService {
- public void executeJob(long jobDbid) {
- commandService.execute(new ExecuteJobCmd(jobDbid));
+ public void executeJob(String jobId) {
+ commandService.execute(new ExecuteJobCmd(jobId));
}
public JobQuery createJobQuery() {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -53,7 +53,7 @@
Job job = managementService.createJobQuery()
.processInstanceId(processInstanceId)
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
job = managementService.createJobQuery()
.processInstanceId(processInstanceId)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -65,7 +65,7 @@
Timer timer = (Timer) jobs.get(0);
- managementService.executeJob(timer.getDbid());
+ managementService.executeJob(timer.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertNotNull(processInstance.findActiveExecutionIn("escalate") );
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/GroupTimersTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/GroupTimersTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/GroupTimersTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -85,7 +85,7 @@
Timer timer = (Timer) jobs.get(0);
assertEquals("timeout", timer.getSignalName());
- managementService.executeJob(timer.getDbid());
+ managementService.executeJob(timer.getId());
processInstance = executionService.findProcessInstanceById(processInstance.getId());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -84,7 +84,7 @@
Job job = jobs.get(0);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals("a bit", executionService.getVariable(processInstanceId, "done"));
@@ -100,7 +100,7 @@
job = jobs.get(0);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
@@ -142,7 +142,7 @@
Job job = jobs.get(0);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
@@ -158,7 +158,7 @@
job = jobs.get(0);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
processInstance = executionService.findProcessInstanceById(processInstanceId);
assertTrue(processInstance.isActive("end"));
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEndCombinationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEndCombinationTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEndCombinationTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -112,7 +112,7 @@
assertEquals(1, jobs.size());
- managementService.executeJob(jobs.get(0).getDbid());
+ managementService.executeJob(jobs.get(0).getId());
jobs = managementService
.createJobQuery()
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEventListenerOnEndTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEventListenerOnEndTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncEventListenerOnEndTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -67,7 +67,7 @@
assertNotNull(job);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals(Execution.STATE_ENDED,
historyService.createHistoryProcessInstanceQuery()
@@ -97,7 +97,7 @@
assertNotNull(job);
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertEquals(Execution.STATE_ENDED,
historyService.createHistoryProcessInstanceQuery()
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/mgmt/JobQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/mgmt/JobQueryTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/mgmt/JobQueryTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -87,9 +87,9 @@
assertEquals(3, messages.size());
- managementService.executeJob(messages.get(0).getDbid());
- managementService.executeJob(messages.get(0).getDbid());
- managementService.executeJob(messages.get(0).getDbid());
+ managementService.executeJob(messages.get(0).getId());
+ managementService.executeJob(messages.get(0).getId());
+ managementService.executeJob(messages.get(0).getId());
List<Job> errorJobs = managementService.createJobQuery()
.exception(true)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/timer/TimerTest.java 2009-06-26 11:51:07 UTC (rev 5128)
@@ -54,7 +54,7 @@
.processInstanceId(processInstance.getId())
.uniqueResult();
- managementService.executeJob(job.getDbid());
+ managementService.executeJob(job.getId());
assertProcessInstanceEnded(processInstance);
}
16 years, 10 months
JBoss JBPM SVN: r5127 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/async/activity and 51 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 07:25:15 -0400 (Fri, 26 Jun 2009)
New Revision: 5127
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/custom/CustomTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.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/assignmenthandler/TaskAssignmentHandlerTest.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/notification/TaskNotificationTest.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/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.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/ProcessManagementImpl.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/GroupConcurrencyTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/MultipleEntriesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/GroupSimpleTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/ImageTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
Log:
JBPM-2348 long deploymentDbid --> String deploymentId
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -38,8 +38,6 @@
/** unique identification of this deployment */
String getId();
- long getDbid();
-
/** typically correspond to the file name or url or some other
* form of identifying the source archive file for this deployment. */
String getName();
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -65,5 +65,5 @@
/** after adding resources, this will perform the actual deployment.
* @return the generated deploymentId identification for this deployment
* in the {@link RepositoryService repository}. */
- long deploy();
+ String deploy();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -50,7 +50,7 @@
/** references the deployment in which this process definition is
* deployed. */
- long getDeploymentDbid();
+ String getDeploymentId();
/** the name of the resource in the deployment which contains the image
* file for this process */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -38,7 +38,7 @@
ProcessDefinitionQuery processDefinitionKey(String key);
ProcessDefinitionQuery processDefinitionNameLike(String name);
ProcessDefinitionQuery processDefinitionName(String name);
- ProcessDefinitionQuery deploymentDbid(long deploymentDbid);
+ ProcessDefinitionQuery deploymentId(String deploymentId);
ProcessDefinitionQuery suspended();
ProcessDefinitionQuery orderAsc(String property);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,19 +33,19 @@
NewDeployment createDeployment();
- void suspendDeployment(long deploymentDbid);
- void resumeDeployment(long deploymentDbid);
+ void suspendDeployment(String deploymentId);
+ void resumeDeployment(String deploymentId);
/** deletes a deployment if the process definitions don't have
* running executions. history information (if any) remains
* in the database. */
- void deleteDeployment(long deploymentDbid);
+ void deleteDeployment(String deploymentId);
/** deletes deployment, contained process definitions, related process instances
* and their history information */
- void deleteDeploymentCascade(long deploymentDbid);
+ void deleteDeploymentCascade(String deploymentId);
- InputStream getResourceAsStream(long deploymentDbid, String resourceName);
+ InputStream getResourceAsStream(String deploymentId, String resourceName);
ProcessDefinitionQuery createProcessDefinitionQuery();
DeploymentQuery createDeploymentQuery();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -32,18 +32,18 @@
*/
public class AsyncActivityTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/async/activity/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/fork/AsyncForkTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -34,18 +34,18 @@
*/
public class AsyncForkTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/async/fork/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class ConcurrencyGraphBasedTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/concurrency/graphbased/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/custom/CustomTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/custom/CustomTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/custom/CustomTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -31,18 +31,18 @@
*/
public class CustomTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/custom/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -34,18 +34,18 @@
*/
public class DecisionConditionsTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/decision/conditions/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class DecisionExpressionTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/decision/expression/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -34,18 +34,18 @@
*/
public class DecisionHandlerTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/decision/handler/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class EndMultipleTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/end/multiple/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class EndProcessInstanceTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/end/processinstance/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class EndStateTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/end/state/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -10,18 +10,18 @@
public class EventListenerTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/eventlistener/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,7 +35,7 @@
*/
public class HqlTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
long taskLaundryDbid;
long taskDishesDbid;
@@ -44,7 +44,7 @@
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/hql/process.jpdl.xml")
.deploy();
@@ -65,7 +65,7 @@
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
taskService.deleteTask(taskLaundryDbid);
taskService.deleteTask(taskDishesDbid);
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/java/JavaInstantiateTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class JavaInstantiateTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/java/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -54,10 +54,10 @@
super.setUp();
// deploy process
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/mail/inline/process.jpdl.xml")
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentId);
// create actors
identityService.createUser("bb", "Big Brother", null, "bb@oceania");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -54,10 +54,10 @@
super.setUp();
// deploy process
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/mail/template/process.jpdl.xml")
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentId);
// create actors
identityService.createUser("bb", "Big Brother", null, "bb@oceania");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class ScriptExpressionTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/script/expression/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/text/ScriptTextTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class ScriptTextTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/script/text/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -32,10 +32,10 @@
ManagementService managementService = processEngine.getManagementService();
// Deploying a process
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/services/Order.jpdl.xml")
.deploy();
- repositoryService.deleteDeployment(deploymentDbid);
+ repositoryService.deleteDeployment(deploymentId);
}
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,7 +35,7 @@
*/
public class SqlTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
long taskLaundryDbid;
long taskDishesDbid;
@@ -44,7 +44,7 @@
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/sql/process.jpdl.xml")
.deploy();
@@ -65,7 +65,7 @@
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
taskService.deleteTask(taskLaundryDbid);
taskService.deleteTask(taskDishesDbid);
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class StateChoiceTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/state/choice/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -31,18 +31,18 @@
*/
public class StateSequenceTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/state/sequence/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,24 +33,24 @@
*/
public class SubProcessOutcomeActivityTest extends JbpmTestCase {
- long subProcessReviewDeploymentDbid;
- long subProcessDocumentDeploymentDbid;
+ String subProcessReviewDeploymentId;
+ String subProcessDocumentDeploymentId;
protected void setUp() throws Exception {
super.setUp();
- subProcessReviewDeploymentDbid = repositoryService.createDeployment()
+ subProcessReviewDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml")
.deploy();
- subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
+ subProcessDocumentDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
- repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
+ repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentId);
+ repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentId);
super.tearDown();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,24 +33,24 @@
*/
public class SubProcessOutcomeValueTest extends JbpmTestCase {
- long subProcessReviewDeploymentDbid;
- long subProcessDocumentDeploymentDbid;
+ String subProcessReviewDeploymentId;
+ String subProcessDocumentDeploymentId;
protected void setUp() throws Exception {
super.setUp();
- subProcessReviewDeploymentDbid = repositoryService.createDeployment()
+ subProcessReviewDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml")
.deploy();
- subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
+ subProcessDocumentDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
- repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
+ repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentId);
+ repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentId);
super.tearDown();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,24 +35,24 @@
*/
public class SubProcessVariablesTest extends JbpmTestCase {
- long subProcessReviewDeploymentDbid;
- long subProcessDocumentDeploymentDbid;
+ String subProcessReviewDeploymentId;
+ String subProcessDocumentDeploymentId;
protected void setUp() throws Exception {
super.setUp();
- subProcessReviewDeploymentDbid = repositoryService.createDeployment()
+ subProcessReviewDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/variables/SubProcessReview.jpdl.xml")
.deploy();
- subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
+ subProcessDocumentDeploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
- repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
+ repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentId);
+ repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentId);
super.tearDown();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,18 +35,18 @@
*/
public class TaskAssigneeTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/assignee/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -31,18 +31,18 @@
*/
public class TaskAssignmentHandlerTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,7 +33,7 @@
*/
public class TaskCandidatesTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
String dept;
protected void setUp() throws Exception {
@@ -49,14 +49,14 @@
identityService.createMembership("joesmoe", dept, "developer");
// deploy process
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/candidates/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
// delete process deployment
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
// delete identities
identityService.deleteGroup(dept);
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/notification/TaskNotificationTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/notification/TaskNotificationTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/notification/TaskNotificationTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -50,10 +50,10 @@
super.setUp();
// deploy process
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/notification/process.jpdl.xml")
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentId);
// create actors
identityService.createUser("johndoe", "John", "Doe", "john@doe");
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/reminder/TaskReminderTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -53,10 +53,10 @@
super.setUp();
// deploy process
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/reminder/process.jpdl.xml")
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentId);
// create actors
identityService.createUser("johndoe", "John", "Doe", "john@doe");
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -32,7 +32,7 @@
*/
public class TaskSwimlaneTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
String dept;
@@ -47,7 +47,7 @@
identityService.createMembership("johndoe", dept, "developer");
// deploy process
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/swimlane/process.jpdl.xml")
.deploy();
@@ -55,7 +55,7 @@
protected void tearDown() throws Exception {
// delete process deployment
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
// delete identities
identityService.deleteGroup(dept);
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -38,18 +38,18 @@
*/
public class TaskVariablesTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/task/variables/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/businesstime/TimerBusinessTimeTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
static long HOUR_IN_MILLIS = 60*60*100;
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/timer/businesstime/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/event/TimerEventTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -36,18 +36,18 @@
*/
public class TimerEventTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/timer/event/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/repeat/TimerRepeatTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -31,18 +31,18 @@
*/
public class TimerRepeatTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/timer/repeat/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/timer/transition/TimerTransitionTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class TimerTransitionTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/timer/transition/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -61,7 +61,7 @@
// active processes
ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
- pdQuery.deploymentDbid(dpl.getDbid());
+ pdQuery.deploymentId(dpl.getId());
List<ProcessDefinition> activePds = pdQuery.list();
for(ProcessDefinition p : activePds)
@@ -71,7 +71,7 @@
// suspended processes
ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
- pdQuery2.deploymentDbid(dpl.getDbid());
+ pdQuery2.deploymentId(dpl.getId());
pdQuery2.suspended();
List<ProcessDefinition> suspendedPds = pdQuery2.list();
@@ -98,7 +98,7 @@
try
{
RepositoryService repositoryService = this.processEngine.getRepositoryService();
- repositoryService.deleteDeploymentCascade(Long.valueOf(id));
+ repositoryService.deleteDeploymentCascade(id);
}
finally
{
@@ -115,9 +115,9 @@
{
RepositoryService repositoryService = this.processEngine.getRepositoryService();
if(isSuspended)
- repositoryService.suspendDeployment(Long.valueOf(id));
+ repositoryService.suspendDeployment(id);
else
- repositoryService.resumeDeployment(Long.valueOf(id));
+ repositoryService.resumeDeployment(id);
}
finally
{
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -55,7 +55,7 @@
//def.setDescription(processDefinition.getDescription());
def.setPackageName(cast.getPackageName());
- def.setDeploymentId(String.valueOf(cast.getDeploymentDbid()));
+ def.setDeploymentId(String.valueOf(cast.getDeploymentId()));
return def;
}
@@ -171,7 +171,7 @@
{
DeploymentImpl d0 = (DeploymentImpl)dpl;
DeploymentRef dRef = new DeploymentRef(
- String.valueOf(dpl.getDbid()), d0.isSuspended()
+ dpl.getId(), d0.isSuspended()
);
String name = d0.getName();
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -121,7 +121,7 @@
.processDefinitionId(procDefId)
.uniqueResult();
if (processDefinition!=null) {
- repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentDbid());
+ repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentId());
}
return getProcessDefinitions();
}
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 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -128,7 +128,7 @@
// check if a template exists
String name = task.getName() + ".ftl";
InputStream template = repoService.getResourceAsStream(
- procDef.getDeploymentDbid(), name
+ procDef.getDeploymentId(), name
);
// merge template with process variables
Modified: jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -68,7 +68,7 @@
String imgRes = processDefinition.getImageResourceName();
InputStream in = repositoryService.getResourceAsStream(
- processDefinition.getDeploymentDbid(), imgRes
+ processDefinition.getDeploymentId(), imgRes
);
if(null==in)
Modified: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -60,14 +60,14 @@
String deploymentName = deploymentMetData.getWatch().getPath();
File deploymentFile = new File(deploymentName);
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentId = repositoryService.createDeployment()
.addResourcesFromZipInputStream(new ZipInputStream(deploymentMetData.getWatch().openStream()))
//.addResourceFromUrl(deploymentMetData.getProcessDescriptor())
.setTimestamp(deploymentFile.lastModified())
.setName(deploymentName)
.deploy();
- DeploymentRef deploymentRef = new DeploymentRef(deploymentDbid, deploymentName);
+ DeploymentRef deploymentRef = new DeploymentRef(deploymentId, deploymentName);
tx.commit();
@@ -116,7 +116,7 @@
// just suspend the process instance (not delete it), see
// http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238250
// see https://jira.jboss.org/jira/browse/JBPM-2242 as well
- repositoryService.suspendDeployment(deploymentRef.getDeploymentDbid());
+ repositoryService.suspendDeployment(deploymentRef.getDeploymentId());
}
else
{
Modified: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -28,23 +28,23 @@
*/
public final class DeploymentRef
{
- private long deploymentDbid;
+ private String deploymentId;
private String location;
- public DeploymentRef(long deploymentDbid, String location)
+ public DeploymentRef(String deploymentId, String location)
{
- this.deploymentDbid = deploymentDbid;
+ this.deploymentId = deploymentId;
this.location = location;
}
public String toString()
{
- return "DeploymentRef {dbid="+deploymentDbid+", location="+location+"}";
+ return "DeploymentRef {id="+deploymentId+", location="+location+"}";
}
- public long getDeploymentDbid()
+ public String getDeploymentId()
{
- return deploymentDbid;
+ return deploymentId;
}
public String getLocation()
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -45,22 +45,22 @@
private static final long serialVersionUID = 1L;
- long deploymentDbid;
+ String deploymentId;
boolean cascade;
- public DeleteDeploymentCmd(long deploymentDbid) {
- this.deploymentDbid = deploymentDbid;
+ public DeleteDeploymentCmd(String deploymentId) {
+ this.deploymentId = deploymentId;
}
- public DeleteDeploymentCmd(long deploymentDbid, boolean cascade) {
- this.deploymentDbid = deploymentDbid;
+ public DeleteDeploymentCmd(String deploymentId, boolean cascade) {
+ this.deploymentId = deploymentId;
this.cascade = cascade;
}
public Object execute(Environment environment) throws Exception {
RepositorySession repositorySession = environment.get(RepositorySession.class);
List<ProcessDefinition> processDefinitions = repositorySession.createProcessDefinitionQuery()
- .deploymentDbid(deploymentDbid)
+ .deploymentId(deploymentId)
.list();
DbSession dbSession = environment.get(DbSession.class);
@@ -80,18 +80,18 @@
} else {
if (!processInstances.isEmpty()) {
- throw new JbpmException("cannot delete deployment "+deploymentDbid+": still executions for "+processDefinition+": "+processInstances);
+ throw new JbpmException("cannot delete deployment "+deploymentId+": still executions for "+processDefinition+": "+processInstances);
}
}
}
Session session = environment.get(Session.class);
- DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
- log.debug("deleting deployment "+deploymentDbid);
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
+ log.debug("deleting deployment "+deploymentId);
session.delete(deployment);
RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
- repositoryCache.set(deploymentDbid, null);
+ repositoryCache.set(deploymentId, null);
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class DeployCmd implements Command<Long> {
+public class DeployCmd implements Command<String> {
private static final long serialVersionUID = 1L;
@@ -41,7 +41,7 @@
this.deployment = deployment;
}
- public Long execute(Environment environment) throws Exception {
+ public String execute(Environment environment) throws Exception {
RepositorySession repositorySession = environment.get(RepositorySession.class);
return repositorySession.deploy(deployment);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -21,8 +21,6 @@
*/
package org.jbpm.pvm.internal.cmd;
-import java.io.InputStream;
-
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.RepositorySession;
@@ -34,16 +32,16 @@
private static final long serialVersionUID = 1L;
- protected long deploymentDbid;
+ protected String deploymentId;
protected String resourceName;
- public GetResourceAsStreamCmd(long deploymentDbid, String resourceName) {
- this.deploymentDbid = deploymentDbid;
+ public GetResourceAsStreamCmd(String deploymentId, String resourceName) {
+ this.deploymentId = deploymentId;
this.resourceName = resourceName;
}
public byte[] execute(Environment environment) {
RepositorySession repositorySession = environment.get(RepositorySession.class);
- return repositorySession.getBytes(deploymentDbid, resourceName);
+ return repositorySession.getBytes(deploymentId, resourceName);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.hibernate.Session;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.pvm.internal.session.RepositorySession;
/**
@@ -33,15 +33,15 @@
private static final long serialVersionUID = 1L;
- long deploymentDbid;
+ String deploymentId;
- public ResumeDeploymentCmd(long deploymentDbid) {
- this.deploymentDbid = deploymentDbid;
+ public ResumeDeploymentCmd(String deploymentId) {
+ this.deploymentId = deploymentId;
}
public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
deployment.resume();
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -26,6 +26,7 @@
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.repository.RepositoryCache;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.session.RepositorySession;
/**
@@ -35,18 +36,20 @@
private static final long serialVersionUID = 1L;
- long deploymentDbid;
+ String deploymentId;
- public SuspendDeploymentCmd(long deploymentDbid) {
- this.deploymentDbid = deploymentDbid;
+ public SuspendDeploymentCmd(String deploymentId) {
+ this.deploymentId = deploymentId;
}
public Object execute(Environment environment) throws Exception {
- DbSession dbSession = environment.get(DbSession.class);
- DeploymentImpl deployment = (DeploymentImpl) dbSession.get(DeploymentImpl.class, deploymentDbid);
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+
+ DeploymentImpl deployment = (DeploymentImpl) repositorySession.getDeployment(deploymentId);
if (deployment==null) {
- throw new JbpmException("deployment "+deploymentDbid+" doesn't exist");
+ throw new JbpmException("deployment "+deploymentId+" doesn't exist");
}
+
deployment.suspend();
// removing deployment from the cache
@@ -54,7 +57,7 @@
// at that time, the suspended property will be propagated to the
// process definitions
RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
- repositoryCache.remove(deploymentDbid);
+ repositoryCache.remove(deploymentId);
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -154,7 +154,13 @@
public String toString() {
return (name!=null ? "process("+name+")" : "process");
}
+
+ // customized getters and setters ///////////////////////////////////////////
+ public String getDeploymentId() {
+ return Long.toString(deploymentDbid);
+ }
+
// getters and setters //////////////////////////////////////////////////////
public ActivityImpl getInitial() {
@@ -193,9 +199,6 @@
public void setId(String id) {
this.id = id;
}
- public long getDeploymentDbid() {
- return deploymentDbid;
- }
public void setDeploymentDbid(long deploymentDbid) {
this.deploymentDbid = deploymentDbid;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -59,17 +59,17 @@
protected String nameLike;
protected String name;
protected boolean suspended;
- protected Long deploymentDbid;
+ protected String deploymentId;
public Object execute(Session session) {
List<Map<String, Object>> propertyMaps = (List<Map<String, Object>>) super.execute(session);
List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
for (Map<String, Object> properties: propertyMaps) {
- Long deploymentDbid = (Long)properties.get("deploymentDbid");
+ String deploymentId = properties.get("deploymentDbid").toString();
String objectName = (String)properties.get("objectName");
RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentDbid, objectName);
+ ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
processDefinitions.add(processDefinition);
}
@@ -123,8 +123,8 @@
appendWhereClause("keyProperty.stringValue = '"+key+"' ", hql);
}
- if (deploymentDbid!=null) {
- appendWhereClause("idProperty.deployment.dbid = "+deploymentDbid+" ", hql);
+ if (deploymentId!=null) {
+ appendWhereClause("idProperty.deployment.dbid = "+deploymentId+" ", hql);
}
appendOrderByClause(hql);
@@ -168,8 +168,8 @@
return this;
}
- public ProcessDefinitionQuery deploymentDbid(long deploymentDbid) {
- this.deploymentDbid = deploymentDbid;
+ public ProcessDefinitionQuery deploymentId(String deploymentId) {
+ this.deploymentId = deploymentId;
return this;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -53,6 +53,6 @@
}
RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
- repositoryCache.set(deployment.getDbid(), deployment.getObjects());
+ repositoryCache.set(deployment.getId(), deployment.getObjects());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -85,7 +85,7 @@
return "deployment("+dbid+")";
}
- public long deploy() {
+ public String deploy() {
return commandService.execute(new DeployCmd(this));
}
@@ -255,7 +255,7 @@
repositorySession.cascadeDeploymentSuspend(this);
RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
- repositoryCache.remove(dbid);
+ repositoryCache.remove(Long.toString(dbid));
}
public void resume() {
@@ -269,7 +269,7 @@
repositorySession.cascadeDeploymentResume(this);
RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
- repositoryCache.remove(dbid);
+ repositoryCache.remove(Long.toString(dbid));
}
public boolean isSuspended() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -29,8 +29,8 @@
*/
public interface RepositoryCache {
- void set(long deploymentdbid, Map<String, Object> deployedObjects);
- Object get(long deploymentDbid, String objectName);
- void remove(long deploymentDbid);
+ void set(String deploymentId, Map<String, Object> deployedObjects);
+ Object get(String deploymentId, String objectName);
+ void remove(String deploymentId);
void clear();
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,24 +30,24 @@
*/
public class RepositoryCacheImpl implements RepositoryCache {
- Map<Long, Map<String, Object>> deployments = new HashMap<Long, Map<String,Object>>();
+ Map<String, Map<String, Object>> deployments = new HashMap<String, Map<String,Object>>();
- public Object get(long deploymentDbid, String objectName) {
- Map<String, Object> deploymentObjects = deployments.get(deploymentDbid);
+ public Object get(String deploymentId, String objectName) {
+ Map<String, Object> deploymentObjects = deployments.get(deploymentId);
if (deploymentObjects==null) {
return null;
}
return deploymentObjects.get(objectName);
}
- public void set(long deploymentDbid, Map<String, Object> objects) {
+ public void set(String deploymentId, Map<String, Object> objects) {
if (objects==null) {
- deployments.put(deploymentDbid, null);
+ deployments.put(deploymentId, null);
} else {
- Map<String, Object> deploymentObjects = deployments.get(deploymentDbid);
+ Map<String, Object> deploymentObjects = deployments.get(deploymentId);
if (deploymentObjects==null) {
deploymentObjects = new HashMap<String, Object>();
- deployments.put(deploymentDbid, deploymentObjects);
+ deployments.put(deploymentId, deploymentObjects);
}
for (String objectName: objects.keySet()) {
Object object = objects.get(objectName);
@@ -56,13 +56,13 @@
}
}
- public void remove(long deploymentDbid) {
+ public void remove(String deploymentDbid) {
if (deployments!=null) {
deployments.remove(deploymentDbid);
}
}
public void clear() {
- deployments = new HashMap<Long, Map<String,Object>>();
+ deployments = new HashMap<String, Map<String,Object>>();
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -51,24 +51,24 @@
return new DeploymentImpl(commandService);
}
- public void suspendDeployment(long deploymentDbid) {
- commandService.execute(new SuspendDeploymentCmd(deploymentDbid));
+ public void suspendDeployment(String deploymentId) {
+ commandService.execute(new SuspendDeploymentCmd(deploymentId));
}
- public void resumeDeployment(long deploymentDbid) {
- commandService.execute(new ResumeDeploymentCmd(deploymentDbid));
+ public void resumeDeployment(String deploymentId) {
+ commandService.execute(new ResumeDeploymentCmd(deploymentId));
}
- public void deleteDeployment(long deploymentDbid) {
- commandService.execute(new DeleteDeploymentCmd(deploymentDbid));
+ public void deleteDeployment(String deploymentId) {
+ commandService.execute(new DeleteDeploymentCmd(deploymentId));
}
- public void deleteDeploymentCascade(long deploymentDbid) {
- commandService.execute(new DeleteDeploymentCmd(deploymentDbid, true));
+ public void deleteDeploymentCascade(String deploymentId) {
+ commandService.execute(new DeleteDeploymentCmd(deploymentId, true));
}
- public InputStream getResourceAsStream(long deploymentDbid, String resource) {
- byte[] bytes = commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ public InputStream getResourceAsStream(String deploymentId, String resource) {
+ byte[] bytes = commandService.execute(new GetResourceAsStreamCmd(deploymentId, resource));
if (bytes!=null) {
return new ByteArrayInputStream(bytes);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.repository;
-import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -29,7 +28,6 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.NewDeployment;
-import org.jbpm.api.Problem;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.internal.log.Log;
@@ -49,14 +47,14 @@
protected RepositoryCache repositoryCache;
protected DeployerManager deployerManager;
- public long deploy(NewDeployment deployment) {
+ public String deploy(NewDeployment deployment) {
DeploymentImpl deploymentImpl = (DeploymentImpl) deployment;
session.save(deploymentImpl);
deployerManager.deploy(deploymentImpl);
- return deploymentImpl.getDbid();
+ return deploymentImpl.getId();
}
@@ -82,7 +80,7 @@
// starts between clearing the cache and committing the transaction, then
// that transaction could potentially re-initialize the process definition
// in the cache.
- repositoryCache.remove(deployment.getDbid());
+ repositoryCache.remove(deployment.getId());
}
public void cascadeDeploymentResume(DeploymentImpl deployment) {
@@ -103,29 +101,32 @@
}
}
- public DeploymentImpl getDeployment(long deploymentDbid) {
- return (DeploymentImpl) session.get(DeploymentImpl.class, deploymentDbid);
+ public DeploymentImpl getDeployment(String deploymentId) {
+ return (DeploymentImpl) session.get(DeploymentImpl.class, Long.parseLong(deploymentId));
}
- public Object getObject(long deploymentDbid, String objectName) {
- Object object = repositoryCache.get(deploymentDbid, objectName);
+ public Object getObject(String deploymentId, String objectName) {
+ Object object = repositoryCache.get(deploymentId, objectName);
if (object!=null) {
log.trace("repository cache hit");
+ } else if (deploymentId==null) {
+ throw new JbpmException("deploymentId is null");
+
} else {
- log.trace("loading deployment "+deploymentDbid+" from db");
- DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ log.trace("loading deployment "+deploymentId+" from db");
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, Long.parseLong(deploymentId));
deployerManager.deploy(deployment);
- object = repositoryCache.get(deploymentDbid, objectName);
+ object = repositoryCache.get(deploymentId, objectName);
if (object==null) {
- throw new JbpmException("deployment "+deploymentDbid+" doesn't contain object "+objectName);
+ throw new JbpmException("deployment "+deploymentId+" doesn't contain object "+objectName);
}
}
return object;
}
- public byte[] getBytes(long deploymentDbid, String resourceName) {
- DeploymentImpl deployment = getDeployment(deploymentDbid);
+ public byte[] getBytes(String deploymentId, String resourceName) {
+ DeploymentImpl deployment = getDeployment(deploymentId);
if (deployment==null) {
return null;
}
@@ -156,10 +157,10 @@
DeploymentProperty deploymentProperty = findDeploymentPropertyByProcessDefinitionId(processDefinitionId);
if (deploymentProperty!=null) {
- long deploymentDbid = deploymentProperty.getDeployment().getDbid();
+ String deploymentId = deploymentProperty.getDeployment().getId();
String objectName = deploymentProperty.getObjectName();
- return (ProcessDefinitionImpl) getObject(deploymentDbid, objectName);
+ return (ProcessDefinitionImpl) getObject(deploymentId, objectName);
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -24,6 +24,7 @@
import org.jbpm.api.NewDeployment;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
/**
@@ -31,11 +32,13 @@
*/
public interface RepositorySession {
- long deploy(NewDeployment deployment);
+ String deploy(NewDeployment deployment);
+
+ DeploymentImpl getDeployment(String deploymentId);
- Object getObject(long deploymentDbid, String objectName);
+ Object getObject(String deploymentId, String objectName);
- byte[] getBytes(long deploymentDbid, String resourceName);
+ byte[] getBytes(String deploymentId, String resourceName);
/** create a process definition query */
ProcessDefinitionQueryImpl createProcessDefinitionQuery();
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -69,7 +69,7 @@
/** registered deployments. registered deployments will be deleted automatically
* in the tearDown. This is a convenience function as each test is expected to clean up the DB. */
- protected List<Long> registeredDeployments = new ArrayList<Long>();
+ protected List<String> registeredDeployments = new ArrayList<String>();
protected void setUp() throws Exception {
super.setUp();
@@ -101,8 +101,8 @@
}
protected void tearDown() throws Exception {
- for (Long deploymentDbid : registeredDeployments) {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ for (String deploymentId : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentId);
}
String errorMsg = null;
@@ -128,8 +128,8 @@
/** deploys the process, keeps a reference to the deployment and
* automatically deletes the deployment in the tearDown */
- public long deployJpdlXmlString(String jpdlXmlString) {
- long deploymentDbid =
+ public String deployJpdlXmlString(String jpdlXmlString) {
+ String deploymentDbid =
repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml", jpdlXmlString)
.deploy();
@@ -140,8 +140,8 @@
}
/** registered deployments will be deleted in the tearDown */
- protected void registerDeployment(long deploymentDbid) {
- registeredDeployments.add(deploymentDbid);
+ protected void registerDeployment(String deploymentId) {
+ registeredDeployments.add(deploymentId);
}
// task helper methods //////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/async/eventlistener/AsyncEventListenerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class AsyncEventListenerTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/async/eventlistener/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/GroupConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/GroupConcurrencyTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/concurrency/GroupConcurrencyTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -30,18 +30,18 @@
*/
public class GroupConcurrencyTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/group/concurrency/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/MultipleEntriesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/MultipleEntriesTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/multipleentries/MultipleEntriesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -34,18 +34,18 @@
public class MultipleEntriesTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/group/multipleentries/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/GroupSimpleTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/GroupSimpleTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/simple/GroupSimpleTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -33,18 +33,18 @@
*/
public class GroupSimpleTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/group/simple/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/goup/timer/GroupTimerTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,18 +35,18 @@
*/
public class GroupTimerTest extends JbpmTestCase {
- long deploymentDbid;
+ String deploymentId;
protected void setUp() throws Exception {
super.setUp();
- deploymentDbid = repositoryService.createDeployment()
+ deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/group/timer/process.jpdl.xml")
.deploy();
}
protected void tearDown() throws Exception {
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -37,7 +37,7 @@
public class DeploymentQueryTest extends JbpmTestCase {
public void testSuspendDeployment() {
- long deploymentClaimDbid = repositoryService
+ String deploymentClaimId = repositoryService
.createDeployment()
.setName("Claim")
.addResourceFromString("process.jpdl.xml",
@@ -50,7 +50,7 @@
)
.deploy();
- long deploymentHireDbid = repositoryService
+ String deploymentHireId = repositoryService
.createDeployment()
.setName("Hire")
.addResourceFromString("process.jpdl.xml",
@@ -63,7 +63,7 @@
)
.deploy();
- long deploymentFireDbid = repositoryService
+ String deploymentFireId = repositoryService
.createDeployment()
.setName("Fire")
.addResourceFromString("process.jpdl.xml",
@@ -76,7 +76,7 @@
)
.deploy();
- repositoryService.suspendDeployment(deploymentHireDbid);
+ repositoryService.suspendDeployment(deploymentHireId);
// find all deployments
@@ -117,9 +117,9 @@
assertEquals(expectedDeploymentNames, getDeploymentNames(deployments));
- repositoryService.deleteDeploymentCascade(deploymentClaimDbid);
- repositoryService.deleteDeploymentCascade(deploymentHireDbid);
- repositoryService.deleteDeploymentCascade(deploymentFireDbid);
+ repositoryService.deleteDeploymentCascade(deploymentClaimId);
+ repositoryService.deleteDeploymentCascade(deploymentHireId);
+ repositoryService.deleteDeploymentCascade(deploymentFireId);
}
Set<String> getDeploymentNames(List<Deployment> deployments) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/ImageTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/ImageTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/ImageTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -35,7 +35,7 @@
public class ImageTest extends JbpmTestCase {
public void testImage() {
- long deploymentDbid = repositoryService
+ String deploymentId = repositoryService
.createDeployment()
.addResourceFromClasspath("org/jbpm/test/deploy/ImageTest.jpdl.xml")
.addResourceFromClasspath("org/jbpm/test/deploy/ImageTest.png")
@@ -49,7 +49,7 @@
String imageResourceName = processDefinition.getImageResourceName();
assertEquals("org/jbpm/test/deploy/ImageTest.png", imageResourceName);
- InputStream inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentDbid(), imageResourceName);
+ InputStream inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), imageResourceName);
byte[] imageBytes = IoUtil.readBytes(inputStream);
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jbpm/test/deploy/ImageTest.png");
@@ -57,6 +57,6 @@
assertTrue(Arrays.equals(expectedImageBytes, imageBytes));
- repositoryService.deleteDeploymentCascade(deploymentDbid);
+ repositoryService.deleteDeploymentCascade(deploymentId);
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -46,7 +46,7 @@
"</process>"
);
- long deploymentHireDbid = deployJpdlXmlString(
+ String deploymentHireId = deployJpdlXmlString(
"<process name='hire'>" +
" <start>" +
" <transition to='h' />" +
@@ -94,7 +94,7 @@
assertEquals(6, processInstances.size());
- repositoryService.suspendDeployment(deploymentHireDbid);
+ repositoryService.suspendDeployment(deploymentHireId);
expectedProcessNames.remove("hire");
@@ -114,7 +114,7 @@
assertEquals(2, countProcessInstancesFor(processInstances, "fire"));
assertEquals(4, processInstances.size());
- repositoryService.resumeDeployment(deploymentHireDbid);
+ repositoryService.resumeDeployment(deploymentHireId);
expectedProcessNames.add("hire");
@@ -144,7 +144,7 @@
"</process>"
);
- long deploymentHireDbid = deployJpdlXmlString(
+ String deploymentHireId = deployJpdlXmlString(
"<process name='hire'>" +
" <start>" +
" <transition to='h' />" +
@@ -153,7 +153,7 @@
"</process>"
);
- long deploymentFireDbid = deployJpdlXmlString(
+ String deploymentFireId = deployJpdlXmlString(
"<process name='fire'>" +
" <start>" +
" <transition to='f' />" +
@@ -162,8 +162,8 @@
"</process>"
);
- repositoryService.suspendDeployment(deploymentHireDbid);
- repositoryService.suspendDeployment(deploymentFireDbid);
+ repositoryService.suspendDeployment(deploymentHireId);
+ repositoryService.suspendDeployment(deploymentFireId);
List<ProcessDefinition> processDefinitions = repositoryService
.createProcessDefinitionQuery()
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -42,7 +42,7 @@
byte[] lotOfBytes = generateString("a lot of bytes ", 5000).getBytes();
byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
- long deploymentDbid =
+ String deploymentDbiId =
repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='Insurance claim'>" +
@@ -52,14 +52,14 @@
.addResourceFromInputStream("other attachment", new ByteArrayInputStream(otherBytes))
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentDbiId);
- InputStream stream = repositoryService.getResourceAsStream(deploymentDbid, "a lot of attachment");
+ InputStream stream = repositoryService.getResourceAsStream(deploymentDbiId, "a lot of attachment");
byte[] retrievedLotOfBytes = readBytes(stream);
assertNotNull(retrievedLotOfBytes);
assertTrue(Arrays.equals(lotOfBytes, retrievedLotOfBytes));
- stream = repositoryService.getResourceAsStream(deploymentDbid, "other attachment");
+ stream = repositoryService.getResourceAsStream(deploymentDbiId, "other attachment");
byte[] retrievedOtherBytes = readBytes(stream);
assertNotNull(retrievedOtherBytes);
assertTrue(Arrays.equals(otherBytes, retrievedOtherBytes));
@@ -70,12 +70,12 @@
InputStream inputStream = classLoader.getResourceAsStream("org/jbpm/test/process/process.jpdl.xml");
assertNotNull(inputStream);
- long deploymentDbid =
+ String deploymentId =
repositoryService.createDeployment()
.addResourceFromInputStream("process.jpdl.xml", inputStream)
.deploy();
- registerDeployment(deploymentDbid);
+ registerDeployment(deploymentId);
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("Resource")
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2009-06-26 10:11:54 UTC (rev 5126)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2009-06-26 11:25:15 UTC (rev 5127)
@@ -151,7 +151,7 @@
}
public void testDeleteDeployment() {
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentDbid = repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='deleteme' version='33'>" +
" <start />" +
@@ -166,7 +166,7 @@
}
public void testDeleteProcessDefinitionAndInstances() {
- long deploymentDbid = repositoryService.createDeployment()
+ String deploymentDbid = repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='deleteme' version='33'>" +
" <start>" +
@@ -190,7 +190,7 @@
}
public void testDeleteProcessDefinitionButNotInstances() {
- long deploymentDbid = deployJpdlXmlString(
+ String deploymentDbid = deployJpdlXmlString(
"<process name='deleteme' version='33'>" +
" <start>" +
" <transition to='w' />" +
16 years, 10 months