Author: tom.baeyens(a)jboss.com
Date: 2009-05-28 07:03:06 -0400 (Thu, 28 May 2009)
New Revision: 4928
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
Modified:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
Log:
JBPM-2257 persisted task variables
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-28 10:10:52 UTC
(rev 4927)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-28 11:03:06 UTC
(rev 4928)
@@ -32,13 +32,15 @@
<property name="progress" column="PROGRESS_"/>
<property name="isSignalling" column="SIGNALLING_"/>
- <!--
- <many-to-one name="variableMap"
- class="org.jbpm.pvm.impl.VariableMap"
- column="VARMAP_"
- foreign-key="FK_TASK_VARMAP"
- cascade="all" />
- -->
+ <property name="hasVariables" column="HASVARS_" />
+ <map name="variables"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_VAR_TASK">
+ <column name="TASK_" index="IDX_VAR_TASK"/>
+ </key>
+ <map-key type="string" column="KEY_" />
+ <one-to-many class="org.jbpm.pvm.internal.type.Variable" />
+ </map>
<many-to-one name="superTask"
class="TaskImpl"
Added:
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
(rev 0)
+++
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java 2009-05-28
11:03:06 UTC (rev 4928)
@@ -0,0 +1,44 @@
+/*
+ * 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.task;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskVariablesTest extends JbpmTestCase {
+
+ public void testTaskVariables() {
+ Task task = taskService.newTask();
+ task.setName("clean da house");
+ long taskDbid = taskService.saveTask(task);
+
+ taskService.setVariable(taskDbid, "text", "hello");
+ taskService.setVariable(taskDbid, "number", new Integer(5));
+
+ assertEquals("hello", taskService.getVariable(taskDbid,
"text"));
+ assertEquals(new Integer(5), taskService.getVariable(taskDbid, "number"));
+ }
+}
Property changes on:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskVariablesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain