JBoss JBPM SVN: r3525 - projects/report-server/trunk/server.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 05:57:14 -0500 (Tue, 23 Dec 2008)
New Revision: 3525
Modified:
projects/report-server/trunk/server/pom.xml
Log:
Fix maven deps
Modified: projects/report-server/trunk/server/pom.xml
===================================================================
--- projects/report-server/trunk/server/pom.xml 2008-12-23 10:53:04 UTC (rev 3524)
+++ projects/report-server/trunk/server/pom.xml 2008-12-23 10:57:14 UTC (rev 3525)
@@ -9,7 +9,7 @@
<!-- Parent -->
<parent>
<groupId>org.jbpm</groupId>
- <artifactId>balalaika-parent</artifactId>
+ <artifactId>report-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -33,7 +33,6 @@
<scope>provided</scope>
</dependency>
-
</dependencies>
<!-- Plugins -->
15 years, 5 months
JBoss JBPM SVN: r3524 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/task and 19 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-23 05:53:04 -0500 (Tue, 23 Dec 2008)
New Revision: 3524
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskBinding.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/NewTaskCmd.java
Removed:
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/jpdl/pom.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java
jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java
Log:
added task activity to jpdl
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -37,11 +37,6 @@
* Use {@link #saveTask(Task)} to persist the task. */
Task newTask();
- /** Creates a task with the given identifier.
- * The returned task will be transient.
- * Use {@link #saveTask(Task)} to persist the task. */
- Task newTask(String taskId);
-
/** Saves the given task to persistent storage. */
void saveTask(Task task);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Task.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -58,8 +58,8 @@
String getDescription();
void setDescription(String description);
- String getAssignedUserId();
- void setAssignedUserId(String assignedUserId);
+ String getAssignee();
+ void setAssignee(String assignee);
Date getCreate();
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-23 10:53:04 UTC (rev 3524)
@@ -272,6 +272,21 @@
</complexContent>
</complexType>
</element>
+
+ <element name="task">
+ <annotation><documentation>Creates a task in the task component.
+ </documentation></annotation>
+ <complexType>
+ <sequence>
+ <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:nodeAttributes" />
+ <attribute name="assignee" type="string" use="required">
+ <annotation><documentation>User id to whom this task should be assigned.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
<!--
<element name="process-state">
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -0,0 +1,60 @@
+/*
+ * 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.examples.task;
+
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.task.Task;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskTest extends DbTestCase {
+
+ public void testTask() {
+ deployJpdlResource("org/jbpm/examples/task/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("Task");
+ String executionId = execution.getId();
+
+ List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(1, taskList.size());
+ Task task = taskList.get(0);
+ assertEquals("review", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // submit the task
+ taskService.submitTask(task.getId());
+
+ // verify that the task list is now empty
+ taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(0, taskList.size());
+
+ // verify that process moved to the next state
+ execution = executionService.findExecution(executionId);
+ assertEquals("wait", execution.getNodeName());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -17,6 +17,7 @@
<process-service />
<execution-service />
<management-service />
+ <task-service />
<command-service>
<retry-interceptor />
@@ -33,6 +34,7 @@
<mapping resource="jbpm.pvm.variable.hbm.xml" />
<mapping resource="jbpm.pvm.job.hbm.xml" />
<mapping resource="jbpm.jpdl.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
<cache-configuration resource="jbpm.pvm.cache.xml"
usage="nonstrict-read-write" />
</hibernate-configuration>
@@ -68,6 +70,7 @@
<transaction />
<pvm-db-session />
<job-db-session />
+ <task-db-session />
<message-session />
<timer-session />
</environment>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Task" xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="20,20,48,48">
+ <flow to="review" />
+ </start>
+
+ <task name="review"
+ assignee="johndoe"
+ g="96,16,127,52">
+
+ <flow to="wait" />
+ </task>
+
+ <state name="wait" g="255,16,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -41,6 +41,11 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-task</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -0,0 +1,52 @@
+/*
+ * 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.jpdl.activity;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.env.Environment;
+import org.jbpm.task.internal.model.TaskImpl;
+import org.jbpm.task.session.TaskDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskActivity extends StateActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String assignee;
+
+ public void execute(ActivityExecution execution) {
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ TaskImpl task = TaskImpl.create(execution);
+ task.setName(execution.getNodeName());
+ task.setAssignee(assignee);
+ taskDbSession.saveTask(task);
+
+ execution.waitForSignal();
+ }
+
+ public void setAssignee(String assignee) {
+ this.assignee = assignee;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskBinding.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -0,0 +1,50 @@
+/*
+ * 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.jpdl.activity;
+
+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;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskBinding extends JpdlActivityBinding {
+
+ private static final String TAG = "task";
+
+ public TaskBinding() {
+ super(TAG);
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ TaskActivity taskActivity = new TaskActivity();
+
+ String assignee = XmlUtil.attribute(element, "assignee", true, parse);
+ taskActivity.setAssignee(assignee);
+
+ return taskActivity;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -11,4 +11,5 @@
<activity binding="org.jbpm.jpdl.activity.JavaBinding" />
<activity binding="org.jbpm.jpdl.activity.ScriptBinding" />
<activity binding="org.jbpm.jpdl.activity.EsbBinding" />
+ <activity binding="org.jbpm.jpdl.activity.TaskBinding" />
</activities>
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -82,6 +82,9 @@
foreign-key="FK_ACT_PARTSDESCR"
index="IDX_ACT_PARTSDESCR" />
</subclass>
+ <subclass name="org.jbpm.jpdl.activity.TaskActivity" discriminator-value="task">
+ <property name="assignee" column="TEXT_" />
+ </subclass>
</class>
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -17,6 +17,7 @@
<process-service />
<execution-service />
<management-service />
+ <task-service />
<command-service>
<retry-interceptor />
@@ -33,6 +34,7 @@
<mapping resource="jbpm.pvm.variable.hbm.xml" />
<mapping resource="jbpm.pvm.job.hbm.xml" />
<mapping resource="jbpm.jpdl.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
<cache-configuration resource="jbpm.pvm.cache.xml"
usage="nonstrict-read-write" />
</hibernate-configuration>
@@ -61,6 +63,7 @@
<transaction />
<pvm-db-session />
<job-db-session />
+ <task-db-session />
<message-session />
<timer-session />
</environment>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -62,6 +62,7 @@
if (executionId!=null) {
return pvmDbSession.findExecutionById(executionId);
}
- return pvmDbSession.findExecutionByKey(processDefinitionName, executionKey);
+ Execution execution = pvmDbSession.findExecutionByKey(processDefinitionName, executionKey);
+ return execution;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -13,6 +13,7 @@
<many-to-one name="node"
class="org.jbpm.pvm.internal.model.NodeImpl"
column="NODE_"
+ lazy="false"
foreign-key="FK_EXEC_NODE"
index="IDX_EXEC_NODE" />
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -1,80 +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.task.internal.cmd;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.session.DbSession;
-import org.jbpm.task.Task;
-import org.jbpm.task.internal.model.TaskDefinitionImpl;
-import org.jbpm.task.internal.model.TaskImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class CreateTaskCmd implements Command<Task> {
-
- private static final long serialVersionUID = 1L;
-
- protected String taskId;
- protected Long taskDefinitionDbid;
- protected Long executionDbid;
-
- public CreateTaskCmd() {
- }
-
- public CreateTaskCmd(String taskId) {
- this.taskId = taskId;
- }
-
- public CreateTaskCmd(String taskId, long taskDefinitionDbid) {
- this.taskId = taskId;
- this.taskDefinitionDbid = taskDefinitionDbid;
- }
-
- public CreateTaskCmd(String taskId, long taskDefinitionDbid, long executionDbid) {
- this.taskId = taskId;
- this.taskDefinitionDbid = taskDefinitionDbid;
- this.executionDbid = executionDbid;
- }
-
- public Task execute(Environment environment) throws Exception {
- TaskDefinitionImpl taskDefinition = null;
- ExecutionImpl execution = null;
-
- Session session = environment.get(Session.class);
-
- if (taskDefinitionDbid!=null) {
- taskDefinition = (TaskDefinitionImpl) session.load(TaskDefinitionImpl.class, taskDefinitionDbid);
- }
-
- if (executionDbid!=null) {
- execution = (ExecutionImpl) session.load(ExecutionImpl.class, executionDbid);
- }
-
- Task task = TaskImpl.create(taskId, taskDefinition, execution);
-
- return task;
- }
-}
Copied: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/NewTaskCmd.java (from rev 3519, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java)
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/NewTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/NewTaskCmd.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -0,0 +1,63 @@
+/*
+ * 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.task.internal.cmd;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.session.DbSession;
+import org.jbpm.task.Task;
+import org.jbpm.task.internal.model.TaskDefinitionImpl;
+import org.jbpm.task.internal.model.TaskImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class NewTaskCmd implements Command<Task> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Long executionDbid;
+
+ public NewTaskCmd() {
+ }
+
+ public NewTaskCmd(long executionDbid) {
+ this.executionDbid = executionDbid;
+ }
+
+ public Task execute(Environment environment) throws Exception {
+ TaskDefinitionImpl taskDefinition = null;
+ ExecutionImpl execution = null;
+
+ Session session = environment.get(Session.class);
+
+ if (executionDbid!=null) {
+ execution = (ExecutionImpl) session.load(ExecutionImpl.class, executionDbid);
+ }
+
+ Task task = TaskImpl.create(execution);
+
+ return task;
+ }
+}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -27,6 +27,7 @@
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.task.internal.model.TaskImpl;
+import org.jbpm.task.session.TaskDbSession;
/**
* @author Alejandro Guizar
@@ -42,18 +43,10 @@
}
public Void execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
+ TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
- if (! task.isPersisted()) {
- Serializable dbid = session.save(task);
- if (task.getId() == null) {
- task.setId(dbid.toString());
- }
-
- } else {
- session.update(task);
- }
-
+ taskDbSession.saveTask(task);
+
return null;
}
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -47,9 +47,21 @@
// TODO maybe we should move these criteria queries to hql queries in the
// hbm file so that users can easily customize.
return session.createCriteria(TaskImpl.class)
- .add(Restrictions.eq("assignedUserId", userId))
+ .add(Restrictions.eq("assignee", userId))
.setFirstResult(firstResult)
.setMaxResults(maxResults)
.list();
}
+
+ public void saveTask(TaskImpl task) {
+ if (! task.isPersisted()) {
+ Serializable dbid = session.save(task);
+ if (task.getId() == null) {
+ task.setId(dbid.toString());
+ }
+
+ } else {
+ session.update(task);
+ }
+ }
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -58,7 +58,7 @@
protected String name;
protected String description;
- protected String assignedUserId;
+ protected String assignee;
protected Set<RoleImpl> roles;
protected Date create;
@@ -88,18 +88,10 @@
// creating a task
public static TaskImpl create() {
- return create(null, null, null);
+ return create(null);
}
- public static TaskImpl create(String taskId) {
- return create(taskId, null, null);
- }
-
- public static TaskImpl create(String taskId, TaskDefinitionImpl taskDefinition) {
- return create(taskId, taskDefinition, null);
- }
-
- public static TaskImpl create(String taskId, TaskDefinitionImpl taskDefinition, ExecutionImpl execution) {
+ public static TaskImpl create(Execution execution) {
TaskImpl task = new TaskImpl();
/*
@@ -119,9 +111,6 @@
*/
task.setCreate(Clock.getCurrentTime());
-
- task.setId(taskId);
- task.setTaskDefinition(taskDefinition);
task.setExecution(execution);
// initialise the task state
@@ -267,18 +256,6 @@
return subtask;
}
- public Task createSubTask(String subTaskId, TaskDefinition subTaskDefinition) {
- if (subTaskDefinition==null) {
- throw new TaskException("subtaskDefinition is null");
- }
- if (subTasks==null) {
- subTasks = new HashSet<TaskImpl>();
- }
- TaskImpl subtask = create(subTaskId, taskDefinition);
- addSubTask(subtask);
- return subtask;
- }
-
public Task addSubTask(TaskImpl subtask) {
if (subTasks==null) {
subTasks = new HashSet<TaskImpl>();
@@ -390,11 +367,11 @@
public String getState() {
return state;
}
- public String getAssignedUserId() {
- return assignedUserId;
+ public String getAssignee() {
+ return assignee;
}
- public void setAssignedUserId(String assignedUserId) {
- this.assignedUserId = assignedUserId;
+ public void setAssignee(String assignedUserId) {
+ this.assignee = assignedUserId;
}
public Swimlane getSwimlane() {
return swimlane;
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -27,7 +27,7 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.task.Role;
import org.jbpm.task.Task;
-import org.jbpm.task.internal.cmd.CreateTaskCmd;
+import org.jbpm.task.internal.cmd.NewTaskCmd;
import org.jbpm.task.internal.cmd.DeleteTaskCmd;
import org.jbpm.task.internal.cmd.GetPersonalTaskListCmd;
import org.jbpm.task.internal.cmd.GetTaskCmd;
@@ -57,13 +57,9 @@
}
public Task newTask() {
- return newTask(null);
+ return commandService.execute(new NewTaskCmd());
}
- public Task newTask(String taskId) {
- return commandService.execute(new CreateTaskCmd(taskId));
- }
-
public Task getTask(String taskId) {
return commandService.execute(new GetTaskCmd(taskId));
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -36,4 +36,6 @@
TaskImpl findTaskById(String taskId);
List<Task> findPersonalTasks(String userId, int firstResult, int maxResults);
+
+ void saveTask(TaskImpl task);
}
Modified: jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/main/resources/jbpm.task.hbm.xml 2008-12-23 10:53:04 UTC (rev 3524)
@@ -55,7 +55,7 @@
<property name="id" column="ID_" unique="true" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
- <property name="assignedUserId" column="ASSIGNEE_"/>
+ <property name="assignee" column="ASSIGNEE_"/>
<set name="roles" cascade="all-delete-orphan">
<key column="TASK_" foreign-key="FK_ROLE_TASK" />
@@ -75,6 +75,11 @@
cascade="all" />
-->
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="FK_TASK_EXEC" />
+
<many-to-one name="swimlane"
class="SwimlaneImpl"
column="SWIMLANE_"
Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -35,22 +35,19 @@
public void testDefaultScenario() {
// execution arrives in task node
// the task id is generated from the executionId and the task name
- String taskId = "t28346";
- Task task = taskService.newTask(taskId);
+ Task task = taskService.newTask();
task.setName("do laundry");
- task.setAssignedUserId("johndoe");
+ task.setAssignee("johndoe");
taskService.saveTask(task);
-
List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
assertEquals("expected 1 task for john doe: "+taskList, 1, taskList.size());
task = taskList.get(0);
- assertEquals("johndoe", task.getAssignedUserId());
- assertEquals("t28346", task.getId());
+ assertEquals("johndoe", task.getAssignee());
assertEquals("do laundry", task.getName());
- taskService.submitTask("t28346");
+ taskService.submitTask(task.getId());
assertEquals(0, taskService.getPersonalTaskList("johndoe", 0, 10).size());
}
Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskTest.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -46,7 +46,7 @@
TaskImpl task;
try {
Clock.setCurrentTime(now);
- task = TaskImpl.create(getName());
+ task = TaskImpl.create();
} finally {
Clock.setCurrentTime(null);
}
@@ -63,21 +63,21 @@
}
public void testTaskAssignment() {
- TaskImpl task = TaskImpl.create(getName());
- task.setAssignedUserId("john doe");
- assertEquals("john doe", task.getAssignedUserId());
+ TaskImpl task = TaskImpl.create();
+ task.setAssignee("john doe");
+ assertEquals("john doe", task.getAssignee());
}
public void testTaskReassignmentAssignment() {
- TaskImpl task = TaskImpl.create(getName());
- task.setAssignedUserId("johndoe");
- assertEquals("johndoe", task.getAssignedUserId());
- task.setAssignedUserId("joesmoe");
- assertEquals("joesmoe", task.getAssignedUserId());
+ TaskImpl task = TaskImpl.create();
+ task.setAssignee("johndoe");
+ assertEquals("johndoe", task.getAssignee());
+ task.setAssignee("joesmoe");
+ assertEquals("joesmoe", task.getAssignee());
}
public void testTaskRoles() {
- TaskImpl task = TaskImpl.create(getName());
+ TaskImpl task = TaskImpl.create();
assertNotNull(task.getRoles());
assertEquals(0, task.getRoles().size());
@@ -124,7 +124,7 @@
}
public void testTaskAllRoles() {
- TaskImpl task = TaskImpl.create(getName());
+ TaskImpl task = TaskImpl.create();
assertNotNull(task.getAllRoles());
assertEquals(0, task.getAllRoles().size());
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java 2008-12-23 10:52:12 UTC (rev 3523)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java 2008-12-23 10:53:04 UTC (rev 3524)
@@ -32,11 +32,8 @@
public class TaskServiceTest extends DbTestCase {
public void testNewTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
- assertEquals(taskId, task.getId());
- // new task is transient
- task = taskService.getTask(taskId);
+ Task task = taskService.newTask();
+ task = taskService.getTask(task.getId());
assertNull("expected null, but was " + task, task);
}
@@ -50,9 +47,9 @@
}
public void testSaveTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
+ Task task = taskService.newTask();
saveTask(task);
+ String taskId = task.getId();
// task was made persistent
task = taskService.getTask(taskId);
assertNotNull("expected non-null task", task);
@@ -65,21 +62,11 @@
assertEquals(dueDate, task.getDueDate());
}
- public void testGetTask() {
- String taskId = getName();
- // ensure task does not exist
- Task task = taskService.getTask(taskId);
- assertNull("expected null, but was " + task, task);
- // create task and verify it exists
- task = taskService.newTask(taskId);
- saveTask(task);
- assertNotNull("expected non-null task", taskService.getTask(taskId));
- }
-
public void testDeleteTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
+ Task task = taskService.newTask();
taskService.saveTask(task);
+ String taskId = task.getId();
+
// task was made persistent
assertNotNull("expected non-null task", taskService.getTask(taskId));
// delete task and verify it does not exist
15 years, 5 months
JBoss JBPM SVN: r3523 - in projects/report-server/trunk: server and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 05:52:12 -0500 (Tue, 23 Dec 2008)
New Revision: 3523
Modified:
projects/report-server/trunk/pom.xml
projects/report-server/trunk/server/pom.xml
Log:
servlet-api scope provided
Modified: projects/report-server/trunk/pom.xml
===================================================================
--- projects/report-server/trunk/pom.xml 2008-12-23 10:51:48 UTC (rev 3522)
+++ projects/report-server/trunk/pom.xml 2008-12-23 10:52:12 UTC (rev 3523)
@@ -18,6 +18,7 @@
<commons.logging.version>1.1.1</commons.logging.version>
<junit.version>3.8.1</junit.version>
<resteasy.version>1.0-beta-8</resteasy.version>
+ <servlet.version>2.4</servlet.version>
</properties>
<modules>
@@ -42,6 +43,14 @@
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ <version>${servlet.version}</version>
+ </dependency>
+
+
+ <dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
Modified: projects/report-server/trunk/server/pom.xml
===================================================================
--- projects/report-server/trunk/server/pom.xml 2008-12-23 10:51:48 UTC (rev 3522)
+++ projects/report-server/trunk/server/pom.xml 2008-12-23 10:52:12 UTC (rev 3523)
@@ -1,48 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
- <modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM3 - Report Server</name>
- <groupId>org.jbpm</groupId>
- <artifactId>report-server</artifactId>
- <packaging>war</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss jBPM3 - Report Server</name>
+ <groupId>org.jbpm</groupId>
+ <artifactId>report-server</artifactId>
+ <packaging>war</packaging>
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm</groupId>
- <artifactId>balalaika-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm</groupId>
+ <artifactId>balalaika-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <!-- Dependencies -->
- <dependencies>
+ <!-- Dependencies -->
+ <dependencies>
- <dependency>
- <groupId>org.jbpm</groupId>
- <artifactId>report-core</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>report-core</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
- </dependencies>
- <!-- Plugins -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
+ </dependencies>
- <finalName>report-server</finalName>
- </build>
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <finalName>report-server</finalName>
+ </build>
</project>
15 years, 5 months
JBoss JBPM SVN: r3522 - projects/report-server/tags.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 05:51:48 -0500 (Tue, 23 Dec 2008)
New Revision: 3522
Removed:
projects/report-server/tags/report-server-1.0.0.Beta1/
Log:
Recreate tag
15 years, 5 months
JBoss JBPM SVN: r3521 - projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/src/test/java/org/jboss/bpm/console/server.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 05:19:33 -0500 (Tue, 23 Dec 2008)
New Revision: 3521
Modified:
projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
Log:
Align tests with trunk
Modified: projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
===================================================================
--- projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java 2008-12-23 10:04:06 UTC (rev 3520)
+++ projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java 2008-12-23 10:19:33 UTC (rev 3521)
@@ -57,7 +57,7 @@
TaskRefWrapper taskList = unmarshallTaskList(taskListResponse);
assertFalse(taskList.getTasks().isEmpty());
- assertTrue(taskList.getTotalCount() == 1); // TODO: shared database may cause problems
+ //assertTrue(taskList.getTotalCount() == 1); // TODO: shared database may cause problems
TaskRef match = null;
for(TaskRef task : taskList.getTasks())
@@ -87,9 +87,18 @@
);
taskList = unmarshallTaskList(taskListResponse);
- // make sure it's empty
- assertTrue(taskList.getTasks().isEmpty());
+ // make sure it's empty the task got deleted
+ match = null;
+ for(TaskRef task : taskList.getTasks())
+ {
+ if(task.getName().equals("example task"))
+ {
+ match = task;
+ break;
+ }
+ }
+ assertNull(match);
}
}
15 years, 5 months
JBoss JBPM SVN: r3520 - in projects/gwt-console/tags/gwt-console-1.0.0.Beta2: rpc and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 05:04:06 -0500 (Tue, 23 Dec 2008)
New Revision: 3520
Modified:
projects/gwt-console/tags/gwt-console-1.0.0.Beta2/pom.xml
projects/gwt-console/tags/gwt-console-1.0.0.Beta2/rpc/pom.xml
projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/pom.xml
projects/gwt-console/tags/gwt-console-1.0.0.Beta2/war/pom.xml
Log:
Version Beta2
Modified: projects/gwt-console/tags/gwt-console-1.0.0.Beta2/pom.xml
===================================================================
--- projects/gwt-console/tags/gwt-console-1.0.0.Beta2/pom.xml 2008-12-23 09:46:39 UTC (rev 3519)
+++ projects/gwt-console/tags/gwt-console-1.0.0.Beta2/pom.xml 2008-12-23 10:04:06 UTC (rev 3520)
@@ -4,7 +4,7 @@
<name>JBoss jBPM3 - GWT Console</name>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Beta2</version>
<packaging>pom</packaging>
<!-- Parent -->
Modified: projects/gwt-console/tags/gwt-console-1.0.0.Beta2/rpc/pom.xml
===================================================================
--- projects/gwt-console/tags/gwt-console-1.0.0.Beta2/rpc/pom.xml 2008-12-23 09:46:39 UTC (rev 3519)
+++ projects/gwt-console/tags/gwt-console-1.0.0.Beta2/rpc/pom.xml 2008-12-23 10:04:06 UTC (rev 3520)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Beta2</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/pom.xml
===================================================================
--- projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/pom.xml 2008-12-23 09:46:39 UTC (rev 3519)
+++ projects/gwt-console/tags/gwt-console-1.0.0.Beta2/server/pom.xml 2008-12-23 10:04:06 UTC (rev 3520)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Beta2</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: projects/gwt-console/tags/gwt-console-1.0.0.Beta2/war/pom.xml
===================================================================
--- projects/gwt-console/tags/gwt-console-1.0.0.Beta2/war/pom.xml 2008-12-23 09:46:39 UTC (rev 3519)
+++ projects/gwt-console/tags/gwt-console-1.0.0.Beta2/war/pom.xml 2008-12-23 10:04:06 UTC (rev 3520)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Beta2</version>
<relativePath>../pom.xml</relativePath>
</parent>
15 years, 5 months
JBoss JBPM SVN: r3519 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/session and 14 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-23 04:46:39 -0500 (Tue, 23 Dec 2008)
New Revision: 3519
Added:
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTaskCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetPersonalTaskListCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTaskCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SubmitTaskCmd.java
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTask.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTask.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTask.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTask.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java
jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/DbSession.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateDbSession.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/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
Log:
prepared task component for task activity
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -25,7 +25,6 @@
import org.jbpm.task.Role;
import org.jbpm.task.Task;
-import org.jbpm.task.TaskBuilder;
/**
* Human task management facility.
@@ -58,15 +57,6 @@
/** Removes the task with the given identifier from persistent storage. */
void deleteTask(String taskId);
- /** Provides a fluent interface for task configuration. The usage model is:
- * <pre>Task task = taskService.buildTask()
- * .name("expenses")
- * .dueDate(asap)
- * .assignedUserId(me)
- * .priority(HIGH)
- * .done();</pre> */
- TaskBuilder buildTask();
-
List<String> getCandidates(String taskId);
List<Role> getRoles(String taskId);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/DbSession.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/DbSession.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -28,6 +28,7 @@
public interface DbSession {
void save(Object entity);
+ void merge(Object entity);
<T> T get(Class<T> entityClass, Object primaryKey);
void delete(Object entity);
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskBuilder.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,28 +0,0 @@
-package org.jbpm.task;
-
-import java.util.Date;
-
-import org.jbpm.TaskService;
-
-/**
- * Task builders are useful to create and configure human tasks through
- * a fluent interface. Refer to {@link TaskService#buildTask()} for the
- * usage model.
- * @author Alejandro Guizar
- */
-public interface TaskBuilder {
-
- TaskBuilder id(String id);
-
- TaskBuilder name(String name);
-
- TaskBuilder description(String description);
-
- TaskBuilder assignedUserId(String assignedUserId);
-
- TaskBuilder priority(int priority);
-
- TaskBuilder dueDate(Date dueDate);
-
- Task done();
-}
\ No newline at end of file
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -51,7 +51,7 @@
MockRegistry.register("orderProcessing", "bookSold", epr, courier);
}
- public void testJavaInstantiate() {
+ public void testEsb() {
deployJpdlResource("org/jbpm/examples/esb/process.jpdl.xml");
Map<String, Object> variables = new HashMap<String, Object>();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateDbSession.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateDbSession.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -55,9 +55,13 @@
}
public void save(Object entity) {
- session.persist(entity);
+ session.save(entity);
}
+ public void merge(Object entity) {
+ session.merge(entity);
+ }
+
public void delete(Object entity) {
session.delete(entity);
}
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 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -189,9 +189,9 @@
this.state = STATE_CREATED;
this.key = key;
- IdGenerator keyGenerator = Environment.getFromCurrent(IdGenerator.class, false);
- if (keyGenerator!=null) {
- this.id = keyGenerator.createId(processDefinition, null, this);
+ IdGenerator idGenerator = processDefinition.getIdGenerator();
+ if (idGenerator!=null) {
+ this.id = idGenerator.createId(processDefinition, null, this);
}
}
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 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -30,7 +30,9 @@
import org.jbpm.Execution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.env.Environment;
import org.jbpm.log.Log;
+import org.jbpm.model.IdGenerator;
import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.lob.Blob;
import org.jbpm.pvm.internal.util.IoUtil;
@@ -115,6 +117,15 @@
return new ExecutionImpl();
}
+ /** by default, during initialization, an id will be generated when
+ * an IdGenerator is present in the environment. By default,
+ * this makes the execution persistent. So in case the process definition
+ * is not persistent and there is an environment present (like in the case
+ * of task lifecycle for jpdl processes), this method needs to be overwritten. */
+ public IdGenerator getIdGenerator() {
+ return Environment.getFromCurrent(IdGenerator.class, false);
+ }
+
// attachments //////////////////////////////////////////////////////////////
public void addAttachment(String name, InputStream inputStream) {
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTask.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTask.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,87 +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.task.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.session.DbSession;
-import org.jbpm.task.Task;
-import org.jbpm.task.internal.model.TaskDefinitionImpl;
-import org.jbpm.task.internal.model.TaskImpl;
-import org.jbpm.task.session.TaskDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class CreateTask implements Command<Task> {
-
- private static final long serialVersionUID = 1L;
-
- protected String taskId;
- protected Long taskDefinitionDbid;
- protected Long executionDbid;
-
- public CreateTask() {
- }
-
- public CreateTask(String taskId) {
- this.taskId = taskId;
- }
-
- public CreateTask(String taskId, long taskDefinitionDbid) {
- this.taskId = taskId;
- this.taskDefinitionDbid = taskDefinitionDbid;
- }
-
- public CreateTask(String taskId, long taskDefinitionDbid, long executionDbid) {
- this.taskId = taskId;
- this.taskDefinitionDbid = taskDefinitionDbid;
- this.executionDbid = executionDbid;
- }
-
- public Task execute(Environment environment) throws Exception {
- TaskDefinitionImpl taskDefinition = null;
- ExecutionImpl execution = null;
-
- if (taskDefinitionDbid!=null) {
- TaskDbSession dbSession = environment.get(TaskDbSession.class);
- taskDefinition = dbSession.get(TaskDefinitionImpl.class, taskDefinitionDbid);
- }
-
- if (executionDbid!=null) {
- DbSession dbSession = environment.get(DbSession.class);
- execution = dbSession.get(ExecutionImpl.class, executionDbid);
- }
-
- Task task = null;
- if (taskDefinition==null) {
- task = TaskImpl.create(taskId);
- } else if (execution==null) {
- task = TaskImpl.create(taskId, taskDefinition);
- } else {
- task = TaskImpl.create(taskId, taskDefinition, execution);
- }
-
- return task;
- }
-}
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskBuilder.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,41 +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.task.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.task.TaskBuilder;
-import org.jbpm.task.internal.model.TaskBuilderImpl;
-import org.jbpm.task.internal.model.TaskImpl;
-
-/**
- * @author Alejandro Guizar
- */
-public class CreateTaskBuilder implements Command<TaskBuilder> {
-
- private static final long serialVersionUID = 1L;
-
- public TaskBuilder execute(Environment environment) throws Exception {
- return new TaskBuilderImpl(TaskImpl.create());
- }
-
-}
Copied: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java (from rev 3439, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTask.java)
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/CreateTaskCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,80 @@
+/*
+ * 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.task.internal.cmd;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.session.DbSession;
+import org.jbpm.task.Task;
+import org.jbpm.task.internal.model.TaskDefinitionImpl;
+import org.jbpm.task.internal.model.TaskImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateTaskCmd implements Command<Task> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+ protected Long taskDefinitionDbid;
+ protected Long executionDbid;
+
+ public CreateTaskCmd() {
+ }
+
+ public CreateTaskCmd(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public CreateTaskCmd(String taskId, long taskDefinitionDbid) {
+ this.taskId = taskId;
+ this.taskDefinitionDbid = taskDefinitionDbid;
+ }
+
+ public CreateTaskCmd(String taskId, long taskDefinitionDbid, long executionDbid) {
+ this.taskId = taskId;
+ this.taskDefinitionDbid = taskDefinitionDbid;
+ this.executionDbid = executionDbid;
+ }
+
+ public Task execute(Environment environment) throws Exception {
+ TaskDefinitionImpl taskDefinition = null;
+ ExecutionImpl execution = null;
+
+ Session session = environment.get(Session.class);
+
+ if (taskDefinitionDbid!=null) {
+ taskDefinition = (TaskDefinitionImpl) session.load(TaskDefinitionImpl.class, taskDefinitionDbid);
+ }
+
+ if (executionDbid!=null) {
+ execution = (ExecutionImpl) session.load(ExecutionImpl.class, executionDbid);
+ }
+
+ Task task = TaskImpl.create(taskId, taskDefinition, execution);
+
+ return task;
+ }
+}
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTask.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTask.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,49 +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.task.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.task.Task;
-import org.jbpm.task.session.TaskDbSession;
-
-/**
- * @author Alejandro Guizar
- */
-public class DeleteTask implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected String taskId;
-
- public DeleteTask(String taskId) {
- this.taskId = taskId;
- }
-
- public Void execute(Environment environment) throws Exception {
- TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
- Task task = taskDbSession.getTask(taskId);
- taskDbSession.delete(task);
- return null;
- }
-
-}
Copied: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTaskCmd.java (from rev 3439, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTask.java)
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/DeleteTaskCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,49 @@
+/*
+ * 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.task.internal.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.Task;
+import org.jbpm.task.session.TaskDbSession;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class DeleteTaskCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+
+ public DeleteTaskCmd(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
+ Task task = taskDbSession.findTaskById(taskId);
+ taskDbSession.delete(task);
+ return null;
+ }
+
+}
Added: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetPersonalTaskListCmd.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetPersonalTaskListCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetPersonalTaskListCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -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.task.internal.cmd;
+
+import java.util.List;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.Task;
+import org.jbpm.task.session.TaskDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetPersonalTaskListCmd implements Command<List<Task>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected int firstResult;
+ protected int maxResults;
+
+ public GetPersonalTaskListCmd(String userId, int firstResult, int maxResults) {
+ this.userId = userId;
+ this.firstResult = firstResult;
+ this.maxResults = maxResults;
+ }
+
+ public List<Task> execute(Environment environment) {
+ TaskDbSession taskDbession = environment.get(TaskDbSession.class);
+ return taskDbession.findPersonalTasks(userId, firstResult, maxResults);
+ }
+}
Property changes on: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetPersonalTaskListCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTask.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTask.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,45 +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.task.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.task.Task;
-import org.jbpm.task.session.TaskDbSession;
-
-/**
- * @author Alejandro Guizar
- */
-public class GetTask implements Command<Task> {
-
- private static final long serialVersionUID = 1L;
-
- protected String taskId;
-
- public GetTask(String taskId) {
- this.taskId = taskId;
- }
-
- public Task execute(Environment environment) throws Exception {
- return environment.get(TaskDbSession.class).getTask(taskId);
- }
-}
Copied: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTaskCmd.java (from rev 3439, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTask.java)
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/GetTaskCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,46 @@
+/*
+ * 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.task.internal.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.Task;
+import org.jbpm.task.session.TaskDbSession;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class GetTaskCmd implements Command<Task> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+
+ public GetTaskCmd(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public Task execute(Environment environment) throws Exception {
+ TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
+ return taskDbSession.findTaskById(taskId);
+ }
+}
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTask.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTask.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTask.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,47 +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.task.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.task.Task;
-import org.jbpm.task.session.TaskDbSession;
-
-/**
- * @author Alejandro Guizar
- */
-public class SaveTask implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected Task task;
-
- public SaveTask(Task task) {
- this.task = task;
- }
-
- public Void execute(Environment environment) throws Exception {
- environment.get(TaskDbSession.class).saveTask(task);
- return null;
- }
-
-}
Copied: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java (from rev 3439, jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTask.java)
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SaveTaskCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -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.task.internal.cmd;
+
+import java.io.Serializable;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.internal.model.TaskImpl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class SaveTaskCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected TaskImpl task;
+
+ public SaveTaskCmd(TaskImpl task) {
+ this.task = task;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+
+ if (! task.isPersisted()) {
+ Serializable dbid = session.save(task);
+ if (task.getId() == null) {
+ task.setId(dbid.toString());
+ }
+
+ } else {
+ session.update(task);
+ }
+
+ return null;
+ }
+}
Added: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SubmitTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SubmitTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SubmitTaskCmd.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,60 @@
+/*
+ * 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.task.internal.cmd;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.task.internal.model.TaskImpl;
+import org.jbpm.task.session.TaskDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubmitTaskCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String taskId;
+ protected TaskImpl task;
+
+ public SubmitTaskCmd(TaskImpl task) {
+ this.task = task;
+ }
+
+ public SubmitTaskCmd(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ TaskDbSession taskDbession = environment.get(TaskDbSession.class);
+ if (task!=null) {
+ taskDbession.merge(task);
+ } else {
+ task = taskDbession.findTaskById(taskId);
+ }
+ task.submit();
+ taskDbession.delete(task);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/cmd/SubmitTaskCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/hibernate/HibernateTaskDbSession.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -22,6 +22,7 @@
package org.jbpm.task.internal.hibernate;
import java.io.Serializable;
+import java.util.List;
import org.hibernate.criterion.Restrictions;
import org.jbpm.pvm.internal.hibernate.HibernateDbSession;
@@ -32,22 +33,23 @@
/**
* @author Alejandro Guizar
*/
-public class HibernateTaskDbSession extends HibernateDbSession implements
- TaskDbSession {
+public class HibernateTaskDbSession extends HibernateDbSession implements TaskDbSession {
- public Task getTask(String taskId) {
- return (Task) session.createCriteria(TaskImpl.class)
- .add(Restrictions.eq("id", taskId))
- .uniqueResult();
+ public TaskImpl findTaskById(String taskId) {
+ // TODO maybe we should move these criteria queries to hql queries in the
+ // hbm file so that users can easily customize.
+ return (TaskImpl) session.createCriteria(TaskImpl.class)
+ .add(Restrictions.eq("id", taskId))
+ .uniqueResult();
}
- public void saveTask(Task task) {
- if (task.getId() == null) {
- Serializable dbid = session.save(task);
- ((TaskImpl) task).setId(dbid.toString());
- }
- else {
- session.saveOrUpdate(task);
- }
+ public List<Task> findPersonalTasks(String userId, int firstResult, int maxResults) {
+ // TODO maybe we should move these criteria queries to hql queries in the
+ // hbm file so that users can easily customize.
+ return session.createCriteria(TaskImpl.class)
+ .add(Restrictions.eq("assignedUserId", userId))
+ .setFirstResult(firstResult)
+ .setMaxResults(maxResults)
+ .list();
}
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -25,6 +25,7 @@
import java.util.Map;
import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.model.IdGenerator;
import org.jbpm.model.Node;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
@@ -34,8 +35,9 @@
/**
* @author Tom Baeyens
*/
-public class LifeCycle {
+public class LifeCycle extends ProcessDefinitionImpl {
+ private static final long serialVersionUID = 1L;
private static LifeCycleParser lifeCycleParser = new LifeCycleParser();
private static Map<String, ProcessDefinitionImpl> lifeCycleProcesses = new HashMap<String, ProcessDefinitionImpl>();
@@ -73,7 +75,7 @@
return lifeCycleProcess;
}
- protected void fireLifeCycleEvent(String eventName, TaskImpl task) {
+ protected static void fireLifeCycleEvent(String eventName, TaskImpl task) {
ExecutionImpl lifeCycleExecution = new ExecutionImpl();
ProcessDefinitionImpl lifeCycleProcess = getLifeCycle(task);
lifeCycleExecution.setProcessDefinition(lifeCycleProcess);
@@ -84,4 +86,11 @@
task.state = lifeCycleExecution.getNode().getName();
}
+ public IdGenerator getIdGenerator() {
+ // overrides the default ProcessDefinitionImpl behaviour that will end up
+ // in the execution being persisted
+ return null;
+ }
+
+
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -36,7 +36,7 @@
public class LifeCycleParser extends Parser {
public Object parseDocumentElement(Element element, Parse parse) {
- ProcessDefinitionImpl lifeCycleProcess = new ProcessDefinitionImpl();
+ ProcessDefinitionImpl lifeCycleProcess = new LifeCycle();
List<Element> stateElements = XmlUtil.elements(element, "state");
for (Element stateElement: stateElements) {
Deleted: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskBuilderImpl.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,73 +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.task.internal.model;
-
-import java.util.Date;
-
-import org.jbpm.task.Task;
-import org.jbpm.task.TaskBuilder;
-
-/**
- * @author Alejandro Guizar
- */
-public class TaskBuilderImpl implements TaskBuilder {
-
- private final TaskImpl task;
-
- public TaskBuilderImpl(TaskImpl task) {
- this.task = task;
- }
-
- public TaskBuilder id(String id) {
- task.setId(id);
- return this;
- }
-
- public TaskBuilder name(String name) {
- task.setName(name);
- return this;
- }
-
- public TaskBuilder description(String description) {
- task.setDescription(description);
- return this;
- }
-
- public TaskBuilder assignedUserId(String assignedUserId) {
- task.setAssignedUserId(assignedUserId);
- return this;
- }
-
- public TaskBuilder priority(int priority) {
- task.setPriority(priority);
- return this;
- }
-
- public TaskBuilder dueDate(Date dueDate) {
- task.setDueDate(dueDate);
- return this;
- }
-
- public Task done() {
- return task;
- }
-}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskImpl.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -27,11 +27,9 @@
import java.util.Date;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.jbpm.Execution;
-import org.jbpm.env.Environment;
import org.jbpm.model.Comment;
import org.jbpm.pvm.internal.cal.Duration;
import org.jbpm.pvm.internal.model.CommentImpl;
@@ -40,7 +38,6 @@
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
-import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.task.Role;
import org.jbpm.task.Swimlane;
import org.jbpm.task.Task;
@@ -57,12 +54,6 @@
private static final long serialVersionUID = 1L;
// private static final Logger log = Logger.getLogger(TaskImpl.class.getName());
- // could be made configurable:
- public static final String CONTEXTKEY_TASK_CLASS_NAME = "taskClassName";
- public static final String[] SEARCHORDER_TASK_CLASS_NAME = new String[]{
- // PvmEnvironment.CONTEXTNAME_APPLICATION
- };
-
protected String id;
protected String name;
protected String description;
@@ -109,8 +100,9 @@
}
public static TaskImpl create(String taskId, TaskDefinitionImpl taskDefinition, ExecutionImpl execution) {
- TaskImpl task = null;
+ TaskImpl task = new TaskImpl();
+ /*
// if a task class name is configured
Environment environment = Environment.getCurrent();
String taskClassName = environment!=null ? (String) environment.get(TaskImpl.CONTEXTKEY_TASK_CLASS_NAME, TaskImpl.SEARCHORDER_TASK_CLASS_NAME) : null;
@@ -124,6 +116,7 @@
else {
task = new TaskImpl();
}
+ */
task.setCreate(Clock.getCurrentTime());
@@ -212,10 +205,20 @@
// completion ///////////////////////////////////////////////////////////////
public void submit() {
- submit(null);
+ if (execution!=null) {
+ // the outcome is dynamically calculated based on e.g. a
+ // variable or a decision table on a variable. an
+ // interface OutcomeEvaluator for user defined outcome calculation
+ // could be envisioned.
+ String outcome = evaluateOutcome();
+ // the outcome serves as the signal given to the execution.
+ execution.signal(outcome);
+ }
}
- public void submit(Map<String, Object> variables) {
+ public String evaluateOutcome() {
+ // for now, only the default signal can be given.
+ return null;
}
// comments /////////////////////////////////////////////////////////////////
@@ -317,109 +320,97 @@
}
this.progress = progress;
}
-
+
+ public boolean isPersisted() {
+ return dbid!=0;
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
return dbid;
}
-
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
-
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
-
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
-
public boolean isBlocking() {
return isBlocking;
}
public void setBlocking(boolean isBlocking) {
this.isBlocking = isBlocking;
}
-
public boolean isSignalling() {
return isSignalling;
}
public void setSignalling(boolean isSignalling) {
this.isSignalling = isSignalling;
}
-
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
-
public void setComments(List<CommentImpl> comments) {
this.comments = comments;
}
-
public Date getCreate() {
return create;
}
public void setCreate(Date create) {
this.create = create;
}
-
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
-
public ExecutionImpl getExecution() {
return execution;
}
public void setExecution(Execution execution) {
this.execution = (ExecutionImpl) execution;
}
-
public String getState() {
return state;
}
-
public String getAssignedUserId() {
return assignedUserId;
}
public void setAssignedUserId(String assignedUserId) {
this.assignedUserId = assignedUserId;
}
-
public Swimlane getSwimlane() {
return swimlane;
}
public void setSwimlane(SwimlaneImpl swimlane) {
this.swimlane = swimlane;
}
-
public TaskDefinition getTaskDefinition() {
return taskDefinition;
}
-
public TaskImpl getSuperTask() {
return superTask;
}
public void setSuperTask(TaskImpl superTask) {
this.superTask = superTask;
}
-
public Integer getProgress() {
return progress;
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/TaskServiceImpl.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -27,82 +27,76 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.task.Role;
import org.jbpm.task.Task;
-import org.jbpm.task.TaskBuilder;
-import org.jbpm.task.internal.cmd.CreateTask;
-import org.jbpm.task.internal.cmd.CreateTaskBuilder;
-import org.jbpm.task.internal.cmd.DeleteTask;
-import org.jbpm.task.internal.cmd.GetTask;
-import org.jbpm.task.internal.cmd.SaveTask;
+import org.jbpm.task.internal.cmd.CreateTaskCmd;
+import org.jbpm.task.internal.cmd.DeleteTaskCmd;
+import org.jbpm.task.internal.cmd.GetPersonalTaskListCmd;
+import org.jbpm.task.internal.cmd.GetTaskCmd;
+import org.jbpm.task.internal.cmd.SaveTaskCmd;
+import org.jbpm.task.internal.cmd.SubmitTaskCmd;
/**
* @author Alejandro Guizar
*/
public class TaskServiceImpl implements TaskService {
- protected CommandService commandService;
+ protected CommandService commandService;
- public TaskServiceImpl() {
- }
+ public TaskServiceImpl() {
+ }
- public TaskServiceImpl(CommandService commandService) {
- this.commandService = commandService;
- }
+ public TaskServiceImpl(CommandService commandService) {
+ this.commandService = commandService;
+ }
- public CommandService getCommandService() {
- return commandService;
- }
+ public CommandService getCommandService() {
+ return commandService;
+ }
- public void setCommandService(CommandService commandService) {
- this.commandService = commandService;
- }
+ public void setCommandService(CommandService commandService) {
+ this.commandService = commandService;
+ }
- public Task newTask() {
+ public Task newTask() {
return newTask(null);
}
public Task newTask(String taskId) {
- return commandService.execute(new CreateTask(taskId));
- }
+ return commandService.execute(new CreateTaskCmd(taskId));
+ }
- public Task getTask(String taskId) {
- return commandService.execute(new GetTask(taskId));
- }
+ public Task getTask(String taskId) {
+ return commandService.execute(new GetTaskCmd(taskId));
+ }
- public void saveTask(Task task) {
- commandService.execute(new SaveTask(task));
- }
+ public void saveTask(Task task) {
+ commandService.execute(new SaveTaskCmd((TaskImpl) task));
+ }
- public void submitTask(String taskId) {
- // TODO Auto-generated method stub
- }
+ public void deleteTask(String taskId) {
+ commandService.execute(new DeleteTaskCmd(taskId));
+ }
- public void deleteTask(String taskId) {
- commandService.execute(new DeleteTask(taskId));
- }
+ public void submitTask(String taskId) {
+ commandService.execute(new SubmitTaskCmd(taskId));
+ }
- public TaskBuilder buildTask() {
- return commandService.execute(new CreateTaskBuilder());
+ public void submitTask(Task task) {
+ commandService.execute(new SubmitTaskCmd((TaskImpl)task));
}
public List<String> getCandidates(String taskId) {
- // TODO Auto-generated method stub
- return null;
- }
+ return null;
+ }
- public List<Role> getRoles(String taskId) {
- // TODO Auto-generated method stub
- return null;
- }
+ public List<Role> getRoles(String taskId) {
+ return null;
+ }
- public List<Task> getPersonalTaskList(String userId, int firstResult,
- int maxResults) {
- // TODO Auto-generated method stub
- return null;
- }
+ public List<Task> getPersonalTaskList(String userId, int firstResult, int maxResults) {
+ return commandService.execute(new GetPersonalTaskListCmd(userId, firstResult, maxResults));
+ }
- public List<Task> getGroupTaskList(String userId, int firstResult,
- int maxResults) {
- // TODO Auto-generated method stub
- return null;
- }
+ public List<Task> getGroupTaskList(String userId, int firstResult, int maxResults) {
+ return null;
+ }
}
Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/session/TaskDbSession.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -21,8 +21,11 @@
*/
package org.jbpm.task.session;
+import java.util.List;
+
import org.jbpm.session.DbSession;
import org.jbpm.task.Task;
+import org.jbpm.task.internal.model.TaskImpl;
/**
* Persistence interface for tasks.
@@ -30,7 +33,7 @@
*/
public interface TaskDbSession extends DbSession {
- Task getTask(String taskId);
+ TaskImpl findTaskById(String taskId);
- void saveTask(Task task);
+ List<Task> findPersonalTasks(String userId, int firstResult, int maxResults);
}
Deleted: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -1,105 +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.task;
-
-import java.util.Date;
-
-import org.jbpm.pvm.internal.util.Priority;
-import org.jbpm.test.DbTestCase;
-
-/**
- * @author Alejandro Guizar
- */
-public class TaskServiceTest extends DbTestCase {
-
- public void testNewTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
- assertEquals(taskId, task.getId());
- // new task is transient
- task = taskService.getTask(taskId);
- assertNull("expected null, but was " + task, task);
- }
-
- public void testGenerateTaskId() {
- Task task = taskService.newTask();
- String taskId = task.getId();
- assertNull("expected null, but was " + taskId, taskId);
- // save task to generate identifier
- saveTask(task);
- assertNotNull("expected non-null task id", task.getId());
- }
-
- public void testSaveTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
- saveTask(task);
- // task was made persistent
- 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(taskId);
- assertEquals(dueDate, task.getDueDate());
- }
-
- public void testGetTask() {
- String taskId = getName();
- // ensure task does not exist
- Task task = taskService.getTask(taskId);
- assertNull("expected null, but was " + task, task);
- // create task and verify it exists
- task = taskService.newTask(taskId);
- saveTask(task);
- assertNotNull("expected non-null task", taskService.getTask(taskId));
- }
-
- public void testDeleteTask() {
- String taskId = getName();
- Task task = taskService.newTask(taskId);
- taskService.saveTask(task);
- // task was made persistent
- assertNotNull("expected non-null task", taskService.getTask(taskId));
- // delete task and verify it does not exist
- taskService.deleteTask(taskId);
- task = taskService.getTask(taskId);
- assertNull("expected null, but was " + task, task);
- }
-
- public void testBuildTask() {
- Date asap = new Date();
- String me = System.getProperty("user.name");
- Task task = taskService.buildTask()
- .name("expenses")
- .dueDate(asap)
- .assignedUserId(me)
- .priority(Priority.HIGH)
- .done();
- assertEquals("expenses", task.getName());
- assertEquals(asap, task.getDueDate());
- assertEquals(me, task.getAssignedUserId());
- assertEquals(Priority.HIGH, task.getPriority());
- }
-}
Added: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java (rev 0)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,57 @@
+/*
+ * 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.task.internal.model;
+
+import java.util.List;
+
+import org.jbpm.task.Task;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskActivityScenarioTest extends DbTestCase {
+
+ public void testDefaultScenario() {
+ // execution arrives in task node
+ // the task id is generated from the executionId and the task name
+ String taskId = "t28346";
+ Task task = taskService.newTask(taskId);
+ task.setName("do laundry");
+ task.setAssignedUserId("johndoe");
+ taskService.saveTask(task);
+
+
+ List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals("expected 1 task for john doe: "+taskList, 1, taskList.size());
+
+ task = taskList.get(0);
+ assertEquals("johndoe", task.getAssignedUserId());
+ assertEquals("t28346", task.getId());
+ assertEquals("do laundry", task.getName());
+
+ taskService.submitTask("t28346");
+
+ assertEquals(0, taskService.getPersonalTaskList("johndoe", 0, 10).size());
+ }
+}
Property changes on: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -51,7 +51,7 @@
protected TaskService taskService;
protected List<ProcessDefinition> processDefinitions;
- protected List<Task> tasks;
+ protected List<String> taskIds;
protected void setUp() throws Exception {
super.setUp();
@@ -86,9 +86,9 @@
}
}
- if (tasks != null) {
- for (Task task : tasks) {
- taskService.deleteTask(task.getId());
+ if (taskIds != null) {
+ for (String taskId : taskIds) {
+ taskService.deleteTask(taskId);
}
}
@@ -142,12 +142,12 @@
}
public void saveTask(Task task) {
- if (tasks == null) {
- tasks = new ArrayList<Task>();
+ taskService.saveTask(task);
+
+ if (taskIds == null) {
+ taskIds = new ArrayList<String>();
}
- tasks.add(task);
-
- taskService.saveTask(task);
+ taskIds.add(task.getId());
}
public HashSet<String> getNodeNames(String processInstanceId) {
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 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -69,7 +69,7 @@
super.runTest();
} catch (AssertionFailedError e) {
log.error("");
- log.error("ASSERTION FAILURE: "+e.getMessage());
+ log.error("ASSERTION FAILURE: "+e.getMessage(), e);
log.error("");
throw e;
} catch (Throwable t) {
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/test-db/pom.xml 2008-12-23 09:46:39 UTC (rev 3519)
@@ -45,7 +45,13 @@
<version>${version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-task</artifactId>
+ <version>${version}</version>
+ </dependency>
+
<!-- TODO remove PVM dependency for compilation (keep it for test)-->
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java (from rev 3439, jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/TaskServiceTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java 2008-12-23 09:46:39 UTC (rev 3519)
@@ -0,0 +1,90 @@
+/*
+ * 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.svc;
+
+import java.util.Date;
+
+import org.jbpm.task.Task;
+import org.jbpm.test.DbTestCase;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class TaskServiceTest extends DbTestCase {
+
+ public void testNewTask() {
+ String taskId = getName();
+ Task task = taskService.newTask(taskId);
+ assertEquals(taskId, task.getId());
+ // new task is transient
+ task = taskService.getTask(taskId);
+ assertNull("expected null, but was " + task, task);
+ }
+
+ public void testGenerateTaskId() {
+ Task task = taskService.newTask();
+ String taskId = task.getId();
+ assertNull("expected null, but was " + taskId, taskId);
+ // save task to generate identifier
+ saveTask(task);
+ assertNotNull("expected non-null task id", task.getId());
+ }
+
+ public void testSaveTask() {
+ String taskId = getName();
+ Task task = taskService.newTask(taskId);
+ saveTask(task);
+ // task was made persistent
+ 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(taskId);
+ assertEquals(dueDate, task.getDueDate());
+ }
+
+ public void testGetTask() {
+ String taskId = getName();
+ // ensure task does not exist
+ Task task = taskService.getTask(taskId);
+ assertNull("expected null, but was " + task, task);
+ // create task and verify it exists
+ task = taskService.newTask(taskId);
+ saveTask(task);
+ assertNotNull("expected non-null task", taskService.getTask(taskId));
+ }
+
+ public void testDeleteTask() {
+ String taskId = getName();
+ Task task = taskService.newTask(taskId);
+ taskService.saveTask(task);
+ // task was made persistent
+ assertNotNull("expected non-null task", taskService.getTask(taskId));
+ // delete task and verify it does not exist
+ taskService.deleteTask(taskId);
+ task = taskService.getTask(taskId);
+ assertNull("expected null, but was " + task, task);
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/TaskServiceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2008-12-23 09:27:51 UTC (rev 3518)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2008-12-23 09:46:39 UTC (rev 3519)
@@ -17,6 +17,7 @@
<process-service />
<execution-service />
<management-service />
+ <task-service />
<command-service>
<retry-interceptor />
@@ -33,6 +34,7 @@
<mapping resource="jbpm.pvm.variable.hbm.xml" />
<mapping resource="jbpm.pvm.job.hbm.xml" />
<mapping resource="jbpm.jpdl.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
<cache-configuration resource="jbpm.pvm.cache.xml"
usage="nonstrict-read-write" />
</hibernate-configuration>
@@ -68,6 +70,7 @@
<transaction />
<pvm-db-session />
<job-db-session />
+ <task-db-session />
<message-session />
<timer-session />
</environment>
15 years, 5 months
JBoss JBPM SVN: r3518 - projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 04:27:51 -0500 (Tue, 23 Dec 2008)
New Revision: 3518
Modified:
projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/jboss-web.xml
projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/web.xml
Log:
Disable authentication
Modified: projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/jboss-web.xml 2008-12-23 09:21:13 UTC (rev 3517)
+++ projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/jboss-web.xml 2008-12-23 09:27:51 UTC (rev 3518)
@@ -12,7 +12,7 @@
</loader-repository>
</class-loading-->
- <security-domain>java:/jaas/jbpm-console</security-domain>
+ <!--security-domain>java:/jaas/jbpm-console</security-domain-->
<context-root>report-server</context-root>
Modified: projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/web.xml 2008-12-23 09:21:13 UTC (rev 3517)
+++ projects/report-server/tags/report-server-1.0.0.Beta1/server/src/main/webapp/WEB-INF/web.xml 2008-12-23 09:27:51 UTC (rev 3518)
@@ -43,7 +43,7 @@
<url-pattern>/rs/*</url-pattern>
</servlet-mapping>
- <security-constraint>
+ <!--security-constraint>
<web-resource-collection>
<web-resource-name>Resteasy</web-resource-name>
<url-pattern>/rs/*</url-pattern>
@@ -64,6 +64,6 @@
</security-role>
<security-role>
<role-name>user</role-name>
- </security-role>
+ </security-role-->
</web-app>
15 years, 5 months
JBoss JBPM SVN: r3517 - projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-23 04:21:13 -0500 (Tue, 23 Dec 2008)
New Revision: 3517
Modified:
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
Log:
Lessen test constrainsts on shared databases
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java 2008-12-23 05:23:42 UTC (rev 3516)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java 2008-12-23 09:21:13 UTC (rev 3517)
@@ -57,7 +57,7 @@
TaskRefWrapper taskList = unmarshallTaskList(taskListResponse);
assertFalse(taskList.getTasks().isEmpty());
- assertTrue(taskList.getTotalCount() == 1); // TODO: shared database may cause problems
+ //assertTrue(taskList.getTotalCount() == 1); // TODO: shared database may cause problems
TaskRef match = null;
for(TaskRef task : taskList.getTasks())
@@ -87,9 +87,18 @@
);
taskList = unmarshallTaskList(taskListResponse);
- // make sure it's empty
- assertTrue(taskList.getTasks().isEmpty());
+ // make sure it's empty the task got deleted
+ match = null;
+ for(TaskRef task : taskList.getTasks())
+ {
+ if(task.getName().equals("example task"))
+ {
+ match = task;
+ break;
+ }
+ }
+ assertNull(match);
}
}
15 years, 5 months
JBoss JBPM SVN: r3516 - in jbpm3/trunk/modules/core/src: main/resources/org/jbpm/db and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-12-23 00:23:42 -0500 (Tue, 23 Dec 2008)
New Revision: 3516
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1921/
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1921/JBPM1921Test.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/TaskMgmtSession.java
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
Log:
[JBPM-1921] restored distinct task instance selection for pooled actors
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/TaskMgmtSession.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/TaskMgmtSession.java 2008-12-22 20:36:43 UTC (rev 3515)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/TaskMgmtSession.java 2008-12-23 05:23:42 UTC (rev 3516)
@@ -23,6 +23,8 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -101,7 +103,17 @@
try {
Query query = session.getNamedQuery("TaskMgmtSession.findPooledTaskInstancesByActorId");
query.setString("swimlaneActorId", actorId);
- result = query.list();
+ List identifiers = query.list();
+ if (!identifiers.isEmpty()) {
+ result = new ArrayList(identifiers.size());
+ for (Iterator i = identifiers.iterator(); i.hasNext();) {
+ Long taskInstanceId = (Long) i.next();
+ result.add(session.load(TaskInstance.class, taskInstanceId));
+ }
+ }
+ else {
+ result = Collections.EMPTY_LIST;
+ }
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
@@ -118,7 +130,17 @@
try {
Query query = session.getNamedQuery("TaskMgmtSession.findPooledTaskInstancesByActorIds");
query.setParameterList("actorIds", actorIds);
- result = query.list();
+ List identifiers = query.list();
+ if (!identifiers.isEmpty()) {
+ result = new ArrayList(identifiers.size());
+ for (Iterator i = identifiers.iterator(); i.hasNext();) {
+ Long taskInstanceId = (Long) i.next();
+ result.add(session.load(TaskInstance.class, taskInstanceId));
+ }
+ }
+ else {
+ result = Collections.EMPTY_LIST;
+ }
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-22 20:36:43 UTC (rev 3515)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-23 05:23:42 UTC (rev 3516)
@@ -374,7 +374,7 @@
<query name="TaskMgmtSession.findPooledTaskInstancesByActorId">
<![CDATA[
- select ti
+ select distinct ti.id
from org.jbpm.taskmgmt.exe.TaskInstance ti
join ti.pooledActors pooledActor
where pooledActor.actorId = :swimlaneActorId
@@ -386,7 +386,7 @@
<query name="TaskMgmtSession.findPooledTaskInstancesByActorIds">
<![CDATA[
- select ti
+ select distinct ti.id
from org.jbpm.taskmgmt.exe.TaskInstance ti
join ti.pooledActors pooledActor
where pooledActor.actorId in ( :actorIds )
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1921/JBPM1921Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1921/JBPM1921Test.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1921/JBPM1921Test.java 2008-12-23 05:23:42 UTC (rev 3516)
@@ -0,0 +1,86 @@
+/*
+ * 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.jbpm1921;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Assigning a task to two pooled actors and calling
+ * <code>jbpmContext.getGroupTaskList(List actorIds)</code> with these two actor
+ * ids will get you a list with duplicate task instances.
+ *
+ * @author Alejandro Guizar
+ */
+public class JBPM1921Test extends AbstractDbTestCase {
+
+ public void testFindByActorId() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<?xml version='1.0'?>"
+ + "<process-definition name='" + getName() + "'>"
+ + " <start-state name='start'>"
+ + " <transition to='team work'/>"
+ + " </start-state>"
+ + " <task-node name='team work'>"
+ + " <task>"
+ + " <assignment pooled-actors='ernie,bert,ernie' />"
+ + " </task>"
+ + " </task-node>"
+ + "</process-definition>");
+ jbpmContext.deployProcessDefinition(processDefinition);
+ try {
+ ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinition.getName());
+ processInstance.signal();
+ List pooledTasks = taskMgmtSession.findPooledTaskInstances("ernie");
+ assertEquals(1, pooledTasks.size());
+ } finally {
+ graphSession.deleteProcessDefinition(processDefinition);
+ }
+ }
+
+ public void testFindByActorIds() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<?xml version='1.0'?>"
+ + "<process-definition name='" + getName() + "'>"
+ + " <start-state name='start'>"
+ + " <transition to='team work'/>"
+ + " </start-state>"
+ + " <task-node name='team work'>"
+ + " <task>"
+ + " <assignment pooled-actors='ernie,bert,groover' />"
+ + " </task>"
+ + " </task-node>"
+ + "</process-definition>");
+ jbpmContext.deployProcessDefinition(processDefinition);
+ try {
+ ProcessInstance processInstance = jbpmContext.newProcessInstance(processDefinition.getName());
+ processInstance.signal();
+ List pooledTasks = jbpmContext.getGroupTaskList(Arrays
+ .asList(new String[] { "ernie", "bert" }));
+ assertEquals(1, pooledTasks.size());
+ } finally {
+ graphSession.deleteProcessDefinition(processDefinition);
+ }
+ }
+}
15 years, 5 months