JBoss JBPM SVN: r5314 - in jbpm4/trunk/modules/distro/src/main/files/jboss: config.jboss5/deploy/jbpm and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-16 20:13:45 -0400 (Thu, 16 Jul 2009)
New Revision: 5314
Added:
jbpm4/trunk/modules/distro/src/main/files/jboss/config.jboss5/deploy/jbpm/jbpm-destinations-service.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
Log:
[JBPM-2210] Add support for AS 5.1.x
provide jboss messaging descriptor
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-07-16 18:16:26 UTC (rev 5313)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-07-17 00:13:45 UTC (rev 5314)
@@ -202,12 +202,6 @@
</fileset>
</copy>
- <copy todir="${jboss.server.config.dir}/deployers/jbpm.deployer" overwrite="true">
- <fileset dir="${jbpm.home}/lib">
- <include name="jbpm-spi.jar"/>
- </fileset>
- </copy>
-
<mkdir dir="${jboss.home}/docs/examples/jbpm" />
<copy todir="${jboss.home}/docs/examples/jbpm" overwrite="true">
<fileset dir="${jbpm.home}/jboss/datasources" />
@@ -238,6 +232,12 @@
<include name="jbpm-jboss5.jar"/>
</fileset>
</copy>
+
+ <copy todir="${jboss.server.config.dir}/deployers/jbpm.deployer" overwrite="true">
+ <fileset dir="${jbpm.home}/lib">
+ <include name="jbpm-spi.jar"/>
+ </fileset>
+ </copy>
</target>
<target name="internal.install.idm.into.jboss" if="jbpm.identity.idm">
Added: jbpm4/trunk/modules/distro/src/main/files/jboss/config.jboss5/deploy/jbpm/jbpm-destinations-service.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.jboss5/deploy/jbpm/jbpm-destinations-service.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.jboss5/deploy/jbpm/jbpm-destinations-service.xml 2009-07-17 00:13:45 UTC (rev 5314)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ This file defines the default queue that jBPM ships with. You can add other
+ destinations to this file, or you can create other *-service.xml files to
+ contain your application's destinations.
+-->
+<server>
+
+ <!--
+ The default command queue. This destination is used by the
+ JmsMessageSession.
+ -->
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=JbpmCommandQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">
+ jboss.messaging:service=ServerPeer
+ </depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+</server>
\ No newline at end of file
15 years, 3 months
JBoss JBPM SVN: r5313 - in jbpm4/trunk: modules/devguide and 6 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-16 14:16:26 -0400 (Thu, 16 Jul 2009)
New Revision: 5313
Added:
jbpm4/trunk/modules/integration/report/.classpath
jbpm4/trunk/modules/integration/report/.project
Modified:
jbpm4/trunk/
jbpm4/trunk/modules/devguide/.project
jbpm4/trunk/modules/distro/.project
jbpm4/trunk/modules/integration/
jbpm4/trunk/modules/integration/form-plugin/
jbpm4/trunk/modules/integration/graphView-plugin/
jbpm4/trunk/modules/integration/report/
jbpm4/trunk/modules/migration/
Log:
supply missing eclipse project files
Property changes on: jbpm4/trunk
___________________________________________________________________
Name: svn:ignore
- *.iml
profiles.xml
target
+ *.iml
profiles.xml
target
.settings
Modified: jbpm4/trunk/modules/devguide/.project
===================================================================
--- jbpm4/trunk/modules/devguide/.project 2009-07-16 16:17:22 UTC (rev 5312)
+++ jbpm4/trunk/modules/devguide/.project 2009-07-16 18:16:26 UTC (rev 5313)
@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
Modified: jbpm4/trunk/modules/distro/.project
===================================================================
--- jbpm4/trunk/modules/distro/.project 2009-07-16 16:17:22 UTC (rev 5312)
+++ jbpm4/trunk/modules/distro/.project 2009-07-16 18:16:26 UTC (rev 5313)
@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
Property changes on: jbpm4/trunk/modules/integration
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
Property changes on: jbpm4/trunk/modules/integration/form-plugin
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
Property changes on: jbpm4/trunk/modules/integration/graphView-plugin
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
Property changes on: jbpm4/trunk/modules/integration/report
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
Added: jbpm4/trunk/modules/integration/report/.classpath
===================================================================
--- jbpm4/trunk/modules/integration/report/.classpath (rev 0)
+++ jbpm4/trunk/modules/integration/report/.classpath 2009-07-16 18:16:26 UTC (rev 5313)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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/report/.project
===================================================================
--- jbpm4/trunk/modules/integration/report/.project (rev 0)
+++ jbpm4/trunk/modules/integration/report/.project 2009-07-16 18:16:26 UTC (rev 5313)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-console-reports</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>
Property changes on: jbpm4/trunk/modules/migration
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
15 years, 3 months
JBoss JBPM SVN: r5312 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/history and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-16 12:17:22 -0400 (Thu, 16 Jul 2009)
New Revision: 5312
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetailQuery.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryDetailQueryImpl.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java
Log:
JBPM-2398 api preparations for task details query
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java 2009-07-16 11:07:23 UTC (rev 5311)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/HistoryService.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -24,6 +24,7 @@
import java.util.Map;
import org.jbpm.api.history.HistoryActivityInstanceQuery;
+import org.jbpm.api.history.HistoryDetailQuery;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
import org.jbpm.api.history.HistoryTaskQuery;
@@ -44,6 +45,9 @@
/** search in history task information */
HistoryTaskQuery createHistoryTaskQuery();
+ /** search in history details */
+ HistoryDetailQuery createHistoryDetailQuery();
+
/** returns the average duration in milliseconds for each activity in the given process definition */
Map<String, Long> avgDurationPerActivity(String processDefinitionId);
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetailQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetailQuery.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetailQuery.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -0,0 +1,70 @@
+/*
+ * 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.api.history;
+
+import java.util.Date;
+import java.util.List;
+
+
+/** query for task comments, task assignments and so on.
+ *
+ * @author Tom Baeyens
+ */
+public interface HistoryDetailQuery {
+
+ /** userId property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_USERID = "userId";
+ /** time property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_TIME = "time";
+
+ /** only select details for the given processInstanceId */
+ HistoryDetailQuery processInstanceId(String processInstanceId);
+
+ /** only select details for the given historyActivityInstanceId */
+ HistoryDetailQuery processActivityInstanceId(String historyActivityInstanceId);
+
+ /** only select details for the given taskId */
+ HistoryDetailQuery taskId(String taskId);
+
+ /** only select details after the given time */
+ HistoryDetailQuery timeAfter(Date time);
+
+ /** only select details before the given time */
+ HistoryDetailQuery timeBefore(Date time);
+
+ /** only select activity instances for the given activity
+ * (this usually used in combination with {@link #processDefinitionId(String)}) */
+ HistoryDetailQuery taskComments();
+
+ /** order selected process definitions descending for certain {@link #PROPERTY_USERID properties} */
+ HistoryDetailQuery orderDesc(String property);
+
+ /** select a specific page in the result set */
+ HistoryDetailQuery page(int firstResult, int maxResults);
+
+ /** execute the query and obtain the list of {@link HistoryDetail}s */
+ List<HistoryDetail> list();
+
+ /** execute the query and obtain the unique {@link HistoryDetail} */
+ HistoryDetail uniqueResult();
+
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryDetailQuery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
+import org.jbpm.pvm.internal.session.DbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CreateHistoryDetailQueryCmd implements Command<HistoryDetailQueryImpl> {
+
+ private static final long serialVersionUID = 1L;
+
+ public HistoryDetailQueryImpl execute(Environment environment) throws Exception {
+ return environment.get(DbSession.class).createHistoryDetailQuery();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-07-16 11:07:23 UTC (rev 5311)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -44,6 +44,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
@@ -417,7 +418,11 @@
public HistoryActivityInstanceQueryImpl createHistoryActivityInstanceQuery() {
return new HistoryActivityInstanceQueryImpl();
}
-
+
+ public HistoryDetailQueryImpl createHistoryDetailQuery() {
+ return new HistoryDetailQueryImpl();
+ }
+
public JobQueryImpl createJobQuery() {
return new JobQueryImpl();
}
@@ -441,5 +446,4 @@
).setLong("taskDbid", taskDbid)
.list();
}
-
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryDetailQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryDetailQueryImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryDetailQueryImpl.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.query;
+
+import java.util.Date;
+import java.util.List;
+
+import org.hibernate.Query;
+import org.jbpm.api.history.HistoryDetail;
+import org.jbpm.api.history.HistoryDetailQuery;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryDetailQueryImpl extends AbstractQuery implements HistoryDetailQuery {
+
+ @Override
+ protected void applyParameters(Query query) {
+ }
+
+ @Override
+ public String hql() {
+ return null;
+ }
+
+ public List<HistoryDetail> list() {
+ return null;
+ }
+
+ public HistoryDetailQuery orderDesc(String property) {
+ return null;
+ }
+
+ public HistoryDetailQuery page(int firstResult, int maxResults) {
+ return null;
+ }
+
+ public HistoryDetailQuery processActivityInstanceId(String historyActivityInstanceId) {
+ return null;
+ }
+
+ public HistoryDetailQuery processInstanceId(String processInstanceId) {
+ return null;
+ }
+
+ public HistoryDetailQuery taskComments() {
+ return null;
+ }
+
+ public HistoryDetailQuery taskId(String taskId) {
+ return null;
+ }
+
+ public HistoryDetailQuery timeAfter(Date time) {
+ return null;
+ }
+
+ public HistoryDetailQuery timeBefore(Date time) {
+ return null;
+ }
+
+ public HistoryDetail uniqueResult() {
+ return null;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryDetailQueryImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-07-16 11:07:23 UTC (rev 5311)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -31,6 +31,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
@@ -73,21 +74,14 @@
/** create a task query */
TaskQueryImpl createTaskQuery();
-
- /** create a history process instance query */
HistoryProcessInstanceQueryImpl createHistoryProcessInstanceQuery();
-
- /** create a history activity instance query */
HistoryActivityInstanceQueryImpl createHistoryActivityInstanceQuery();
-
- List<HistoryComment> findCommentsByTaskId(String taskId);
-
- /** create a process instance query */
+ HistoryDetailQueryImpl createHistoryDetailQuery();
JobQueryImpl createJobQuery();
-
- /** create a deployment query */
DeploymentQueryImpl createDeploymentQuery();
+ List<HistoryComment> findCommentsByTaskId(String taskId);
+
/** the execution uniquely identified by the given executionKey.
* this method doesn't 'see' suspended executions. */
ClientExecution findExecutionById(String executionId);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java 2009-07-16 11:07:23 UTC (rev 5311)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/HistoryServiceImpl.java 2009-07-16 16:17:22 UTC (rev 5312)
@@ -27,15 +27,18 @@
import org.jbpm.api.HistoryService;
import org.jbpm.api.history.HistoryActivityInstanceQuery;
import org.jbpm.api.history.HistoryComment;
+import org.jbpm.api.history.HistoryDetailQuery;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
import org.jbpm.api.history.HistoryTaskQuery;
import org.jbpm.pvm.internal.cmd.CreateHistoryActivityInstanceQueryCmd;
+import org.jbpm.pvm.internal.cmd.CreateHistoryDetailQueryCmd;
import org.jbpm.pvm.internal.cmd.CreateHistoryProcessInstanceQueryCmd;
import org.jbpm.pvm.internal.cmd.CreateHistoryTaskQueryCmd;
import org.jbpm.pvm.internal.cmd.GetTaskCommentsCmd;
import org.jbpm.pvm.internal.query.AvgDurationPerActivityQueryCmd;
import org.jbpm.pvm.internal.query.ChoiceDistributionQueryCmd;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.HistoryTaskQueryImpl;
@@ -70,4 +73,10 @@
query.setCommandService(commandService);
return query;
}
+
+ public HistoryDetailQuery createHistoryDetailQuery() {
+ HistoryDetailQueryImpl query = commandService.execute(new CreateHistoryDetailQueryCmd());
+ query.setCommandService(commandService);
+ return query;
+ }
}
15 years, 3 months
JBoss JBPM SVN: r5311 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 07:07:23 -0400 (Thu, 16 Jul 2009)
New Revision: 5311
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
Log:
JBPM-2040 : added testcase to see if unstructured fork/join with one path leading to end-state is possible
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java 2009-07-16 09:26:01 UTC (rev 5310)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java 2009-07-16 11:07:23 UTC (rev 5311)
@@ -24,6 +24,7 @@
*/
package org.jbpm.test.activities;
+import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -69,5 +70,103 @@
assertProcessInstanceEnded(processInstanceId);
}
+
+
+ private static final String UNSTRUCTURED_CONCURRENT_PROCESS =
+ "<process name='unstructuredConcurrency' xmlns='http://jbpm.org/4.0/jpdl'>" +
+ "<start name='start'> " +
+ " <transition to='theFork'/> " +
+ "</start> " +
+ "<fork name='theFork'> " +
+ " <transition name='pathA' to='A'/> " +
+ " <transition name='pathB' to='B'/> " +
+ "</fork> " +
+ "<task name='A'> " +
+ " <transition to='theJoin'/> " +
+ "</task> " +
+ "<task name='B'> " +
+ " <transition to='end2'/> " +
+ "</task> " +
+ "<join name='theJoin'> " +
+ " <transition to='waitState'/> " +
+ "</join> " +
+ "<state name='waitState'>" +
+ " <transition to='end1' />" +
+ "</state>" +
+ "<end name='end1'/> " +
+ "<end name='end2'/> " +
+ "</process>";
+
+ // Test for JBPM-2040
+ public void testDefaultUnstructuredForkBehaviour() {
+ deployJpdlXmlString(UNSTRUCTURED_CONCURRENT_PROCESS);
+ String processInstanceId = executionService.startProcessInstanceByKey("unstructuredConcurrency").getId();
+
+ Task taskA = taskService.createTaskQuery().activityName("A").uniqueResult();
+ taskService.completeTask(taskA.getId());
+ assertActivitiesActive(processInstanceId, "waitState", "B");
+
+ Task taskB = taskService.createTaskQuery().activityName("B").uniqueResult();
+ taskService.completeTask(taskB.getId());
+ assertProcessInstanceEnded(processInstanceId);
+ }
+
+ //Test for JBPM-2040
+ public void testDefaultUnstructuredForkBehaviour2() {
+ deployJpdlXmlString(UNSTRUCTURED_CONCURRENT_PROCESS);
+ String processInstanceId = executionService.startProcessInstanceByKey("unstructuredConcurrency").getId();
+
+ Task taskB = taskService.createTaskQuery().activityName("B").uniqueResult();
+ taskService.completeTask(taskB.getId());
+ assertProcessInstanceEnded(processInstanceId);
+
+ assertTrue("There are still open tasks left",
+ taskService.createTaskQuery().processInstanceId(processInstanceId).list().isEmpty());
+ }
+
+ //Test for JBPM-2040
+ public void testUnstructuredForkBehaviourWhenEndingExecutionOnly() {
+ // We're now changing the default end behaviour to ending
+ // only the execution instead of the process instance
+ deployJpdlXmlString(addEndExecutionToConcurrentProcess());
+ String processInstanceId = executionService.startProcessInstanceByKey("unstructuredConcurrency").getId();
+
+ Task taskB = taskService.createTaskQuery().activityName("B").uniqueResult();
+ taskService.completeTask(taskB.getId());
+
+ assertProcessInstanceActive(processInstanceId);
+ assertActivityActive(processInstanceId, "A");
+
+ Task taskA = taskService.createTaskQuery().activityName("A").uniqueResult();
+ taskService.completeTask(taskA.getId());
+ assertActivityActive(processInstanceId, "waitState");
+ assertProcessInstanceActive(processInstanceId);
+
+ executionService.signalExecutionById(
+ executionService.findExecutionById(processInstanceId)
+ .findActiveExecutionIn("waitState").getId());
+ assertProcessInstanceEnded(processInstanceId);
+ }
+
+ //Test for JBPM-2040
+ public void testUnstructuredForkBehaviourWhenEndingExecutionOnly2() {
+ // We're now changing the default end behaviour to ending
+ // only the execution instead of the process instance
+ deployJpdlXmlString(addEndExecutionToConcurrentProcess());
+ String processInstanceId = executionService.startProcessInstanceByKey("unstructuredConcurrency").getId();
+
+ Task taskA = taskService.createTaskQuery().activityName("A").uniqueResult();
+ taskService.completeTask(taskA.getId());
+ assertActivitiesActive(processInstanceId, "B", "waitState");
+
+ Task taskB = taskService.createTaskQuery().activityName("B").uniqueResult();
+ taskService.completeTask(taskB.getId());
+ assertProcessInstanceActive(processInstanceId);
+ }
+
+ private String addEndExecutionToConcurrentProcess() {
+ return UNSTRUCTURED_CONCURRENT_PROCESS.replace("<end name='end1'/>", "<end name='end1' ends='execution'/>")
+ .replace("<end name='end2'/>", "<end name='end2' ends='execution'/>");
+ }
}
15 years, 3 months
JBoss JBPM SVN: r5310 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 05:26:01 -0400 (Thu, 16 Jul 2009)
New Revision: 5310
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
Log:
Test for JBPM-2297
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkTest.java 2009-07-16 09:26:01 UTC (rev 5310)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package org.jbpm.test.activities;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Joram Barrez
+ */
+public class ForkTest extends JbpmTestCase {
+
+ // Test for JBPM-2297
+ public void testBasicForkUsage() {
+ deployJpdlXmlString(
+ "<process name='sboxCreation' xmlns='http://jbpm.org/4.0/jpdl'>" +
+ "<start name='start'> " +
+ " <transition to='fork (review)'/> " +
+ "</start> " +
+ "<fork name='fork (review)'> " +
+ " <transition name='Reporting review' to='Review (risk)'/> " +
+ " <transition name='Risk review' to='Review (reporting)'/> " +
+ "</fork> " +
+ "<task candidate-groups='risk-dept' name='Review (risk)'> " +
+ " <transition name='Approve' to='join (approved)'/> " +
+ " <transition name='Reject' to='Rejected by Risk'/> " +
+ "</task> " +
+ "<task candidate-groups='reporting-dept' name='Review (reporting)'> " +
+ " <transition name='Approve' to='join (approved)'/> " +
+ " <transition name='Reject' to='Rejected by Reporting'/> " +
+ "</task> " +
+ "<join name='join (approved)'> " +
+ " <transition to='end1'/> " +
+ "</join> " +
+ "<end-cancel name='Rejected by Reporting'/> " +
+ "<end name='end1'/> " +
+ "<end-cancel name='Rejected by Risk'/> " +
+ "</process>");
+
+ String processInstanceId = executionService.startProcessInstanceByKey("sboxCreation").getId();
+ Task riskTask = taskService.createTaskQuery().activityName("Review (risk)").uniqueResult();
+ Task reportTask = taskService.createTaskQuery().activityName("Review (reporting)").uniqueResult();
+
+ taskService.completeTask(riskTask.getId(), "Approve");
+ taskService.completeTask(reportTask.getId(), "Reject");
+
+ assertProcessInstanceEnded(processInstanceId);
+ }
+
+}
15 years, 3 months
JBoss JBPM SVN: r5309 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/activity and 3 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 04:36:51 -0400 (Thu, 16 Jul 2009)
New Revision: 5309
Modified:
jbpm4/trunk/modules/distro/src/main/files/readme.html
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java
Log:
JBPM-2425: When taskService.completeTask(taskId, outcome) is called with an unexisting outcome, an exception is thrown instead of suspending the process.
Modified: jbpm4/trunk/modules/distro/src/main/files/readme.html
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/readme.html 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/distro/src/main/files/readme.html 2009-07-16 08:36:51 UTC (rev 5309)
@@ -34,8 +34,19 @@
guide are not guaranteed to be forward compatible.</td>
</tr>
</table>
+
+<h1>Release Notes for jBPM 4.1</h1>
+<h2>Changed functionality</h2>
+<ul>
+<li>
+ Calling <i>taskService.completeTask(String taskId, String outcome)</i>i> with an unexisting outcome will
+ throw an exception instead of suspending the process instance. (see <a href="https://jira.jboss.org/jira/browse/JBPM-2425">[JBPM-2425]</a>)
+</li>
+</ul>
+
+
<h1>Release Notes for jBPM 4.0 (GA)</h1>
<h2>Known Issues
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-07-16 08:36:51 UTC (rev 5309)
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.Map;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
@@ -130,11 +131,9 @@
}
} else {
// if a user specified outcome was provided and it doesn't
- // match with an outgoing transition name, then the process
- // instance is suspended. parked for admin intervention.
- log.info("No outcome named '" + signalName + "' was found."
- + "The process instance is now suspended.");
- ((ExecutionImpl)execution.getProcessInstance()).suspend();
+ // match with an outgoing transition name, then an exception is
+ // thrown since this is likely a programmatic error.
+ throw new JbpmException("No outcome named '" + signalName + "' was found.");
}
}
if (transition!=null) {
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-07-16 08:36:51 UTC (rev 5309)
@@ -199,6 +199,27 @@
return null;
}
+ public void assertNoOpenTasks(String processInstanceId) {
+ List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
+ assertTrue("There were still open tasks found for the process instance with id " +
+ processInstanceId + ". Current tasks are: " +
+ listAllOpenTasks(processInstanceId), tasks.isEmpty());
+ }
+
+ protected String listAllOpenTasks(String processInstanceId) {
+ List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstanceId).list();
+ StringBuilder result = new StringBuilder();
+ for (Task task : tasks) {
+ result.append("'" + task.getName() + "', ");
+ }
+
+ if (result.length() > 2) {
+ result.setLength(result.length() - 2); // remove the last ', '
+ }
+
+ return result.toString();
+ }
+
// execution helper methods //////////////////////////////////////////
public void assertExecutionEnded(String processInstanceId) {
@@ -262,7 +283,11 @@
for (String activeActivity : activeActivities) {
result.append("'" + activeActivity + "', ");
}
- result.setLength(result.length() - 2); // remove the last ', '
+
+ if (result.length() > 2) {
+ result.setLength(result.length() - 2); // remove the last ', '
+ }
+
return result.toString();
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-07-16 08:36:51 UTC (rev 5309)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
@@ -75,32 +76,4 @@
assertEquals(0, processInstances.size());
}
- //Additonal test case for JBPM-2319
- public void testProcessInstanceEndState() {
- deployJpdlXmlString(
- "<process name='testProcess'>" +
- " <start name='start'>" +
- " <transition to='task'/>" +
- " </start>" +
- " <task name='task' >" +
- " <transition name='Reject (risk)' to='Rejected by risk' />" +
- " <transition name='Reject (reporting)' to='Rejected by reporting' />" +
- " </task>" +
- " <end name='Rejected by risk' />" +
- " <end name='Rejected by reporting' />" +
- "</process>"
- );
-
- ProcessInstance pi = executionService.startProcessInstanceByKey("testProcess");
- Task task = taskService.createTaskQuery()
- .processInstanceId(pi.getId())
- .uniqueResult();
- taskService.completeTask(task.getId(), "TYPO");
-
- HistoryProcessInstance historyPi = historyService.createHistoryProcessInstanceQuery()
- .processInstanceId(pi.getId())
- .uniqueResult();
- assertEquals(HistoryProcessInstance.STATE_ACTIVE, historyPi.getState());
- }
-
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java 2009-07-16 08:36:51 UTC (rev 5309)
@@ -57,6 +57,7 @@
Ids ids = deployAndStartProcessInstance();
taskService.completeTask(ids.taskId);
assertExecutionInOneOrMoreActivitiesActive(ids.processInstanceId, "stateOne", "stateTwo");
+ assertNoOpenTasks(ids.processInstanceId);
assertHistoryTaskCreated(ids.processInstanceId, null);
}
@@ -75,7 +76,7 @@
}
}
- public void testCompletionWithInvalidId() {
+ public void testCompletionWithInvalidTaskId() {
try {
taskService.completeTask(Long.toString(-123456789L));
fail();
@@ -87,17 +88,38 @@
public void testCompletionWithOutcome() {
Ids ids = deployAndStartProcessInstance();
taskService.completeTask(ids.taskId, "one");
+
assertActivityActive(ids.processInstanceId, "stateOne");
assertNotActivityActive(ids.processInstanceId, "stateTwo");
+
+ assertNoOpenTasks(ids.processInstanceId);
assertHistoryTaskCreated(ids.processInstanceId, "one");
}
+ // Test for JBPM-2425
+ public void testCompletionWithInvalidOutcome() {
+ Ids ids = deployAndStartProcessInstance();
+
+ try {
+ taskService.completeTask(ids.taskId, "doesn't exist");
+ fail();
+ } catch (JbpmException e) {
+ // exception should be thrown
+ }
+
+ // Task should still be open now (rollback in db)
+ assertNotNull("After completion with an invalid outcome, the task should remain unchanged",
+ taskService.createTaskQuery().processInstanceId(ids.processInstanceId).uniqueResult());
+ }
+
public void testCompletionWithVariables() {
Ids ids = deployAndStartProcessInstance();
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("testVar", "testValue");
taskService.completeTask(ids.taskId, vars);
+
assertEquals("testValue", executionService.getVariable(ids.processInstanceId, "testVar"));
+ assertNoOpenTasks(ids.processInstanceId);
assertHistoryTaskCreated(ids.processInstanceId, null);
}
@@ -106,8 +128,11 @@
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("testVar", "testValue");
taskService.completeTask(ids.taskId, "two",vars);
+
assertEquals("testValue", executionService.getVariable(ids.processInstanceId, "testVar"));
assertActivityActive(ids.processInstanceId, "stateTwo");
+
+ assertNoOpenTasks(ids.processInstanceId);
assertHistoryTaskCreated(ids.processInstanceId, "two");
}
@@ -123,13 +148,13 @@
return result;
}
- private void assertHistoryTaskCreated(String executionId, String outcome) {
+ private void assertHistoryTaskCreated(String executionId, String historicalOutcome) {
HistoryTask historyTask = historyService.createHistoryTaskQuery()
.executionId(executionId)
.uniqueResult();
assertNotNull(historyTask);
- if (outcome != null) {
- assertEquals(outcome, historyTask.getOutcome());
+ if (historicalOutcome != null) {
+ assertEquals(historicalOutcome, historyTask.getOutcome());
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java 2009-07-16 07:26:11 UTC (rev 5308)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskOutcomesTest.java 2009-07-16 08:36:51 UTC (rev 5309)
@@ -24,6 +24,7 @@
import java.util.HashSet;
import java.util.Set;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -139,15 +140,13 @@
.assignee("johndoe")
.uniqueResult();
- taskService.completeTask(task.getId(), "Refused");
+ try {
+ taskService.completeTask(task.getId(), "Refused");
+ fail();
+ } catch (JbpmException e) {
+ // exception should be thrown
+ }
- processInstance = executionService.
- createProcessInstanceQuery()
- .suspended()
- .processInstanceId(processInstance.getId())
- .uniqueResult();
-
- assertTrue(processInstance.isSuspended());
}
public void testGetOutcomesNoTransition() {
15 years, 3 months
JBoss JBPM SVN: r5308 - jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 03:26:11 -0400 (Thu, 16 Jul 2009)
New Revision: 5308
Modified:
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
Log:
After having to look up again on how to run the Spring tests, I added it to the cfg file now.
Modified: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml 2009-07-16 07:24:19 UTC (rev 5307)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/test/spring/jbpm.cfg.xml 2009-07-16 07:26:11 UTC (rev 5308)
@@ -1,3 +1,9 @@
+<!--
+To run the test-db suite with Spring:
+
+mvn clean test -Djbpm.test.cfg.type=spring-test -Djbpm.test.cfg.resource=org/jbpm/test/spring/jbpm.cfg.xml -Djbpm.test.cfg.applicationContext=org/jbpm/test/spring/applicationContext.xml
+ -->
+
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
15 years, 3 months
JBoss JBPM SVN: r5307 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/cfg and 10 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-16 03:24:19 -0400 (Thu, 16 Jul 2009)
New Revision: 5307
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/UserProvidedEnvironmentObject.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/UserProvidedAuthenticationTest.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Authentication.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/AuthenticationFilter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ProvidedAuthentication.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/WireObject.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AuthenticationBinding.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.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/cfg/SpringConfiguration.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AbstractServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ExecutionEagerLoadingTest.java
Log:
JBPM-2417 first part of user provided authentication through service api
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -136,4 +136,11 @@
public ProcessEngine buildProcessEngine() {
return impl.buildProcessEngine();
}
+
+ /** provides the hibernate session factory programmatically.
+ * The hibernateSessionFactory parameter is of type Object to
+ * prevent a dependency of the API on hibernate directly.*/
+ public Configuration setHibernateSessionFactory(Object hibernateSessionFactory){
+ return impl.setHibernateSessionFactory(hibernateSessionFactory);
+ }
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -21,7 +21,9 @@
*/
package org.jbpm.api;
+import java.sql.Connection;
+
/** central starting point for all process engine API
* interactions. This is a thread safe object so it can be
* kept in a static member field or in JNDI or something
@@ -62,4 +64,21 @@
/** retrieve and object defined in the process engine by name */
Object get(String name);
+
+ /** sets the authenticated user's id for the next invocation of
+ * a service method in the same thread.
+ * This method returns the process engine for convenient method concatenations. */
+ ProcessEngine setAuthenticatedUserId(String authenticatedUserId);
+
+ /** sets the hibernate session for the next invocation of
+ * a service method in the same thread.
+ * The hibernateSession parameter is of type Object to
+ * prevent a dependency of the API on hibernate directly.
+ * This method returns the process engine for convenient method concatenations. */
+ ProcessEngine setHibernateSession(Object hibernateSession);
+
+ /** sets the hibernate session for the next invocation of
+ * a service method in the same thread.
+ * This method returns the process engine for convenient method concatenations. */
+ ProcessEngine setJdbcConnection(Connection jdbcConnection);
}
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-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -24,6 +24,8 @@
import java.io.File;
import java.io.InputStream;
import java.net.URL;
+import java.sql.Connection;
+import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -41,7 +43,7 @@
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.JbpmConfigurationParser;
import org.jbpm.pvm.internal.env.PvmEnvironment;
-import org.jbpm.pvm.internal.env.WireObject;
+import org.jbpm.pvm.internal.env.UserProvidedEnvironmentObject;
import org.jbpm.pvm.internal.stream.FileStreamInput;
import org.jbpm.pvm.internal.stream.InputStreamInput;
import org.jbpm.pvm.internal.stream.ResourceStreamInput;
@@ -90,7 +92,10 @@
protected boolean isConfigured = false;
protected WireContext processEngineWireContext = new WireContext(new WireDefinition(), Context.CONTEXTNAME_PROCESS_ENGINE);
protected WireDefinition transactionWireDefinition = new WireDefinition();
-
+
+ protected ThreadLocal<List<UserProvidedEnvironmentObject>> userProvidedEnvironmentObjectsThreadLocal = new ThreadLocal<List<UserProvidedEnvironmentObject>>();
+ protected ThreadLocal<String> authenticatedUserIdThreadLocal = new ThreadLocal<String>();
+
public JbpmConfiguration() {
super((Configuration)null);
}
@@ -122,10 +127,11 @@
return this;
}
- public void setSessionFactory(Object sessionFactory) {
+ public Configuration setHibernateSessionFactory(Object hibernateSessionFactory) {
processEngineWireContext
.getWireDefinition()
- .addDescriptor(new ProvidedObjectDescriptor(sessionFactory, true));
+ .addDescriptor(new ProvidedObjectDescriptor(hibernateSessionFactory, true));
+ return this;
}
public Configuration setInputStream(InputStream inputStream) {
@@ -189,32 +195,28 @@
return processEngineWireContext.get(RepositoryService.class);
}
-
public Environment openEnvironment() {
- return openEnvironment(null);
- }
-
- public Environment openEnvironment(List<WireObject> txWireObjects) {
PvmEnvironment environment = new PvmEnvironment(this);
if (log.isTraceEnabled()) log.trace("opening " + environment);
- // set the classloader
- ClassLoader classLoader = processEngineWireContext.getClassLoader();
- if (classLoader != null) {
- environment.setClassLoader(classLoader);
- }
+ installAuthenticatedUserId(environment);
+ installProcessEngineContext(environment);
+ installTransactionContext(environment);
- // add the process-engine context
- environment.setContext(processEngineWireContext);
+ return environment;
+ }
- // add the transaction context
- WireDefinition usedWireDefinition = transactionWireDefinition;
- if (txWireObjects!=null) {
- usedWireDefinition = new WireDefinition(transactionWireDefinition, txWireObjects);
+ protected void installAuthenticatedUserId(Environment environment) {
+ String authenticatedUserId = authenticatedUserIdThreadLocal.get();
+ if (authenticatedUserId!=null) {
+ environment.setAuthenticatedUserId(authenticatedUserId);
+ authenticatedUserIdThreadLocal.set(null);
}
-
- WireContext transactionContext = new WireContext(usedWireDefinition, Context.CONTEXTNAME_TRANSACTION, environment, true);
+ }
+
+ protected void installTransactionContext(PvmEnvironment environment) {
+ WireContext transactionContext = new WireContext(transactionWireDefinition, Context.CONTEXTNAME_TRANSACTION, environment, true);
// add the environment block context to the environment
environment.setContext(transactionContext);
@@ -227,9 +229,11 @@
Environment.popEnvironment();
throw e;
}
+ }
- // if all went well, return the created environment
- return environment;
+ protected void installProcessEngineContext(PvmEnvironment environment) {
+ // add the process-engine context
+ environment.setContext(processEngineWireContext);
}
public void close() {
@@ -285,4 +289,28 @@
public WireDefinition getTransactionWireDefinition() {
return transactionWireDefinition;
}
+
+ public ProcessEngine setAuthenticatedUserId(String authenticatedUserId) {
+ authenticatedUserIdThreadLocal.set(authenticatedUserId);
+ return this;
+ }
+
+ public ProcessEngine setHibernateSession(Object hibernateSession) {
+ addUserProvidedEnvironmentObject(new UserProvidedEnvironmentObject(hibernateSession, null, true));
+ return this;
+ }
+
+ public ProcessEngine setJdbcConnection(Connection jdbcConnection) {
+ addUserProvidedEnvironmentObject(new UserProvidedEnvironmentObject(jdbcConnection, null, true));
+ return this;
+ }
+
+ protected synchronized void addUserProvidedEnvironmentObject(UserProvidedEnvironmentObject userProvidedEnvironmentObject) {
+ List<UserProvidedEnvironmentObject> environmentObjects = userProvidedEnvironmentObjectsThreadLocal.get();
+ if (environmentObjects==null) {
+ environmentObjects = new ArrayList<UserProvidedEnvironmentObject>();
+ userProvidedEnvironmentObjectsThreadLocal.set(environmentObjects);
+ }
+ environmentObjects.add(userProvidedEnvironmentObject);
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -25,12 +25,13 @@
import java.util.List;
import org.jbpm.api.ProcessEngine;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Context;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.env.SpringContext;
-import org.jbpm.pvm.internal.env.WireObject;
+import org.jbpm.pvm.internal.env.UserProvidedEnvironmentObject;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
import org.springframework.context.ApplicationContext;
@@ -46,122 +47,89 @@
*
* @author Andries Inze
*/
-public class SpringConfiguration extends JbpmConfiguration implements
- EnvironmentFactory, ProcessEngine, ApplicationContextAware {
+public class SpringConfiguration extends JbpmConfiguration implements EnvironmentFactory, ProcessEngine, ApplicationContextAware {
- private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(SpringConfiguration.class.getName());
+
+ private static final long serialVersionUID = 1L;
- private ApplicationContext applicationContext;
+ private ApplicationContext applicationContext;
- private String jbpmConfigurationLocation;
+ private String jbpmConfigurationLocation;
- /**
- * Instantiates a new spring configuration.
- */
- public SpringConfiguration(String jbpmConfigurationLocation) {
- try {
- super.setInputStream(new ClassPathResource(
- jbpmConfigurationLocation).getInputStream());
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ /**
+ * Instantiates a new spring configuration.
+ */
+ public SpringConfiguration(String jbpmConfigurationLocation) {
+ try {
+ super.setInputStream(new ClassPathResource(jbpmConfigurationLocation).getInputStream());
+ } catch (IOException e) {
+ throw new RuntimeException(e);
}
+ }
- public SpringConfiguration() {
- // By jbpmTestCase
- }
+ public SpringConfiguration() {
+ // By jbpmTestCase
+ }
- @Override
- public ProcessEngine buildProcessEngine() {
- if (applicationContext == null) {
- applicationContext = new ClassPathXmlApplicationContext(System
- .getProperty("jbpm.test.cfg.applicationContext"));
- }
-
- return super.buildProcessEngine();
+ @Override
+ public ProcessEngine buildProcessEngine() {
+ if (applicationContext == null) {
+ applicationContext = new ClassPathXmlApplicationContext(System.getProperty("jbpm.test.cfg.applicationContext"));
}
- /**
- * {@inheritDoc)
+ return super.buildProcessEngine();
+ }
- */
- @Override
- public Environment openEnvironment(List<WireObject> txWireObjects) {
+ public Environment openEnvironment() {
+ PvmEnvironment environment = new PvmEnvironment(this);
- PvmEnvironment environment = new PvmEnvironment(this);
+ if (log.isTraceEnabled())
+ log.trace("opening jbpm-spring" + environment);
- // FIXME: All beneath should be a super call
+ environment.setContext(new SpringContext(applicationContext));
- // set the classloader
- ClassLoader classLoader = processEngineWireContext.getClassLoader();
- if (classLoader != null) {
- environment.setClassLoader(classLoader);
- }
+ installAuthenticatedUserId(environment);
+ installProcessEngineContext(environment);
+ installTransactionContext(environment);
- // add the process-engine context
- environment.setContext(new SpringContext(applicationContext));
- environment.setContext(processEngineWireContext);
+ return environment;
+ }
- // add the transaction context
- WireDefinition usedWireDefinition = transactionWireDefinition;
- if (txWireObjects != null) {
- usedWireDefinition = new WireDefinition(transactionWireDefinition,
- txWireObjects);
- }
-
- WireContext transactionContext = new WireContext(usedWireDefinition,
- Context.CONTEXTNAME_TRANSACTION, environment, true);
- // add the environment block context to the environment
- environment.setContext(transactionContext);
-
- Environment.pushEnvironment(environment);
- try {
- // finish the creation of the environment wire context
- transactionContext.create();
-
- } catch (RuntimeException e) {
- Environment.popEnvironment();
- throw e;
- }
-
- // if all went well, return the created environment
- return environment;
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T get(Class<T> type) {
+ String[] names = applicationContext.getBeanNamesForType(type);
+ if (names.length == 1) {
+ return (T) applicationContext.getBean(names[0]);
}
- @SuppressWarnings("unchecked")
- @Override
- public <T> T get(Class<T> type) {
- String[] names = applicationContext.getBeanNamesForType(type);
- if (names.length == 1) {
- return (T) applicationContext.getBean(names[0]);
- }
+ return super.get(type);
+ }
- return super.get(type);
+ @Override
+ public Object get(String key) {
+ if (applicationContext.containsBean(key)) {
+ return applicationContext.getBean(key);
}
- @Override
- public Object get(String key) {
- if (applicationContext.containsBean(key)) {
- return applicationContext.getBean(key);
- }
+ return super.get(key);
+ }
- return super.get(key);
- }
+ /**
+ * {@inheritDoc)
- /**
- * {@inheritDoc)
+ */
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
- */
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- /**
- * Gets the application context.
- *
- * @return the application context
- */
- public ApplicationContext getApplicationContext() {
- return applicationContext;
- }
+ /**
+ * Gets the application context.
+ *
+ * @return the application context
+ */
+ public ApplicationContext getApplicationContext() {
+ return applicationContext;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -21,10 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import java.util.List;
-import org.jbpm.pvm.internal.env.WireObject;
-
/**
* @author Tom Baeyens
*/
@@ -32,13 +29,14 @@
private static final long serialVersionUID = 1L;
- protected List<WireObject> txWireObjects;
+ String authenticatedUserId;
- public List<WireObject> getTxWireObjects() {
- return txWireObjects;
+
+ public String getAuthenticatedUserId() {
+ return authenticatedUserId;
}
- public void setTxWireObjects(List<WireObject> txWireObjects) {
- this.txWireObjects = txWireObjects;
+ public void setAuthenticatedUserId(String authenticatedUserId) {
+ this.authenticatedUserId = authenticatedUserId;
}
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Authentication.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Authentication.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Authentication.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -1,37 +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.env;
-
-/** knows how to get the userId (String) of the currently authenticated user.
- * @author Tom Baeyens */
-public class Authentication {
-
- static final ThreadLocal<String> userIdThreadLocal = new ThreadLocal<String>();
-
- public String getUserId() {
- return userIdThreadLocal.get();
- }
-
- public static void setUserId(String userId) {
- userIdThreadLocal.set(userId);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/AuthenticationFilter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/AuthenticationFilter.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/AuthenticationFilter.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -1,62 +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.env;
-
-import java.io.IOException;
-import java.security.Principal;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-
-/**
- * @author Tom Baeyens
- */
-public class AuthenticationFilter implements Filter {
-
- public void init(FilterConfig filterConfig) throws ServletException {
- }
-
- public void destroy() {
- }
-
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- HttpServletRequest httpRequest = (HttpServletRequest)request;
- Principal userPrincipal = httpRequest.getUserPrincipal();
- if (userPrincipal!=null) {
- String userId = userPrincipal.getName();
- Authentication.setUserId(userId);
- try {
- chain.doFilter(request, response);
- } finally {
- Authentication.setUserId(null);
- }
- } else {
- chain.doFilter(request, response);
- }
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -38,7 +38,7 @@
private static final Log log = Log.getLog(BasicEnvironment.class.getName());
- protected String userId;
+ protected String authenticatedUserId;
protected Map<String, Context> contexts;
protected ArrayList<String> defaultSearchOrderList;
protected String[] defaultSearchOrder;
@@ -87,27 +87,14 @@
return getContext(Context.CONTEXTNAME_TRANSACTION);
}
- // userId methods ///////////////////////////////////////////////////////////
+ // authenticatedUserId //////////////////////////////////////////////////////
- public String getUserId() {
- // if the authenticated user was explicitely set
- if (userId!=null) {
- // return that one
- return userId;
- }
-
- // if an Authentication was specified
- Authentication authentication = get(Authentication.class);
- if (authentication!=null) {
- // let the authentication do the work
- return authentication.getUserId();
- }
-
- return null;
+ public String getAuthenticatedUserId() {
+ return authenticatedUserId;
}
- public void setUserId(String userId) {
- this.userId = userId;
+ public void setAuthenticatedUserId(String authenticatedUserId) {
+ this.authenticatedUserId = authenticatedUserId;
}
// classloader methods //////////////////////////////////////////////////////
@@ -115,6 +102,7 @@
public ClassLoader getClassLoader() {
return classLoader;
}
+
public void setClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -155,10 +155,10 @@
public abstract <T> T get(Class<T> type, String[] searchOrder);
/** get the authenticated user id */
- public abstract String getUserId();
+ public abstract String getAuthenticatedUserId();
/** set the authenticated user id */
- public abstract void setUserId(String userId);
+ public abstract void setAuthenticatedUserId(String authenticatedUserId);
/**
* closes the Environment by removing all its contexts.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -57,14 +57,6 @@
Environment openEnvironment();
/**
- * open a new Environment and pass in a list of objects
- * that must be placed/exposed in the transaction context.
- * The client is responsible for
- * closing the environment with {@link Environment#close()}.
- */
- Environment openEnvironment(List<WireObject> txWireObjects);
-
- /**
* closes this environment factory and cleans any allocated
* resources.
*/
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ProvidedAuthentication.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ProvidedAuthentication.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ProvidedAuthentication.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -1,40 +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.env;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProvidedAuthentication extends Authentication {
-
- protected String userId;
-
- public ProvidedAuthentication(String userId) {
- this.userId = userId;
- }
-
- public String getUserId() {
- return userId;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/UserProvidedEnvironmentObject.java (from rev 5297, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/WireObject.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/UserProvidedEnvironmentObject.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/UserProvidedEnvironmentObject.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -0,0 +1,62 @@
+/*
+ * 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.env;
+
+import org.jbpm.api.JbpmException;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UserProvidedEnvironmentObject {
+
+ protected String name;
+ protected Object object;
+ protected boolean isTypeExposed;
+
+ public UserProvidedEnvironmentObject(Object object) {
+ this(object, null, true);
+ }
+
+ public UserProvidedEnvironmentObject(Object object, String name) {
+ this(object, null, true);
+ }
+
+ public UserProvidedEnvironmentObject(Object object, String name, boolean isTypeExposed) {
+ if (object==null) {
+ throw new JbpmException("object is null");
+ }
+ this.object = object;
+ this.isTypeExposed = isTypeExposed;
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public Object getObject() {
+ return object;
+ }
+ public boolean isTypeExposed() {
+ return isTypeExposed;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/UserProvidedEnvironmentObject.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/env/WireObject.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/WireObject.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/WireObject.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -1,62 +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.env;
-
-import org.jbpm.api.JbpmException;
-
-
-/**
- * @author Tom Baeyens
- */
-public class WireObject {
-
- protected String name;
- protected Object object;
- protected boolean isTypeExposed;
-
- public WireObject(Object object) {
- this(object, null, true);
- }
-
- public WireObject(Object object, String name) {
- this(object, null, true);
- }
-
- public WireObject(Object object, String name, boolean isTypeExposed) {
- if (object==null) {
- throw new JbpmException("object is null");
- }
- this.object = object;
- this.isTypeExposed = isTypeExposed;
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
- public Object getObject() {
- return object;
- }
- public boolean isTypeExposed() {
- return isTypeExposed;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -59,7 +59,7 @@
Environment environment = Environment.getCurrent();
if (environment!=null) {
- this.userId = environment.getUserId();
+ this.userId = environment.getAuthenticatedUserId();
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AbstractServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AbstractServiceImpl.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AbstractServiceImpl.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -21,14 +21,7 @@
*/
package org.jbpm.pvm.internal.svc;
-import java.sql.Connection;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.pvm.internal.cmd.AbstractCommand;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.ProvidedAuthentication;
-import org.jbpm.pvm.internal.env.WireObject;
/**
@@ -37,7 +30,6 @@
public class AbstractServiceImpl {
protected CommandService commandService;
- protected ThreadLocal<List<WireObject>> contextThreadLocal;
public CommandService getCommandService() {
return commandService;
@@ -46,31 +38,4 @@
public void setCommandService(CommandService commandService) {
this.commandService = commandService;
}
-
- public void setUserId(String userId) {
- addTxWireObject(new WireObject(new ProvidedAuthentication(userId)));
- }
-
- public void setConnection(Connection connection) {
- addTxWireObject(new WireObject(connection));
- }
-
- protected synchronized void addTxWireObject(WireObject wireObject) {
- if (contextThreadLocal==null) {
- contextThreadLocal = new ThreadLocal<List<WireObject>>();
- }
- List<WireObject> txWireObjects = contextThreadLocal.get();
- if (txWireObjects==null) {
- txWireObjects = new ArrayList<WireObject>();
- contextThreadLocal.set(txWireObjects);
- }
- txWireObjects.add(wireObject);
- }
-
- protected void addTxWireObjects(AbstractCommand cmd) {
- if (contextThreadLocal!=null) {
- cmd.setTxWireObjects(contextThreadLocal.get());
- contextThreadLocal.set(null);
- }
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -51,14 +51,14 @@
execution.setState(Execution.STATE_ACTIVE_ROOT);
if (userId!=null) {
- environment.setUserId(userId);
+ environment.setAuthenticatedUserId(userId);
}
try {
CommandService commandService = environment.get(CommandService.class);
commandService.execute(command);
} finally {
if (userId!=null) {
- environment.setUserId(null);
+ environment.setAuthenticatedUserId(null);
}
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -44,7 +44,7 @@
if (messageSession==null) {
throw new JbpmException("no message session for executing command asynchronously");
}
- String userId = (propagateUserId ? environment.getUserId() : null);
+ String userId = (propagateUserId ? environment.getAuthenticatedUserId() : null);
messageSession.send(new AsyncCommandMessage(command, userId));
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -21,13 +21,12 @@
*/
package org.jbpm.pvm.internal.svc;
-import java.util.List;
-
-import org.jbpm.pvm.internal.cmd.AbstractCommand;
import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.env.Context;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.env.WireObject;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
/** sets up an environment around the execution of the command.
@@ -41,16 +40,9 @@
public <T> T execute(Command<T> command) {
Environment environment;
- if (command instanceof AbstractCommand) {
- AbstractCommand abstractCommand = (AbstractCommand) command;
- List<WireObject> txWireObjects = abstractCommand.getTxWireObjects();
- environment = environmentFactory.openEnvironment(txWireObjects);
-
- } else {
- environment = environmentFactory.openEnvironment();
- }
-
+ environment = environmentFactory.openEnvironment();
try {
+ injectEnvironmentObjects(environment);
return next.execute(command);
} finally {
@@ -58,6 +50,11 @@
}
}
+ protected void injectEnvironmentObjects(Environment environment) {
+ WireContext transactionContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
+ transactionContext.getWireDefinition().addDescriptor(new ProvidedObjectDescriptor());
+ }
+
public EnvironmentFactory getEnvironmentFactory() {
return environmentFactory;
}
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-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -28,7 +28,7 @@
import java.util.Map;
import java.util.Set;
-import org.jbpm.pvm.internal.env.WireObject;
+import org.jbpm.pvm.internal.env.UserProvidedEnvironmentObject;
import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
@@ -58,7 +58,7 @@
public WireDefinition() {
}
- public WireDefinition(WireDefinition other, List<WireObject> txWireObjects) {
+ public WireDefinition(WireDefinition other, List<UserProvidedEnvironmentObject> txWireObjects) {
if (other.descriptors!=null) {
this.descriptors = new HashMap<String, Descriptor>(other.descriptors);
}
@@ -70,11 +70,11 @@
}
this.useTypes = other.useTypes;
- for (WireObject wireObject: txWireObjects) {
+ for (UserProvidedEnvironmentObject userProvidedEnvironmentObject: txWireObjects) {
ProvidedObjectDescriptor descriptor = new ProvidedObjectDescriptor(
- wireObject.getObject(),
- wireObject.isTypeExposed(),
- wireObject.getName()
+ userProvidedEnvironmentObject.getObject(),
+ userProvidedEnvironmentObject.isTypeExposed(),
+ userProvidedEnvironmentObject.getName()
);
addDescriptor(descriptor);
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AuthenticationBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AuthenticationBinding.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AuthenticationBinding.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.wire.binding;
-
-import org.jbpm.pvm.internal.env.Authentication;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class AuthenticationBinding extends WireDescriptorBinding {
-
- public AuthenticationBinding() {
- super("authentication");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor objectDescriptor = new ObjectDescriptor();
-
- objectDescriptor.setClassName(Authentication.class.getName());
-
- return objectDescriptor;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-07-16 07:24:19 UTC (rev 5307)
@@ -23,8 +23,6 @@
<script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
</script-manager>
- <authentication />
-
<id-generator />
<types resource="jbpm.variable.types.xml" />
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-07-16 07:24:19 UTC (rev 5307)
@@ -38,7 +38,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.ScriptManagerBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.BusinessCalendarBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdGeneratorBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AuthenticationBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.MailTemplateBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.AddressResolverBinding"/>
<!-- hibernate bindings -->
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/UserProvidedAuthenticationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/UserProvidedAuthenticationTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/UserProvidedAuthenticationTest.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -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.test.auth;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UserProvidedAuthenticationTest extends JbpmTestCase {
+
+ public void testUserProvidedAuthentication() {
+ deployJpdlXmlString(
+ "<process name='UserProvidedAuthentication'>" +
+ " <start>" +
+ " <transition to='t' />" +
+ " </start>" +
+ " <task name='t' assignee='johndoe'>" +
+ " <transition to='s' />" +
+ " </task>" +
+ " <state name='s' />" +
+ "</process>"
+ );
+
+ Execution processInstance = executionService.startProcessInstanceByKey("UserProvidedAuthentication");
+
+ Task task = taskService.createTaskQuery()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult();
+
+ processEngine.setAuthenticatedUserId("jackblack");
+ taskService.addTaskComment(task.getId(), "the lord of the ring");
+
+ task.getId();
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/auth/UserProvidedAuthenticationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ExecutionEagerLoadingTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ExecutionEagerLoadingTest.java 2009-07-16 07:00:37 UTC (rev 5306)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/ExecutionEagerLoadingTest.java 2009-07-16 07:24:19 UTC (rev 5307)
@@ -21,8 +21,6 @@
*/
package org.jbpm.test.execution;
-import java.util.HashMap;
-
import org.jbpm.api.Execution;
import org.jbpm.test.JbpmTestCase;
15 years, 3 months
JBoss JBPM SVN: r5306 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/cmd and 2 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 03:00:37 -0400 (Thu, 16 Jul 2009)
New Revision: 5306
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
Log:
JBPM-2343: add convenience method complete task + set variables in one transaction. Also added test case for various usages of task completion.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-16 06:58:08 UTC (rev 5305)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-16 07:00:37 UTC (rev 5306)
@@ -78,6 +78,13 @@
* of a process execution, this operation may result in a process instance
* being triggered. */
void completeTask(String taskId);
+
+ /** Deletes this task and marks the related history task as completed. The
+ * given variables are created (or they overwrite existing values) as task
+ * variables. If the task was created in the context of a process execution,
+ * this operation may result in a process instance being triggered to
+ * continue.*/
+ void completeTask(String taskId, Map<String, Object> variables);
/** Deletes this task, marks the related history task as completed
* with the specified outcome. If the task was created in the context
@@ -85,6 +92,14 @@
* being triggered. The outcome in that case corresponds to an outgoing
* transition in the process. */
void completeTask(String taskId, String outcome);
+
+ /** Deletes this task, marks the related history task as completed with the
+ * specified outcome. The given variables are created (or they overwrite
+ * existing values) as task variables. If the task was created in the context
+ * of a process execution, this operation may result in a process instance
+ * being triggered. The outcome in that case corresponds to an outgoing
+ * transition in the process. */
+ void completeTask(String taskId, String outcome, Map<String, Object> variables);
/** Deletes the task without completing it.
* The history information is kept in the DB.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2009-07-16 06:58:08 UTC (rev 5305)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2009-07-16 07:00:37 UTC (rev 5306)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
+import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
@@ -42,7 +43,17 @@
public Void execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
+
+ if (taskId == null || "".equals(taskId)) {
+ throw new JbpmException("Cannot complete a task with a null or empty taskId");
+ }
+
TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
+
+ if (task == null) {
+ throw new JbpmException("No task with id " + taskId + " was found");
+ }
+
if (outcome==null) {
task.complete();
} else {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-07-16 06:58:08 UTC (rev 5305)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-07-16 07:00:37 UTC (rev 5306)
@@ -35,6 +35,7 @@
import org.jbpm.pvm.internal.cmd.AddReplyCommentCmd;
import org.jbpm.pvm.internal.cmd.AddTaskCommentCmd;
import org.jbpm.pvm.internal.cmd.AssignTaskCmd;
+import org.jbpm.pvm.internal.cmd.CompositeCmd;
import org.jbpm.pvm.internal.cmd.DeleteTaskCmd;
import org.jbpm.pvm.internal.cmd.CompleteTaskCmd;
import org.jbpm.pvm.internal.cmd.CreateTaskQueryCmd;
@@ -84,12 +85,25 @@
}
public void completeTask(String taskId) {
- completeTask(taskId, null);
+ commandService.execute(new CompleteTaskCmd(taskId, null));
}
+
+ public void completeTask(String taskId, Map<String, Object> variables) {
+ completeTask(taskId, null, variables);
+ }
public void completeTask(String taskId, String outcome) {
commandService.execute(new CompleteTaskCmd(taskId, outcome));
}
+
+ public void completeTask(String taskId, String outcome, Map<String, Object> variables) {
+ SetTaskVariablesCmd setTaskVariablesCmd = new SetTaskVariablesCmd(taskId);
+ setTaskVariablesCmd.setVariables(variables);
+ CompositeCmd compositeCmd = new CompositeCmd();
+ compositeCmd.addCommand(setTaskVariablesCmd);
+ compositeCmd.addCommand(new CompleteTaskCmd(taskId, outcome));
+ commandService.execute(compositeCmd);
+ }
public void addTaskParticipatingUser(String taskId, String userId, String participation) {
commandService.execute(new AddParticipationCmd(taskId, null, userId, null, participation));
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java 2009-07-16 07:00:37 UTC (rev 5306)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.taskactivity;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.history.HistoryTask;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * Testcase for the several ways of completing a task.
+ *
+ * @author jbarrez
+ */
+public class TaskCompletionTest extends JbpmTestCase {
+
+ private static final String PROCESS =
+ "<process name='taskCompletion'>" +
+ " <start>" +
+ " <transition to='theTask' />" +
+ " </start>" +
+ " <task name='theTask' assignee='johndoe'>" +
+ " <transition name='one' to='stateOne' />" +
+ " <transition name='two' to='stateTwo' />" +
+ " </task>" +
+ " <state name='stateOne'>" +
+ " <transition to='theEnd' />" +
+ " </state>" +
+ " <state name='stateTwo'>" +
+ " <transition to='theEnd' />" +
+ " </state>" +
+ " <end name='theEnd' />" +
+ "</process>";
+
+ public void testCompletionWithNoOutcome() {
+ Ids ids = deployAndStartProcessInstance();
+ taskService.completeTask(ids.taskId);
+ assertExecutionInOneOrMoreActivitiesActive(ids.processInstanceId, "stateOne", "stateTwo");
+ assertHistoryTaskCreated(ids.processInstanceId, null);
+ }
+
+ public void testCompletionWithNullOrEmptyId() {
+ try {
+ taskService.completeTask(null);
+ fail();
+ } catch (JbpmException e) {
+ // exception should be thrown
+ }
+ try {
+ taskService.completeTask("");
+ fail();
+ } catch (JbpmException e) {
+ // exception should be thrown
+ }
+ }
+
+ public void testCompletionWithInvalidId() {
+ try {
+ taskService.completeTask(Long.toString(-123456789L));
+ fail();
+ } catch (JbpmException e) {
+ // exception should be thrown
+ }
+ }
+
+ public void testCompletionWithOutcome() {
+ Ids ids = deployAndStartProcessInstance();
+ taskService.completeTask(ids.taskId, "one");
+ assertActivityActive(ids.processInstanceId, "stateOne");
+ assertNotActivityActive(ids.processInstanceId, "stateTwo");
+ assertHistoryTaskCreated(ids.processInstanceId, "one");
+ }
+
+ public void testCompletionWithVariables() {
+ Ids ids = deployAndStartProcessInstance();
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("testVar", "testValue");
+ taskService.completeTask(ids.taskId, vars);
+ assertEquals("testValue", executionService.getVariable(ids.processInstanceId, "testVar"));
+ assertHistoryTaskCreated(ids.processInstanceId, null);
+ }
+
+ public void testCompletionWithOutcomeAndVariables() {
+ Ids ids = deployAndStartProcessInstance();
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("testVar", "testValue");
+ taskService.completeTask(ids.taskId, "two",vars);
+ assertEquals("testValue", executionService.getVariable(ids.processInstanceId, "testVar"));
+ assertActivityActive(ids.processInstanceId, "stateTwo");
+ assertHistoryTaskCreated(ids.processInstanceId, "two");
+ }
+
+ /**
+ * Returns the process instance id and the taskId of the single task
+ * that is open after process start
+ */
+ private Ids deployAndStartProcessInstance() {
+ deployJpdlXmlString(PROCESS);
+ Ids result = new Ids();
+ result.processInstanceId = executionService.startProcessInstanceByKey("taskCompletion").getId();
+ result.taskId = taskService.createTaskQuery().processInstanceId(result.processInstanceId).uniqueResult().getId();
+ return result;
+ }
+
+ private void assertHistoryTaskCreated(String executionId, String outcome) {
+ HistoryTask historyTask = historyService.createHistoryTaskQuery()
+ .executionId(executionId)
+ .uniqueResult();
+ assertNotNull(historyTask);
+ if (outcome != null) {
+ assertEquals(outcome, historyTask.getOutcome());
+ }
+ }
+
+ /* Just a wrapper for two ids, since Java doesnt allow to return multiple values */
+ private class Ids {
+
+ private String processInstanceId;
+ private String taskId;
+
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/taskactivity/TaskCompletionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 3 months
JBoss JBPM SVN: r5305 - in jbpm4/trunk/modules: test-base/src/main/java/org/jbpm/test and 3 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-16 02:58:08 -0400 (Thu, 16 Jul 2009)
New Revision: 5305
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/JoinTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinBinding.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-concurrent/src/test/java/org/jbpm/test/concurrent/BasicUsageTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskPropertiesTest.java
Log:
Fix for JBPM-2407 + added some test convience methods
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinBinding.java 2009-07-16 06:18:49 UTC (rev 5304)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinBinding.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -31,6 +31,10 @@
* @author Tom Baeyens
*/
public class JoinBinding extends JpdlBinding {
+
+ private static final String MULTIPLICITY = "multiplicity";
+
+ private static final String LOCKMODE = "lockmode";
public JoinBinding() {
super("join");
@@ -38,22 +42,22 @@
public Object parse(Element element, Parse parse, Parser parser) {
JoinActivity joinActivity = new JoinActivity();
-
- if (element.hasAttribute("multiplicicty")) {
- String multiplicictyText = element.getAttribute("multiplicicty");
+
+ if (element.hasAttribute(MULTIPLICITY)) {
+ String multiplicictyText = element.getAttribute(MULTIPLICITY);
try {
int multiplicity = Integer.parseInt(multiplicictyText);
joinActivity.setMultiplicity(multiplicity);
} catch (NumberFormatException e) {
- parse.addProblem("multiplicity "+multiplicictyText+" is not a valid integer", element);
+ parse.addProblem(MULTIPLICITY + " " + multiplicictyText + " is not a valid integer", element);
}
}
- if (element.hasAttribute("lockmode")) {
- String lockModeText = element.getAttribute("lockmode");
+ if (element.hasAttribute(LOCKMODE)) {
+ String lockModeText = element.getAttribute(LOCKMODE);
LockMode lockMode = LockMode.parse(lockModeText.toUpperCase());
if (lockMode==null) {
- parse.addProblem("lockmode "+lockModeText+" is not a valid lock mode", element);
+ parse.addProblem(LOCKMODE + " " + lockModeText + " is not a valid lock mode", element);
} else {
joinActivity.setLockMode(lockMode);
}
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-07-16 06:18:49 UTC (rev 5304)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -36,7 +36,6 @@
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
-import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.task.Task;
/** base class for persistent jBPM tests.
@@ -203,7 +202,7 @@
// execution helper methods //////////////////////////////////////////
public void assertExecutionEnded(String processInstanceId) {
- assertNull("Error: a process instance with id " + processInstanceId + " was found",
+ assertNull("Error: an active process instance with id " + processInstanceId + " was found",
executionService.findProcessInstanceById(processInstanceId));
}
@@ -215,22 +214,49 @@
assertExecutionEnded(processInstance.getId());
}
- public void assertActiveActivity(String activityName, String executionId) {
- Execution execution = executionService.findExecutionById(executionId);
- assertTrue("The given execution (or any child execution) isn't in the activity '" + activityName
- + "' (current activities : " + listAllActiveActivites(executionId) + ")",
- execution.isActive(activityName));
+ public void assertProcessInstanceActive(String processInstanceId) {
+ assertNotNull("Error: an active process instance with id " + processInstanceId + " was not found",
+ executionService.findProcessInstanceById(processInstanceId));
}
- public void assertExecutionInActivity(String executionId, String activityName) {
+ public void assertActivityActive(String executionId, String activityName) {
assertTrue("The execution with id '" + executionId +
"' is not active in the activity '" + activityName + "'." +
"Current activitites are: " + listAllActiveActivites(executionId),
executionService.findExecutionById(executionId).isActive(activityName));
}
- private String listAllActiveActivites(String executionId) {
+ public void assertNotActivityActive(String executionId, String activityName) {
Execution execution = executionService.findExecutionById(executionId);
+ assertFalse(execution.isActive(activityName));
+ }
+
+ public void assertActivitiesActive(String executionId, String ... activityNames) {
+ for (String activityName : activityNames) {
+ assertActivityActive(executionId, activityName);
+ }
+ }
+
+ /** Checks if the given execution is active in one (or more) of the given activities */
+ public void assertExecutionInOneOrMoreActivitiesActive(String executionId, String ... activityNames) {
+
+ boolean inOneActivityActive = false;
+ Execution execution = executionService.findExecutionById(executionId);
+
+ for (String activityName : activityNames) {
+ if (execution.isActive(activityName)) {
+ inOneActivityActive = true;
+ }
+ }
+
+ assertTrue("The execution with id '" + executionId +
+ "' is not active in one of these activities: " + activityNames +
+ "Current activitites are: " + listAllActiveActivites(executionId),
+ inOneActivityActive);
+ }
+
+ protected String listAllActiveActivites(String executionId) {
+ Execution execution = executionService.findExecutionById(executionId);
Set<String> activeActivities = execution.findActiveActivityNames();
StringBuilder result = new StringBuilder();
for (String activeActivity : activeActivities) {
Modified: jbpm4/trunk/modules/test-concurrent/src/test/java/org/jbpm/test/concurrent/BasicUsageTest.java
===================================================================
--- jbpm4/trunk/modules/test-concurrent/src/test/java/org/jbpm/test/concurrent/BasicUsageTest.java 2009-07-16 06:18:49 UTC (rev 5304)
+++ jbpm4/trunk/modules/test-concurrent/src/test/java/org/jbpm/test/concurrent/BasicUsageTest.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -52,7 +52,7 @@
);
ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerTest");
- assertActiveActivity("wait", processInstance.getId());
+ assertActivityActive("wait", processInstance.getId());
Job job = managementService.createJobQuery()
.processInstanceId(processInstance.getId())
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/JoinTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/JoinTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/JoinTest.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.activities;
+
+import org.jbpm.api.Execution;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * Test case for basic functionality of Join activity.
+ *
+ * @author jbarrez
+ */
+public class JoinTest extends JbpmTestCase {
+
+
+ public void testMultiplicityLessThanIncomingTransitions() {
+ deployJpdlXmlString(
+ "<process name='multiplicityProcess'>" +
+ " <start>" +
+ " <transition to='theFork' />" +
+ " </start>" +
+ " <fork name='theFork'>" +
+ " <transition to='stateOne' />" +
+ " <transition to='stateTwo' />" +
+ " <transition to='stateThree' />" +
+ " </fork>" +
+ " <state name='stateOne'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <state name='stateTwo'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <state name='stateThree'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <join name='theJoin' multiplicity='2'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+ String processInstanceId = executionService.startProcessInstanceByKey("multiplicityProcess").getId();
+ assertActivitiesActive(processInstanceId, "stateOne", "stateTwo", "stateThree");
+
+ // Signalling 'stateOne' will should not end the process instance
+ Execution executionInStateOne = executionService.findExecutionById(processInstanceId)
+ .findActiveExecutionIn("stateOne");
+ executionService.signalExecutionById(executionInStateOne.getId());
+ assertProcessInstanceActive(processInstanceId);
+
+ // Signalling 'stateTwo' should end the process instance
+ Execution executionInStateTwo = executionService.findExecutionById(processInstanceId)
+ .findActiveExecutionIn("stateTwo");
+ executionService.signalExecutionById(executionInStateTwo.getId());
+ assertProcessInstanceEnded(processInstanceId);
+ }
+
+ public void testNoMultiplicity() {
+ deployJpdlXmlString(
+ "<process name='multiplicityProcess'>" +
+ " <start>" +
+ " <transition to='theFork' />" +
+ " </start>" +
+ " <fork name='theFork'>" +
+ " <transition to='stateOne' />" +
+ " <transition to='stateTwo' />" +
+ " <transition to='stateThree' />" +
+ " </fork>" +
+ " <state name='stateOne'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <state name='stateTwo'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <state name='stateThree'>" +
+ " <transition to='theJoin' />" +
+ " </state> " +
+ " <join name='theJoin'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ String processInstanceId = executionService.startProcessInstanceByKey("multiplicityProcess").getId();
+ assertActivitiesActive(processInstanceId, "stateOne", "stateTwo", "stateThree");
+
+ executionService.signalExecutionById(executionService.findExecutionById(processInstanceId).findActiveExecutionIn("stateOne").getId());
+ assertProcessInstanceActive(processInstanceId);
+ executionService.signalExecutionById(executionService.findExecutionById(processInstanceId).findActiveExecutionIn("stateTwo").getId());
+ assertProcessInstanceActive(processInstanceId);
+ executionService.signalExecutionById(executionService.findExecutionById(processInstanceId).findActiveExecutionIn("stateThree").getId());
+ assertProcessInstanceEnded(processInstanceId);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/JoinTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java 2009-07-16 06:18:49 UTC (rev 5304)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -71,7 +71,7 @@
ProcessInstance processInstance = executionService.startProcessInstanceByKey("mainProcess");
Task task = taskService.findPersonalTasks("johndoe").get(0);
taskService.completeTask(task.getId(), "nok");
- assertExecutionInActivity(processInstance.getId(), "update");
+ assertActivityActive(processInstance.getId(), "update");
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskPropertiesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskPropertiesTest.java 2009-07-16 06:18:49 UTC (rev 5304)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskPropertiesTest.java 2009-07-16 06:58:08 UTC (rev 5305)
@@ -30,6 +30,8 @@
/**
+ * Testcase to check if properties can be resolved through a {@link Task}.
+ *
* @author Joram Barrez
*/
public class TaskPropertiesTest extends JbpmTestCase {
15 years, 3 months