JBoss JBPM SVN: r6353 - jbpm4/trunk/modules/distro/src/main/files/install.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-16 05:25:12 -0400 (Sun, 16 May 2010)
New Revision: 6353
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
Log:
JBPM-2846 change tomcat from v6.0.20 to v6.0.26
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-05-16 02:49:49 UTC (rev 6352)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2010-05-16 09:25:12 UTC (rev 6353)
@@ -28,7 +28,7 @@
<property name="examples.file" value="${jbpm.home}/examples/target/examples.jar" />
- <property name="tomcat.version" value="6.0.20" />
+ <property name="tomcat.version" value="6.0.26" />
<property name="tomcat.parent.dir" value="${jbpm.home}" />
<property name="tomcat.home" value="${tomcat.parent.dir}/apache-tomcat-${tomcat.version}" />
<property name="tomcat.filename" value="apache-tomcat-${tomcat.version}.zip" />
@@ -313,7 +313,7 @@
tofile="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar/jbpm.hibernate.cfg.xml"
overwrite="true" />
- <!-- copy the right datasource configuration file and replace the jdbc properties with
+ <!-- copy the right datasource configuration file and replace the jdbc properties with
the values in the jdbc/${database}.properties file -->
<copy todir="${jboss.server.config.dir}/deploy/jbpm" overwrite="true">
<filterset filtersfile="${jdbc.properties.dir}/${database}.properties" />
15 years, 11 months
JBoss JBPM SVN: r6352 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 22:49:49 -0400 (Sat, 15 May 2010)
New Revision: 6352
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskAfterJoinTest.java
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java
Log:
JBPM-2836 testcase for task after join problem
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskAfterJoinTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskAfterJoinTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskAfterJoinTest.java 2010-05-16 02:49:49 UTC (rev 6352)
@@ -0,0 +1,78 @@
+
+package org.jbpm.test.task;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * JBPM-2836.
+ *
+ * @author Huisheng Xu
+ */
+public class TaskAfterJoinTest extends JbpmTestCase {
+ protected static final String PROCESS_XML = ""
+ + "<process name='TaskAfterJoinTest' xmlns='http://jbpm.org/4.3/jpdl'>"
+ + " <start g='16,60,48,48'>"
+ + " <transition to='fork'/>"
+ + " </start>"
+ + " <fork g='96,60,48,48' name='fork'>"
+ + " <transition g='120,41:' to='state1'/>"
+ + " <transition to='state2' g='120,126:'/>"
+ + " </fork>"
+ + " <state g='176,16,149,52' name='state1'>"
+ + " <transition g='379,40:' to='join'/>"
+ + " </state>"
+ + " <state g='176,100,149,52' name='state2'>"
+ + " <transition to='join' g='382,125:'/>"
+ + " </state>"
+ + " <join g='357,60,48,48' name='join'>"
+ + " <transition to='task1'/>"
+ + " </join>"
+ + " <end g='561,60,48,48' name='end'/>"
+ + " <task candidate-groups='sales-dept' g='437,58,92,52' name='task1'>"
+ + " <transition to='end'/>"
+ + " </task>"
+ + "</process>";
+
+ public void testTask() {
+ deployJpdlXmlString(PROCESS_XML);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TaskAfterJoinTest");
+ String pid = processInstance.getId();
+
+ Set<String> expectedActivityNames = new HashSet<String>();
+ expectedActivityNames.add("state1");
+ expectedActivityNames.add("state2");
+
+ assertEquals(expectedActivityNames, processInstance.findActiveActivityNames());
+
+ assertNotNull(processInstance.findActiveExecutionIn("state1"));
+ assertNotNull(processInstance.findActiveExecutionIn("state2"));
+
+ String state1Id = processInstance.findActiveExecutionIn("state1").getId();
+ processInstance = executionService.signalExecutionById(state1Id);
+
+ expectedActivityNames.remove("state1");
+ assertEquals(expectedActivityNames, processInstance.findActiveActivityNames());
+
+ assertNotNull(processInstance.findActiveExecutionIn("state2"));
+
+ String state2Id = processInstance.findActiveExecutionIn("state2").getId();
+ // HERE - it raises NullPointerException
+ processInstance = executionService.signalExecutionById(state2Id);
+
+ expectedActivityNames.remove("state2");
+ expectedActivityNames.add("task1");
+ assertEquals(expectedActivityNames, processInstance.findActiveActivityNames());
+
+ assertNotNull(processInstance.findActiveExecutionIn("task1"));
+
+ String task1Id = processInstance.findActiveExecutionIn("task1").getId();
+ processInstance = executionService.signalExecutionById(task1Id);
+
+ assertNull("execution "+pid+" should not exist", executionService.findExecutionById(pid));
+ }
+}
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 2010-05-16 02:47:47 UTC (rev 6351)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskQueryCandidatesTest.java 2010-05-16 02:49:49 UTC (rev 6352)
@@ -175,4 +175,19 @@
taskService.deleteTaskCascade(taskId);
}
+
+ /**
+ * JBPM-2641.
+ */
+ public void testCountUserCandidateDuplicate() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ String taskId = taskService.saveTask(task);
+ taskService.addTaskParticipatingUser(taskId, "boss_rigging", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskId, "boss_rigging", Participation.CANDIDATE);
+
+ assertEquals(1, taskService.createTaskQuery().candidate("boss_rigging").list().size());
+
+ taskService.deleteTaskCascade(taskId);
+ }
}
15 years, 11 months
JBoss JBPM SVN: r6351 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 22:47:47 -0400 (Sat, 15 May 2010)
New Revision: 6351
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentInvalidTest.java
Log:
JBPM-2635 testcase for invalid verion in deployed xml
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentInvalidTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentInvalidTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentInvalidTest.java 2010-05-16 02:47:47 UTC (rev 6351)
@@ -0,0 +1,68 @@
+/*
+ * 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.deploy;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * JBPM-2635.
+ *
+ * @author Huisheng Xu
+ */
+public class DeploymentInvalidTest extends JbpmTestCase {
+
+ public void testDeployWithInvalidVersion() {
+ deployJpdlXmlString(
+ "<process name='InvalidVersion'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ " <end name='end' />" +
+ "</process>"
+ );
+ executionService.startProcessInstanceByKey("InvalidVersion");
+
+ try {
+ deployJpdlXmlString(
+ "<process name='InvalidVersion' version='1.0.0'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ " <end name='end' />" +
+ "</process>"
+ );
+ fail();
+ } catch(Exception ex) {
+ assertTrue(true);
+ }
+ executionService.startProcessInstanceByKey("InvalidVersion");
+ }
+
+}
15 years, 11 months
JBoss JBPM SVN: r6350 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 22:45:27 -0400 (Sat, 15 May 2010)
New Revision: 6350
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/ForkSwimlaneTest.java
Log:
JBPM-2570 testcase for fork/join problem
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/ForkSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/ForkSwimlaneTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/ForkSwimlaneTest.java 2010-05-16 02:45:27 UTC (rev 6350)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.activity.task;
+
+import java.util.List;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.task.Task;
+
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.events.VariableCreate;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.repository.RepositoryCache;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * JBPM-2570.
+ *
+ * @author Huisheng Xu
+ */
+public class ForkSwimlaneTest extends JbpmTestCase {
+ private static final String PROCESS_XML = ""
+ + "<process name='ForkSwimlane' xmlns='http://jbpm.org/4.3/jpdl'>"
+ + " <swimlane candidate-groups='A' name='A'/>"
+ + " <swimlane candidate-groups='B' name='B'/>"
+ + " <start name='start'>"
+ + " <transition to='task1A'/>"
+ + " </start>"
+ + " <task name='task1A' swimlane='A'>"
+ + " <transition to='task1B'/>"
+ + " </task>"
+ + " <task name='task1B' swimlane='B'>"
+ + " <transition to='fork'/>"
+ + " </task>"
+ + " <fork name='fork'>"
+ + " <transition to='task2A'/>"
+ + " <transition to='task2B'/>"
+ + " </fork>"
+ + " <task name='task2A' swimlane='A'>"
+ + " <transition to='join'/>"
+ + " </task>"
+ + " <task name='task2B' swimlane='B'>"
+ + " <transition to='join'/>"
+ + " </task>"
+ + " <join name='join'>"
+ + " <transition to='end'/>"
+ + " </join>"
+ + " <end name='end'/>"
+ + "</process>";
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ String groupA = identityService.createGroup("A");
+ String groupB = identityService.createGroup("B");
+
+ identityService.createUser("lingo", "lingo", "lingo");
+ identityService.createMembership("lingo", groupA, "lingo-groupA");
+ identityService.createMembership("lingo", groupB, "lingo-groupB");
+ this.deployJpdlXmlString(PROCESS_XML);
+ }
+
+ protected void tearDown() throws Exception {
+ identityService.deleteGroup("A");
+ identityService.deleteGroup("B");
+ identityService.deleteUser("lingo");
+ super.tearDown();
+ }
+
+ public void testSwimlane() {
+ ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("ForkSwimlane");
+ takeAndCompleteTask("lingo");
+ takeAndCompleteTask("lingo");
+ completeTask("lingo");
+ completeTask("lingo");
+ }
+
+ protected void takeAndCompleteTask(String username) {
+ List<Task> tasks = taskService.findGroupTasks(username);
+ Task task = tasks.get(0);
+ taskService.takeTask(task.getId(), username);
+ taskService.completeTask(task.getId());
+ }
+
+ protected void completeTask(String username) {
+ List<Task> tasks = taskService.findPersonalTasks(username);
+ Task task = tasks.get(0);
+ taskService.completeTask(task.getId());
+ }
+}
15 years, 11 months
JBoss JBPM SVN: r6349 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 22:38:20 -0400 (Sat, 15 May 2010)
New Revision: 6349
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/TwoForksTest.java
Log:
JBPM-2553 testcase for violation of unique constraint with two splits
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/TwoForksTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/TwoForksTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/TwoForksTest.java 2010-05-16 02:38:20 UTC (rev 6349)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+ package org.jbpm.test.activity.forkjoin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+import junit.framework.TestCase;
+
+/**
+ * JBPM-2553.
+ *
+ * @author Huisheng Xu
+ */
+public class TwoForksTest extends JbpmTestCase {
+ public void testTwoForks() {
+ deployJpdlXmlString(""
+ + "<process name='TwoForks' xmlns='http://jbpm.org/4.0/jpdl'>"
+ + " <start g='179,17,32,29' name='start1'>"
+ + " <transition g='-43,-18' name='to fork1' to='fork1'/>"
+ + " </start>"
+ + " <fork g='185,95,49,50' name='fork1'>"
+ + " <transition name='left' to='task1' g='-44,-18'/>"
+ + " <transition name='right' to='task2' g='-44,-18'/>"
+ + " </fork>"
+ + " <end g='193,606,38,33' name='end1'/>"
+ + " <task name='task1' g='90,177,73,44'>"
+ + " <transition name='to fork2' to='fork2' g='-43,-18'/>"
+ + " </task>"
+ + " <task name='task2' g='249,172,83,48'>"
+ + " <transition name='to join2' to='join2' g='288,425:-41,-18'/>"
+ + " </task>"
+ + " <task name='task3' g='21,313,88,45'>"
+ + " <transition name='to join1' to='join1' g='-41,-18'/>"
+ + " </task>"
+ + " <task name='task4' g='154,313,88,48'>"
+ + " <transition name='to join1' to='join1' g='-41,-18'/>"
+ + " </task>"
+ + " <fork name='fork2' g='108,250,37,28'>"
+ + " <transition name='left' to='task3' g='-44,-18'/>"
+ + " <transition name='right' to='task4' g='-44,-18'/>"
+ + " </fork>"
+ + " <join name='join1' g='112,407,51,31'>"
+ + " <transition name='to join2' to='join2' g='-41,-18'/>"
+ + " </join>"
+ + " <join name='join2' g='192,511,57,44'>"
+ + " <transition name='to end1' to='end1' g='-42,-18'/>"
+ + " </join>"
+ + "</process>");
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoForks");
+ List<Task> tasks = taskService.createTaskQuery().list();
+ while (!tasks.isEmpty()) {
+ for (Task task : tasks) {
+ taskService.completeTask(task.getId());
+ }
+ tasks = taskService.createTaskQuery().list();
+ }
+ Date endTime = historyService
+ .createHistoryProcessInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult()
+ .getEndTime();
+
+ assertNotNull(endTime);
+ }
+
+}
15 years, 11 months
JBoss JBPM SVN: r6348 - in jbpm4/trunk/modules/pvm/src: test/java/org/jbpm/pvm/internal/wire and 3 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 22:20:34 -0400 (Sat, 15 May 2010)
New Revision: 6348
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/wire/binding/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
Log:
JBPM-2596 let nested parse exception raise to parent parse problem list
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2010-05-15 14:18:26 UTC (rev 6347)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2010-05-16 02:20:34 UTC (rev 6348)
@@ -377,6 +377,7 @@
// import the element into the destination element
destination.appendChild(destination.getOwnerDocument().importNode(e, true));
}
+ importedParse.checkErrors(destination.getTagName());
} catch (Exception e) {
importingParse.addProblem("couldn't import "+importedStreamInput, e);
Added: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/binding/TypesBindingTest.java 2010-05-16 02:20:34 UTC (rev 6348)
@@ -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.wire.binding;
+
+import java.util.List;
+import org.jbpm.test.BaseJbpmTestCase;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.jbpm.pvm.internal.xml.Bindings;
+import org.jbpm.pvm.internal.xml.Problem;
+
+
+/**
+ * @author Huisheng Xu
+ */
+public class TypesBindingTest extends BaseJbpmTestCase {
+ public void testParse() {
+ Parser parser = new Parser();
+ Bindings bindings = new Bindings();
+ parser.setBindings(bindings);
+ parser.getBindings().addBinding(new TypesBinding());
+
+ String xml = "<types resource='org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml' />";
+
+ List<Problem> problems = parser
+ .createParse()
+ .setString(xml)
+ .execute()
+ .getProblems();
+
+ assertTextPresent(
+ "couldn't import resource://org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml",
+ problems.get(0).getMsg());
+ }
+}
Added: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/wire/binding/invalid.jbpm.variable.types.xml 2010-05-16 02:20:34 UTC (rev 6348)
@@ -0,0 +1,34 @@
+<types>
+
+ <!-- types stored in a native column -->
+ <type name="string" class="java.lang.String" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" >
+ <type name="long" class="java.lang.Long" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="double" class="java.lang.Double" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- types converted to a string -->
+ <type name="date" class="java.util.Date" converter="org.jbpm.pvm.internal.type.converter.DateToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="boolean" class="java.lang.Boolean" converter="org.jbpm.pvm.internal.type.converter.BooleanToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="char" class="java.lang.Character" converter="org.jbpm.pvm.internal.type.converter.CharacterToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+
+ <!-- types converted to a long -->
+ <type name="byte" class="java.lang.Byte" converter="org.jbpm.pvm.internal.type.converter.ByteToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="short" class="java.lang.Short" converter="org.jbpm.pvm.internal.type.converter.ShortToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="integer" class="java.lang.Integer" converter="org.jbpm.pvm.internal.type.converter.IntegerToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+
+ <!-- types converted to a double -->
+ <type name="float" class="java.lang.Float" converter="org.jbpm.pvm.internal.type.converter.FloatToDoubleConverter" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- byte[] and char[] -->
+ <type name="byte[]" class="[B" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+ <type name="char[]" class="[C" variable-class="org.jbpm.pvm.internal.type.variable.TextVariable" />
+
+ <type name="hibernate-long-id" class="hibernatable" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
+ <type name="hibernate-string-id" class="hibernatable" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />
+
+ <type name="serializable" class="serializable" converter="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+
+ <!-- TODO: add ejb3 entity bean support -->
+ <!-- TODO: add JCR activity support -->
+ <!-- TODO: add collection support -->
+
+</types>
15 years, 11 months
JBoss JBPM SVN: r6347 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 10:18:26 -0400 (Sat, 15 May 2010)
New Revision: 6347
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java
Log:
JBPM-2841 apply testcase to verify multiplicity join with swimlane
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java 2010-05-15 13:38:22 UTC (rev 6346)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/task/TaskSwimlaneTest.java 2010-05-15 14:18:26 UTC (rev 6347)
@@ -21,9 +21,11 @@
*/
package org.jbpm.test.activity.task;
+import java.util.Date;
import java.util.List;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.job.Job;
import org.jbpm.api.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -32,7 +34,7 @@
* @author Tom Baeyens
*/
public class TaskSwimlaneTest extends JbpmTestCase {
-
+
public void testSwimlaneTaskEnd() {
deployJpdlXmlString(
"<process name='TaskSwimlane'> " +
@@ -47,14 +49,14 @@
" <end name='end' />" +
"</process>"
);
-
+
executionService.startProcessInstanceByKey("TaskSwimlane");
List<Task> tasks = taskService.findPersonalTasks("johndoe");
assertEquals(1, tasks.size());
Task task = tasks.get(0);
taskService.completeTask(task.getId());
-
+
assertEquals(0, executionService.createProcessInstanceQuery().count());
assertEquals(0, taskService.createTaskQuery().count());
}
@@ -84,18 +86,69 @@
" <end name='end' />" +
"</process>"
);
-
+
executionService.startProcessInstanceByKey("TaskConcurrentSwimlane");
List<Task> tasks = taskService.findPersonalTasks("johndoe");
assertEquals(2, tasks.size());
taskService.completeTask(tasks.get(0).getId());
taskService.completeTask(tasks.get(1).getId());
-
+
assertEquals(0, executionService.createProcessInstanceQuery().count());
assertEquals(0, taskService.createTaskQuery().count());
}
+ public void testSwimlaneWithMultiplicity() {
+ deployJpdlXmlString(
+ "<process key='join-multiplicity-test' name='join-multiplicity-test' xmlns='http://jbpm.org/4.3/jpdl'>" +
+ " <swimlane name='swimlane1' assignee='user1'/>" +
+ " <swimlane name='swimlane2' assignee='user2'/>" +
+ " <start g='165,4,48,48' name='start1'>" +
+ " <transition g='-50,-20' name='to task1' to='task1'/>" +
+ " </start>" +
+ " <end g='165,511,48,48' name='end1'/>" +
+ " <task g='143,97,92,52' name='task1' swimlane='swimlane1'>" +
+ " <transition g='-50,-20' name='to fork1' to='fork1'/>" +
+ " </task>" +
+ " <task g='9,282,92,52' name='task2' swimlane='swimlane1'>" +
+ " <transition g='-49,-20' name='to join1' to='join1'/>" +
+ " </task>" +
+ " <task g='283,282,92,52' name='task3' swimlane='swimlane2'>" +
+ " <transition g='-49,-20' name='to join1' to='join1'/>" +
+ " </task>" +
+ " <fork g='165,185,48,48' name='fork1'>" +
+ " <transition g='-50,-20' name='to task2' to='task2'/>" +
+ " <transition g='-50,-20' name='to task3' to='task3'/>" +
+ " </fork>" +
+ " <join continue='async' g='165,387,48,48' multiplicity='1' name='join1'>" +
+ " <transition g='-50,-20' name='to end1' to='end1'/>" +
+ " </join>" +
+ "</process>"
+ );
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("join-multiplicity-test");
+ String processInstanceId = processInstance.getId();
+
+ List<Task> user1Tasks = taskService.findPersonalTasks("user1");
+ assertEquals(1, user1Tasks.size());
+ Task task1 = user1Tasks.get(0);
+ taskService.completeTask(task1.getId(), "to fork1");
+
+ user1Tasks = taskService.findPersonalTasks("user1");
+ assertEquals(1, user1Tasks.size());
+ Task task2 = user1Tasks.get(0);
+ taskService.completeTask(task2.getId(), "to join1");
+
+ List<Job> jobs = managementService.createJobQuery().processInstanceId(processInstanceId).list();
+ assertEquals(1, jobs.size());
+ Job join1Job = jobs.get(0);
+ managementService.executeJob(join1Job.getId());
+
+ Date endTime = historyService.createHistoryProcessInstanceQuery().processInstanceId(processInstance.getId()).uniqueResult().getEndTime();
+
+ assertNotNull(endTime);
+ }
+
public void testTaskParse() {
deployJpdlXmlString(
"<process name='Swimlane' xmlns='http://jbpm.org/4.3/jpdl'>"
15 years, 11 months
JBoss JBPM SVN: r6346 - in jbpm4/trunk/modules/pvm/src: test/java/org/jbpm/pvm/internal/tx and 1 other directory.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 09:38:22 -0400 (Sat, 15 May 2010)
New Revision: 6346
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronizationTest.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronization.java
Log:
correct spring transaction convert to synchronization
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronization.java 2010-05-15 11:35:46 UTC (rev 6345)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronization.java 2010-05-15 13:38:22 UTC (rev 6346)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.tx;
+import javax.transaction.Status;
import javax.transaction.Synchronization;
import org.springframework.transaction.support.TransactionSynchronization;
@@ -38,7 +39,14 @@
}
public void afterCompletion(int status) {
- synchronization.afterCompletion(status);
+ if (status == STATUS_COMMITTED) {
+ synchronization.afterCompletion(Status.STATUS_COMMITTED);
+ } else if (status == STATUS_ROLLED_BACK) {
+ synchronization.afterCompletion(Status.STATUS_ROLLEDBACK);
+ } else {
+ throw new TransactionException("invalid transaction state: "
+ + status);
+ }
}
public void beforeCompletion() {
Added: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronizationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronizationTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/SpringToStandardSynchronizationTest.java 2010-05-15 13:38:22 UTC (rev 6346)
@@ -0,0 +1,69 @@
+/*
+ * 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.tx;
+
+import junit.framework.TestCase;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import org.springframework.transaction.support.TransactionSynchronization;
+
+public class SpringToStandardSynchronizationTest extends TestCase {
+ public void testCommited() {
+ MockSync sync = new MockSync();
+ SpringToStandardSynchronization stss = new SpringToStandardSynchronization(sync);
+ stss.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
+ assertEquals(Status.STATUS_COMMITTED, sync.getStatus());
+ }
+
+ public void testRollback() {
+ MockSync sync = new MockSync();
+ SpringToStandardSynchronization stss = new SpringToStandardSynchronization(sync);
+ stss.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
+ assertEquals(Status.STATUS_ROLLEDBACK, sync.getStatus());
+ }
+
+ public void testUnknowStatus() {
+ Synchronization sync = new MockSync();
+ SpringToStandardSynchronization stss = new SpringToStandardSynchronization(sync);
+ try {
+ stss.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
+ fail();
+ } catch(TransactionException ex) {
+ assertTrue(true);
+ }
+ }
+
+ static class MockSync implements Synchronization {
+ private int status;
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void afterCompletion(int status) {
+ this.status = status;
+ }
+
+ public void beforeCompletion() {
+ }
+ }
+}
15 years, 11 months
JBoss JBPM SVN: r6345 - in jbpm4/trunk/modules/jpdl/src: test/java/org/jbpm/jpdl/parsing and 1 other directory.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 07:35:46 -0400 (Sat, 15 May 2010)
New Revision: 6345
Added:
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/DecisionParsingTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
Log:
JBPM-2862 fix decisionBinding parse conditition handler wrong
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java 2010-05-15 09:28:37 UTC (rev 6344)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java 2010-05-15 11:35:46 UTC (rev 6345)
@@ -83,7 +83,7 @@
} else {
Element conditionHandlerElement = XmlUtil.element(conditionElement, "handler");
- if (handlerElement!=null) {
+ if (conditionHandlerElement != null) {
UserCodeCondition userCodeCondition = new UserCodeCondition();
UserCodeReference conditionReference = parser.parseUserCodeReference(conditionHandlerElement, parse);
Added: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/DecisionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/DecisionParsingTest.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/DecisionParsingTest.java 2010-05-15 11:35:46 UTC (rev 6345)
@@ -0,0 +1,57 @@
+package org.jbpm.jpdl.parsing;
+
+import java.util.List;
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.model.Activity;
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.jpdl.internal.activity.DecisionConditionActivity;
+import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.el.Expression;
+import org.jbpm.pvm.internal.el.StaticTextExpression;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.Condition;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+import org.jbpm.pvm.internal.wire.usercode.UserCodeCondition;
+
+public class DecisionParsingTest extends JpdlParseTestCase {
+
+ public void testDecitionConditionParse() {
+ ClientProcessDefinition definition = parse(
+ "<process name='decision parse'>" +
+ " <start>" +
+ " <transition to='d1' />" +
+ " </start>" +
+ " <decision name='d1'>" +
+ " <transition to='end1'>" +
+ " <condition>" +
+ " <handler class='org.jbpm.jpdl.parsing.DecisionParingTest$CustomCondition'/>" +
+ " </condition>" +
+ " </transition>" +
+ " </decision>" +
+ " <end name='end1'/>" +
+ "</process>");
+
+ Activity activity = definition.findActivity("d1");
+ assert activity instanceof ActivityImpl : activity.getClass();
+ ActivityImpl activityImpl = (ActivityImpl) activity;
+
+ ActivityBehaviour behaviour = activityImpl.getActivityBehaviour();
+ assert behaviour instanceof DecisionConditionActivity : behaviour.getClass();
+
+ List<TransitionImpl> outgoingTransitions = (List) activity.getOutgoingTransitions();
+ assert outgoingTransitions.size() == 1 : outgoingTransitions.size();
+
+ TransitionImpl transition = outgoingTransitions.get(0);
+ Condition condition = transition.getCondition();
+
+ assert condition instanceof UserCodeCondition : condition.getClass();
+ }
+
+ static class CustomCondition implements Condition {
+ public boolean evaluate(OpenExecution execution) {
+ return true;
+ }
+ }
+}
15 years, 11 months
JBoss JBPM SVN: r6344 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/history and 1 other directory.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-05-15 05:28:37 -0400 (Sat, 15 May 2010)
New Revision: 6344
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskDetailTest.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java
Log:
JBPM-2835 save history task detail for TaskUpdate
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java 2010-05-15 09:22:08 UTC (rev 6343)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskImpl.java 2010-05-15 09:28:37 UTC (rev 6344)
@@ -97,6 +97,7 @@
public void addDetail(HistoryDetailImpl detail) {
detail.setHistoryTask(this, nextDetailIndex);
+ this.details.add(detail);
nextDetailIndex++;
}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskDetailTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskDetailTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/HistoryTaskDetailTest.java 2010-05-15 09:28:37 UTC (rev 6344)
@@ -0,0 +1,136 @@
+/*
+ * 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.history;
+
+import java.util.Date;
+import java.util.List;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.history.HistoryActivityInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Huisheng Xu
+ */
+public class HistoryTaskDetailTest extends JbpmTestCase {
+ private static final String PROCESS_XML =
+ "<process name='HistoryTaskDetail'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review' " +
+ " assignee='johndoe'>" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>";
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ deployJpdlXmlString(PROCESS_XML);
+ }
+
+ public void testHistoryAssignment() {
+ executionService.startProcessInstanceByKey("HistoryTaskDetail");
+
+ List<Task> tasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(1, tasks.size());
+ String taskId = tasks.get(0).getId();
+ processEngine.execute(new TaskReassignCmd(taskId, "Lingo"));
+
+ assertEquals(1, taskService.findPersonalTasks("Lingo").size());
+ assertEquals(1, historyService.createHistoryDetailQuery().list().size());
+ }
+
+ public void testHistoryPriority() {
+ executionService.startProcessInstanceByKey("HistoryTaskDetail");
+
+ List<Task> tasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(1, tasks.size());
+ String taskId = tasks.get(0).getId();
+ processEngine.execute(new TaskChangePriorityCmd(taskId, 10));
+
+ assertEquals(1, historyService.createHistoryDetailQuery().list().size());
+ }
+
+ public void testHistoryDuedate() {
+ executionService.startProcessInstanceByKey("HistoryTaskDetail");
+
+ List<Task> tasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(1, tasks.size());
+ String taskId = tasks.get(0).getId();
+ processEngine.execute(new TaskChangeDuedateCmd(taskId, new Date()));
+
+ assertEquals(1, historyService.createHistoryDetailQuery().list().size());
+ }
+
+ static class TaskReassignCmd implements Command<Void> {
+ private String taskId;
+ private String newAssignee;
+ public TaskReassignCmd(String taskId, String newAssignee) {
+ this.taskId = taskId;
+ this.newAssignee = newAssignee;
+ }
+ public Void execute(Environment env) {
+ Task task = taskService.getTask(taskId);
+ task.setAssignee(newAssignee);
+ taskService.saveTask(task);
+
+ return null;
+ }
+ }
+
+ static class TaskChangePriorityCmd implements Command<Void> {
+ private String taskId;
+ private int newPriority;
+ public TaskChangePriorityCmd(String taskId, int newPriority) {
+ this.taskId = taskId;
+ this.newPriority = newPriority;
+ }
+ public Void execute(Environment env) {
+ Task task = taskService.getTask(taskId);
+ task.setPriority(newPriority);
+ taskService.saveTask(task);
+
+ return null;
+ }
+ }
+
+ static class TaskChangeDuedateCmd implements Command<Void> {
+ private String taskId;
+ private Date newDuedate;
+ public TaskChangeDuedateCmd(String taskId, Date newDuedate) {
+ this.taskId = taskId;
+ this.newDuedate = newDuedate;
+ }
+ public Void execute(Environment env) {
+ Task task = taskService.getTask(taskId);
+ task.setDuedate(newDuedate);
+ taskService.saveTask(task);
+
+ return null;
+ }
+ }
+
+}
15 years, 11 months