[jbpm-commits] JBoss JBPM SVN: r4324 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/activity and 26 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Mar 25 03:29:28 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-03-25 03:29:28 -0400 (Wed, 25 Mar 2009)
New Revision: 4324
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/cancel/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.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/script/ScriptManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
Log:
JBPM-2104 task handler
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -62,8 +62,8 @@
* the call returns <code>null</code>. */
Task getTask(long taskDbid);
- /** Takes a task from the group task list to the current user's personal task list. */
- void takeTask(long taskDbid);
+ /** assigns this task to the given asignee. */
+ void assignTask(long taskDbid, String assigneeUserId);
/** Deletes this task, marks the related history task as completed.
* If the task was created in the context
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -284,10 +284,4 @@
/** marks the end of an activity with a specific transitionName for history purposes. */
void historyActivityEnd(String transitionName);
-
- /** marks the start of a user task for history purposes. */
- void historyTaskStart(Task task);
-
- /** marks the end of a user task for history purposes. */
- void historyTaskComplete(String outcome);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -27,7 +27,7 @@
*/
public interface Assignable {
- void setAssignee(String assigned);
+ void setAssignee(String assignee);
void addCandidateUser(String userId);
void addCandidateGroup(String groupId);
}
\ No newline at end of file
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -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;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DefaultTaskHandler implements TaskHandler {
+
+ public boolean executionCreateTask(OpenTask task) {
+ assign(task);
+ task.historyTaskStart();
+ return true;
+ }
+
+ protected void assign(OpenTask task) {
+ }
+
+ public void executionSignal(OpenTask task) {
+ task.setSignalling(false);
+ }
+
+ public void taskCancel(OpenTask task, String reason) {
+ task.historyTaskCancel(reason);
+ }
+
+ public void taskComplete(OpenTask task, String outcome) {
+ task.historyTaskComplete(outcome);
+
+ if (task.isSignalling()) {
+ task.getExecution().signal(outcome);
+ }
+ }
+
+ public void taskSubTaskComplete(OpenTask task, OpenTask subTask) {
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,48 @@
+/*
+ * 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 org.jbpm.client.ClientExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface OpenTask extends Task, Assignable {
+
+ ClientExecution getExecution();
+
+ OpenTask createSubTask();
+ OpenTask createSubTask(String name);
+
+ /** fires a history event that marks the start of this task. */
+ void historyTaskStart();
+
+ /** fires a history event that marks the completion of this task. */
+ void historyTaskComplete(String outcome);
+
+ /** fires a history event that marks the cancellation of this task. */
+ void historyTaskCancel(String reason);
+
+ boolean isSignalling();
+ void setSignalling(boolean isSignalling);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.task;
-
-import java.io.Serializable;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface SwimlaneDefinition extends Serializable {
-
- String getName();
-
-}
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface TaskHandler {
+
+ boolean executionCreateTask(OpenTask task);
+ void executionSignal(OpenTask task);
+ void taskComplete(OpenTask task, String outcome);
+ void taskCancel(OpenTask task, String reason);
+ void taskSubTaskComplete(OpenTask task, OpenTask subTask);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-03-25 07:29:28 UTC (rev 4324)
@@ -315,7 +315,7 @@
</documentation></annotation>
<complexType>
<sequence>
- <element name="handler" minOccurs="0" type="tns:wireObjectType" />
+ <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
<element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
@@ -449,6 +449,10 @@
invocation.</documentation></annotation>
<complexType >
<group ref="tns:wireObjectGroup" />
+ <attribute name="name" type="string">
+ <annotation><documentation>Name of the field in which the value should be injected.
+ </documentation></annotation>
+ </attribute>
</complexType>
</element>
</sequence>
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,41 @@
+/*
+ * 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.assignmenthandler;
+
+import org.jbpm.model.OpenExecution;
+import org.jbpm.task.Assignable;
+import org.jbpm.task.AssignmentHandler;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignTask implements AssignmentHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ String assignee;
+
+ public void assign(Assignable assignable, OpenExecution execution) {
+ assignable.setAssignee(assignee);
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,45 @@
+/*
+ * 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.assignmenthandler;
+
+import java.util.List;
+
+import org.jbpm.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskAssignmentHandlerTest extends JbpmTestCase {
+
+ public void testTaskAssignmentHandler() {
+ deployJpdlResource("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml");
+
+ executionService.startProcessInstanceByKey("TaskAssignmentHandler");
+
+ 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());
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -60,8 +60,7 @@
assertEquals("review", task.getName());
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -49,14 +49,12 @@
long taskDbid = task.getDbid();
assertEquals("enter order data", task.getName());
assertNull(task.getAssignee());
-
+
+ assertEquals(0, taskService.getPersonalTaskList("johndoe", 0, 10).size());
+
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(taskDbid);
+ taskService.assignTask(taskDbid, "johndoe");
- // submit the task
- taskService.completeTask(taskDbid);
-
// the next task will be created and assigned directly to johndoe
// this is because johndoe was the person that took the previous task
// in the salesRepresentative swimlane. so that person is most likely
@@ -69,6 +67,15 @@
taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
assertEquals(1, taskList.size());
task = taskList.get(0);
+ assertEquals("enter order data", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // submit the task
+ taskService.completeTask(taskDbid);
+
+ taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(1, taskList.size());
+ task = taskList.get(0);
assertEquals("calculate quote", task.getName());
assertEquals("johndoe", task.getAssignee());
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -27,6 +27,7 @@
import java.util.Map;
import java.util.Set;
+import org.jbpm.Execution;
import org.jbpm.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -42,7 +43,7 @@
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("category", "big");
variables.put("dollars", 100000);
- executionService.startProcessInstanceByKey("TaskVariables", variables);
+ Execution execution = executionService.startProcessInstanceByKey("TaskVariables", variables);
List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
Task task = taskList.get(0);
@@ -61,5 +62,19 @@
variables = taskService.getVariables(taskDbid, variableNames);
assertEquals(expectedVariables, variables);
+
+ variables = new HashMap<String, Object>();
+ variables.put("category", "small");
+ variables.put("lires", 923874893);
+ taskService.setVariables(taskDbid, variables);
+
+ expectedVariables = new HashMap<String, Object>();
+ expectedVariables.put("category", "small");
+ expectedVariables.put("lires", 923874893);
+ expectedVariables.put("dollars", 100000);
+
+ variables = executionService.getVariables(execution.getId(), expectedVariables.keySet());
+
+ assertEquals(expectedVariables, variables);
}
}
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="TaskAssignmentHandler" xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="review" />
+ </start>
+
+ <task name="review" g="96,16,127,52">
+ <assignment-handler class="org.jbpm.examples.task.assignmenthandler.AssignTask">
+ <field name="assignee">
+ <string value="johndoe" />
+ </field>
+ </assignment-handler>
+ <transition 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/assignmenthandler/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="TaskHandler" xmlns="http://jbpm.org/4/jpdl">
-
- <start g="20,20,48,48">
- <transition to="open case" />
- </start>
-
- <task
- name="open case"
- g="96,16,127,52">
-
- <handler class="org.jbpm.examples.java.AssignTask">
- <field name="assignee"><string value="John Doe"/></field>
- </handler>
-
- <transition to="wait"/>
- </task>
-
- <state name="wait" g="255,16,88,52"/>
-
-</process>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -21,16 +21,13 @@
*/
package org.jbpm.jpdl.internal.activity;
-import java.util.ArrayList;
import java.util.List;
-import java.util.Set;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.operation.InvokeOperation;
-import org.jbpm.pvm.internal.wire.operation.Operation;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -43,8 +40,6 @@
public static final String TAG = "java";
- private static final WireParser wireParser = WireParser.getInstance();
-
public JavaBinding() {
super(TAG);
}
@@ -66,34 +61,8 @@
javaActivity.setInvokeOperation(invokeOperation);
}
- String className = XmlUtil.attribute(element, "class");
- if (className!=null) {
- ObjectDescriptor objectDescriptor = new ObjectDescriptor();
-
- objectDescriptor.setClassName(className);
-
- // read the operations elements
- List<Operation> operations = null;
- List<Element> elements = XmlUtil.elements(element);
-
- Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
- for (Element childElement: elements) {
- if (operationTagNames.contains(childElement.getTagName())) {
- Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
- if (operations==null) {
- operations = new ArrayList<Operation>();
- }
- operations.add(operation);
- }
- }
- objectDescriptor.setOperations(operations);
-
- // autowiring
- Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
- if (isAutoWireEnabled!=null) {
- objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
- }
-
+ if (element.hasAttribute("class")) {
+ ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(element, parse);
javaActivity.setDescriptor(objectDescriptor);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -23,11 +23,13 @@
import java.util.List;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.jpdl.internal.xml.UnresolvedTransitions;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.w3c.dom.Element;
@@ -36,6 +38,8 @@
* @author Tom Baeyens
*/
public abstract class JpdlActivityBinding extends TagBinding {
+
+ protected static final WireParser wireParser = JpdlParser.wireParser;
public JpdlActivityBinding(String tagName) {
super(tagName, "http://jbpm.org/4/jpdl", "activity");
@@ -68,6 +72,4 @@
unresolvedTransitions.add(transition, transitionElement);
}
}
-
}
-
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -29,10 +29,10 @@
import org.jbpm.jpdl.internal.model.JpdlExecution;
import org.jbpm.model.Activity;
import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.session.TaskDbSession;
+import org.jbpm.task.TaskHandler;
/**
@@ -47,12 +47,16 @@
public void execute(ActivityExecution execution) {
JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class);
TaskImpl task = jpdlExecution.createTask(taskDefinition);
+ TaskHandler taskHandler = task.getTaskHandler();
+ boolean wait = taskHandler.executionCreateTask(task);
+
TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
taskDbSession.save(task);
-
- execution.historyTaskStart(task);
- execution.waitForSignal();
+
+ if (wait) {
+ execution.waitForSignal();
+ }
}
public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
@@ -72,7 +76,7 @@
}
}
- public SwimlaneDefinitionImpl getTaskDefinition() {
+ public TaskDefinitionImpl getTaskDefinition() {
return taskDefinition;
}
public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,9 +22,12 @@
package org.jbpm.jpdl.internal.activity;
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -65,34 +68,40 @@
}
}
- parseAssignmentAttributes(element, taskDefinition);
+ parseAssignmentAttributes(element, taskDefinition, parse);
return taskDefinition;
}
- public static void parseAssignmentAttributes(Element element, SwimlaneDefinitionImpl swimlaneDefinition) {
+ public static void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
Element descriptionElement = XmlUtil.element(element, "description");
if (descriptionElement!=null) {
String description = XmlUtil.getContentText(descriptionElement);
- swimlaneDefinition.setDescription(description);
+ assignableDefinition.setDescription(description);
}
-
+
+ Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
+ if (assignmentHandlerElement!=null) {
+ ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(assignmentHandlerElement, parse);
+ assignableDefinition.setAssignmentHandlerDescriptor(objectDescriptor);
+ }
+
String assigneeExpression = XmlUtil.attribute(element, "assignee");
- swimlaneDefinition.setAssigneeExpression(assigneeExpression);
+ assignableDefinition.setAssigneeExpression(assigneeExpression);
String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
- swimlaneDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
+ assignableDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
- swimlaneDefinition.setCandidateUsersExpression(candidateUsersExpression);
+ assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
- swimlaneDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
+ assignableDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
- swimlaneDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
+ assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
- swimlaneDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
+ assignableDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -31,13 +31,17 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
+import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.ParticipantImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Assignable;
+import org.jbpm.task.AssignmentHandler;
/**
* @author Tom Baeyens
@@ -77,8 +81,6 @@
}
task.setDescription(taskDefinition.getDescription());
- task.setBlocking(taskDefinition.isBlocking());
- task.setSignalling(taskDefinition.isSignalling());
task.setPriority(taskDefinition.getPriority());
SwimlaneDefinitionImpl swimlaneDefinition = taskDefinition.getSwimlaneDefinition();
@@ -102,21 +104,21 @@
/** tasks and swimlane assignment.
* SwimlaneDefinitionImpl is base class for TaskDefinitionImpl.
* Both Task and Swimlane implement Assignable. */
- public void initializeAssignments(SwimlaneDefinitionImpl assignmentDefinition, Assignable assignable) {
- String assigneeExpression = assignmentDefinition.getAssigneeExpression();
+ public void initializeAssignments(AssignableDefinitionImpl assignableDefinition, Assignable assignable) {
+ String assigneeExpression = assignableDefinition.getAssigneeExpression();
if (assigneeExpression!=null) {
String assignee = resolveAssignmentExpression(assigneeExpression,
- assignmentDefinition.getAssigneeExpressionLanguage());
+ assignableDefinition.getAssigneeExpressionLanguage());
assignable.setAssignee(assignee);
if (log.isTraceEnabled()) log.trace("task "+name+" assigned to "+assignee+" using expression "+assigneeExpression);
}
- String candidateUsersExpression = assignmentDefinition.getCandidateUsersExpression();
+ String candidateUsersExpression = assignableDefinition.getCandidateUsersExpression();
if (candidateUsersExpression!=null) {
String candidateUsers =
resolveAssignmentExpression(candidateUsersExpression,
- assignmentDefinition.getCandidateUsersExpressionLanguage());
+ assignableDefinition.getCandidateUsersExpressionLanguage());
StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
while (tokenizer.hasMoreTokens()) {
String candidateUser = tokenizer.nextToken();
@@ -124,17 +126,27 @@
}
}
- String candidateGroupsExpression = assignmentDefinition.getCandidateGroupsExpression();
+ String candidateGroupsExpression = assignableDefinition.getCandidateGroupsExpression();
if (candidateGroupsExpression!=null) {
String candidateGroups =
resolveAssignmentExpression(candidateGroupsExpression,
- assignmentDefinition.getCandidateGroupsExpressionLanguage());
+ assignableDefinition.getCandidateGroupsExpressionLanguage());
StringTokenizer tokenizer = new StringTokenizer(candidateGroups, ",");
while (tokenizer.hasMoreTokens()) {
String candidateGroup = tokenizer.nextToken();
assignable.addCandidateGroup(candidateGroup);
}
}
+
+ Descriptor assignmentHandlerDescriptor = assignableDefinition.getAssignmentHandlerDescriptor();
+ if (assignmentHandlerDescriptor!=null) {
+ AssignmentHandler assignmentHandler = (AssignmentHandler) WireContext.create(assignmentHandlerDescriptor);
+ try {
+ assignmentHandler.assign(assignable, this);
+ } catch (Exception e) {
+ throw new JbpmException("assignment handler threw exception: "+e, e);
+ }
+ }
}
protected String resolveAssignmentExpression(String expression, String expressionLanguage) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,8 +22,10 @@
package org.jbpm.jpdl.internal.xml;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
+import java.util.Set;
import org.jbpm.activity.ActivityBehaviour;
import org.jbpm.internal.log.Log;
@@ -34,6 +36,9 @@
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.operation.Operation;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -45,6 +50,8 @@
private static final Log log = Log.getLog(JpdlParser.class.getName());
+ public static final WireParser wireParser = WireParser.getInstance();
+
public static final String[] DEFAULT_ACTIVITIES_RESOURCES = new String[]{
"jbpm.jpdl.activities.xml",
"jbpm.user.activities.xml"
@@ -125,7 +132,7 @@
if (swimlaneName!=null) {
SwimlaneDefinitionImpl swimlaneDefinition =
processDefinition.createSwimlaneDefinition(swimlaneName);
- TaskBinding.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition);
+ TaskBinding.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition, parse);
}
}
@@ -165,4 +172,36 @@
return processDefinition;
}
+
+ public static ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor();
+
+ String className = XmlUtil.attribute(element, "class");
+ if (className!=null) {
+ objectDescriptor.setClassName(className);
+
+ // read the operations elements
+ List<Operation> operations = null;
+ List<Element> elements = XmlUtil.elements(element);
+
+ Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
+ for (Element childElement: elements) {
+ if (operationTagNames.contains(childElement.getTagName())) {
+ Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
+ if (operations==null) {
+ operations = new ArrayList<Operation>();
+ }
+ operations.add(operation);
+ }
+ }
+ objectDescriptor.setOperations(operations);
+
+ // autowiring
+ Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
+ if (isAutoWireEnabled!=null) {
+ objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
+ }
+ }
+ return objectDescriptor;
+ }
}
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.jbpm.JbpmException;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.session.TaskDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignTaskCmd extends AbstractCommand<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected long taskDbid;
+ protected String assigneeUserId;
+
+ public AssignTaskCmd(long taskDbid, String assigneeUserId) {
+ this.taskDbid = taskDbid;
+ this.assigneeUserId = assigneeUserId;
+ }
+
+ public Void execute(Environment environment) {
+ TaskDbSession taskDbession = environment.get(TaskDbSession.class);
+ TaskImpl task = (TaskImpl) taskDbession.findTaskByDbid(taskDbid);
+ if (task==null) {
+ throw new JbpmException("task "+taskDbid+" does not exist");
+ }
+ task.setAssignee(assigneeUserId, true);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.session.TaskDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TakeTaskCmd extends AbstractCommand<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected long taskDbid;
-
- public TakeTaskCmd(long taskDbid) {
- this.taskDbid = taskDbid;
- }
-
- public Void execute(Environment environment) {
- TaskDbSession taskDbession = environment.get(TaskDbSession.class);
- TaskImpl task = (TaskImpl) taskDbession.findTaskByDbid(taskDbid);
- if (task==null) {
- throw new JbpmException("task "+taskDbid+" does not exist");
- }
- task.take();
- return null;
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCancel extends ActivityEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String reason;
+
+ public TaskCancel(String reason) {
+ this.reason = reason;
+ }
+
+ protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
+ super.updateHistoryActivityInstance(historyActivityInstance);
+
+ HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
+ historyTaskInstance.setState(reason);
+ }
+
+ protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
+ return HistoryTaskInstanceImpl.class;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.events;
-
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
-import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskDelete extends ActivityEnd {
-
- private static final long serialVersionUID = 1L;
-
- protected String reason;
-
- public TaskDelete(String reason) {
- this.reason = reason;
- }
-
- protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
- super.updateHistoryActivityInstance(historyActivityInstance);
-
- HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
- historyTaskInstance.setState(reason);
- }
-
- protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
- return HistoryTaskInstanceImpl.class;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -35,6 +35,7 @@
import org.jboss.identity.idm.api.RoleType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
+import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.api.model.SimpleGroupType;
import org.jboss.identity.idm.p3p.P3PConstants;
@@ -62,10 +63,11 @@
public void createUser(String userName, String password, String givenName, String lastName) {
try {
+ Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
// TODO add the password
-
- Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
+ // identitySession.getAttributesManager().updateCredential(identity, new PasswordCredential(password));
+
Attribute[] attributes = new Attribute[] {
new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, new String[] { givenName }),
new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, new String[] { lastName })
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -63,7 +63,7 @@
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.history.events.TaskComplete;
-import org.jbpm.pvm.internal.history.events.TaskDelete;
+import org.jbpm.pvm.internal.history.events.TaskCancel;
import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
@@ -990,19 +990,7 @@
fireHistoryEvent(new ActivityEnd(transitionName));
}
- public void historyTaskStart(Task task) {
- fireHistoryEvent(new TaskStart(task));
- }
-
- public void historyTaskComplete(String outcome) {
- fireHistoryEvent(new TaskComplete(outcome));
- }
- public void historyTaskDelete(String reason) {
- fireHistoryEvent(new TaskDelete(reason));
- }
-
-
// extensions ///////////////////////////////////////////////////////////////
public <T> T getExtension(Class<T> extensionClass) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -105,7 +105,7 @@
throw new JbpmException("no scripting engine configured for language "+language);
}
- if (log.isDebugEnabled()) log.debug("evaluating "+language+" script :"+script);
+ if (log.isTraceEnabled()) log.trace("evaluating "+language+" script "+script);
if (execution==null) {
return evaluate(scriptEngine, script);
@@ -136,7 +136,7 @@
try {
Object result = scriptEngine.eval(script);
- log.debug("script evaluated to "+result);
+ if (log.isTraceEnabled()) log.trace("script evaluated to "+result);
return result;
} catch (ScriptException e) {
throw new JbpmException("script evaluation error: "+e.getMessage(), e);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -45,7 +45,7 @@
import org.jbpm.pvm.internal.cmd.RemoveParticipantCmd;
import org.jbpm.pvm.internal.cmd.SaveTaskCmd;
import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.TakeTaskCmd;
+import org.jbpm.pvm.internal.cmd.AssignTaskCmd;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.task.TaskQueryImpl;
import org.jbpm.task.IdentityRef;
@@ -173,8 +173,8 @@
return commandService.execute(cmd);
}
- public void takeTask(long taskDbid) {
- TakeTaskCmd cmd = new TakeTaskCmd(taskDbid);
+ public void assignTask(long taskDbid, String assigneeUserId) {
+ AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, assigneeUserId);
addTxWireObjects(cmd);
commandService.execute(cmd);
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.task;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface Assignable {
-
- void setAssignee(String assigned);
- void addCandidateUser(String userId);
- void addCandidateGroup(String groupId);
-}
\ No newline at end of file
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+import org.jbpm.pvm.internal.model.ProcessElementImpl;
+import org.jbpm.pvm.internal.util.EqualsUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignableDefinitionImpl extends ProcessElementImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+ protected String description;
+
+ protected String assigneeExpression;
+ protected String assigneeExpressionLanguage;
+ protected String candidateUsersExpression;
+ protected String candidateUsersExpressionLanguage;
+ protected String candidateGroupsExpression;
+ protected String candidateGroupsExpressionLanguage;
+ protected Descriptor assignmentHandlerDescriptor;
+
+ // equals ///////////////////////////////////////////////////////////////////
+ // hack to support comparing hibernate proxies against the real objects
+ // since this always falls back to ==, we don't need to overwrite the hashcode
+ public boolean equals(Object o) {
+ return EqualsUtil.equals(this, o);
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
+ public String getAssigneeExpression() {
+ return assigneeExpression;
+ }
+ 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 void setAssigneeExpression(String assigneeExpression) {
+ this.assigneeExpression = assigneeExpression;
+ }
+ public Descriptor getAssignmentHandlerDescriptor() {
+ return assignmentHandlerDescriptor;
+ }
+ public void setAssignmentHandlerDescriptor(Descriptor assignmentHandlerDescriptor) {
+ this.assignmentHandlerDescriptor = assignmentHandlerDescriptor;
+ }
+ public String getAssigneeExpressionLanguage() {
+ return assigneeExpressionLanguage;
+ }
+ public void setAssigneeExpressionLanguage(String assigneeExpressionLanguage) {
+ this.assigneeExpressionLanguage = assigneeExpressionLanguage;
+ }
+ public String getCandidateUsersExpression() {
+ return candidateUsersExpression;
+ }
+ public void setCandidateUsersExpression(String candidateUsersExpression) {
+ this.candidateUsersExpression = candidateUsersExpression;
+ }
+ public String getCandidateUsersExpressionLanguage() {
+ return candidateUsersExpressionLanguage;
+ }
+ public void setCandidateUsersExpressionLanguage(String candidateUsersExpressionLanguage) {
+ this.candidateUsersExpressionLanguage = candidateUsersExpressionLanguage;
+ }
+ public String getCandidateGroupsExpression() {
+ return candidateGroupsExpression;
+ }
+ public void setCandidateGroupsExpression(String candidateGroupsExpression) {
+ this.candidateGroupsExpression = candidateGroupsExpression;
+ }
+ public String getCandidateGroupsExpressionLanguage() {
+ return candidateGroupsExpressionLanguage;
+ }
+ public void setCandidateGroupsExpressionLanguage(String candidateGroupsExpressionLanguage) {
+ this.candidateGroupsExpressionLanguage = candidateGroupsExpressionLanguage;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface OpenTaskDefinition {
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,98 +22,12 @@
package org.jbpm.pvm.internal.task;
import java.io.Serializable;
-import java.util.StringTokenizer;
-import org.jbpm.JbpmException;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessElementImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.util.EqualsUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.task.GroupRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.UserRef;
-
/**
* is a process role (aka participant).
*/
-public class SwimlaneDefinitionImpl extends ProcessElementImpl implements Serializable {
+public class SwimlaneDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
private static final long serialVersionUID = 1L;
- protected String name;
- protected String description;
-
- protected String assigneeExpression;
- protected String assigneeExpressionLanguage;
- protected String candidateUsersExpression;
- protected String candidateUsersExpressionLanguage;
- protected String candidateGroupsExpression;
- protected String candidateGroupsExpressionLanguage;
- protected Descriptor assignerDescriptor;
-
- // equals ///////////////////////////////////////////////////////////////////
- // hack to support comparing hibernate proxies against the real objects
- // since this always falls back to ==, we don't need to overwrite the hashcode
- public boolean equals(Object o) {
- return EqualsUtil.equals(this, o);
- }
-
- // getters and setters //////////////////////////////////////////////////////
-
- public String getAssigneeExpression() {
- return assigneeExpression;
- }
- 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 void setAssigneeExpression(String assigneeExpression) {
- this.assigneeExpression = assigneeExpression;
- }
- public Descriptor getAssignerDescriptor() {
- return assignerDescriptor;
- }
- public void setAssignerDescriptor(Descriptor assignerDescriptor) {
- this.assignerDescriptor = assignerDescriptor;
- }
- public String getAssigneeExpressionLanguage() {
- return assigneeExpressionLanguage;
- }
- public void setAssigneeExpressionLanguage(String assigneeExpressionLanguage) {
- this.assigneeExpressionLanguage = assigneeExpressionLanguage;
- }
- public String getCandidateUsersExpression() {
- return candidateUsersExpression;
- }
- public void setCandidateUsersExpression(String candidateUsersExpression) {
- this.candidateUsersExpression = candidateUsersExpression;
- }
- public String getCandidateUsersExpressionLanguage() {
- return candidateUsersExpressionLanguage;
- }
- public void setCandidateUsersExpressionLanguage(String candidateUsersExpressionLanguage) {
- this.candidateUsersExpressionLanguage = candidateUsersExpressionLanguage;
- }
- public String getCandidateGroupsExpression() {
- return candidateGroupsExpression;
- }
- public void setCandidateGroupsExpression(String candidateGroupsExpression) {
- this.candidateGroupsExpression = candidateGroupsExpression;
- }
- public String getCandidateGroupsExpressionLanguage() {
- return candidateGroupsExpressionLanguage;
- }
- public void setCandidateGroupsExpressionLanguage(String candidateGroupsExpressionLanguage) {
- this.candidateGroupsExpressionLanguage = candidateGroupsExpressionLanguage;
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -29,7 +29,7 @@
/**
* defines a task and how the actor(s) must be calculated at runtime.
*/
-public class TaskDefinitionImpl extends SwimlaneDefinitionImpl implements Serializable {
+public class TaskDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -21,16 +21,14 @@
*/
package org.jbpm.pvm.internal.task;
-import java.util.Map;
-import org.jbpm.task.Swimlane;
-import org.jbpm.task.Task;
-
/**
* @author Tom Baeyens
*/
public interface TaskExecution {
- Map<String, ? extends Task> getTasks();
- Map<String, ? extends Swimlane> getSwimlanes();
+ void decouple();
+
+ void complete();
+ void complete(boolean cascade);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -34,7 +34,9 @@
import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.env.Authentication;
+import org.jbpm.pvm.internal.history.events.TaskCancel;
+import org.jbpm.pvm.internal.history.events.TaskComplete;
+import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
@@ -42,11 +44,14 @@
import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Assignable;
+import org.jbpm.task.DefaultTaskHandler;
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
+import org.jbpm.task.OpenTask;
import org.jbpm.task.Participant;
import org.jbpm.task.Swimlane;
import org.jbpm.task.Task;
+import org.jbpm.task.TaskHandler;
import org.jbpm.task.UserRef;
/**
@@ -54,12 +59,14 @@
* someones task list) and that can trigger the continuation of execution
* of the token upon completion.
*/
-public class TaskImpl extends ScopeInstanceImpl implements Serializable, Task, Assignable {
+public class TaskImpl extends ScopeInstanceImpl implements Serializable, OpenTask, Assignable {
private static final long serialVersionUID = 1L;
private static Log log = Log.getLog(TaskImpl.class.getName());
+ private static final TaskHandler DEFAULT_TASK_HANDLER = new DefaultTaskHandler();
+
protected String id;
protected String name;
protected String description;
@@ -70,6 +77,7 @@
protected Date create;
protected Date dueDate;
protected Integer progress;
+ protected boolean isSignalling = true;
// protected VariableMap variableMap;
protected List<CommentImpl> comments;
@@ -81,12 +89,9 @@
protected ExecutionImpl execution;
protected ExecutionImpl processInstance;
- protected boolean isSignalling = true;
- protected boolean isBlocking;
-
protected SwimlaneImpl swimlane;
- protected Assignable superTask;
+ protected TaskImpl superTask;
protected Set<TaskImpl> subTasks;
protected Long executionDbid;
@@ -103,23 +108,15 @@
// assignment ///////////////////////////////////////////////////////////////
- public void take() {
- if (assignee!=null) {
- throw new JbpmException("task "+dbid+" is already taken by "+assignee);
- }
- Authentication authentication = Environment.getFromCurrent(Authentication.class);
- assignee = authentication.getUserId();
- if (assignee==null) {
- throw new JbpmException("no currently authenticated user");
- }
- log.trace("user "+assignee+" takes "+this);
-
- propagateAssigneeToSwimlane();
+ public void setAssignee(String assignee) {
+ this.assignee = assignee;
}
- public void setAssignee(String assigned) {
- this.assignee = assigned;
- propagateAssigneeToSwimlane();
+ public void setAssignee(String assignee, boolean propagateToSwimlane) {
+ this.assignee = assignee;
+ if (propagateToSwimlane) {
+ propagateAssigneeToSwimlane();
+ }
}
protected void propagateAssigneeToSwimlane() {
@@ -195,21 +192,11 @@
}
public void complete(String outcome) {
- if (execution!=null) {
- execution.historyTaskComplete(outcome);
- execution.historyTaskDelete("completed");
-
- // TODO propagate the outjected variables to the execution
-
- // the outcome serves as the signal given to the execution.
- execution.signal(outcome);
- }
+ getTaskHandler().taskComplete(this, outcome);
}
public void cancel(String reason) {
- if (execution!=null) {
- execution.historyTaskDelete(reason);
- }
+ getTaskHandler().taskCancel(this, reason);
}
// comments /////////////////////////////////////////////////////////////////
@@ -248,17 +235,25 @@
return (Set) subTasks;
}
- public Task createSubTask(String name) {
+ public TaskImpl createSubTask() {
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ TaskImpl subTask = (TaskImpl) taskDbSession.createTask();
if (subTasks==null) {
subTasks = new HashSet<TaskImpl>();
}
- TaskImpl subtask = new TaskImpl();
+ addSubTask(subTask);
+ return subTask;
+ }
+
+ public TaskImpl createSubTask(String name) {
+ // TODO look up the task definition in the current task's
+ // subtask definitions and in the process's task definitions
+ TaskImpl subtask = createSubTask();
subtask.setName(name);
- addSubTask(subtask);
return subtask;
}
- public Task addSubTask(TaskImpl subtask) {
+ public TaskImpl addSubTask(TaskImpl subtask) {
if (subTasks==null) {
subTasks = new HashSet<TaskImpl>();
}
@@ -331,18 +326,6 @@
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;
}
@@ -382,10 +365,10 @@
public void setSwimlane(SwimlaneImpl swimlane) {
this.swimlane = swimlane;
}
- public Assignable getSuperTask() {
+ public TaskImpl getSuperTask() {
return superTask;
}
- public void setSuperTask(Assignable superTask) {
+ public void setSuperTask(TaskImpl superTask) {
this.superTask = superTask;
}
public Integer getProgress() {
@@ -421,4 +404,44 @@
public void setProcessInstance(ExecutionImpl processInstance) {
this.processInstance = processInstance;
}
+ public boolean isSignalling() {
+ return isSignalling;
+ }
+ public void setSignalling(boolean isSignalling) {
+ this.isSignalling = isSignalling;
+ }
+
+ public void cancelExecution(String signal) {
+ if (execution!=null){
+ execution.end("cancel");
+ }
+ }
+
+ public void historyTaskCancel(String reason) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskCancel(reason));
+ }
+ }
+
+ public void historyTaskComplete(String outcome) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskComplete(outcome));
+ }
+ }
+
+ public void historyTaskStart() {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskStart(this));
+ }
+ }
+
+ public void signalExecution(String signalName) {
+ if (execution!=null){
+ execution.signal(signalName);
+ }
+ }
+
+ public TaskHandler getTaskHandler() {
+ return DEFAULT_TASK_HANDLER;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -63,8 +63,7 @@
assertEquals("review", task.getName());
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
@@ -121,9 +120,8 @@
task = taskList.get(0);
assertEquals("review", task.getName());
- // submit the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ // take the task
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
More information about the jbpm-commits
mailing list