[jbpm-commits] JBoss JBPM SVN: r4298 - in jbpm4/trunk: bin and 31 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Mar 19 11:00:01 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-03-19 11:00:00 -0400 (Thu, 19 Mar 2009)
New Revision: 4298
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentObject.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskExtension.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml
jbpm4/trunk/modules/integration/console/.classpath
jbpm4/trunk/modules/integration/console/.project
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsByUserNameAndGroupType.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetGroups.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetUsers.java
Modified:
jbpm4/trunk/
jbpm4/trunk/bin/test.distro.bat
jbpm4/trunk/build.xml
jbpm4/trunk/hudson/hudson-home/jobs/jBPM4-JDK1.5/config.xml
jbpm4/trunk/modules/api/src/main/java/org/jbpm/IdentityService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/Group.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/User.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
jbpm4/trunk/modules/distro/src/main/resources/config-tool/build.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.identity.hbm.xml
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/jbpm/cfg/part3.jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
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/integration/console/
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/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/GroupImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentityServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
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/UserImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.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/query/AbstractQuery.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycleParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/identity/IdentityTest.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
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/resources/jbpm.cfg.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/pom.xml
Log:
task candidates
Property changes on: jbpm4/trunk
___________________________________________________________________
Name: svn:ignore
- *.iml
profiles.xml
+ *.iml
profiles.xml
target
Modified: jbpm4/trunk/bin/test.distro.bat
===================================================================
--- jbpm4/trunk/bin/test.distro.bat 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/bin/test.distro.bat 2009-03-19 15:00:00 UTC (rev 4298)
@@ -2,8 +2,8 @@
set JBPM_VERSION=4.0.0-SNAPSHOT
set JBOSS_PARENT=C:\Software
set DOWNLOAD_DIR=C:\Downloads\jboss
-set JBOSS_VERSION=5.0.0.GA
-set CONTAINER=jboss500
+set JBOSS_VERSION=4.2.2.GA
+set CONTAINER=jboss422
set DATABASE=hsqldb
set JBOSS_DISTRO_FILE=C:\Downloads\jboss\jboss-%JBOSS_VERSION%.zip
@@ -11,7 +11,7 @@
cd %JBPM4_ROOT%
set ERRORLEVEL=0
-cmd /C mvn -DskipTests -Pdistro -Ddatabase=%DATABASE% -Djbpm.target.container=%CONTAINER% -Djboss.home=%JBOSS_HOME% clean install
+cmd /C mvn -Pdistro -Ddatabase=%DATABASE% -Djbpm.target.container=%CONTAINER% -Djboss.home=%JBOSS_HOME% clean install
if ERRORLEVEL 1 goto end
rmdir /S /Q %JBOSS_HOME%
unzip -q %JBOSS_DISTRO_FILE% -d c:\Software
Modified: jbpm4/trunk/build.xml
===================================================================
--- jbpm4/trunk/build.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/build.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -155,9 +155,13 @@
</target>
<target name="test.configuration" description="create test configuration in target/config">
- <ant antfile="modules/distro/src/main/resources/config-tool/build.xml" target="create.configuration.files" inheritall="false">
- <property name="config.files.dir" value="${basedir}/target/config" />
- <property name="tmp.dir" value="${basedir}/target/config.tmp" />
+ <ant antfile="modules/distro/src/main/resources/config-tool/build.xml"
+ target="db.drop.create" inheritall="false">
+ <property name="database" value="mysql" />
+ <property name="config.files.dir" value="${basedir}/target/config.tool/config.files" />
+ <property name="tmp.dir" value="${basedir}/target/config.tool/tmp" />
+ <property name="db.scripts.dir" value="${basedir}/target/config.tool/db.scripts" />
+ <property name="libs.dir" value="${basedir}/target/libs" />
</ant>
</target>
Modified: jbpm4/trunk/hudson/hudson-home/jobs/jBPM4-JDK1.5/config.xml
===================================================================
--- jbpm4/trunk/hudson/hudson-home/jobs/jBPM4-JDK1.5/config.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/hudson/hudson-home/jobs/jBPM4-JDK1.5/config.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -60,7 +60,7 @@
# create the database tables
#
cd $JBPMDIR/modules/db
-mvn -Pcreate-tables -Ddatabase=$DATABASE install
+mvn -Ddatabase=$DATABASE install
#
# call command.sh
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/IdentityService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/IdentityService.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/IdentityService.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -31,18 +31,48 @@
* @author Tom Baeyens
*/
public interface IdentityService {
+
+ /** create a new user */
+ void createUser(String userId, String givenName, String familyName);
- void createUser(String userName, String givenName, String familyName);
- void deleteUser(String userName);
+ /** lookup a user
+ * @return the user or null if no such user exists */
+ User findUserById(String userId);
- void createGroup(String groupName, String groupType);
- void createGroup(String groupName, String groupType, String parentgroupName);
+ /** get all the users in the system.
+ * Returns an empty list if no users exist. */
+ List<User> findUsers();
- void createMembership(String userName, String groupName, String groupType, String role);
+ /** delete the given user.
+ * No effect (no exception) if the user does not exist. */
+ void deleteUser(String userId);
- List<User> getUsers();
+ /** create a group new group
+ * @return the generated id for this group. */
+ String createGroup(String groupName, String groupType, String parentGroupId);
- List<Group> getGroups();
+ /** lookup a group.
+ * @return the user or null if no such user exists */
+ Group findGroupById(String groupId);
- List<Group> findGroupsByUserAndGroupType(String userName, String groupType);
-}
+ /** groups of the given groupType for which the given user is a member.
+ * Returns an empty list if no such groups exist. */
+ List<Group> findGroupsByUserAndGroupType(String userId, String groupType);
+
+ /** all groups for which this user is a member.
+ * Returns an empty list if no such groups exist. */
+ List<Group> findGroupsByUser(String userId);
+
+ /** deletes the given group.
+ * No effect (no exception) if the group does not exist. */
+ void deleteGroup(String groupId);
+
+ /** makes the given user a member of the given group with the given role.
+ * Role can be null. */
+ void createMembership(String userId, String groupId, String role);
+
+ /** makes the given user a member of the given group with the given role.
+ * Role can be null. If no such membership exists, this method will
+ * not throw an exception and have no effect. */
+ void deleteMembership(String userId, String groupId, String role);
+}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -51,7 +51,7 @@
/** automatically assigned during deployment of a process that
* represents the sequence number for process definitions with
- * the same {@link ObservableElement#getName() name}. */
+ * the same {@link ObservableElement#getId() name}. */
int getVersion();
/** the description name given to this process definition.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -38,7 +38,11 @@
public static final String PROPERTY_PRIORITY = "priority";
public static final String PROPERTY_PROGRESS = "progress";
- TaskQuery assignee(String assignee);
+ /** only find tasks for which the given user is the assignee */
+ TaskQuery assignee(String userId);
+
+ /** only find tasks for which the given user is a candidate */
+ TaskQuery candidate(String userId);
TaskQuery page(int firstResult, int maxResults);
TaskQuery orderAsc(String property);
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -90,16 +90,16 @@
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
* @param participation specifies the kind of involvement of the participant
* in this swimlane. see {@link Participant} for default constants. */
- void addSwimlaneParticipant(long szimlaneDbid, IdentityRef identityRef, String participation);
+ void addSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
/** get roles related to a given swimlane. */
- List<Participant> getSwimlaneParticipants(long szimlaneDbid);
+ List<Participant> getSwimlaneParticipants(long swimlaneDbid);
/** remove a role from a given swimlane.
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
* @param participation specifies the kind of involvement of the participant
* in this swimlane. see {@link Participant} for default constants. */
- void removeSwimlaneParticipant(long szimlaneDbid, IdentityRef identityRef, String participation);
+ void removeSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
/** create a new query for tasks */
TaskQuery createTaskQuery();
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentFactory.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentFactory.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentFactory.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -23,6 +23,7 @@
import java.io.InputStream;
import java.io.Serializable;
+import java.util.List;
import org.xml.sax.InputSource;
@@ -56,6 +57,14 @@
Environment openEnvironment();
/**
+ * open a new Environment and pass in a list of objects
+ * that must be placed/exposed in the environment context.
+ * The client is responsible for
+ * closing the environment with {@link Environment#close()}.
+ */
+ // Environment openEnvironment(List<EnvironmentObject> environmentObjects);
+
+ /**
* closes this environment factory and cleans any allocated
* resources.
*/
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentObject.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentObject.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentObject.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.env;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EnvironmentObject {
+
+ protected String name;
+ protected Object object;
+ protected boolean exposeType;
+
+ public EnvironmentObject(Object object) {
+ this.object = object;
+ this.exposeType = true;
+ }
+
+ public EnvironmentObject(Object object, String name) {
+ this.object = object;
+ this.name = name;
+ }
+
+ public EnvironmentObject(Object object, String name, boolean exposeType) {
+ this.object = object;
+ this.exposeType = exposeType;
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public Object getObject() {
+ return object;
+ }
+ public boolean isExposeType() {
+ return exposeType;
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/Group.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/Group.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/Group.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -28,7 +28,9 @@
*/
public interface Group {
- String TYPE_ORGANISATION_UNIT = "ORGANIZATION_UNIT";
+ String TYPE_UNIT = "unit";
+ String getId();
String getName();
+ String getType();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/User.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/User.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/identity/User.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -27,7 +27,7 @@
*/
public interface User {
- String getName();
+ String getId();
String getGivenName();
String getFamilyName();
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -21,6 +21,7 @@
*/
package org.jbpm.session;
+import org.jbpm.Execution;
import org.jbpm.task.Task;
/**
@@ -28,8 +29,12 @@
* @author Alejandro Guizar
*/
public interface TaskDbSession extends DbSession {
+
+ Task newTask();
Task findTaskByDbid(long taskDbid);
void saveTask(Task task);
+
+ void deletingExecution(Execution execution);
}
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,34 @@
+/*
+ * 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();
+
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskDefinition.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskDefinition.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,34 @@
+/*
+ * 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 TaskDefinition extends Serializable {
+
+ String getName();
+
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskExtension.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskExtension.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskExtension.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,39 @@
+/*
+ * 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 TaskExtension {
+
+ TaskDefinition getTaskDefinition();
+ TaskDefinition getTaskDefinition(String name);
+
+ Task createTask(TaskDefinition taskDefinition);
+
+ SwimlaneDefinition getSwimlaneDefinition(String name);
+
+ Swimlane getSwimlane(String name);
+ Swimlane createSwimlane(SwimlaneDefinition swimlaneDefinition);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskExtension.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/build.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/build.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -11,6 +11,10 @@
<equals arg1="${jpdl}" arg2="include" />
</condition>
+ <condition property="is.mysql">
+ <equals arg1="${database}" arg2="mysql" />
+ </condition>
+
<!-- condition property="is.identity.included">
<equals arg1="${identity}" arg2="include" />
</condition -->
@@ -40,6 +44,9 @@
<exclude name="jbpm.jpdl.activities.xml" />
</fileset>
</copy>
+
+ <antcall target="internal.mysql.mapping.updates" />
+
<copy todir="${config.files.dir}">
<fileset dir="jbpm">
<include name="*.xml" />
@@ -75,11 +82,11 @@
</filelist>
</concat>
- <antcall target="internal.jpdl.hibernate.mapping.files" />
<!-- antcall target="internal.identity.config.files" / -->
- <antcall target="internal.jdk.logging" />
-
- <echo>Created jbpm configuration files in ${config.files.dir}</echo>
+ <antcall target="internal.jpdl.files" />
+ <antcall target="internal.jdk.logging" />
+
+ <echo>Created jbpm configuration files in ${config.files.dir}</echo>
</target>
<target name="create.remote.configuration"
@@ -247,7 +254,7 @@
</target>
-->
- <target name="internal.jpdl.hibernate.mapping.files" if="is.jpdl.included">
+ <target name="internal.jpdl.files" if="is.jpdl.included">
<copy todir="${config.files.dir}">
<fileset dir="hibernate/mapping.files">
<include name="jbpm.jpdl.hbm.xml" />
@@ -262,6 +269,13 @@
</copy>
</target>
+ <target name="internal.mysql.mapping.updates" if="is.mysql">
+ <replace file="${config.files.dir}/jbpm.execution.hbm.xml">
+ <replacetoken><![CDATA[name="blob" type="blob" column="BLOB_VALUE_"]]></replacetoken>
+ <replacevalue><![CDATA[name="blob" type="blob" sql-type="longblob" column="BLOB_VALUE_"]]></replacevalue>
+ </replace>
+ </target>
+
<target name="internal.prepare">
<delete dir="${tmp.dir}" />
<mkdir dir="${config.files.dir}" />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.identity.hbm.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.identity.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -10,7 +10,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_" />
+ <property name="id" column="ID_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
@@ -44,6 +44,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
+ <property name="id" column="ID_" />
<property name="name" column="NAME_" />
<property name="type" column="TYPE_" />
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -19,8 +19,12 @@
<property name="dueDateDuration" column="DUEDATE_"/>
<property name="isBlocking" column="BLOCK_"/>
<property name="isSignalling" column="SIGNAL_"/>
- <property name="assigneeExpression" column="ASSIGNEE_EXPR_"/>
- <property name="candidatesExpression" column="CANDIDATES_EXPR_"/>
+ <property name="assigneeExpression" column="ASS_EXPR_"/>
+ <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
+ <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
+ <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
+ <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
+ <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignerDescriptor"
column="ASSIGNER_DESCR_"
@@ -111,8 +115,8 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="identityType" column="IDENTITYTYPE_"/>
- <property name="identityId" column="IDENTITYID_"/>
+ <property name="groupId" column="GROUPID_"/>
+ <property name="userId" column="USERID_"/>
<property name="participation" column="PARTICIPATION_" />
<many-to-one name="task"
@@ -154,6 +158,11 @@
column="SWIMLANEDEF_"
foreign-key="FK_SWIMLANE_DEF" />
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="FK_SWIMLANE_EXEC" />
+
<set name="participants" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
<one-to-many class="ParticipantImpl" />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -2,13 +2,15 @@
<check-problems />
<save />
</deployer-manager>
-
+
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine"
write-context="">
<script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
</script-manager>
+
+ <authentication />
<job-executor auto-start="false" />
@@ -34,4 +36,3 @@
<message-session />
<timer-session />
<history-session />
-
\ No newline at end of file
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -1,61 +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.examples.task;
-
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.jbpm.task.Task;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskTest extends JbpmTestCase {
-
- // FIXME revisit the testTask
- public void testTask() {
-// deployJpdlResource("org/jbpm/examples/task/process.jpdl.xml");
-//
-// Execution execution = executionService.startProcessInstanceByKey("Task");
-// String executionId = execution.getId();
-//
-// List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
-// assertEquals(1, taskList.size());
-// Task task = taskList.get(0);
-// assertEquals("review", task.getName());
-// assertEquals("johndoe", task.getAssignee());
-//
-// // submit the task
-// taskService.submitTask(task.getDbid());
-//
-// // verify that the task list is now empty
-// taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
-// assertEquals(0, taskList.size());
-//
-// // verify that process moved to the next state
-// execution = executionService.findExecution(executionId);
-// assertEquals("wait", execution.getActivityName());
- }
-
-}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -37,7 +37,6 @@
public class TaskCandidatesTest extends JbpmTestCase {
public void testTaskAssignee() {
- /*
deployJpdlResource("org/jbpm/examples/task/candidates/process.jpdl.xml");
Map<String, Object> variables = new HashMap<String, Object>();
@@ -55,11 +54,28 @@
task = taskList.get(0);
assertEquals("review", task.getName());
+ /*
// submit the task
taskService.takeTask(task.getDbid());
// verify that the group task lists are now empty
+ taskList = taskService.getGroupTaskList("johndoe", 0, 10);
+ assertEquals(0, taskList.size());
+ taskList = taskService.getGroupTaskList("joesmoe", 0, 10);
+ assertEquals(0, taskList.size());
+
+ // verify that the task now shows up in the personal task list for johndoe
taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(1, taskList.size());
+ task = taskList.get(0);
+ assertEquals("review", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // submit the task
+ taskService.submitTask(task.getDbid());
+
+ // verify that the task list is now empty
+ taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
assertEquals(0, taskList.size());
// verify that process moved to the next state
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -33,13 +33,15 @@
<check-problems />
<save />
</deployer-manager>
-
+
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine"
write-context="">
<script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
</script-manager>
+
+ <authentication />
<job-executor auto-start="false" />
@@ -58,7 +60,6 @@
</process-engine-context>
<transaction-context>
- <hibernate-session />
<transaction />
<pvm-db-session />
<job-db-session />
@@ -66,6 +67,7 @@
<message-session />
<timer-session />
<history-session />
+ <hibernate-session />
<identity-session />
</transaction-context>
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -10,7 +10,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_" />
+ <property name="id" column="ID_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
@@ -44,6 +44,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
+ <property name="id" column="ID_" />
<property name="name" column="NAME_" />
<property name="type" column="TYPE_" />
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -19,8 +19,12 @@
<property name="dueDateDuration" column="DUEDATE_"/>
<property name="isBlocking" column="BLOCK_"/>
<property name="isSignalling" column="SIGNAL_"/>
- <property name="assigneeExpression" column="ASSIGNEE_EXPR_"/>
- <property name="candidatesExpression" column="CANDIDATES_EXPR_"/>
+ <property name="assigneeExpression" column="ASS_EXPR_"/>
+ <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
+ <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
+ <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
+ <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
+ <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignerDescriptor"
column="ASSIGNER_DESCR_"
@@ -111,8 +115,8 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="identityType" column="IDENTITYTYPE_"/>
- <property name="identityId" column="IDENTITYID_"/>
+ <property name="groupId" column="GROUPID_"/>
+ <property name="userId" column="USERID_"/>
<property name="participation" column="PARTICIPATION_" />
<many-to-one name="task"
@@ -154,6 +158,11 @@
column="SWIMLANEDEF_"
foreign-key="FK_SWIMLANE_DEF" />
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="FK_SWIMLANE_EXEC" />
+
<set name="participants" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
<one-to-many class="ParticipantImpl" />
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/candidates/process.jpdl.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="TaskCandidates">
+
+ <start g="20,20,48,48">
+ <transition to="review" />
+ </start>
+
+ <task name="review"
+ candidate-users="johndoe, joesmoe"
+ g="96,16,127,52">
+
+ <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/candidates/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Property changes on: jbpm4/trunk/modules/integration/console
___________________________________________________________________
Name: svn:ignore
+ target
Added: jbpm4/trunk/modules/integration/console/.classpath
===================================================================
--- jbpm4/trunk/modules/integration/console/.classpath (rev 0)
+++ jbpm4/trunk/modules/integration/console/.classpath 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/integration/console/.project
===================================================================
--- jbpm4/trunk/modules/integration/console/.project (rev 0)
+++ jbpm4/trunk/modules/integration/console/.project 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>integration-console</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -51,15 +51,24 @@
public static TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse, Parser parser) {
TaskDefinitionImpl taskDefinition = new TaskDefinitionImpl();
- for (Element assignmentElement: XmlUtil.elements(element, "assignment")) {
- String assigneeExpression = XmlUtil.attribute(assignmentElement, "assignee");
- taskDefinition.setAssigneeExpression(assigneeExpression);
-
- String candidatesExpression = XmlUtil.attribute(assignmentElement, "candidates");
- taskDefinition.setCandidatesExpression(candidatesExpression);
- }
+ String assigneeExpression = XmlUtil.attribute(element, "assignee");
+ taskDefinition.setAssigneeExpression(assigneeExpression);
+ String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
+ taskDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
+
+ String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
+ taskDefinition.setCandidateUsersExpression(candidateUsersExpression);
+
+ String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
+ taskDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
+
+ String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
+ taskDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
+
+ String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
+ taskDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
+
return taskDefinition;
}
-
}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -21,13 +21,74 @@
*/
package org.jbpm.jpdl.internal.model;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.JbpmException;
+import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.task.SwimlaneImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.session.TaskDbSession;
+import org.jbpm.task.Swimlane;
+import org.jbpm.task.SwimlaneDefinition;
+import org.jbpm.task.Task;
+import org.jbpm.task.TaskDefinition;
+import org.jbpm.task.TaskExtension;
/**
* @author Tom Baeyens
*/
-public class JpdlExecution extends ExecutionImpl {
+public class JpdlExecution extends ExecutionImpl implements TaskExtension {
private static final long serialVersionUID = 1L;
+ protected Set<TaskImpl> tasks = new HashSet<TaskImpl>();
+ protected Map<String, SwimlaneImpl> swimlanes = new HashMap<String, SwimlaneImpl>();
+
+ public <T> T getExtension(Class<T> extensionClass) {
+ if (extensionClass==null) {
+ throw new JbpmException("extensionClass is null.");
+ }
+
+ if (extensionClass.equals(TaskExtension.class)) {
+ return (T) this;
+ }
+
+ throw new JbpmException("unsuppported extension "+extensionClass);
+ }
+
+ public void deleting() {
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ if (taskDbSession!=null) {
+ taskDbSession.deletingExecution(this);
+ }
+ }
+
+ public Swimlane createSwimlane(SwimlaneDefinition swimlaneDefinition) {
+ return null;
+ }
+
+ public Swimlane getSwimlane(String name) {
+ return null;
+ }
+
+ public SwimlaneDefinition getSwimlaneDefinition(String name) {
+ return null;
+ }
+
+ public TaskDefinition getTaskDefinition() {
+ return null;
+ }
+
+ public TaskDefinition getTaskDefinition(String name) {
+ return null;
+ }
+
+ public Task createTask(TaskDefinition taskDefinition) {
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ return null;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -178,7 +178,7 @@
public Environment openEnvironment() {
PvmEnvironment environment = new PvmEnvironment(this);
- log.debug("opening " + environment);
+ if (log.isTraceEnabled()) log.trace("opening " + environment);
// set the classloader
ClassLoader classLoader = environmentFactoryCtxWireContext.getClassLoader();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -51,7 +51,7 @@
((Closable)context).close();
}
super.close();
- log.debug("closed "+this);
+ if (log.isTraceEnabled()) log.trace("closed "+this);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -24,6 +24,7 @@
import java.util.List;
import org.hibernate.Query;
+import org.hibernate.metadata.ClassMetadata;
import org.jbpm.Execution;
import org.jbpm.JbpmException;
import org.jbpm.ProcessDefinition;
@@ -35,6 +36,7 @@
import org.jbpm.job.Message;
import org.jbpm.job.Timer;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.svc.DefaultCommandService;
import org.jbpm.session.PvmDbSession;
@@ -102,7 +104,7 @@
if ( deleteHistory
// and if hibernate knows about the history class
- && (session.getSessionFactory().getClassMetadata(HistoryProcessInstanceImpl.class)!=null)
+ && (isHistoryEnabled())
) {
List<HistoryProcessInstance> historyProcessInstances = new HistoryProcessInstanceQueryImpl(new DefaultCommandService())
.processDefinitionId(processDefinitionId)
@@ -219,15 +221,13 @@
throw new JbpmException("processInstanceId is null");
}
- Execution processInstance = findExecutionById(processInstanceId);
-
// if history should be deleted
if ( deleteHistory
- // and if hibernate knows about the history class
- && (session.getSessionFactory().getClassMetadata(HistoryProcessInstanceImpl.class)!=null)
+ && (isHistoryEnabled())
) {
+ // try to get the history
HistoryProcessInstanceImpl historyProcessInstance = (HistoryProcessInstanceImpl)
- session.get(HistoryProcessInstanceImpl.class, processInstance.getId());
+ session.get(HistoryProcessInstanceImpl.class, processInstanceId);
// if there is a history process instance in the db
if (historyProcessInstance!=null) {
@@ -237,15 +237,27 @@
session.delete(historyProcessInstance);
}
}
+
+ ExecutionImpl processInstance = (ExecutionImpl) findExecutionById(processInstanceId);
if (processInstance!=null) {
if (log.isDebugEnabled()) {
log.debug("deleting process instance "+processInstanceId);
}
+
+ // process language specific delete operations
+ processInstance.deleting();
+
session.delete(processInstance);
}
}
+ /** see if hibernate knows about the history class */
+ public boolean isHistoryEnabled() {
+ ClassMetadata historyHibernateMetadata = session.getSessionFactory().getClassMetadata(HistoryProcessInstanceImpl.class);
+ return historyHibernateMetadata!=null;
+ }
+
public List<String> findHistoryProcessInstanceIds(String processDefinitionId) {
Query query = session.getNamedQuery("findHistoryProcessInstanceIds");
query.setString("processDefinitionId", processDefinitionId);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -23,6 +23,10 @@
import java.io.Serializable;
+import org.hibernate.Query;
+import org.jbpm.Execution;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Task;
@@ -31,10 +35,10 @@
* @author Alejandro Guizar
*/
public class HibernateTaskDbSession extends HibernateDbSession implements TaskDbSession {
+
+ private static Log log = Log.getLog(HibernateTaskDbSession.class.getName());
public TaskImpl findTaskByDbid(long taskDbid) {
- // TODO maybe we should move these criteria queries to hql queries in the
- // hbm file so that users can easily customize.
return (TaskImpl) session.get(TaskImpl.class, taskDbid);
}
@@ -57,4 +61,41 @@
session.update(taskImpl);
}
}
+
+ public Task newTask() {
+ return TaskImpl.create();
+ }
+
+ public void deletingExecution(Execution execution) {
+ deleteTasks(execution);
+ deleteSwimlanes(execution);
+ }
+
+ public void deleteSwimlanes(Execution execution) {
+ Query query = session.createQuery(
+ "select swimlane " +
+ "from "+SwimlaneImpl.class.getName()+" as swimlane " +
+ "where swimlane.execution = :execution"
+ );
+ query.setEntity("execution", execution);
+
+ for (Object swimlane: query.list()) {
+ log.trace("deleting "+swimlane);
+ session.delete(swimlane);
+ }
+ }
+
+ public void deleteTasks(Execution execution) {
+ Query query = session.createQuery(
+ "select task " +
+ "from "+TaskImpl.class.getName()+" as task " +
+ "where task.execution = :execution"
+ );
+ query.setEntity("execution", execution);
+
+ for (Object task: query.list()) {
+ log.trace("deleting "+task);
+ session.delete(task);
+ }
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroup.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class CreateGroup implements Command<Void> {
+public class CreateGroup implements Command<String> {
private static final long serialVersionUID = 1L;
@@ -37,16 +37,14 @@
protected String groupType;
protected String parentGroupId;
-
public CreateGroup(String groupName, String groupType, String parentGroupId) {
this.groupName = groupName;
this.groupType = groupType;
this.parentGroupId = parentGroupId;
}
- public Void execute(Environment environment) throws Exception {
+ public String execute(Environment environment) throws Exception {
IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.createGroup(groupName, groupType, parentGroupId);
- return null;
+ return identitySession.createGroup(groupName, groupType, parentGroupId);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembership.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -35,20 +35,17 @@
protected String userId;
protected String groupId;
- protected String groupType;
protected String role;
- public CreateMembership(String userId, String groupId, String groupType, String role) {
+ public CreateMembership(String userId, String groupId, String role) {
this.userId = userId;
this.groupId = groupId;
- this.groupType = groupType;
this.role = role;
}
public Object execute(Environment environment) throws Exception {
IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.createMembership(userId, groupId, groupType, role);
+ identitySession.createMembership(userId, groupId, role);
return null;
}
-
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroup.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -34,17 +34,14 @@
private static final long serialVersionUID = 1L;
protected String groupId;
- protected String groupType;
- public DeleteGroup(String groupId, String groupType) {
+ public DeleteGroup(String groupId) {
this.groupId = groupId;
- this.groupType = groupType;
}
public Void execute(Environment environment) throws Exception {
IdentitySession identitySession = environment.get(IdentitySession.class);
- identitySession.deleteGroup(groupId, groupType);
+ identitySession.deleteGroup(groupId);
return null;
}
-
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.identity.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeleteMembership implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String groupId;
+ protected String role;
+
+ public DeleteMembership(String userId, String groupId, String role) {
+ this.userId = userId;
+ this.groupId = groupId;
+ this.role = role;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ identitySession.deleteMembership(userId, groupId, role);
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembership.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,47 @@
+/*
+ * 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.identity.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.identity.Group;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindGroup implements Command<Group> {
+
+ private static final long serialVersionUID = 1L;
+
+ String groupId;
+
+ public FindGroup(String groupId) {
+ this.groupId = groupId;
+ }
+
+ public Group execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findGroupById(groupId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java (from rev 4274, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsByUserNameAndGroupType.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,58 @@
+/*
+ * 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.identity.cmd;
+
+import java.util.List;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.identity.Group;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindGroups implements Command<List<Group>> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String userId;
+ protected String groupType;
+
+ public FindGroups(String userId) {
+ this.userId = userId;
+ }
+
+ public FindGroups(String userId, String groupType) {
+ this.userId = userId;
+ this.groupType = groupType;
+ }
+
+ public List<Group> execute(Environment environment) throws Exception {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ if (groupType!=null) {
+ return identitySession.findGroupsByUserAndGroupType(userId, groupType);
+ }
+ return identitySession.findGroupsByUser(userId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroups.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsByUserNameAndGroupType.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsByUserNameAndGroupType.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsByUserNameAndGroupType.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -1,52 +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.identity.cmd;
-
-import java.util.List;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.identity.Group;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindGroupsByUserNameAndGroupType implements Command<List<Group>> {
-
- private static final long serialVersionUID = 1L;
-
- protected String userName;
- protected String groupType;
-
- public FindGroupsByUserNameAndGroupType(String userName, String groupType) {
- this.userName = userName;
- this.groupType = groupType;
- }
-
- public List<Group> execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.findGroupsByUserAndGroupType(userName, groupType);
- }
-
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,47 @@
+/*
+ * 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.identity.cmd;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.identity.User;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindUser implements Command<User> {
+
+ private static final long serialVersionUID = 1L;
+
+ String userId;
+
+ public FindUser(String userId) {
+ this.userId = userId;
+ }
+
+ public User execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findUserById(userId);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java (from rev 4274, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetUsers.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -0,0 +1,43 @@
+/*
+ * 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.identity.cmd;
+
+import java.util.List;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.identity.User;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindUsers implements Command<List<User>> {
+
+ private static final long serialVersionUID = 1L;
+
+ public List<User> execute(Environment environment) {
+ IdentitySession identitySession = environment.get(IdentitySession.class);
+ return identitySession.findUsers();
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsers.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetGroups.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetGroups.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetGroups.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -1,43 +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.identity.cmd;
-
-import java.util.List;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.identity.Group;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetGroups implements Command<List<Group>> {
-
- private static final long serialVersionUID = 1L;
-
- public List<Group> execute(Environment environment) throws Exception {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.getGroups(Group.TYPE_ORGANISATION_UNIT);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetUsers.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetUsers.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/GetUsers.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -1,43 +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.identity.cmd;
-
-import java.util.List;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.identity.User;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetUsers implements Command<List<User>> {
-
- private static final long serialVersionUID = 1L;
-
- public List<User> execute(Environment environment) {
- IdentitySession identitySession = environment.get(IdentitySession.class);
- return identitySession.getUsers();
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/GroupImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/GroupImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/GroupImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -38,16 +38,23 @@
protected GroupImpl parent;
+ protected String id;
protected String name;
protected String type;
public GroupImpl() {
}
- public GroupImpl(String name) {
- this.name = name;
+ public GroupImpl(String id) {
+ this.id = id;
}
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
public String getName() {
return name;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentityServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentityServiceImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentityServiceImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -31,10 +31,12 @@
import org.jbpm.pvm.internal.identity.cmd.CreateMembership;
import org.jbpm.pvm.internal.identity.cmd.CreateUser;
import org.jbpm.pvm.internal.identity.cmd.DeleteGroup;
+import org.jbpm.pvm.internal.identity.cmd.DeleteMembership;
import org.jbpm.pvm.internal.identity.cmd.DeleteUser;
-import org.jbpm.pvm.internal.identity.cmd.FindGroupsByUserNameAndGroupType;
-import org.jbpm.pvm.internal.identity.cmd.GetGroups;
-import org.jbpm.pvm.internal.identity.cmd.GetUsers;
+import org.jbpm.pvm.internal.identity.cmd.FindGroup;
+import org.jbpm.pvm.internal.identity.cmd.FindGroups;
+import org.jbpm.pvm.internal.identity.cmd.FindUser;
+import org.jbpm.pvm.internal.identity.cmd.FindUsers;
/**
@@ -43,40 +45,49 @@
public class IdentityServiceImpl implements IdentityService {
protected CommandService commandService;
-
- public List<Group> getGroups() {
- return commandService.execute(new GetGroups());
+
+ public void createUser(String userId, String givenName, String familyName) {
+ commandService.execute(new CreateUser(userId, givenName, familyName));
}
- public List<User> getUsers() {
- return commandService.execute(new GetUsers());
+ public User findUserById(String userId) {
+ return commandService.execute(new FindUser(userId));
}
- public void createUser(String userName, String givenName, String familyName) {
- commandService.execute(new CreateUser(userName, givenName, familyName));
+ public List<User> findUsers() {
+ return commandService.execute(new FindUsers());
}
- public void createGroup(String groupName, String groupType) {
- commandService.execute(new CreateGroup(groupName, groupType, null));
+ public void deleteUser(String userId) {
+ commandService.execute(new DeleteUser(userId));
}
- public void createGroup(String groupName, String groupType, String parentGroupName) {
- commandService.execute(new CreateGroup(groupName, groupType, parentGroupName));
+ public String createGroup(String groupName, String groupType, String parentGroupId) {
+ return commandService.execute(new CreateGroup(groupName, groupType, parentGroupId));
}
- public void deleteUser(String userName) {
- commandService.execute(new DeleteUser(userName));
+ public Group findGroupById(String groupId) {
+ return commandService.execute(new FindGroup(groupId));
}
- public void deleteGroup(String groupName, String groupType) {
- commandService.execute(new DeleteGroup(groupName, groupType));
+ public List<Group> findGroupsByUser(String userId) {
+ return commandService.execute(new FindGroups(userId));
}
- public void createMembership(String userName, String groupName, String groupType, String role) {
- commandService.execute(new CreateMembership(userName, groupName, groupType, role));
+ public List<Group> findGroupsByUserAndGroupType(String userId, String groupType) {
+ return commandService.execute(new FindGroups(userId, groupType));
}
- public List<Group> findGroupsByUserAndGroupType(String userName, String groupType) {
- return commandService.execute(new FindGroupsByUserNameAndGroupType(userName, groupType));
+ public void deleteGroup(String groupId) {
+ commandService.execute(new DeleteGroup(groupId));
}
+
+ public void createMembership(String userId, String groupId, String role) {
+ commandService.execute(new CreateMembership(userId, groupId, role));
+ }
+
+ public void deleteMembership(String userId, String groupId, String role) {
+ commandService.execute(new DeleteMembership(userId, groupId, role));
+ }
+
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -37,92 +37,107 @@
protected Session session;
- public void createGroup(String groupName, String groupType, String parentGroupName) {
- GroupImpl group = new GroupImpl();
- group.setName(groupName);
- group.setType(groupType);
+ public void createUser(String userName, String givenName, String familyName) {
+ UserImpl user = new UserImpl();
+ user.setId(userName);
+ user.setGivenName(givenName);
+ user.setFamilyName(familyName);
- if (parentGroupName!=null) {
- GroupImpl parentGroup = findGroup(parentGroupName, null);
- group.setParent(parentGroup);
- }
-
- session.save(group);
+ session.save(user);
}
- protected GroupImpl findGroup(String name, String type) {
- GroupImpl group = (GroupImpl) session.createQuery(
- "select group " +
- "from "+GroupImpl.class.getName()+" as group " +
- "where group.name = '"+name+"'" +
- (type!=null ? " and group.type = '"+type+"'" : "")
- ).uniqueResult();
- return group;
- }
-
- protected UserImpl findUser(String name) {
+ public UserImpl findUserById(String userId) {
UserImpl user = (UserImpl) session.createQuery(
"select user " +
"from "+UserImpl.class.getName()+" as user " +
- "where user.name = '"+name+"'"
+ "where user.id = '"+userId+"'"
).uniqueResult();
return user;
}
- public void createMembership(String userName, String groupName, String groupType, String role) {
- UserImpl user = findUser(userName);
- GroupImpl group = findGroup(groupName, groupType);
-
- MembershipImpl membership = new MembershipImpl();
- membership.setUser(user);
- membership.setGroup(group);
- membership.setRole(role);
-
- session.save(membership);
+ public List<User> findUsers() {
+ return session.createQuery(
+ "from "+UserImpl.class.getName()
+ ).list();
}
- public void createUser(String userName, String givenName, String familyName) {
- UserImpl user = new UserImpl();
- user.setName(userName);
- user.setGivenName(givenName);
- user.setFamilyName(familyName);
-
- session.save(user);
+ public void deleteUser(String userId) {
+ UserImpl user = findUserById(userId);
+ session.delete(user);
}
- public void deleteGroup(String groupName, String groupType) {
- GroupImpl group = findGroup(groupName, groupType);
- session.delete(group);
+ public String createGroup(String groupName, String groupType, String parentGroupId) {
+ GroupImpl group = new GroupImpl();
+ group.setId("group://"+groupType+"/"+groupName);
+ group.setName(groupName);
+ group.setType(groupType);
+
+ if (parentGroupId!=null) {
+ GroupImpl parentGroup = findGroupById(parentGroupId);
+ group.setParent(parentGroup);
+ }
+
+ session.save(group);
+
+ return group.getId();
}
- public void deleteUser(String userName) {
- UserImpl user = findUser(userName);
- session.delete(user);
+ public GroupImpl findGroupById(String groupId) {
+ GroupImpl group = (GroupImpl) session.createQuery(
+ "select group " +
+ "from "+GroupImpl.class.getName()+" as group " +
+ "where group.id = '"+groupId+"'"
+ ).uniqueResult();
+ return group;
}
- public List<Group> findGroupsByUserAndGroupType(String userName, String groupType) {
+ public List<Group> findGroupsByUserAndGroupType(String userId, String groupType) {
Query query = session.createQuery(
"select distinct membership.group " +
"from "+MembershipImpl.class.getName()+" as membership " +
- "where membership.user.name = '"+userName+"'" +
+ "where membership.user.id = '"+userId+"'" +
" and membership.group.type = '"+groupType+"'"
);
return query.list();
}
- public List<Group> getGroups(String groupType) {
+ public List<Group> findGroupsByUser(String userId) {
+ Query query = session.createQuery(
+ "select distinct membership.group " +
+ "from "+MembershipImpl.class.getName()+" as membership " +
+ "where membership.user.id = '"+userId+"'"
+ );
+ return query.list();
+ }
+
+ public List<Group> findGroups() {
return session.createQuery(
"from "+GroupImpl.class.getName()
).list();
}
- public List<User> getUsers() {
- return session.createQuery(
- "from "+UserImpl.class.getName()
- ).list();
+ public void deleteGroup(String groupId) {
+ GroupImpl group = findGroupById(groupId);
+ session.delete(group);
}
+ public void createMembership(String userId, String groupId, String role) {
+ UserImpl user = findUserById(userId);
+ GroupImpl group = findGroupById(groupId);
+
+ MembershipImpl membership = new MembershipImpl();
+ membership.setUser(user);
+ membership.setGroup(group);
+ membership.setRole(role);
+
+ session.save(membership);
+ }
+
+ public void deleteMembership(String userId, String groupId, String role) {
+ }
+
public void setSession(Session session) {
this.session = session;
}
+
}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -73,7 +73,7 @@
}
}
- public List<User> getUsers() {
+ public List<User> findUsers() {
try {
Collection<Identity> identities = identitySession
.getPersistenceManager()
@@ -96,6 +96,10 @@
}
}
+ public User findUserById(String userId) {
+ throw new UnsupportedOperationException("please implement me");
+ }
+
public void deleteUser(String userName) {
try {
org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
@@ -113,15 +117,18 @@
}
}
- public void createGroup(String groupName, String groupType, String parentGroupName) {
+ public String createGroup(String groupName, String groupType, String parentGroupId) {
+ String groupId = null;
+
try {
GroupType simpleGroupType = new SimpleGroupType(groupType);
org.jboss.identity.idm.api.Group group = identitySession.getPersistenceManager().createGroup(groupName, simpleGroupType);
+ groupId = group.getId();
- if (parentGroupName!=null) {
- org.jboss.identity.idm.api.Group parentGroup = findGroup(parentGroupName, groupType);
+ if (parentGroupId!=null) {
+ org.jboss.identity.idm.api.Group parentGroup = findIdmGroupById(parentGroupId);
if (parentGroup==null) {
- throw new JbpmException("parent group "+parentGroupName+" doesn't exist");
+ throw new JbpmException("parent group "+parentGroupId+" doesn't exist");
}
identitySession.getRelationshipManager().associateGroups(parentGroup, group);
}
@@ -129,9 +136,15 @@
} catch (IdentityException e) {
throw new JbpmException("couldn't create group "+groupName, e);
}
+
+ return groupId;
}
- public List<Group> getGroups(String groupType) {
+ public Group findGroupById(String groupId) {
+ throw new UnsupportedOperationException("please implement me");
+ }
+
+ public List<Group> findGroupsByGroupType(String groupType) {
try {
GroupType simpleGroupType = new SimpleGroupType(groupType);
Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession
@@ -153,10 +166,41 @@
}
}
- public void deleteGroup(String groupName, String groupType) {
+ public List<Group> findGroupsByUser(String userId) {
+ throw new UnsupportedOperationException("please implement me");
+ }
+
+ public List<Group> findGroupsByUserAndGroupType(String userName, String groupType) {
try {
- org.jboss.identity.idm.api.Group group = findGroup(groupName, groupType);
+ org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
+ if (identity==null) {
+ return Collections.EMPTY_LIST;
+ }
+
+ List<Group> groups = new ArrayList<Group>();
+
+ GroupType identityGroupType = new SimpleGroupType(groupType);
+ Collection<org.jboss.identity.idm.api.Group> identityGroups = identitySession
+ .getRoleManager()
+ .findGroupsWithRelatedRole(identity, identityGroupType, null);
+
+ for (org.jboss.identity.idm.api.Group identityGroup: identityGroups) {
+ String groupName = identityGroup.getName();
+ GroupImpl group = new GroupImpl(groupName);
+ groups.add(group);
+ }
+
+ return groups;
+
+ } catch (Exception e) {
+ throw new JbpmException("couldn't get groups for user "+userName+" and groupType "+groupType, e);
+ }
+ }
+ public void deleteGroup(String groupId) {
+ try {
+ org.jboss.identity.idm.api.Group group = findIdmGroupById(groupId);
+
if (group==null) {
return;
}
@@ -166,20 +210,20 @@
.removeGroup(group, true);
} catch (IdentityException e) {
- throw new JbpmException("couldn't delete group "+groupName, e);
+ throw new JbpmException("couldn't delete group "+groupId, e);
}
}
- public void createMembership(String userName, String groupName, String groupType, String role) {
+ public void createMembership(String userId, String groupId, String role) {
try {
- org.jboss.identity.idm.api.Group group = findGroup(groupName, groupType);
+ org.jboss.identity.idm.api.Group group = findIdmGroupById(groupId);
if (group==null) {
- throw new JbpmException("group "+groupName+" doesn't exist");
+ throw new JbpmException("group "+groupId+" doesn't exist");
}
- org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
+ org.jboss.identity.idm.api.Identity identity = findIdentity(userId);
if (identity==null) {
- throw new JbpmException("user "+userName+" doesn't exist");
+ throw new JbpmException("user "+userId+" doesn't exist");
}
@@ -196,37 +240,14 @@
}
} catch (Exception e) {
- throw new JbpmException("couldn't create membership "+userName+", "+groupName+", "+role, e);
+ throw new JbpmException("couldn't create membership "+userId+", "+groupId+", "+role, e);
}
}
- public List<Group> findGroupsByUserAndGroupType(String userName, String groupType) {
- try {
- org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
- if (identity==null) {
- return Collections.EMPTY_LIST;
- }
-
- List<Group> groups = new ArrayList<Group>();
-
- GroupType identityGroupType = new SimpleGroupType(groupType);
- Collection<org.jboss.identity.idm.api.Group> identityGroups = identitySession
- .getRoleManager()
- .findGroupsWithRelatedRole(identity, identityGroupType, null);
-
- for (org.jboss.identity.idm.api.Group identityGroup: identityGroups) {
- String groupName = identityGroup.getName();
- GroupImpl group = new GroupImpl(groupName);
- groups.add(group);
- }
-
- return groups;
-
- } catch (Exception e) {
- throw new JbpmException("couldn't get groups for user "+userName+" and groupType "+groupType, e);
- }
+ public void deleteMembership(String userId, String groupId, String role) {
+ throw new UnsupportedOperationException("please implement me");
}
-
+
protected org.jboss.identity.idm.api.Identity findIdentity(String userName) throws IdentityException {
Collection<org.jboss.identity.idm.api.Identity> identities = identitySession
.getPersistenceManager()
@@ -241,20 +262,8 @@
return identities.iterator().next();
}
- protected org.jboss.identity.idm.api.Group findGroup(String groupName, String groupType) throws IdentityException {
- GroupType groupIdType = new SimpleGroupType(groupType);
-
- Collection<org.jboss.identity.idm.api.Group> groups = identitySession
- .getPersistenceManager()
- .findGroup(groupIdType, new IdentitySearchControl[]{
- new NameFilterSearchControl(groupName)
- } );
-
- if ( (groups==null) || (groups.size()==0) ) {
- return null;
- }
-
- return groups.iterator().next();
+ protected org.jboss.identity.idm.api.Group findIdmGroupById(String groupId) {
+ throw new UnsupportedOperationException("please implement me");
}
protected String getAttributeString(Identity identity, String attributeName) throws IdentityException {
@@ -287,4 +296,6 @@
public void setIdentitySession(IdentitySession identitySession) {
this.identitySession = identitySession;
}
+
+
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/UserImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -36,21 +36,21 @@
protected long dbid;
protected int dbversion;
- protected String name;
+ protected String id;
protected String givenName;
protected String familyName;
public UserImpl() {
}
- public UserImpl(String name, String givenName, String familyName) {
- this.name = name;
+ public UserImpl(String id, String givenName, String familyName) {
+ this.id = id;
this.givenName = givenName;
this.familyName = familyName;
}
- public String getName() {
- return name;
+ public String getId() {
+ return id;
}
public String getGivenName() {
return givenName;
@@ -65,11 +65,11 @@
) {
return givenName+" "+familyName;
}
- return name;
+ return id;
}
- public void setName(String name) {
- this.name = name;
+ public void setId(String id) {
+ this.id = id;
}
public void setGivenName(String givenName) {
this.givenName = givenName;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -32,15 +32,47 @@
*/
public interface IdentitySession {
- void createUser(String userName, String givenName, String familyName);
- List<User> getUsers();
- void deleteUser(String userName);
+ /** create a new user */
+ void createUser(String userId, String givenName, String familyName);
+
+ /** lookup a user
+ * @return the user or null if no such user exists */
+ User findUserById(String userId);
- void createGroup(String groupName, String groupType, String parentGroupName);
- List<Group> getGroups(String groupType);
- void deleteGroup(String groupName, String groupType);
+ /** get all the users in the system.
+ * Returns an empty list if no users exist. */
+ List<User> findUsers();
+
+ /** delete the given user.
+ * No effect (no exception) if the user does not exist. */
+ void deleteUser(String userId);
+
+ /** create a group new group
+ * @return the generated id for this group. */
+ String createGroup(String groupName, String groupType, String parentGroupId);
+
+ /** lookup a group.
+ * @return the user or null if no such user exists */
+ Group findGroupById(String groupId);
- void createMembership(String userName, String groupName, String groupType, String role);
+ /** groups of the given groupType for which the given user is a member.
+ * Returns an empty list if no such groups exist. */
+ List<Group> findGroupsByUserAndGroupType(String userId, String groupType);
- List<Group> findGroupsByUserAndGroupType(String userName, String groupType);
+ /** all groups for which this user is a member.
+ * Returns an empty list if no such groups exist. */
+ List<Group> findGroupsByUser(String userId);
+
+ /** deletes the given group.
+ * No effect (no exception) if the group does not exist. */
+ void deleteGroup(String groupId);
+
+ /** makes the given user a member of the given group with the given role.
+ * Role can be null. */
+ void createMembership(String userId, String groupId, String role);
+
+ /** makes the given user a member of the given group with the given role.
+ * Role can be null. If no such membership exists, this method will
+ * not throw an exception and have no effect. */
+ void deleteMembership(String userId, String groupId, String role);
}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -996,6 +996,12 @@
throw new JbpmException("unsuppported extension "+extensionClass.getName());
}
+ /** notification of this execution being deleted. this allows for
+ * specific process lanugage executions to remove all the pointers
+ * to this execution */
+ public void deleting() {
+ }
+
// 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
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -71,6 +71,7 @@
if (isWhereAdded) {
hql.append(" and ");
} else {
+ isWhereAdded = true;
hql.append("where ");
}
hql.append(whereClause);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycleParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycleParser.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycleParser.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -37,6 +37,7 @@
public Object parseDocumentElement(Element element, Parse parse) {
ProcessDefinitionImpl lifeCycleProcess = new LifeCycle();
+ lifeCycleProcess.setName("TaskLifeCycle");
List<Element> stateElements = XmlUtil.elements(element, "state");
for (Element stateElement: stateElements) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -40,8 +40,8 @@
protected long dbid;
protected int dbversion;
- protected String identityType;
- protected String identityId;
+ protected String userId;
+ protected String groupId;
protected String participation;
protected TaskImpl task;
protected SwimlaneImpl swimlane;
@@ -55,10 +55,10 @@
}
public IdentityRef getIdentityRef() {
- if ("U".equals(identityType)) {
- return new UserRef(identityId);
+ if (userId!=null) {
+ return new UserRef(userId);
}
- return new GroupRef(identityId);
+ return new GroupRef(groupId);
}
public void setIdentityRef(IdentityRef identityRef) {
@@ -67,14 +67,12 @@
}
if (identityRef instanceof UserRef) {
- identityType = "U";
+ userId = identityRef.getId();
} else if (identityRef instanceof GroupRef) {
- identityType = "G";
+ groupId = identityRef.getId();
} else {
throw new JbpmException("invalid identity type: "+identityRef.getClass().getName());
}
-
- identityId = identityRef.getId();
}
public TaskImpl getTask() {
@@ -98,10 +96,16 @@
public void setParticipation(String participation) {
this.participation = participation;
}
- public String getIdentityId() {
- return identityId;
+ public String getUserId() {
+ return userId;
}
- public void setIdentityId(String identityId) {
- this.identityId = identityId;
+ public void setUserId(String userId) {
+ this.userId = userId;
}
+ public String getGroupId() {
+ return groupId;
+ }
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -27,6 +27,7 @@
import java.util.Set;
import org.jbpm.JbpmException;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.task.IdentityRef;
import org.jbpm.task.Participant;
@@ -43,6 +44,7 @@
protected int dbversion;
protected String name = null;
protected String assignee = null;
+ protected ExecutionImpl execution = null;
protected Set<ParticipantImpl> participants = null;
protected SwimlaneDefinitionImpl swimlaneDefinition = null;
@@ -57,8 +59,6 @@
}
// participants /////////////////////////////////////////////////////////////
-
- // participants /////////////////////////////////////////////////////////////
public Set<ParticipantImpl> getParticipants() {
if (participants==null) {
@@ -101,6 +101,10 @@
return EqualsUtil.equals(this, o);
}
+ public String toString() {
+ return "Swimlane("+name+")";
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
@@ -118,4 +122,10 @@
public void setName(String name) {
this.name = name;
}
+ public ExecutionImpl getExecution() {
+ return execution;
+ }
+ public void setExecution(ExecutionImpl execution) {
+ this.execution = execution;
+ }
}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -23,12 +23,18 @@
import java.io.Serializable;
import java.util.List;
+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.Priority;
import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.Participant;
+import org.jbpm.task.UserRef;
/**
* defines a task and how the actor(s) must be calculated at runtime.
@@ -53,15 +59,48 @@
protected SwimlaneDefinitionImpl swimlaneDefinition;
protected String assigneeExpression;
protected String assigneeExpressionLanguage;
- protected String candidatesExpression;
- protected String candidatesExpressionLanguage;
+ protected String candidateUsersExpression;
+ protected String candidateUsersExpressionLanguage;
+ protected String candidateGroupsExpression;
+ protected String candidateGroupsExpressionLanguage;
protected Descriptor assignerDescriptor;
+ public void initialize(TaskImpl task) {
+ task.setPriority(priority);
+
+ if (assigneeExpression!=null) {
+ String assignee = resolveAssignmentExpression(assigneeExpression, assigneeExpressionLanguage, task.getExecution());
+ task.setAssignee(assignee);
+ }
+
+ if (candidateUsersExpression!=null) {
+ String candidateUsers = resolveAssignmentExpression(candidateUsersExpression, candidateUsersExpressionLanguage, task.getExecution());
+ StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String candidateUser = tokenizer.nextToken();
+ task.addParticipant(new UserRef(candidateUser), Participant.CANDIDATE);
+ }
+ }
- public void initialize(TaskImpl task) {
+ if (candidateGroupsExpression!=null) {
+ String candidateGroups = resolveAssignmentExpression(candidateGroupsExpression, candidateGroupsExpressionLanguage, task.getExecution());
+ StringTokenizer tokenizer = new StringTokenizer(candidateGroups, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String candidateGroup = tokenizer.nextToken();
+ task.addParticipant(new GroupRef(candidateGroup), Participant.CANDIDATE);
+ }
+ }
+ }
+
+ protected String resolveAssignmentExpression(String expression, String expressionLanguage, ExecutionImpl execution) {
ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
- String assigneeName = (String) scriptManager.evaluateExpression(assigneeExpression, task.getExecution(), assigneeExpressionLanguage);
- task.setAssignee(assigneeName);
+ Object result = scriptManager.evaluateExpression(expression, execution, expressionLanguage);
+ if ( (result ==null)
+ || (result instanceof String)
+ ) {
+ return (String) result;
+ }
+ throw new JbpmException("result of assignment expression is "+result.getClass().getName()+" instead of String");
}
// getters and setters //////////////////////////////////////////////////////
@@ -78,12 +117,36 @@
public void setAssignerDescriptor(Descriptor assignerDescriptor) {
this.assignerDescriptor = assignerDescriptor;
}
- public String getCandidatesExpression() {
- return candidatesExpression;
+ public String getAssigneeExpressionLanguage() {
+ return assigneeExpressionLanguage;
}
- public void setCandidatesExpression(String candidatesExpression) {
- this.candidatesExpression = candidatesExpression;
+ 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;
+ }
public boolean isBlocking() {
return isBlocking;
}
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -212,6 +212,9 @@
}
Authentication authentication = Environment.getFromCurrent(Authentication.class);
assignee = authentication.getUserId();
+ if (assignee==null) {
+ throw new JbpmException("no currently authenticated user");
+ }
}
// comments /////////////////////////////////////////////////////////////////
@@ -286,6 +289,10 @@
public boolean equals(Object o) {
return EqualsUtil.equals(this, o);
}
+
+ public String toString() {
+ return "Task("+name+")";
+ }
public String getLifeCycleResource() {
// the default lifecycle can be overridden in subclasses
@@ -374,8 +381,8 @@
public String getAssignee() {
return assignee;
}
- public void setAssignee(String assignedUserId) {
- this.assignee = assignedUserId;
+ public void setAssignee(String assigned) {
+ this.assignee = assigned;
}
public Swimlane getSwimlane() {
return swimlane;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -21,12 +21,15 @@
*/
package org.jbpm.pvm.internal.task;
-import java.io.ObjectStreamException;
+import java.util.ArrayList;
import java.util.List;
import org.hibernate.Query;
import org.jbpm.TaskQuery;
import org.jbpm.cmd.CommandService;
+import org.jbpm.env.Environment;
+import org.jbpm.identity.Group;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
import org.jbpm.pvm.internal.query.AbstractQuery;
import org.jbpm.pvm.internal.query.Page;
import org.jbpm.task.Task;
@@ -42,6 +45,9 @@
private static final String UNASSIGNED = "unassigned";
protected String assignee = null;
+ protected String candidate = null;
+
+ protected List<String> groupIds = null;
public TaskQueryImpl(CommandService commandService) {
super(commandService);
@@ -51,6 +57,11 @@
this.assignee = assignee;
return this;
}
+
+ public TaskQuery candidate(String userId) {
+ this.candidate = userId;
+ return this;
+ }
public TaskQuery unassigned() {
this.assignee = UNASSIGNED;
@@ -80,15 +91,38 @@
if ( (assignee!=UNASSIGNED) && (assignee!=null) ) {
query.setString("assignee", assignee);
}
+
+ if (groupIds!=null) {
+ query.setParameterList("groupIds", groupIds);
+ }
}
public String hql() {
StringBuffer hql = new StringBuffer();
- hql.append("select task ");
+ hql.append("select distinct task ");
hql.append("from ");
hql.append(TaskImpl.class.getName());
hql.append(" as task ");
+ if (candidate!=null) {
+ hql.append(", ");
+ hql.append(ParticipantImpl.class.getName());
+ hql.append(" as participant ");
+
+ appendWhereClause("participant.task = task ", hql);
+ appendWhereClause("participant.participation = 'candidate' ", hql);
+
+ IdentitySession identitySession = Environment.getFromCurrent(IdentitySession.class);
+ List<Group> groups = identitySession.findGroupsByUser(candidate);
+ if (!groups.isEmpty()) {
+ groupIds = new ArrayList<String>();
+ for (Group g: groups) {
+ groupIds.add(g.getId());
+ }
+ appendWhereClause("(participant.userId = '"+candidate+"' or participant.groupId in (:groupIds) ) ", hql);
+ }
+ }
+
if (assignee==UNASSIGNED) {
appendWhereClause("task.assignee is null ", hql);
} else if (assignee!=null) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskServiceImpl.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskServiceImpl.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -111,16 +111,20 @@
commandService.execute(new RemoveParticipantCmd(null, szimlaneDbid, identityRef, participation));
}
- public List<Task> getPersonalTaskList(String assignee, int firstResult, int maxResults) {
+ public List<Task> getPersonalTaskList(String userId, int firstResult, int maxResults) {
return createTaskQuery()
- .assignee(assignee)
+ .assignee(userId)
.orderDesc(TaskQuery.PROPERTY_PRIORITY)
.page(firstResult, maxResults)
.execute();
}
public List<Task> getGroupTaskList(String userId, int firstResult, int maxResults) {
- return null;
+ return createTaskQuery()
+ .candidate(userId)
+ .orderDesc(TaskQuery.PROPERTY_PRIORITY)
+ .page(firstResult, maxResults)
+ .execute();
}
public TaskQuery createTaskQuery() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -46,16 +46,16 @@
throw e;
}
- log.debug("begun hibernate transaction "+System.identityHashCode(transaction)+" on hibernate session "+System.identityHashCode(session));
+ if (log.isTraceEnabled()) log.trace("begun hibernate transaction "+System.identityHashCode(transaction)+" on hibernate session "+System.identityHashCode(session));
}
public void prepare() {
- log.debug("flushing hibernate session "+System.identityHashCode(session));
+ if (log.isTraceEnabled()) log.trace("flushing hibernate session "+System.identityHashCode(session));
session.flush();
}
public void commit() {
- log.debug("committing hibernate transaction "+System.identityHashCode(transaction));
+ if (log.isTraceEnabled()) log.trace("committing hibernate transaction "+System.identityHashCode(transaction));
try {
transaction.commit();
} finally {
@@ -64,12 +64,12 @@
}
private void closeSession() {
- log.debug("closing hibernate session "+System.identityHashCode(session));
+ if (log.isTraceEnabled()) log.trace("closing hibernate session "+System.identityHashCode(session));
session.close();
}
public void rollback() {
- log.debug("rolling back hibernate transaction "+System.identityHashCode(transaction));
+ if (log.isTraceEnabled()) log.trace("rolling back hibernate transaction "+System.identityHashCode(transaction));
try {
transaction.rollback();
} finally {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -56,6 +56,13 @@
public WireDefinition() {
}
+ public WireDefinition(WireDefinition other) {
+ this.descriptors = new HashMap<String, Descriptor>(other.descriptors);
+ this.descriptorNames = new HashMap<Class<?>, String>(other.descriptorNames);
+ this.useTypes = other.useTypes;
+ this.eagerInitNames = new ArrayList<String>(other.eagerInitNames);
+ }
+
public void addDescriptor(Descriptor descriptor) {
if (descriptor!=null) {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/identity/IdentityTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/identity/IdentityTest.java 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/identity/IdentityTest.java 2009-03-19 15:00:00 UTC (rev 4298)
@@ -39,19 +39,19 @@
identityService.createUser("johndoe", "John", "Doe");
- List<User> users = identityService.getUsers();
+ List<User> users = identityService.findUsers();
assertNotNull(users);
assertEquals(1, users.size());
User johndoe = users.get(0);
- assertEquals("johndoe", johndoe.getName());
+ assertEquals("johndoe", johndoe.getId());
assertEquals("John", johndoe.getGivenName());
assertEquals("Doe", johndoe.getFamilyName());
assertEquals("John Doe", johndoe.toString());
identityService.deleteUser("johndoe");
- assertEquals(0, identityService.getUsers().size());
+ assertEquals(0, identityService.findUsers().size());
}
public void testSingleGroup() throws Exception {
@@ -61,18 +61,18 @@
identityService.createUser("joesmoe", "Joe", "Smoe");
identityService.createUser("jackblack", "Jack", "Black");
- identityService.createGroup("redhat", Group.TYPE_ORGANISATION_UNIT);
- identityService.createGroup("jboss", Group.TYPE_ORGANISATION_UNIT, "redhat");
- identityService.createGroup("jbpm", Group.TYPE_ORGANISATION_UNIT, "jboss");
+ String redhatId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
+ String jbossId = identityService.createGroup("jboss", Group.TYPE_UNIT, "redhat");
+ String jbpmId = identityService.createGroup("jbpm", Group.TYPE_UNIT, "jboss");
- identityService.createMembership("johndoe", "jbpm", Group.TYPE_ORGANISATION_UNIT, "developer");
- identityService.createMembership("joesmoe", "jbpm", Group.TYPE_ORGANISATION_UNIT, "developer");
- identityService.createMembership("jackblack", "jboss", Group.TYPE_ORGANISATION_UNIT, "manager");
+ identityService.createMembership("johndoe", jbpmId, "developer");
+ identityService.createMembership("joesmoe", jbpmId, "developer");
+ identityService.createMembership("jackblack", jbossId, "manager");
- List<Group> groups = identityService.findGroupsByUserAndGroupType("jackblack", Group.TYPE_ORGANISATION_UNIT);
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("jackblack", Group.TYPE_UNIT);
assertEquals(1, groups.size());
Group group = groups.get(0);
- assertEquals("jboss", group.getName());
+ assertEquals("group://unit/jboss", group.getId());
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -29,13 +29,15 @@
<check-problems />
<save />
</deployer-manager>
-
+
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine"
write-context="">
<script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
</script-manager>
+
+ <authentication />
<job-executor auto-start="false" />
@@ -54,7 +56,6 @@
</process-engine-context>
<transaction-context>
- <hibernate-session />
<transaction />
<pvm-db-session />
<job-db-session />
@@ -62,6 +63,7 @@
<message-session />
<timer-session />
<history-session />
+ <hibernate-session />
<identity-session />
</transaction-context>
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -10,7 +10,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_" />
+ <property name="id" column="ID_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
@@ -44,6 +44,7 @@
</id>
<version name="dbversion" column="DBVERSION_" />
+ <property name="id" column="ID_" />
<property name="name" column="NAME_" />
<property name="type" column="TYPE_" />
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -19,8 +19,12 @@
<property name="dueDateDuration" column="DUEDATE_"/>
<property name="isBlocking" column="BLOCK_"/>
<property name="isSignalling" column="SIGNAL_"/>
- <property name="assigneeExpression" column="ASSIGNEE_EXPR_"/>
- <property name="candidatesExpression" column="CANDIDATES_EXPR_"/>
+ <property name="assigneeExpression" column="ASS_EXPR_"/>
+ <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
+ <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
+ <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
+ <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
+ <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignerDescriptor"
column="ASSIGNER_DESCR_"
@@ -111,8 +115,8 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="identityType" column="IDENTITYTYPE_"/>
- <property name="identityId" column="IDENTITYID_"/>
+ <property name="groupId" column="GROUPID_"/>
+ <property name="userId" column="USERID_"/>
<property name="participation" column="PARTICIPATION_" />
<many-to-one name="task"
@@ -154,6 +158,11 @@
column="SWIMLANEDEF_"
foreign-key="FK_SWIMLANE_DEF" />
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="FK_SWIMLANE_EXEC" />
+
<set name="participants" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
<one-to-many class="ParticipantImpl" />
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -33,13 +33,15 @@
<check-problems />
<save />
</deployer-manager>
-
+
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine"
write-context="">
<script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
</script-manager>
+
+ <authentication />
<job-executor auto-start="false" />
@@ -58,7 +60,6 @@
</process-engine-context>
<transaction-context>
- <hibernate-session />
<transaction />
<pvm-db-session />
<job-db-session />
@@ -66,6 +67,7 @@
<message-session />
<timer-session />
<history-session />
+ <hibernate-session />
<identity-session />
</transaction-context>
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-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -19,8 +19,12 @@
<property name="dueDateDuration" column="DUEDATE_"/>
<property name="isBlocking" column="BLOCK_"/>
<property name="isSignalling" column="SIGNAL_"/>
- <property name="assigneeExpression" column="ASSIGNEE_EXPR_"/>
- <property name="candidatesExpression" column="CANDIDATES_EXPR_"/>
+ <property name="assigneeExpression" column="ASS_EXPR_"/>
+ <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
+ <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
+ <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
+ <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
+ <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignerDescriptor"
column="ASSIGNER_DESCR_"
@@ -111,8 +115,8 @@
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="identityType" column="IDENTITYTYPE_"/>
- <property name="identityId" column="IDENTITYID_"/>
+ <property name="groupId" column="GROUPID_"/>
+ <property name="userId" column="USERID_"/>
<property name="participation" column="PARTICIPATION_" />
<many-to-one name="task"
@@ -154,6 +158,11 @@
column="SWIMLANEDEF_"
foreign-key="FK_SWIMLANE_DEF" />
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="FK_SWIMLANE_EXEC" />
+
<set name="participants" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
<one-to-many class="ParticipantImpl" />
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-03-19 13:55:00 UTC (rev 4297)
+++ jbpm4/trunk/pom.xml 2009-03-19 15:00:00 UTC (rev 4298)
@@ -421,6 +421,9 @@
<module>modules/userguide</module>
<module>modules/distro</module>
</modules>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
<build>
<plugins>
<plugin>
More information about the jbpm-commits
mailing list