JBoss JBPM SVN: r4359 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/session and 48 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-30 13:03:18 -0400 (Mon, 30 Mar 2009)
New Revision: 4359
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/RepositoryService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/RepositorySession.java
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.repository.hbm.xml
Removed:
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/ProcessDeploymentRef.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/deploy/ParseJpdlDeployer.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/ParseJpdlBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetAttachment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/AssignFileTypeDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProblemsDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployExecutionService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/StartExecutionInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/Deployment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositoryService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProblemsBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProcessBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SaveBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/DeployerManagerDescriptor.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessAttachmentsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinitionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.execution.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.references/pvm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/jpdl.deployers.include.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part2.jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/jpdl.include.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java
jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDeployer.java
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlProcessDefinition.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml
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/cmd/DeployCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentProperty.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SavePolicy.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/BaseJbpmTestCase.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/cfg/ConfigurationTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
Log:
replaced ProcessService with RepositoryService
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,64 +21,31 @@
*/
package org.jbpm;
-import java.io.File;
import java.io.InputStream;
-import java.io.Serializable;
import java.net.URL;
-import java.util.List;
import java.util.zip.ZipInputStream;
+import org.jbpm.client.ClientProcessDefinition;
-/** a deployment unit, containing all information in source format from which
- * a process definition will be created and stored in the process repository.
- *
- * <p>A deployment takes a bunch of files as input. Files must have a name
- * and optionally they can have a type. During deployment, the type can be
- * deducted from the filename automatically. Use the <code>addXxxx</code>-methods
- * to add files to the deployment. Use {@link #setFileType(String, String)} to
- * set the file type programmatically.
- * </p>
- *
- * <p>The deployment also manages a map of objects. The deployers will typically
- * generate those objects based on the corresponding file contents. E.g. the
- * jpdl deployer will produce a <code>order.jpdl.xml</code>
- * {@link ProcessDefinition}-object from the <code>order.jpdl.xml</code> file.
- * </p>
- *
- * <p>Typically, a deployer will save the created objects into the database.
- * </p>
- *
- * <p>Users can also supply objects programmatically with {@link #addObject(String, Object)}.
- * </p>
- *
+/**
* @author Tom Baeyens
*/
-public interface Deployment extends Serializable {
+public interface Deployment {
+ String getName();
Deployment setName(String name);
+
+ long getTimestamp();
Deployment setTimestamp(long timestamp);
- Deployment addResource(String resource);
- Deployment addFile(File file);
- Deployment addUrl(URL url);
- Deployment addInputStream(String name, InputStream inputStream);
- Deployment addString(String name, String string);
- Deployment addArchiveResource(String resource);
- Deployment addArchiveFile(File file);
- Deployment addArchiveUrl(URL url);
- Deployment addArchive(ZipInputStream zipInputStream);
- Deployment addDirectory(String directory);
- Deployment addDirectoryCanonical(String directory);
- Deployment addDirectory(File directory);
- Deployment addDirectoryCanonical(File directory);
- Deployment addProcessDefinition(ProcessDefinition processDefinition);
+ Deployment addResourceFromString(String resourceName, String string);
+ Deployment addResourceFromInputStream(String resourceName, InputStream inputStream);
+ Deployment addResourceFromClasspath(String resourceName);
+ Deployment addResourceFromUrl(URL url);
+ Deployment addResourcesFromZipInputStream(ZipInputStream zipInputStream);
+
+ /** @return deploymentId */
+ long deploy();
- Deployment setFileType(String fileName, String fileType);
-
- Deployment deploy();
-
- /** the deployed process definitions. */
- List<ProcessDefinition> getProcessDefinitions();
- /** the problems encountered during deployment */
- List<Problem> getProblems();
+ Deployment addProcessDefinition(ClientProcessDefinition processDefinition);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -31,8 +31,6 @@
String PROPERTY_KEY = "key";
- ExecutionQuery processDefinitionNameLike(String processDefinitionName);
- ExecutionQuery processDefinitionKeyLike(String processDefinitionKey);
ExecutionQuery processDefinitionId(String processDefinitionId);
ExecutionQuery processInstanceId(String processInstanceId);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinition.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -30,12 +30,6 @@
*/
public interface ProcessDefinition extends Serializable {
- /** the optional package name of this process. This can be used to create
- * hierarchy of process categories for easy lookup. This is a
- * similar way of grouping and creating a structure as in Java.
- * We recommend the same conventions as with Java package names. */
- String getPackageName();
-
/** the short display name given to this process definition.
* Multiple process definitions can have the same as long
* as they are given a different {@link #version}. */
@@ -53,9 +47,8 @@
* represents the sequence number for process definitions with
* the same {@link ObservableElement#getId() name}. */
int getVersion();
-
- /** the description name given to this process definition.
- * Multiple process definitions can have the same */
- String getDescription();
-
+
+ /** references the deployment in which this process definition is
+ * deployed. */
+ long getDeploymentDbid();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinitionQuery.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessDefinitionQuery.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,17 +28,23 @@
*/
public interface ProcessDefinitionQuery {
- String PROPERTY_NAME = "name";
- String PROPERTY_KEY = "key";
- String PROPERTY_PACKAGENAME = "packageName";
- String PROPERTY_VERSION = "version";
- String PROPERTY_DEPLOYMENTTIME = "deploymentTime";
+ String PROPERTY_ID = "idProperty.stringValue";
+ String PROPERTY_KEY = "keyProperty.stringValue";
+ String PROPERTY_NAME = "idProperty.objectName";
+ String PROPERTY_VERSION = "versionProperty.longValue";
+ String PROPERTY_DEPLOYMENT_TIMESTAMP = "deployment.timestamp";
+ ProcessDefinitionQuery id(String id);
+ ProcessDefinitionQuery key(String key);
ProcessDefinitionQuery nameLike(String name);
- ProcessDefinitionQuery keyLike(String key);
+ ProcessDefinitionQuery name(String name);
+ ProcessDefinitionQuery deploymentDbid(long deploymentDbid);
ProcessDefinitionQuery orderAsc(String property);
ProcessDefinitionQuery orderDesc(String property);
+
+ ProcessDefinitionQuery page(int firstResult, int maxResults);
List<ProcessDefinition> execute();
+ ProcessDefinition uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -29,9 +29,9 @@
*/
public interface ProcessEngine {
- /** the {@link ProcessService process service} that provides access
+ /** the {@link RepositoryService repository service} that provides access
* to the process repository. */
- ProcessService getProcessService();
+ RepositoryService getRepositoryService();
/** the {@link ExecutionService execution service} that provides access
* to the runtime executions repository. */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -58,10 +58,6 @@
/** deletes process definition, the existing executions and the history. */
void deleteProcessDefinitionCascade(String processDefinitionId);
- /** retrieves an attachment of a process definition */
- byte[] getAttachment(String processDefinitionId, String name);
-
-
/** provide a userId that will be used in the next method invocation
* on this service by this thread. */
void setUserId(String userId);
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/RepositoryService.java (from rev 4355, jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/RepositoryService.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/RepositoryService.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/RepositoryService.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -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;
+
+import java.io.InputStream;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositoryService {
+
+ Deployment createDeployment();
+
+ void deleteDeployment(long deploymentDbid);
+ void deleteDeploymentCascade(long deploymentDbid);
+
+ InputStream getResourceAsStream(long deploymentDbid, String resourceName);
+
+ ProcessDefinitionQuery createProcessDefinitionQuery();
+
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/RepositoryService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.Execution;
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.job.Job;
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/RepositorySession.java (from rev 4355, jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/session/RepositorySession.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/RepositorySession.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/RepositorySession.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.session;
+
+import java.io.InputStream;
+
+import org.jbpm.Deployment;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.client.ClientProcessDefinition;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositorySession {
+
+ long deploy(Deployment deployment);
+
+ Object getObject(long deploymentDbid, String objectName);
+
+ InputStream getResourceAsStream(long deploymentDbid, String resourceName);
+
+ ProcessDefinitionQuery createProcessDefinitionQuery();
+
+ ClientProcessDefinition loadProcessDefinitionById(String processDefinitionId);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/RepositorySession.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -33,10 +33,10 @@
import org.jbpm.ManagementService;
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.TaskService;
import org.jbpm.cmd.CommandService;
import org.jbpm.job.Job;
-import org.jbpm.pvm.internal.repository.api.RepositoryService;
import org.jbpm.pvm.internal.stream.StringStreamInput;
import org.jbpm.task.Task;
import org.jbpm.test.BaseJbpmTestCase;
@@ -72,7 +72,6 @@
protected static ProcessEngine processEngine = null;
protected static RepositoryService repositoryService;
- protected static ProcessService processService;
protected static ExecutionService executionService;
protected static ManagementService managementService;
protected static TaskService taskService;
@@ -107,7 +106,6 @@
processEngine = configuration.buildProcessEngine();
repositoryService = processEngine.get(RepositoryService.class);
- processService = processEngine.getProcessService();
executionService = processEngine.getExecutionService();
historyService = processEngine.getHistoryService();
managementService = processEngine.getManagementService();
@@ -138,7 +136,7 @@
public void deployJpdlXmlString(String jpdlXmlString) {
long deploymentDbid =
repositoryService.createDeployment()
- .addStreamInput("xmlstring.jpdl.xml", new StringStreamInput(jpdlXmlString))
+ .addResourceFromString("xmlstring.jpdl.xml", jpdlXmlString)
.deploy();
registerDeployment(deploymentDbid);
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.execution.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.execution.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,12 +28,8 @@
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
- <many-to-one name="activity"
- class="org.jbpm.pvm.internal.model.ActivityImpl"
- column="ACT_"
- lazy="false"
- foreign-key="FK_EXEC_ACT"
- index="IDX_EXEC_ACT" />
+ <property name="activityName" column="ACTIVITYNAME_" />
+ <property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -63,19 +59,13 @@
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
- <many-to-one name="processDefinition"
- class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_EXEC_PROCESS"
- index="IDX_EXEC_PROCESS" />
+ <!-- many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" / -->
- <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
-
- <many-to-one name="transitionOrigin"
+ <!-- many-to-one name="transitionOrigin"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="TRANSORIG_"
foreign-key="FK_EXEC_TRANSORIG"
- index="IDX_EXEC_TRANSORIG" />
+ index="IDX_EXEC_TRANSORIG" / -->
<list name="executions"
cascade="all-delete-orphan"
@@ -212,7 +202,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -240,21 +230,22 @@
cascade="none"
foreign-key="FK_JOB_EXE"
index="IDX_JOB_EXE"/>
- <many-to-one name="commandDescriptor"
+
+ <!-- many-to-one name="commandDescriptor"
column="CMDDESCR_"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
cascade="all"
foreign-key="FK_JOB_CMDDESCR"
- index="IDX_JOB_CMDDESCR"/>
+ index="IDX_JOB_CMDDESCR"/ -->
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeActivityMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
<property name="signalName" column="SIGNAL_" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
column="NODE_"
cascade="none"
- foreign-key="FK_JOB_NODE"/>
+ foreign-key="FK_JOB_NODE"/ -->
</subclass>
<subclass name="org.jbpm.pvm.internal.model.op.TakeTransitionMessage" discriminator-value="TakeTrMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.ProceedToDestinationMessage" discriminator-value="ProceedDestMsg" />
@@ -357,22 +348,4 @@
]]>
</query>
- <query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query>
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinition.id = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -18,11 +18,11 @@
<property name="state" column="STATE_" />
<property name="endActivityName" column="ENDACTIVITY_" />
- <many-to-one name="processDefinition"
+ <!-- many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
column="PROCDEF_"
foreign-key="FK_HISTPI_PROCDEF"
- index="IDX_HISTPI_PROCDEF" />
+ index="IDX_HISTPI_PROCDEF" / -->
<set name="historyActivityInstances"
cascade="all">
@@ -48,11 +48,11 @@
foreign-key="FK_HAI_HPI"
index="IDX_HAI_HPI" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="ACTIVITY_"
foreign-key="FK_HISTAI_ACT"
- index="IDX_HISTAI_ACT" />
+ index="IDX_HISTAI_ACT" / -->
<property name="type" column="TYPE_" />
<property name="executionId" column="EXECUTION_" />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,7 +3,7 @@
<hibernate-mapping default-access="field">
- <subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
+ <!-- subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
discriminator-value="jpdl">
<map name="swimlaneDefinitions"
@@ -22,7 +22,7 @@
<map-key type="string" column="NAME_" />
<one-to-many class="org.jbpm.pvm.internal.task.TaskDefinitionImpl" />
</map>
- </subclass>
+ </subclass -->
<subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
extends="org.jbpm.pvm.internal.model.ExecutionImpl"
@@ -38,7 +38,7 @@
</map>
</subclass>
- <class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -118,5 +118,6 @@
index="IDX_ACT_TASKDEF" />
</subclass>
</class>
+ -->
</hibernate-mapping>
\ No newline at end of file
Copied: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml (from rev 4355, jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml)
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="name" column="NAME_" />
+ <property name="timestamp" column="TIMESTAMP_" />
+
+ <map name="resources" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_DEPLOYMENT">
+ <column name="DEPLOYMENT_" index="IDX_LOB_DEPLOYMENT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+
+ <set name="objectProperties"
+ table="JBPM_DEPLOYPROPS"
+ cascade="all">
+ <key column="DEPLOYMENT_" />
+ <one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="stringValue" column="STRINGVAL_" />
+ <property name="longValue" column="LONGVAL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
table="JBPM_ASSIGNDEF"
discriminator-value="A" >
@@ -32,8 +32,9 @@
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
+ -->
- <!-- ### TASK DEFINITION ################################################ -->
+ <!-- ### TASK DEFINITION ################################################
<subclass name="TaskDefinitionImpl" discriminator-value="T">
<property name="priority" column="PRIORITY_"/>
@@ -60,6 +61,7 @@
</list>
</subclass>
</class>
+ -->
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
@@ -116,11 +118,7 @@
column="SWIMLANE_"
foreign-key="FK_TASK_SWIML" />
- <many-to-one name="taskDefinition"
- column="TASKDEF_"
- class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
- foreign-key="FK_TSK_TASKDEF"
- index="IDX_TSK_TASKDEF" />
+ <property name="taskDefinitionName" column="TASKDEFNAME_"/>
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
@@ -169,10 +167,10 @@
<property name="name" column="NAME_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <many-to-one name="swimlaneDefinition"
+ <!-- many-to-one name="swimlaneDefinition"
class="SwimlaneDefinitionImpl"
column="SWIMLANEDEF_"
- foreign-key="FK_SWIMLANE_DEF" />
+ foreign-key="FK_SWIMLANE_DEF" / -->
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.references/pvm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.references/pvm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.references/pvm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,4 +1,4 @@
- <mapping resource="jbpm.definition.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/jpdl.deployers.include.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/jpdl.deployers.include.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/jpdl.deployers.include.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,5 +1,2 @@
<deployer-manager>
- <assign-file-type>
- <file extension=".jpdl.xml" type="jpdl" />
- </assign-file-type>
- <parse-jpdl />
+ <jpdl-deployer />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,8 @@
<process-engine-context>
- <process-service />
+ <repository-service />
+ <repository-cache />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part2.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part2.jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part2.jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,8 +1,6 @@
<hibernate-configuration>
<cfg resource="jbpm.hibernate.cfg.xml" />
- <cache-configuration resource="jbpm.cache.xml"
- usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/cfg/part3.jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,6 +1,3 @@
- <check-process />
- <check-problems />
- <save />
</deployer-manager>
<script-manager default-expression-language="juel"
@@ -30,6 +27,7 @@
<transaction-context>
<transaction />
+ <repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/jpdl.include.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/jpdl.include.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/jpdl.include.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,2 +1,2 @@
<!-- jpdl bindings -->
- <binding class="org.jbpm.jpdl.internal.xml.ParseJpdlBinding" />
+ <binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -50,6 +50,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositorySessionBinding" />
+
<!-- db sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
@@ -59,19 +61,16 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.HistoryServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.TaskServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryCacheBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AssignFileTypesBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProcessBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProblemsBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.SaveBinding" />
<!-- interceptors -->
<binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentInterceptorBinding" />
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,7 +28,7 @@
import junit.framework.Test;
import org.jbpm.ExecutionService;
-import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
@@ -36,7 +36,7 @@
import org.jbpm.enterprise.internal.custom.WaitState;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.session.DbSession;
@@ -82,7 +82,7 @@
.endProcess();
// deploy process
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
@@ -118,7 +118,7 @@
public void testSchedule() throws CreateException {
// start an execution
environment.get(CommandService.class).execute(
- new StartExecutionCmd(processDefinitionId, null, null));
+ new StartProcessInstanceCmd(processDefinitionId, null, null));
// wait for activity to execute
Date executionDate = HappyListener.waitFor();
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -31,6 +31,7 @@
import org.jbpm.Execution;
import org.jbpm.ExecutionService;
import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
@@ -130,7 +131,7 @@
public void testHappyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
@@ -175,7 +176,7 @@
public void testNoisyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(NoisyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
@@ -228,7 +229,7 @@
public void testCyclicTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,9 +21,11 @@
*/
package org.jbpm.test.deployer;
+import org.jbpm.ProcessDefinitionQuery;
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
import org.jbpm.ProcessDefinition;
+import org.jbpm.RepositoryService;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -56,10 +58,12 @@
tx.begin();
ProcessEngine processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
- ProcessService processService = processEngine.getProcessService();
+ RepositoryService repositoryService = processEngine.getRepositoryService();
- ProcessDefinition def =
- processService.findLatestProcessDefinitionByKey(JBPM_DEPLOYER_TEST_V5);
+ ProcessDefinition def = repositoryService.createProcessDefinitionQuery()
+ .key(JBPM_DEPLOYER_TEST_V5)
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .uniqueResult();
tx.commit();
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -22,12 +22,10 @@
package org.jbpm.examples.hql;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import java.util.Set;
import org.jbpm.Execution;
+import org.jbpm.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -37,22 +35,33 @@
public class HqlTest extends JbpmTestCase {
public void testHql() {
+ // add task laundry
+ Task task = taskService.newTask();
+ task.setName("laundry");
+ taskService.saveTask(task);
+
+ // add task dishes
+ task = taskService.newTask();
+ task.setName("dishes");
+ taskService.saveTask(task);
+
+ // add task iron
+ task = taskService.newTask();
+ task.setName("iron");
+ taskService.saveTask(task);
+
deployJpdlResource("org/jbpm/examples/hql/process.jpdl.xml");
Execution execution = executionService.startProcessInstanceByKey("Hql");
String executionId = execution.getId();
- Set<String> variableNames = executionService.getVariableNames(executionId);
- Map<String, Object> variables = executionService.getVariables(executionId, variableNames);
-
- Map<String, Object> expectedVariables = new HashMap<String, Object>();
- List<String> activityNames = new ArrayList<String>();
- activityNames.add("get process names");
- activityNames.add("count activities");
- expectedVariables.put("activities with o", activityNames);
-
- expectedVariables.put("activities", new Long(4));
-
- assertEquals(expectedVariables, variables);
+ List<String> expectedTaskNames = new ArrayList<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("iron");
+ Object taskNames = executionService.getVariable(executionId, "tasknames with i");
+ assertEquals(expectedTaskNames, taskNames);
+
+ Object activities = executionService.getVariable(executionId, "tasks");
+ assertEquals("3", activities.toString());
}
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,51 +1,42 @@
package org.jbpm.examples.services;
+import junit.framework.TestCase;
+
import org.jbpm.Configuration;
-import org.jbpm.Deployment;
-import org.jbpm.Execution;
import org.jbpm.ExecutionService;
+import org.jbpm.HistoryService;
+import org.jbpm.ManagementService;
import org.jbpm.ProcessEngine;
-import org.jbpm.ProcessService;
-import org.jbpm.test.BaseJbpmTestCase;
+import org.jbpm.RepositoryService;
+import org.jbpm.TaskService;
-/** example on how to create process engine objects starting from a configuration
+/** shows explicitely the part of the API that is
+ * provided by JbpmTestCase as a convenience.
*
- * @author Koen Aers
+ * @author Koen Aers, Tom Baeyens
*/
-public class ProcessEngineTest extends BaseJbpmTestCase {
+public class ProcessEngineTest extends TestCase {
- /** creation of a process engine with the default configuration */
- public void testDefaultProcessEngine() {
+ public void testBasicApiUsage() {
+ // create a configuration
Configuration configuration = new Configuration();
+ // build a process engine from a configuration
ProcessEngine processEngine = configuration.buildProcessEngine();
- ProcessService processService = processEngine.getProcessService();
+
+ // Obtain the services from the process engine
+ // ProcessEngine and Services are to be used as singletons. (ie they are threadsafe)
+ RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionService executionService = processEngine.getExecutionService();
+ TaskService taskService = processEngine.getTaskService();
+ HistoryService historyService = processEngine.getHistoryService();
+ ManagementService managementService = processEngine.getManagementService();
- Deployment deployment = processService.createDeployment();
- deployment.addResource("org/jbpm/examples/services/process.jpdl.xml");
- deployment.deploy();
-
- Execution processInstance = executionService.startProcessInstanceByKey("simple");
- executionService.signalExecutionById(processInstance.getId());
- assertEquals("state", processInstance.getActivityName());
-
- }
+ // Deploying a process
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/services/process.jpdl.xml")
+ .deploy();
- /** creation of a process engine with a custom configuration */
- public void testCustomProcessEngineCreation() {
- Configuration configuration = new Configuration().setXmlString(
- "<jbpm-configuration>" +
- " <process-engine-context>" +
- " <process-service />" +
- " </process-engine-context>" +
- "</jbpm-configuration>");
- ProcessEngine processEngine = configuration.buildProcessEngine();
-
- // All services but the process service are created with the above configuration
- assertNotNull(processEngine);
- assertNotNull(processEngine.getProcessService());
- assertNull(processEngine.getTaskService());
+ repositoryService.deleteDeployment(deploymentDbid);
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -25,6 +25,7 @@
import java.util.List;
import org.jbpm.Execution;
+import org.jbpm.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -34,19 +35,33 @@
public class SqlTest extends JbpmTestCase {
public void testSql() {
+ // add task laundry
+ Task task = taskService.newTask();
+ task.setName("laundry");
+ taskService.saveTask(task);
+
+ // add task dishes
+ task = taskService.newTask();
+ task.setName("dishes");
+ taskService.saveTask(task);
+
+ // add task iron
+ task = taskService.newTask();
+ task.setName("iron");
+ taskService.saveTask(task);
+
deployJpdlResource("org/jbpm/examples/sql/process.jpdl.xml");
Execution execution = executionService.startProcessInstanceByKey("Sql");
String executionId = execution.getId();
- List<String> expectedActivityNames = new ArrayList<String>();
- expectedActivityNames.add("get process names");
- expectedActivityNames.add("count activities");
- Object activityNames = executionService.getVariable(executionId, "activities with o");
- assertEquals(expectedActivityNames, activityNames);
+ List<String> expectedTaskNames = new ArrayList<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("iron");
+ Object taskNames = executionService.getVariable(executionId, "tasknames with i");
+ assertEquals(expectedTaskNames, taskNames);
- Object activities = executionService.getVariable(executionId, "activities");
- assertEquals("4", activities.toString());
+ Object activities = executionService.getVariable(executionId, "tasks");
+ assertEquals("3", activities.toString());
}
-
}
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,8 @@
<process-engine-context>
- <process-service />
+ <repository-service />
+ <repository-cache />
<execution-service />
<history-service />
<management-service />
@@ -18,20 +19,12 @@
<hibernate-configuration>
<cfg resource="jbpm.hibernate.cfg.xml" />
- <cache-configuration resource="jbpm.cache.xml"
- usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
<deployer-manager>
- <assign-file-type>
- <file extension=".jpdl.xml" type="jpdl" />
- </assign-file-type>
- <parse-jpdl />
- <check-process />
- <check-problems />
- <save />
+ <jpdl-deployer />
</deployer-manager>
<script-manager default-expression-language="juel"
@@ -61,6 +54,7 @@
<transaction-context>
<transaction />
+ <repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,12 +28,8 @@
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
- <many-to-one name="activity"
- class="org.jbpm.pvm.internal.model.ActivityImpl"
- column="ACT_"
- lazy="false"
- foreign-key="FK_EXEC_ACT"
- index="IDX_EXEC_ACT" />
+ <property name="activityName" column="ACTIVITYNAME_" />
+ <property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -63,19 +59,13 @@
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
- <many-to-one name="processDefinition"
- class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_EXEC_PROCESS"
- index="IDX_EXEC_PROCESS" />
+ <!-- many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" / -->
- <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
-
- <many-to-one name="transitionOrigin"
+ <!-- many-to-one name="transitionOrigin"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="TRANSORIG_"
foreign-key="FK_EXEC_TRANSORIG"
- index="IDX_EXEC_TRANSORIG" />
+ index="IDX_EXEC_TRANSORIG" / -->
<list name="executions"
cascade="all-delete-orphan"
@@ -212,7 +202,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -240,21 +230,22 @@
cascade="none"
foreign-key="FK_JOB_EXE"
index="IDX_JOB_EXE"/>
- <many-to-one name="commandDescriptor"
+
+ <!-- many-to-one name="commandDescriptor"
column="CMDDESCR_"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
cascade="all"
foreign-key="FK_JOB_CMDDESCR"
- index="IDX_JOB_CMDDESCR"/>
+ index="IDX_JOB_CMDDESCR"/ -->
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeActivityMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
<property name="signalName" column="SIGNAL_" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
column="NODE_"
cascade="none"
- foreign-key="FK_JOB_NODE"/>
+ foreign-key="FK_JOB_NODE"/ -->
</subclass>
<subclass name="org.jbpm.pvm.internal.model.op.TakeTransitionMessage" discriminator-value="TakeTrMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.ProceedToDestinationMessage" discriminator-value="ProceedDestMsg" />
@@ -357,22 +348,4 @@
]]>
</query>
- <query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query>
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinition.id = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -15,7 +15,7 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <mapping resource="jbpm.definition.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -18,11 +18,11 @@
<property name="state" column="STATE_" />
<property name="endActivityName" column="ENDACTIVITY_" />
- <many-to-one name="processDefinition"
+ <!-- many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
column="PROCDEF_"
foreign-key="FK_HISTPI_PROCDEF"
- index="IDX_HISTPI_PROCDEF" />
+ index="IDX_HISTPI_PROCDEF" / -->
<set name="historyActivityInstances"
cascade="all">
@@ -48,11 +48,11 @@
foreign-key="FK_HAI_HPI"
index="IDX_HAI_HPI" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="ACTIVITY_"
foreign-key="FK_HISTAI_ACT"
- index="IDX_HISTAI_ACT" />
+ index="IDX_HISTAI_ACT" / -->
<property name="type" column="TYPE_" />
<property name="executionId" column="EXECUTION_" />
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,7 +3,7 @@
<hibernate-mapping default-access="field">
- <subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
+ <!-- subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
discriminator-value="jpdl">
<map name="swimlaneDefinitions"
@@ -22,7 +22,7 @@
<map-key type="string" column="NAME_" />
<one-to-many class="org.jbpm.pvm.internal.task.TaskDefinitionImpl" />
</map>
- </subclass>
+ </subclass -->
<subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
extends="org.jbpm.pvm.internal.model.ExecutionImpl"
@@ -38,7 +38,7 @@
</map>
</subclass>
- <class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -118,5 +118,6 @@
index="IDX_ACT_TASKDEF" />
</subclass>
</class>
+ -->
</hibernate-mapping>
\ No newline at end of file
Copied: jbpm4/trunk/modules/examples/src/test/resources/jbpm.repository.hbm.xml (from rev 4355, jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.repository.hbm.xml)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.repository.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="name" column="NAME_" />
+ <property name="timestamp" column="TIMESTAMP_" />
+
+ <map name="resources" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_DEPLOYMENT">
+ <column name="DEPLOYMENT_" index="IDX_LOB_DEPLOYMENT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+
+ <set name="objectProperties"
+ table="JBPM_DEPLOYPROPS"
+ cascade="all">
+ <key column="DEPLOYMENT_" />
+ <one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="stringValue" column="STRINGVAL_" />
+ <property name="longValue" column="LONGVAL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
table="JBPM_ASSIGNDEF"
discriminator-value="A" >
@@ -32,8 +32,9 @@
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
+ -->
- <!-- ### TASK DEFINITION ################################################ -->
+ <!-- ### TASK DEFINITION ################################################
<subclass name="TaskDefinitionImpl" discriminator-value="T">
<property name="priority" column="PRIORITY_"/>
@@ -60,6 +61,7 @@
</list>
</subclass>
</class>
+ -->
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
@@ -116,11 +118,7 @@
column="SWIMLANE_"
foreign-key="FK_TASK_SWIML" />
- <many-to-one name="taskDefinition"
- column="TASKDEF_"
- class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
- foreign-key="FK_TSK_TASKDEF"
- index="IDX_TSK_TASKDEF" />
+ <property name="taskDefinitionName" column="TASKDEFNAME_"/>
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
@@ -169,10 +167,10 @@
<property name="name" column="NAME_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <many-to-one name="swimlaneDefinition"
+ <!-- many-to-one name="swimlaneDefinition"
class="SwimlaneDefinitionImpl"
column="SWIMLANEDEF_"
- foreign-key="FK_SWIMLANE_DEF" />
+ foreign-key="FK_SWIMLANE_DEF" / -->
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -50,6 +50,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositorySessionBinding" />
+
<!-- db sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
@@ -59,19 +61,16 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.HistoryServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.TaskServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryCacheBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AssignFileTypesBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProcessBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProblemsBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.SaveBinding" />
<!-- interceptors -->
<binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentInterceptorBinding" />
@@ -88,6 +87,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.EnlistBinding" />
<!-- jpdl bindings -->
- <binding class="org.jbpm.jpdl.internal.xml.ParseJpdlBinding" />
+ <binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
</wire-bindings>
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,30 +3,30 @@
<process name="Hql" xmlns="http://jbpm.org/4/jpdl">
<start g="17,20,48,48">
- <transition to="get process names" />
+ <transition to="get task names" />
</start>
- <hql name="get process names"
- var="activities with o"
+ <hql name="get task names"
+ var="tasknames with i"
g="96,16,115,52">
<query>
- select activity.name
- from org.jbpm.pvm.internal.model.ActivityImpl as activity
- where activity.name like :activityName
+ select task.name
+ from org.jbpm.pvm.internal.task.TaskImpl as task
+ where task.name like :taskName
</query>
<parameters>
- <string name="activityName" value="%o%" />
+ <string name="taskName" value="%i%" />
</parameters>
- <transition to="count activities" />
+ <transition to="count tasks" />
</hql>
- <hql name="count activities"
- var="activities"
+ <hql name="count tasks"
+ var="tasks"
unique="true"
g="243,16,95,52">
<query>
select count(*)
- from org.jbpm.pvm.internal.model.ActivityImpl
+ from org.jbpm.pvm.internal.task.TaskImpl
</query>
<transition to="wait" />
</hql>
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,30 +3,30 @@
<process name="Sql" xmlns="http://jbpm.org/4/jpdl">
<start g="16,20,48,48">
- <transition to="get process names" />
+ <transition to="get task names" />
</start>
- <sql name="get process names"
- var="activities with o"
+ <sql name="get task names"
+ var="tasknames with i"
g="96,16,126,52">
<query>
select NAME_
- from JBPM_ACTIVITY
- where NAME_ like :activityName
+ from JBPM_TASK
+ where NAME_ like :name
</query>
<parameters>
- <string name="activityName" value="%o%" />
+ <string name="name" value="%i%" />
</parameters>
- <transition to="count activities" />
+ <transition to="count tasks" />
</sql>
- <sql name="count activities"
- var="activities"
+ <sql name="count tasks"
+ var="tasks"
unique="true"
g="254,16,92,52">
<query>
select count(*)
- from JBPM_ACTIVITY
+ from JBPM_TASK
</query>
<transition to="wait" />
</sql>
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,39 +21,41 @@
*/
package org.jbpm.integration.console;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.jboss.bpm.console.client.model.ParticipantRef;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.model.ParticipantRef;
import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
-
+import org.jbpm.ProcessDefinition;
import org.jbpm.model.OpenExecution;
-import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.model.Transition;
-import org.jbpm.task.*;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.IdentityRef;
+import org.jbpm.task.Participation;
+import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
-import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class ModelAdaptor
{
- public static ProcessDefinitionRef adoptDefinition(OpenProcessDefinition p0)
+ public static ProcessDefinitionRef adoptDefinition(ProcessDefinition processDefinition)
{
ProcessDefinitionRef def = new ProcessDefinitionRef();
- def.setId( p0.getId() );
- def.setName(p0.getName());
- def.setVersion(p0.getVersion());
-
- def.setKey( p0.getKey() );
- def.setDescription(p0.getDescription());
- def.setPackageName(p0.getPackageName());
+ def.setId( processDefinition.getId() );
+ def.setName(processDefinition.getName());
+ def.setVersion(processDefinition.getVersion());
+ def.setKey( processDefinition.getKey() );
+ // def.setDescription(p0.getDescription());
+ // def.setPackageName(p0.getPackageName());
return def;
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,19 +21,21 @@
*/
package org.jbpm.integration.console;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.server.integration.ProcessManagement;
-import org.jbpm.*;
+import org.jbpm.Execution;
+import org.jbpm.ExecutionQuery;
+import org.jbpm.ExecutionService;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.RepositoryService;
import org.jbpm.model.OpenExecution;
-import org.jbpm.model.OpenProcessDefinition;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -44,20 +46,15 @@
{
List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
- ProcessService processService = this.processEngine.getProcessService();
- List<String> keys = processService.findProcessDefinitionKeys();
- Set<ProcessDefinition> definitions = new HashSet<ProcessDefinition>();
- for(String key : keys)
- {
- definitions.addAll(
- processService.findProcessDefinitionsByKey(key)
- );
- }
-
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ List<ProcessDefinition> definitions = repositoryService.createProcessDefinitionQuery()
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
+ .execute();
+
// adopt ProcessDefinition to console model
- for(ProcessDefinition p0 : definitions)
+ for(ProcessDefinition processDefinition : definitions)
{
- results.add( ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0) );
+ results.add( ModelAdaptor.adoptDefinition(processDefinition) );
}
return results;
@@ -66,15 +63,22 @@
public ProcessDefinitionRef getProcessDefinition(String procDefId)
{
- ProcessService processService = this.processEngine.getProcessService();
- ProcessDefinition p0 = processService.findProcessDefinitionById(procDefId);
- return ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0);
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id(procDefId)
+ .uniqueResult();
+ return ModelAdaptor.adoptDefinition(processDefinition);
}
public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId)
{
- ProcessService processService = this.processEngine.getProcessService();
- processService.deleteProcessDefinitionCascade(procDefId);
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id(procDefId)
+ .uniqueResult();
+ if (processDefinition!=null) {
+ repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentDbid());
+ }
return getProcessDefinitions();
}
@@ -162,13 +166,10 @@
public void deploy(String fileName, String contentType, InputStream deployment)
{
- List<ProcessDefinition> definitions =
- this.processEngine.getProcessService()
+ this.processEngine.getRepositoryService()
.createDeployment()
- .addInputStream(fileName, deployment)
- .deploy()
- .getProcessDefinitions();
-
+ .addResourceFromInputStream(fileName, deployment)
+ .deploy();
}
}
Modified: jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -27,7 +27,7 @@
import org.jboss.deployment.SubDeployerSupport;
import org.jbpm.integration.spi.DeploymentAdaptor;
import org.jbpm.integration.spi.JBPMDeploymentMetaData;
-import org.jbpm.integration.spi.ProcessDeploymentRef;
+import org.jbpm.integration.spi.DeploymentRef;
import org.jbpm.internal.log.Log;
import java.util.List;
@@ -37,7 +37,7 @@
/**
* An AS 4.2.x deployer for jBPM4 process archives.
* Delegates to {@link org.jbpm.integration.spi.DeploymentAdaptor}.
- * The deployer retains a {@link org.jbpm.integration.spi.ProcessDeploymentRef}
+ * The deployer retains a {@link org.jbpm.integration.spi.DeploymentRef}
* for subsequent undeployment calls.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -105,7 +105,7 @@
{
log.info("Deploy " + rootDeployment.url);
- List<ProcessDeploymentRef> allProcessRefs = new ArrayList<ProcessDeploymentRef>();
+ List<DeploymentRef> deploymentRefs = new ArrayList<DeploymentRef>();
Iterator iterator = rootDeployment.subDeployments.iterator();
while(iterator.hasNext())
@@ -116,12 +116,12 @@
md.setWatch(rootDeployment.watch);
md.setProcessDescriptor(subDeployment.url);
- List<ProcessDeploymentRef> subDeploymentRefs = null;
+ DeploymentRef deploymentRef;
try
{
- subDeploymentRefs = adaptor.deploy(md);
- allProcessRefs.addAll(subDeploymentRefs);
+ deploymentRef = adaptor.deploy(md);
+ deploymentRefs.add(deploymentRef);
}
catch (Throwable t)
{
@@ -129,7 +129,7 @@
}
}
- rootDeployment.context.put(CONTEXT_REFERENCE, allProcessRefs);
+ rootDeployment.context.put(CONTEXT_REFERENCE, deploymentRefs);
}
}
@@ -151,17 +151,17 @@
{
log.info("Undeploy " + rootDeployment.url);
- List<ProcessDeploymentRef> processRefs = (List<ProcessDeploymentRef>)
+ List<DeploymentRef> deploymentRefs = (List<DeploymentRef>)
rootDeployment.context.get(CONTEXT_REFERENCE);
- if(null==processRefs)
+ if(null==deploymentRefs)
{
log.info("Failed to retrieve process reference information. " +
"Ignore undepoyment call: "+ rootDeployment.url);
return;
}
- adaptor.undeploy(processRefs);
+ adaptor.undeploy(deploymentRefs);
}
}
}
Modified: jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDeployer.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -27,15 +27,16 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jbpm.integration.spi.DeploymentAdaptor;
import org.jbpm.integration.spi.JBPMDeploymentMetaData;
-import org.jbpm.integration.spi.ProcessDeploymentRef;
+import org.jbpm.integration.spi.DeploymentRef;
import org.jbpm.internal.log.Log;
+import java.util.ArrayList;
import java.util.List;
/**
* An AS 5.0.x deployer for jBPM4 process archives.
* Delegates to {@link org.jbpm.integration.spi.DeploymentAdaptor}.
- * The deployer retains a {@link org.jbpm.integration.spi.ProcessDeploymentRef}
+ * The deployer retains a {@link org.jbpm.integration.spi.DeploymentRef}
* for subsequent undeployment calls.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -63,9 +64,9 @@
try
{
- List<ProcessDeploymentRef> processRefs = adaptor.deploy(deployment);
+ DeploymentRef deploymentRef = adaptor.deploy(deployment);
// TODO: mark the process 'ready', classloader assoc
- unit.addAttachment("jbpm.deployer.reference", processRefs);
+ unit.addAttachment("jbpm.deployment.ref", deploymentRef);
}
catch (Throwable t)
{
@@ -78,15 +79,18 @@
{
log.info("Undeploy "+deployment);
- List<ProcessDeploymentRef> processRefs =
- (List<ProcessDeploymentRef>)unit.getAttachment("jbpm.deployer.reference");
+ DeploymentRef deploymentRef =
+ (DeploymentRef)unit.getAttachment("jbpm.deployment.ref");
- if(null==processRefs)
+ if(null==deploymentRef)
{
log.info("Failed to retrieve process reference information. Ignore undepoyment call: "+ deployment);
return;
}
+
+ List<DeploymentRef> deploymentRefs = new ArrayList<DeploymentRef>();
+ deploymentRefs.add(deploymentRef);
- adaptor.undeploy(processRefs);
+ adaptor.undeploy(deploymentRefs);
}
}
Modified: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,18 +21,16 @@
*/
package org.jbpm.integration.spi;
-import org.jbpm.Deployment;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.ProcessService;
-import org.jbpm.internal.log.Log;
+import java.io.File;
+import java.util.List;
import javax.naming.InitialContext;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
+import org.jbpm.RepositoryService;
+import org.jbpm.internal.log.Log;
+
/**
* Adopts AS 4 and AS 5 deployer invocations to jBPM invocations.
*
@@ -42,7 +40,7 @@
{
private static final Log log = Log.getLog(DeploymentAdaptor.class.getName());
- public List<ProcessDeploymentRef> deploy(JBPMDeploymentMetaData deploymentMetData)
+ public DeploymentRef deploy(JBPMDeploymentMetaData deploymentMetData)
{
JBPMService jbpmService = JBPMServiceLocator.locateService();
@@ -56,36 +54,21 @@
tx.begin();
// deploy to process engine
- ProcessService processService = jbpmService.getProcessEngine().getProcessService();
- String pathToDeployment = deploymentMetData.getWatch().getPath();
- File deploymentFile = new File(pathToDeployment);
+ RepositoryService repositoryService = jbpmService.getProcessEngine().getRepositoryService();
+ String deploymentName = deploymentMetData.getWatch().getPath();
+ File deploymentFile = new File(deploymentName);
- Deployment dpl = processService.createDeployment()
- .addUrl(deploymentMetData.getProcessDescriptor())
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromUrl(deploymentMetData.getProcessDescriptor())
.setTimestamp(deploymentFile.lastModified())
- .setName(deploymentMetData.getWatch().getPath());
+ .setName(deploymentName)
+ .deploy();
+
+ DeploymentRef deploymentRef = new DeploymentRef(deploymentDbid, deploymentName);
- List<ProcessDefinition> processesInScope =
- dpl
- .deploy()
- .getProcessDefinitions();
-
- // pass reference to the deployment unit for undeployment
- List<ProcessDeploymentRef> processRefs = new ArrayList<ProcessDeploymentRef>();
- for(ProcessDefinition pd : processesInScope)
- {
- ProcessDeploymentRef ref = new ProcessDeploymentRef(
- pd.getId(),
- pd.getVersion(),
- deploymentMetData.getWatch().getPath()
- );
- processRefs.add(ref);
- }
-
tx.commit();
- return processRefs;
-
+ return deploymentRef;
}
catch(Throwable e)
{
@@ -103,7 +86,7 @@
}
- public void undeploy(List<ProcessDeploymentRef> processRefs)
+ public void undeploy(List<DeploymentRef> deploymentRefs)
{
UserTransaction tx = null;
@@ -111,28 +94,27 @@
{
JBPMService jbpmService = JBPMServiceLocator.locateService();
- ProcessService processService = jbpmService.getProcessEngine().getProcessService();
+ RepositoryService repositoryService = jbpmService.getProcessEngine().getRepositoryService();
InitialContext ctx = new InitialContext();
tx = (UserTransaction)ctx.lookup("UserTransaction");
tx.begin();
-
- for(ProcessDeploymentRef ref : processRefs)
- {
+
+ for (DeploymentRef deploymentRef: deploymentRefs) {
// if the physical artifact has been removed the process can be deleted
- File deploymentArtifact = new File(ref.getLocation());
+ File deploymentArtifact = new File(deploymentRef.getLocation());
if(!deploymentArtifact.exists())
{
- log.info("The deployment artifact for process '"+ref+" has been deleted."+
+ log.info("The deployment artifact for process '"+deploymentRef+" has been deleted."+
" The process definition will be removed.");
- processService.deleteProcessDefinition(ref.getProcessId());
+ repositoryService.deleteDeployment(deploymentRef.getDeploymentDbid());
}
else
{
// TODO: if the file remains, mark the process as 'shutdown'
- log.info("The deployment artifact for process '"+ref+"' retains. " +
+ log.info("The deployment artifact for process '"+deploymentRef+"' retains. " +
"Keep process definition.");
}
}
Copied: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java (from rev 4355, jbpm4/branches/tbaeyens/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java)
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.integration.spi;
+
+/**
+ * Retains with a deployer for undeployment calls.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class DeploymentRef
+{
+ private long deploymentDbid;
+ private String location;
+
+ public DeploymentRef(long deploymentDbid, String location)
+ {
+ this.deploymentDbid = deploymentDbid;
+ this.location = location;
+ }
+
+ public String toString()
+ {
+ return "DeploymentRef {dbid="+deploymentDbid+", location="+location+"}";
+ }
+
+ public long getDeploymentDbid()
+ {
+ return deploymentDbid;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+}
Property changes on: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentRef.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/ProcessDeploymentRef.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/ProcessDeploymentRef.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/ProcessDeploymentRef.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.integration.spi;
-
-/**
- * Retains with a deployer for undeployment calls.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public final class ProcessDeploymentRef
-{
- private String processId;
- private int version;
- private String location;
-
- public ProcessDeploymentRef(String processId, int version, String location)
- {
- this.processId = processId;
- this.version = version;
- this.location = location;
- }
-
- public String toString()
- {
- return "ProcessDeploymentRef {id="+processId+", version="+version+", location="+location+"}";
- }
-
- public String getProcessId()
- {
- return processId;
- }
-
- public int getVersion()
- {
- return version;
- }
-
- public String getLocation()
- {
- return location;
- }
-}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,13 +21,8 @@
*/
package org.jbpm.jpdl.internal.activity;
-import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
import org.jbpm.jpdl.internal.xml.JpdlParser;
-import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
-import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -46,68 +41,9 @@
public Object parse(Element element, Parse parse, Parser parser) {
TaskActivity taskActivity = new TaskActivity();
- TaskDefinitionImpl taskDefinition = parseTaskDefinition(element, parse, parser);
+ TaskDefinitionImpl taskDefinition = JpdlParser.parseTaskDefinition(element, parse, parser);
taskActivity.setTaskDefinition(taskDefinition);
-
+
return taskActivity;
}
-
- public static TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse, Parser parser) {
- TaskDefinitionImpl taskDefinition = new TaskDefinitionImpl();
-
- taskDefinition.setName(XmlUtil.attribute(element, "name"));
-
- String swimlaneName = XmlUtil.attribute(element, "swimlane");
- if (swimlaneName!=null) {
- JpdlProcessDefinition jpdlProcessDefinition = parse.findObject(JpdlProcessDefinition.class);
- SwimlaneDefinitionImpl swimlaneDefinition = jpdlProcessDefinition.getSwimlaneDefinition(swimlaneName);
- if (swimlaneDefinition!=null) {
- taskDefinition.setSwimlaneDefinition(swimlaneDefinition);
- } else {
- parse.addProblem("swimlane "+swimlaneName+" not declared");
- }
- }
-
- Element taskHandlerElement = XmlUtil.element(element, "task-handler");
- if (taskHandlerElement!=null) {
- ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(taskHandlerElement, parse);
- taskDefinition.setTaskHandlerDescriptor(objectDescriptor);
- }
-
- parseAssignmentAttributes(element, taskDefinition, parse);
-
- return taskDefinition;
- }
-
- public static void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
- Element descriptionElement = XmlUtil.element(element, "description");
- if (descriptionElement!=null) {
- String description = XmlUtil.getContentText(descriptionElement);
- assignableDefinition.setDescription(description);
- }
-
- Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
- if (assignmentHandlerElement!=null) {
- ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(assignmentHandlerElement, parse);
- assignableDefinition.setAssignmentHandlerDescriptor(objectDescriptor);
- }
-
- String assigneeExpression = XmlUtil.attribute(element, "assignee");
- assignableDefinition.setAssigneeExpression(assigneeExpression);
-
- String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
- assignableDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
-
- String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
- assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
-
- String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
- assignableDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
-
- String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
- assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
-
- String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
- assignableDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
- }
}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/deploy/ParseJpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/deploy/ParseJpdlDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/deploy/ParseJpdlDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,57 +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.jpdl.internal.deploy;
-
-import org.jbpm.ProcessDefinition;
-import org.jbpm.jpdl.internal.xml.JpdlParser;
-import org.jbpm.pvm.internal.deploy.Deployer;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-import org.jbpm.pvm.internal.xml.Parse;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ParseJpdlDeployer implements Deployer {
-
- static JpdlParser jpdlParser = new JpdlParser();
-
- public void deploy(DeploymentImpl deployment) {
- for (String fileName: deployment.getFileNamesForType("jpdl")) {
- // parse them
- Parse parse = jpdlParser.createParse();
- parse.setProblems(deployment.getProblems());
- parse.setInputStream(deployment.getFile(fileName));
- parse.execute();
-
- // add the parsed xml dom to the deployment documents
- // so that other subsequent deployers can just use the dom
- // instead of reparsing the whole jpdl.xml file
- deployment.addDocument(fileName, parse.getDocument());
-
- // add the parsed process definition to the processDefinitions
- // this is where the save process deployer will find it
- ProcessDefinition processDefinition = (ProcessDefinition) parse.getDocumentObject();
- deployment.addProcessDefinition(processDefinition);
- }
- }
-}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlProcessDefinition.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlProcessDefinition.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -45,6 +45,7 @@
public SwimlaneDefinitionImpl createSwimlaneDefinition(String name) {
SwimlaneDefinitionImpl swimlaneDefinition = new SwimlaneDefinitionImpl();
+ swimlaneDefinition.setName(name);
swimlaneDefinitions.put(name, swimlaneDefinition);
return swimlaneDefinition;
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -24,6 +24,8 @@
import java.io.InputStream;
import java.util.List;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.ProcessDefinitionQuery;
import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
@@ -31,8 +33,8 @@
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.repository.Deployer;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
-import org.jbpm.pvm.internal.repository.api.RepositorySession;
import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.session.RepositorySession;
/**
@@ -42,42 +44,47 @@
private static Log log = Log.getLog(JpdlDeployer.class.getName());
+ public static final String KEY_ID = "id";
+ public static final String KEY_KEY = "key";
+ public static final String KEY_VERSION = "version";
+
static JpdlParser jpdlParser = new JpdlParser();
public void deploy(DeploymentImpl deployment) {
for (String resourceName: deployment.getResourceNames()) {
- InputStream inputStream = deployment.getResourceAsStream(resourceName);
- Parse parse = jpdlParser.createParse();
- parse.setProblems(deployment.getProblems());
- parse.setInputStream(inputStream);
- parse.execute();
-
- JpdlProcessDefinition processDefinition =
- (JpdlProcessDefinition) parse.getDocumentObject();
+ if (resourceName.endsWith(".jpdl.xml")) {
+ InputStream inputStream = deployment.getResourceAsStream(resourceName);
+ Parse parse = jpdlParser.createParse();
+ parse.setProblems(deployment.getProblems());
+ parse.setInputStream(inputStream);
+ parse.execute();
+ JpdlProcessDefinition processDefinition = (JpdlProcessDefinition) parse.getDocumentObject();
+ if ((processDefinition != null) && (processDefinition.getName() != null)) {
+ String processDefinitionName = processDefinition.getName();
- if ( (processDefinition!=null)
- && (processDefinition.getName()!=null)
- ) {
- String processDefinitionName = processDefinition.getName();
+ processDefinition.setDeploymentDbid(deployment.getDbid());
- processDefinition.setDeploymentDbid(deployment.getDbid());
-
- String key = deployment.getObjectProperty(processDefinitionName, "jpdl.key");
- if (key!=null) {
- String id = deployment.getObjectProperty(processDefinitionName, "jpdl.id");
- processDefinition.setId(id);
- processDefinition.setKey(key);
- deployment.addObject(processDefinitionName, processDefinition);
-
- } else {
- checkKey(processDefinition, deployment);
- checkId(processDefinition, deployment);
+ if (deployment.hasObjectProperties(processDefinitionName)) {
+ String key = (String) deployment.getObjectProperty(processDefinitionName, KEY_KEY);
+ String id = (String) deployment.getObjectProperty(processDefinitionName, KEY_ID);
+ String version = (String) deployment.getObjectProperty(processDefinitionName, KEY_VERSION);
+ processDefinition.setId(id);
+ processDefinition.setKey(key);
+ processDefinition.setVersion(Integer.parseInt(version));
+ } else {
+ checkKey(processDefinition, deployment);
+ checkVersion(processDefinition, deployment);
+ checkId(processDefinition, deployment);
+
+ deployment.addObjectProperty(processDefinitionName, KEY_KEY, processDefinition.getKey());
+ deployment.addObjectProperty(processDefinitionName, KEY_VERSION, new Long(processDefinition.getVersion()));
+ deployment.addObjectProperty(processDefinitionName, KEY_ID, processDefinition.getId());
+ }
+
deployment.addObject(processDefinitionName, processDefinition);
- deployment.addObjectProperty(processDefinitionName, "jpdl.key", processDefinition.getKey());
- deployment.addObjectProperty(processDefinitionName, "jpdl.id", processDefinition.getId());
}
}
}
@@ -96,32 +103,65 @@
}
RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
- List<String> existingKeys = repositorySession.findObjectPropertyValues(processDefinitionName, "jpdl.key");
- if ( (!existingKeys.isEmpty())
- && existingKeys.get(0).equals(processDefinitionKey)
- ) {
- deployment.addProblem("invalid key '"+processDefinitionKey+"' in process "+processDefinition.getName()+". Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
+
+ List<ProcessDefinition> existingProcesses = repositorySession.createProcessDefinitionQuery()
+ .name(processDefinitionName)
+ .execute();
+
+ for (ProcessDefinition existingProcess: existingProcesses) {
+ if (!processDefinitionKey.equals(existingProcess.getKey())) {
+ deployment.addProblem("invalid key '"+processDefinitionKey+"' in process "+processDefinition.getName()+". Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
+ }
}
- List<String> existingNames = repositorySession.findObjectNames("jpdl.key", processDefinitionKey);
- if ( (!existingNames.isEmpty())
- && existingNames.get(0).equals(processDefinitionName)
- ) {
- deployment.addProblem("invalid name '"+processDefinitionName+"' in process "+processDefinition.getName()+". Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
+ existingProcesses = repositorySession.createProcessDefinitionQuery()
+ .key(processDefinitionKey)
+ .execute();
+
+ for (ProcessDefinition existingProcess: existingProcesses) {
+ if (!processDefinitionName.equals(existingProcess.getName())) {
+ deployment.addProblem("invalid name '"+processDefinitionName+"' in process "+processDefinition.getName()+". Existing process has name '"+processDefinitionName+"' and key '"+processDefinitionKey+"'");
+ }
}
}
protected void checkId(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment) {
String id = processDefinition.getId();
if (id==null) {
- id = processDefinition.getKey()+"-"+deployment.getDbid();
- log.trace("created id '"+id+"' for "+processDefinition);
+ id = processDefinition.getKey()+"-"+processDefinition.getVersion();
+ if (log.isTraceEnabled()) log.trace("created id '"+id+"' for "+processDefinition);
processDefinition.setId(id);
}
RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
- if (repositorySession.findObjectByPropertyValue("jpdl.id", id) != null) {
+ ProcessDefinition existingProcessDefinition = repositorySession.createProcessDefinitionQuery()
+ .id(id)
+ .uniqueResult();
+ if (existingProcessDefinition != null) {
deployment.addProblem("process '" + id + "' already exists");
}
}
+
+ protected void checkVersion(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment) {
+ int version = processDefinition.getVersion();
+ String key = processDefinition.getKey();
+ if (version==ProcessDefinitionImpl.UNASSIGNED_VERSION) {
+ RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+
+ ProcessDefinition latestDeployedVersion = repositorySession
+ .createProcessDefinitionQuery()
+ .key(key)
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0, 1)
+ .uniqueResult();
+
+ if (latestDeployedVersion!=null) {
+ version = latestDeployedVersion.getVersion() + 1;
+ } else {
+ version = 1;
+ }
+ if (log.isTraceEnabled()) log.trace("assigning version "+version+" to process definition "+key);
+ processDefinition.setVersion(version);
+ }
+ }
}
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java (from rev 4355, jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.xml;
+
+import org.jbpm.jpdl.internal.repository.JpdlDeployer;
+import org.jbpm.pvm.internal.wire.binding.WireDescriptorBinding;
+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 JpdlDeployerBinding extends WireDescriptorBinding {
+
+ public JpdlDeployerBinding() {
+ super("jpdl-deployer");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new ObjectDescriptor(JpdlDeployer.class);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlDeployerBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -30,10 +30,12 @@
import org.jbpm.activity.ActivityBehaviour;
import org.jbpm.internal.log.Log;
import org.jbpm.jpdl.internal.activity.JpdlActivityBinding;
-import org.jbpm.jpdl.internal.activity.TaskBinding;
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
+import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
@@ -132,7 +134,7 @@
if (swimlaneName!=null) {
SwimlaneDefinitionImpl swimlaneDefinition =
processDefinition.createSwimlaneDefinition(swimlaneName);
- TaskBinding.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition, parse);
+ JpdlParser.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition, parse);
}
}
@@ -173,6 +175,73 @@
return processDefinition;
}
+ public static void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
+ Element descriptionElement = XmlUtil.element(element, "description");
+ if (descriptionElement!=null) {
+ String description = XmlUtil.getContentText(descriptionElement);
+ assignableDefinition.setDescription(description);
+ }
+
+ Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
+ if (assignmentHandlerElement!=null) {
+ ObjectDescriptor objectDescriptor = parseObjectDescriptor(assignmentHandlerElement, parse);
+ assignableDefinition.setAssignmentHandlerDescriptor(objectDescriptor);
+ }
+
+ String assigneeExpression = XmlUtil.attribute(element, "assignee");
+ assignableDefinition.setAssigneeExpression(assigneeExpression);
+
+ String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
+ assignableDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
+
+ String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
+ assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
+
+ String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
+ assignableDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
+
+ String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
+ assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
+
+ String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
+ assignableDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
+ }
+
+ public static TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse, Parser parser) {
+ TaskDefinitionImpl taskDefinition = new TaskDefinitionImpl();
+
+ String taskName = XmlUtil.attribute(element, "name");
+ taskDefinition.setName(taskName);
+
+ ProcessDefinitionImpl processDefinition = parse.findObject(ProcessDefinitionImpl.class);
+ if (processDefinition.getTaskDefinition(taskName)!=null) {
+ parse.addProblem("duplicate task name "+taskName);
+ } else {
+ processDefinition.addTaskDefinitionImpl(taskDefinition);
+ }
+
+ String swimlaneName = XmlUtil.attribute(element, "swimlane");
+ if (swimlaneName!=null) {
+ JpdlProcessDefinition jpdlProcessDefinition = parse.findObject(JpdlProcessDefinition.class);
+ SwimlaneDefinitionImpl swimlaneDefinition = jpdlProcessDefinition.getSwimlaneDefinition(swimlaneName);
+ if (swimlaneDefinition!=null) {
+ taskDefinition.setSwimlaneDefinition(swimlaneDefinition);
+ } else {
+ parse.addProblem("swimlane "+swimlaneName+" not declared");
+ }
+ }
+
+ Element taskHandlerElement = XmlUtil.element(element, "task-handler");
+ if (taskHandlerElement!=null) {
+ ObjectDescriptor objectDescriptor = parseObjectDescriptor(taskHandlerElement, parse);
+ taskDefinition.setTaskHandlerDescriptor(objectDescriptor);
+ }
+
+ JpdlParser.parseAssignmentAttributes(element, taskDefinition, parse);
+
+ return taskDefinition;
+ }
+
public static ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
ObjectDescriptor objectDescriptor = new ObjectDescriptor();
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/ParseJpdlBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/ParseJpdlBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/ParseJpdlBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.xml;
-
-import org.jbpm.jpdl.internal.deploy.ParseJpdlDeployer;
-import org.jbpm.pvm.internal.wire.binding.WireDescriptorBinding;
-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 ParseJpdlBinding extends WireDescriptorBinding {
-
- public ParseJpdlBinding() {
- super("parse-jpdl");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- return new ObjectDescriptor(ParseJpdlDeployer.class);
- }
-
-}
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,8 @@
<process-engine-context>
- <process-service />
+ <repository-service />
+ <repository-cache />
<execution-service />
<history-service />
<management-service />
@@ -18,20 +19,12 @@
<hibernate-configuration>
<cfg resource="jbpm.hibernate.cfg.xml" />
- <cache-configuration resource="jbpm.cache.xml"
- usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
<deployer-manager>
- <assign-file-type>
- <file extension=".jpdl.xml" type="jpdl" />
- </assign-file-type>
- <parse-jpdl />
- <check-process />
- <check-problems />
- <save />
+ <jpdl-deployer />
</deployer-manager>
<script-manager default-expression-language="juel"
@@ -61,6 +54,7 @@
<transaction-context>
<transaction />
+ <repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,12 +28,8 @@
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
- <many-to-one name="activity"
- class="org.jbpm.pvm.internal.model.ActivityImpl"
- column="ACT_"
- lazy="false"
- foreign-key="FK_EXEC_ACT"
- index="IDX_EXEC_ACT" />
+ <property name="activityName" column="ACTIVITYNAME_" />
+ <property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -63,19 +59,13 @@
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
- <many-to-one name="processDefinition"
- class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_EXEC_PROCESS"
- index="IDX_EXEC_PROCESS" />
+ <!-- many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" / -->
- <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
-
- <many-to-one name="transitionOrigin"
+ <!-- many-to-one name="transitionOrigin"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="TRANSORIG_"
foreign-key="FK_EXEC_TRANSORIG"
- index="IDX_EXEC_TRANSORIG" />
+ index="IDX_EXEC_TRANSORIG" / -->
<list name="executions"
cascade="all-delete-orphan"
@@ -212,7 +202,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -240,21 +230,22 @@
cascade="none"
foreign-key="FK_JOB_EXE"
index="IDX_JOB_EXE"/>
- <many-to-one name="commandDescriptor"
+
+ <!-- many-to-one name="commandDescriptor"
column="CMDDESCR_"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
cascade="all"
foreign-key="FK_JOB_CMDDESCR"
- index="IDX_JOB_CMDDESCR"/>
+ index="IDX_JOB_CMDDESCR"/ -->
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeActivityMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
<property name="signalName" column="SIGNAL_" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
column="NODE_"
cascade="none"
- foreign-key="FK_JOB_NODE"/>
+ foreign-key="FK_JOB_NODE"/ -->
</subclass>
<subclass name="org.jbpm.pvm.internal.model.op.TakeTransitionMessage" discriminator-value="TakeTrMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.ProceedToDestinationMessage" discriminator-value="ProceedDestMsg" />
@@ -357,22 +348,4 @@
]]>
</query>
- <query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query>
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinition.id = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -15,7 +15,7 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <mapping resource="jbpm.definition.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -18,11 +18,11 @@
<property name="state" column="STATE_" />
<property name="endActivityName" column="ENDACTIVITY_" />
- <many-to-one name="processDefinition"
+ <!-- many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
column="PROCDEF_"
foreign-key="FK_HISTPI_PROCDEF"
- index="IDX_HISTPI_PROCDEF" />
+ index="IDX_HISTPI_PROCDEF" / -->
<set name="historyActivityInstances"
cascade="all">
@@ -48,11 +48,11 @@
foreign-key="FK_HAI_HPI"
index="IDX_HAI_HPI" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="ACTIVITY_"
foreign-key="FK_HISTAI_ACT"
- index="IDX_HISTAI_ACT" />
+ index="IDX_HISTAI_ACT" / -->
<property name="type" column="TYPE_" />
<property name="executionId" column="EXECUTION_" />
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,7 +3,7 @@
<hibernate-mapping default-access="field">
- <subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
+ <!-- subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
discriminator-value="jpdl">
<map name="swimlaneDefinitions"
@@ -22,7 +22,7 @@
<map-key type="string" column="NAME_" />
<one-to-many class="org.jbpm.pvm.internal.task.TaskDefinitionImpl" />
</map>
- </subclass>
+ </subclass -->
<subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
extends="org.jbpm.pvm.internal.model.ExecutionImpl"
@@ -38,7 +38,7 @@
</map>
</subclass>
- <class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -118,5 +118,6 @@
index="IDX_ACT_TASKDEF" />
</subclass>
</class>
+ -->
</hibernate-mapping>
\ No newline at end of file
Copied: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml (from rev 4355, jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="name" column="NAME_" />
+ <property name="timestamp" column="TIMESTAMP_" />
+
+ <map name="resources" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_DEPLOYMENT">
+ <column name="DEPLOYMENT_" index="IDX_LOB_DEPLOYMENT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+
+ <set name="objectProperties"
+ table="JBPM_DEPLOYPROPS"
+ cascade="all">
+ <key column="DEPLOYMENT_" />
+ <one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="stringValue" column="STRINGVAL_" />
+ <property name="longValue" column="LONGVAL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
table="JBPM_ASSIGNDEF"
discriminator-value="A" >
@@ -32,8 +32,9 @@
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
+ -->
- <!-- ### TASK DEFINITION ################################################ -->
+ <!-- ### TASK DEFINITION ################################################
<subclass name="TaskDefinitionImpl" discriminator-value="T">
<property name="priority" column="PRIORITY_"/>
@@ -60,6 +61,7 @@
</list>
</subclass>
</class>
+ -->
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
@@ -116,11 +118,7 @@
column="SWIMLANE_"
foreign-key="FK_TASK_SWIML" />
- <many-to-one name="taskDefinition"
- column="TASKDEF_"
- class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
- foreign-key="FK_TSK_TASKDEF"
- index="IDX_TSK_TASKDEF" />
+ <property name="taskDefinitionName" column="TASKDEFNAME_"/>
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
@@ -169,10 +167,10 @@
<property name="name" column="NAME_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <many-to-one name="swimlaneDefinition"
+ <!-- many-to-one name="swimlaneDefinition"
class="SwimlaneDefinitionImpl"
column="SWIMLANEDEF_"
- foreign-key="FK_SWIMLANE_DEF" />
+ foreign-key="FK_SWIMLANE_DEF" / -->
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -50,6 +50,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositorySessionBinding" />
+
<!-- db sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
@@ -59,19 +61,16 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.HistoryServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.TaskServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryCacheBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AssignFileTypesBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProcessBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProblemsBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.SaveBinding" />
<!-- interceptors -->
<binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentInterceptorBinding" />
@@ -88,6 +87,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.EnlistBinding" />
<!-- jpdl bindings -->
- <binding class="org.jbpm.jpdl.internal.xml.ParseJpdlBinding" />
+ <binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
</wire-bindings>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -25,7 +25,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.jbpm.Configuration;
@@ -35,6 +34,7 @@
import org.jbpm.ManagementService;
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.TaskService;
import org.jbpm.env.Context;
import org.jbpm.env.Environment;
@@ -154,15 +154,15 @@
public ManagementService getManagementService() {
return environmentFactoryCtxWireContext.get(ManagementService.class);
}
- public ProcessService getProcessService() {
- return environmentFactoryCtxWireContext.get(ProcessService.class);
- }
public TaskService getTaskService() {
return environmentFactoryCtxWireContext.get(TaskService.class);
}
public IdentityService getIdentityService() {
return environmentFactoryCtxWireContext.get(IdentityService.class);
}
+ public RepositoryService getRepositoryService() {
+ return environmentFactoryCtxWireContext.get(RepositoryService.class);
+ }
public static EnvironmentFactory parseXmlString(String xmlString) {
JbpmConfiguration jbpmConfiguration = new JbpmConfiguration();
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,88 @@
+/*
+ * 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 java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.RepositoryCache;
+import org.jbpm.session.PvmDbSession;
+import org.jbpm.session.RepositorySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeleteDeploymentCmd implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ long deploymentDbid;
+ boolean cascade;
+
+ public DeleteDeploymentCmd(long deploymentDbid) {
+ this.deploymentDbid = deploymentDbid;
+ }
+
+ public DeleteDeploymentCmd(long deploymentDbid, boolean cascade) {
+ this.deploymentDbid = deploymentDbid;
+ this.cascade = cascade;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ List<ProcessDefinition> processDefinitions = repositorySession.createProcessDefinitionQuery()
+ .deploymentDbid(deploymentDbid)
+ .execute();
+
+ PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+
+ for (ProcessDefinition processDefinition: processDefinitions) {
+ String processDefinitionId = processDefinition.getId();
+ List<String> processInstanceIds = pvmDbSession.findProcessInstanceIds(processDefinitionId);
+ if (cascade) {
+ for (String processInstanceId: processInstanceIds) {
+ pvmDbSession.deleteProcessInstance(processInstanceId, false);
+ }
+ } else {
+ if (!processInstanceIds.isEmpty()) {
+ throw new JbpmException("cannot delete deployment "+deploymentDbid+": still executions for "+processDefinition+": "+processInstanceIds);
+ }
+ }
+ }
+
+ Session session = environment.get(Session.class);
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ session.delete(deployment);
+
+ RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
+ repositoryCache.set(deploymentDbid, null);
+
+ return null;
+ }
+
+}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,38 +21,42 @@
*/
package org.jbpm.pvm.internal.cmd;
-import java.util.List;
-
import org.jbpm.JbpmException;
-import org.jbpm.ProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.deploy.DeployerManager;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.session.RepositorySession;
+
/**
* @author Tom Baeyens
*/
-public class DeployCmd extends AbstractCommand<List<ProcessDefinition>> {
+public class DeployCmd implements Command<Long> {
private static final long serialVersionUID = 1L;
-
- protected DeploymentImpl deployment;
+ private static Log log = Log.getLog(DeployCmd.class.getName());
+
+ DeploymentImpl deployment;
+
public DeployCmd(DeploymentImpl deployment) {
this.deployment = deployment;
}
- public List<ProcessDefinition> execute(Environment environment) throws Exception {
- DeployerManager deployerManager = environment.get(DeployerManager.class);
- if (deployerManager==null) {
- throw new JbpmException("no "+DeployerManager.class.getName()+" configured");
+ public Long execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ long deploymentDbid = repositorySession.deploy(deployment);
+
+ if (deployment.hasProblems()) {
+ String problemsText = deployment.getProblemsText();
+ if (problemsText!=null) {
+ String errorMsg = "problems during deployment of "+deployment+": "+problemsText;
+ log.info(errorMsg);
+ throw new JbpmException(errorMsg);
+ }
}
-
- // let the process parser managemer determine the process language
- // and handle the deployment
- deployerManager.deploy(deployment);
- return deployment.getProcessDefinitions();
+ return deploymentDbid;
}
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetAttachment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetAttachment.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetAttachment.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.session.PvmDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetAttachment extends AbstractCommand<byte[]> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionId;
- protected String name;
-
- public GetAttachment(String processDefinitionId, String name) {
- this.processDefinitionId = processDefinitionId;
- this.name = name;
- }
-
- public byte[] execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- ClientProcessDefinition processDefinition = pvmDbSession.findProcessDefinitionById(processDefinitionId);
- return processDefinition.getAttachment(name);
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import java.io.InputStream;
+
+import org.jbpm.env.Environment;
+import org.jbpm.session.RepositorySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetResourceAsStreamCmd extends AbstractCommand<InputStream> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected long deploymentDbid;
+ protected String resourceName;
+
+ public GetResourceAsStreamCmd(long deploymentDbid, String resourceName) {
+ this.deploymentDbid = deploymentDbid;
+ this.resourceName = resourceName;
+ }
+
+ public InputStream execute(Environment environment) {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ InputStream resourceStream = repositorySession.getResourceAsStream(deploymentDbid, resourceName);
+ return resourceStream;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.JbpmException;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.client.ClientProcessInstance;
-import org.jbpm.env.Environment;
-import org.jbpm.session.PvmDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class StartExecutionCmd extends VariablesCmd<Execution> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionId;
- protected String executionKey;
-
- public StartExecutionCmd(String processDefinitionId, Map<String, Object> variables, String executionKey) {
- this.processDefinitionId = processDefinitionId;
- this.variables = variables;
- this.executionKey = executionKey;
- }
-
- public Execution execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
-
- ClientProcessDefinition processDefinition = null;
-
- processDefinition = pvmDbSession.findProcessDefinitionById(processDefinitionId);
- if (processDefinition==null) {
- throw new JbpmException("no process definition with id '"+processDefinitionId+"'");
- }
-
- ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
- processInstance.setVariables(variables);
- processInstance.start();
-
- pvmDbSession.save(processInstance);
- return processInstance;
- }
-
- public String getProcessDefinitionKey() {
- return processDefinitionId;
- }
- public void setProcessDefinitionKey(String processDefinitionKey) {
- this.processDefinitionId = processDefinitionKey;
- }
- public String getExecutionKey() {
- return executionKey;
- }
- public void setExecutionKey(String executionKey) {
- this.executionKey = executionKey;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.JbpmException;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.client.ClientProcessInstance;
-import org.jbpm.env.Environment;
-import org.jbpm.session.PvmDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StartExecutionInLatestCmd extends VariablesCmd<Execution> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionKey;
- protected String executionKey;
-
- public StartExecutionInLatestCmd(String processDefinitionKey, Map<String, Object> variables, String executionKey) {
- if (processDefinitionKey==null) {
- throw new JbpmException("processDefinitionKey is null");
- }
- this.processDefinitionKey = processDefinitionKey;
- this.variables = variables;
- this.executionKey = executionKey;
- }
-
- public Execution execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
-
- ClientProcessDefinition processDefinition = null;
-
- processDefinition = pvmDbSession.findLatestProcessDefinitionByKey(processDefinitionKey);
-
- if (processDefinition==null) {
- throw new JbpmException("no process definition with key '"+processDefinitionKey+"'");
- }
-
- ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
- processInstance.setVariables(variables);
- processInstance.start();
-
- pvmDbSession.save(processInstance);
- return processInstance;
- }
-
- public String getExecutionKey() {
- return executionKey;
- }
- public void setExecutionKey(String executionKey) {
- this.executionKey = executionKey;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,82 @@
+/*
+ * 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 java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.env.Environment;
+import org.jbpm.session.PvmDbSession;
+import org.jbpm.session.RepositorySession;
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartProcessInstanceCmd extends VariablesCmd<Execution> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processDefinitionId;
+ protected String executionKey;
+
+ public StartProcessInstanceCmd(String processDefinitionId, Map<String, Object> variables, String executionKey) {
+ this.processDefinitionId = processDefinitionId;
+ this.variables = variables;
+ this.executionKey = executionKey;
+ }
+
+ public Execution execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+
+ ClientProcessDefinition processDefinition = (ClientProcessDefinition)
+ repositorySession.loadProcessDefinitionById(processDefinitionId);
+ if (processDefinition==null) {
+ throw new JbpmException("no process definition with id '"+processDefinitionId+"'");
+ }
+
+ ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
+ processInstance.setVariables(variables);
+ processInstance.start();
+
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(processInstance);
+
+ return processInstance;
+ }
+
+ public String getProcessDefinitionKey() {
+ return processDefinitionId;
+ }
+ public void setProcessDefinitionKey(String processDefinitionKey) {
+ this.processDefinitionId = processDefinitionKey;
+ }
+ public String getExecutionKey() {
+ return executionKey;
+ }
+ public void setExecutionKey(String executionKey) {
+ this.executionKey = executionKey;
+ }
+}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -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.cmd;
+
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.env.Environment;
+import org.jbpm.session.RepositorySession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartProcessInstanceInLatestCmd extends VariablesCmd<Execution> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processDefinitionKey;
+ protected String executionKey;
+
+ public StartProcessInstanceInLatestCmd(String processDefinitionKey, Map<String, Object> variables, String executionKey) {
+ if (processDefinitionKey==null) {
+ throw new JbpmException("processDefinitionKey is null");
+ }
+ this.processDefinitionKey = processDefinitionKey;
+ this.variables = variables;
+ this.executionKey = executionKey;
+ }
+
+ public Execution execute(Environment environment) throws Exception {
+ ClientProcessDefinition processDefinition = null;
+
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ processDefinition = (ClientProcessDefinition) repositorySession.createProcessDefinitionQuery()
+ .key(processDefinitionKey)
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0, 1)
+ .uniqueResult();
+
+ if (processDefinition==null) {
+ throw new JbpmException("no process definition with key '"+processDefinitionKey+"'");
+ }
+
+ processDefinition = repositorySession.loadProcessDefinitionById(processDefinition.getId());
+
+ ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
+ processInstance.setVariables(variables);
+ processInstance.start();
+
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(processInstance);
+ return processInstance;
+ }
+
+ public String getExecutionKey() {
+ return executionKey;
+ }
+ public void setExecutionKey(String executionKey) {
+ this.executionKey = executionKey;
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/AssignFileTypeDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/AssignFileTypeDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/AssignFileTypeDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,59 +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.deploy;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class AssignFileTypeDeployer implements Deployer, Serializable {
-
- /* maps extensions to file types */
- Map<String, String> fileTypes = new HashMap<String, String>();
-
- private static final long serialVersionUID = 1L;
-
- public void deploy(DeploymentImpl deployment) {
- for (String fileName: deployment.getFileNames()) {
- for (String extension: fileTypes.keySet()) {
- if (fileName.endsWith(extension)) {
- String fileType = fileTypes.get(extension);
- deployment.setFileType(fileName, fileType);
- break;
- }
- }
- }
- }
-
- public void addFileType(String extension, String fileType) {
- fileTypes.put(extension, fileType);
- }
-
- public String toString() {
- return "assign-file-type";
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProblemsDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProblemsDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProblemsDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,55 +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.deploy;
-
-import java.io.Serializable;
-
-import org.jbpm.JbpmException;
-import org.jbpm.Problem;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CheckProblemsDeployer implements Deployer, Serializable {
-
- private static final Log log = Log.getLog(CheckProblemsDeployer.class.getName());
- private static final long serialVersionUID = 1L;
-
- public void deploy(DeploymentImpl deployment) {
- if (deployment.hasProblems()) {
- for (Problem problem: deployment.getProblems()) {
- Throwable cause = problem.getCause();
- if (cause!=null) {
- log.debug("deployment exception", cause);
- }
- }
- throw new JbpmException("problems during deployment: "+deployment.getProblemsText());
- }
- }
-
- public String toString() {
- return "check-problems";
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckProcessDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,152 +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.deploy;
-
-import java.io.Serializable;
-
-import org.jbpm.ProcessDefinition;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.env.Environment;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-import org.jbpm.pvm.internal.wire.binding.CheckProcessBinding;
-import org.jbpm.session.PvmDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class CheckProcessDeployer implements Deployer, Serializable {
-
- private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(CheckProcessDeployer.class.getName());
-
- protected boolean assignVersion = true;
- protected boolean assignKey = true;
-
- public void deploy(DeploymentImpl deployment) {
- Environment environment = Environment.getCurrent();
- if (environment==null) {
- deployment.addProblem("environment is required by deployer "+CheckProcessBinding.TAG);
- return;
- }
-
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- if (pvmDbSession==null) {
- deployment.addProblem(PvmDbSession.class.getName()+" is required in the environment by deployer "+CheckProcessBinding.TAG);
- return;
- }
-
- for (ProcessDefinition processDefinition : deployment.getProcessDefinitions()) {
- checkProcessDefinition(processDefinition, deployment, pvmDbSession);
- }
- }
-
- public void checkProcessDefinition(ProcessDefinition processDefinition, DeploymentImpl deployment, PvmDbSession pvmDbSession) {
- if ( (processDefinition.getName()==null)
- || ("".equals(processDefinition.getName()))
- ) {
- // A problem was already added by the JpdlParser
- return;
- }
-
- checkKey((ProcessDefinitionImpl)processDefinition, deployment, pvmDbSession);
- checkVersion((ProcessDefinitionImpl)processDefinition, deployment, pvmDbSession);
- checkId((ProcessDefinitionImpl)processDefinition, deployment, pvmDbSession);
- }
-
- protected void checkKey(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment, PvmDbSession pvmDbSession) {
- String name = processDefinition.getName();
- String key = processDefinition.getKey();
- if ( (key==null)
- && assignKey
- ) {
- // replace any non-word character with an underscore
- key = name.replaceAll("\\W", "_");
-
- processDefinition.setKey(key);
- }
-
- String existingKey = pvmDbSession.findProcessDefinitionKeyByName(name);
- if ( (existingKey!=null)
- && (!existingKey.equals(key))
- ) {
- deployment.addProblem("invalid key '"+key+"' in process "+processDefinition.getName()+". Existing process has name '"+name+"' and key '"+existingKey+"'");
- }
-
- String existingName = pvmDbSession.findProcessDefinitionNameByKey(key);
- if ( (existingName!=null)
- && (!existingName.equals(name))
- ) {
- deployment.addProblem("invalid name '"+name+"' in process "+processDefinition.getName()+". Existing process has name '"+existingName+"' and key '"+key+"'");
- }
- }
-
- protected void checkVersion(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment, PvmDbSession pvmDbSession) {
- int version = processDefinition.getVersion();
- String key = processDefinition.getKey();
- if ( (version==ProcessDefinitionImpl.UNASSIGNED_VERSION)
- && ! assignVersion
- ) {
- deployment.addProblem("no version specified in process definition "+key);
- }
-
- if ( (version==ProcessDefinitionImpl.UNASSIGNED_VERSION)
- && assignVersion
- ) {
- ClientProcessDefinition latestDeployedVersion = pvmDbSession.findLatestProcessDefinitionByKey(key);
- if (latestDeployedVersion!=null) {
- version = latestDeployedVersion.getVersion() + 1;
- } else {
- version = 1;
- }
- log.debug("assigning version "+version+" to process definition "+key);
- processDefinition.setVersion(version);
-
- }
- }
-
- protected void checkId(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment, PvmDbSession pvmDbSession) {
- String id = processDefinition.getId();
- if (id==null) {
- id = processDefinition.getKey()+"-"+processDefinition.getVersion();
- log.trace("created id '"+id+"' for "+processDefinition);
- processDefinition.setId(id);
- }
-
- if (pvmDbSession.findProcessDefinitionById(id) != null) {
- deployment.addProblem("process '" + id + "' already exists");
- }
- }
-
- public void setAssignVersion(boolean assignVersion) {
- this.assignVersion = assignVersion;
- }
-
- public void setAssignKey(boolean assignKey) {
- this.assignKey = assignKey;
- }
-
- public String toString() {
- return "check-process";
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,35 +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.deploy;
-
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public interface Deployer {
-
- void deploy(DeploymentImpl deployment);
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,68 +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.deploy;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.JbpmException;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-
-
-
-/** manages sequences of deployers for multiple process languages.
- *
- * <p>Each process language has a language-id. In a deployment a language-id can
- * be given. This deployer manager will be able to find a sequence of deployers
- * based on the language-id.
- * </p>
- *
- * <p>Also, an extension can be associated to a process language. In that case
- * the deployer manager can find the deployer sequence based on the
- * extension of the deployed file name.
- * </p>
- *
- * @author Tom Baeyens
- */
-public class DeployerManager {
-
- private static final Log log = Log.getLog(DeployerManager.class.getName());
-
- /** configurable list of deployers */
- protected List<Deployer> deployers = new ArrayList<Deployer>();
-
- public void deploy(DeploymentImpl deployment) {
- if (deployment==null) {
- throw new JbpmException("deployment is null");
- }
-
- for (Deployer deployer: deployers) {
- if (log.isTraceEnabled()) log.trace("applying deployer "+deployer+" to "+deployment);
- deployer.deploy(deployment);
- }
- }
-
- public void setDeployers(List<Deployer> deployers) {
- this.deployers = deployers;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveDeployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveDeployer.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveDeployer.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,77 +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.deploy;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.List;
-
-import org.jbpm.env.Environment;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-import org.jbpm.session.PvmDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class SaveDeployer implements Deployer, Serializable {
-
- private static final long serialVersionUID = 1L;
- private static Log log = Log.getLog(SaveDeployer.class.getName());
-
- public void deploy(DeploymentImpl deployment) {
- Environment environment = Environment.getCurrent();
- if (environment==null) {
- deployment.addProblem("environment is required by "+getClass().getName());
- return;
- }
-
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- if (pvmDbSession==null) {
- deployment.addProblem(PvmDbSession.class.getName()+" is required in the environment by "+getClass().getName());
- return;
- }
-
- boolean deployedProcess = false;
-
- List<ProcessDefinitionImpl> processDefinitions = (List)deployment.getProcessDefinitions();
-
- for (ProcessDefinitionImpl processDefinition : processDefinitions) {
- log.debug("saving process definition "+processDefinition);
- deployedProcess = true;
- pvmDbSession.save(processDefinition);
- for (String fileName : deployment.getFileNames()) {
- InputStream inputStream = deployment.getFile(fileName);
- processDefinition.addAttachment(fileName, inputStream);
- }
- }
-
- if (!deployedProcess) {
- log.info("no process definition in "+deployment);
- }
- }
-
- public String toString() {
- return "save";
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -208,7 +208,12 @@
public List<String> findProcessInstanceIds(String processDefinitionId) {
// query definition can be found at the bottom of resource jbpm.pvm.job.hbm.xml
- Query query = session.getNamedQuery("findProcessInstanceIds");
+ Query query = session.createQuery(
+ "select processInstance.id " +
+ "from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance " +
+ "where processInstance.processDefinitionId = :processDefinitionId " +
+ " and processInstance.parent is null"
+ );
query.setString("processDefinitionId", processDefinitionId);
return query.list();
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -68,10 +68,10 @@
import org.jbpm.pvm.internal.model.op.ProceedToDestination;
import org.jbpm.pvm.internal.model.op.Signal;
import org.jbpm.pvm.internal.model.op.TakeTransition;
-import org.jbpm.pvm.internal.repository.api.RepositorySession;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.session.MessageSession;
+import org.jbpm.session.RepositorySession;
/**
* @author Tom Baeyens
@@ -1016,10 +1016,7 @@
}
public String getActivityName() {
- if (getActivity()!=null) {
- return getActivity().getName();
- }
- return null;
+ return activityName;
}
public ProcessDefinitionImpl getProcessDefinition() {
@@ -1027,7 +1024,7 @@
&& (processDefinitionId!=null)
) {
RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
- processDefinition = (ProcessDefinitionImpl) repositorySession.findObjectByPropertyValue("jpdl.id", processDefinitionId);
+ processDefinition = (ProcessDefinitionImpl) repositorySession.loadProcessDefinitionById(processDefinitionId);
if (processDefinition==null) {
throw new JbpmException("couldn't find process definition "+processDefinitionId+" in the repository");
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -35,6 +35,7 @@
import org.jbpm.model.IdGenerator;
import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.IoUtil;
/**
@@ -72,6 +73,8 @@
/** the activity which is executed when the process starts */
protected ActivityImpl initial;
+ protected Map<String, TaskDefinitionImpl> taskDefinitions;
+
/** the attachments */
protected Map<String, Lob> attachments;
@@ -127,6 +130,22 @@
public IdGenerator getIdGenerator() {
return Environment.getFromCurrent(IdGenerator.class, false);
}
+
+ // task definitions /////////////////////////////////////////////////////////
+
+ public void addTaskDefinitionImpl(TaskDefinitionImpl taskDefinition) {
+ if (taskDefinitions==null) {
+ taskDefinitions = new HashMap<String, TaskDefinitionImpl>();
+ }
+ taskDefinitions.put(taskDefinition.getName(), taskDefinition);
+ }
+
+ public TaskDefinitionImpl getTaskDefinition(String name) {
+ if (taskDefinitions!=null) {
+ return taskDefinitions.get(name);
+ }
+ return null;
+ }
// attachments //////////////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -22,9 +22,11 @@
package org.jbpm.pvm.internal.query;
import java.io.ObjectStreamException;
+import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
+import org.jbpm.ProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -37,6 +39,7 @@
private static final long serialVersionUID = 1L;
+ protected Session session;
protected CommandService commandService;
protected String orderByClause = null;
protected Page page = null;
@@ -46,6 +49,10 @@
this.commandService = commandService;
}
+ public AbstractQuery(Session session) {
+ this.session = session;
+ }
+
protected abstract void applyParameters(Query query);
public abstract String hql();
@@ -53,20 +60,31 @@
/* reuse by copy and paste:
* (return type can't be changed)
public ConcreteQuery page(int firstResult, int maxResults) {
- this.page = new Page{firstResult, maxResults};
+ this.page = new Page(firstResult, maxResults);
return this;
}
*/
+ public List execute() {
+ if (commandService!=null) {
+ return (List) commandService.execute(this);
+ }
+ return (List) execute(session);
+ }
+
public Object execute(Environment environment) throws Exception {
Session session = environment.get(Session.class);
+ return execute(session);
+ }
+
+ public Object execute(Session session) {
String hql = hql();
Query query = session.createQuery(hql);
applyParameters(query);
applyPage(query);
return query.list();
}
-
+
protected void appendWhereClause(String whereClause, StringBuffer hql) {
if (isWhereAdded) {
hql.append(" and ");
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -39,8 +39,6 @@
private static final long serialVersionUID = 1L;
protected boolean onlyProcessInstances;
- protected String processDefinitionNameLike;
- protected String processDefinitionKeyLike;
protected String processDefinitionId;
protected String processInstanceId;
@@ -80,17 +78,9 @@
}
if (processDefinitionId!=null) {
- appendWhereClause("execution.processDefinition.id = '"+processDefinitionId+"' ", hql);
+ appendWhereClause("execution.processDefinitionId = '"+processDefinitionId+"' ", hql);
}
- if (processDefinitionNameLike!=null) {
- appendWhereClause("execution.processDefinition.name like '"+processDefinitionNameLike+"' ", hql);
- }
-
- if (processDefinitionKeyLike!=null) {
- appendWhereClause("execution.processDefinition.key like '"+processDefinitionKeyLike+"' ", hql);
- }
-
appendOrderByClause(hql);
return hql.toString();
@@ -114,16 +104,6 @@
return this;
}
- public ExecutionQuery processDefinitionKeyLike(String processDefinitionKey) {
- this.processDefinitionKeyLike = processDefinitionKey;
- return this;
- }
-
- public ExecutionQuery processDefinitionNameLike(String processDefinitionName) {
- this.processDefinitionNameLike = processDefinitionName;
- return this;
- }
-
public ExecutionQuery page(int firstResult, int maxResults) {
this.page = new Page(firstResult, maxResults);
return this;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,13 +21,19 @@
*/
package org.jbpm.pvm.internal.query;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.hibernate.Query;
+import org.hibernate.Session;
+import org.jbpm.JbpmException;
import org.jbpm.ProcessDefinition;
import org.jbpm.ProcessDefinitionQuery;
import org.jbpm.cmd.CommandService;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.DeploymentProperty;
/**
@@ -37,34 +43,98 @@
private static final long serialVersionUID = 1L;
- private static final String NEWLINE = System.getProperty("line.separator");
-
+ protected String id;
+ protected String key;
protected String nameLike;
- protected String keyLike;
+ protected String name;
+ protected Long deploymentDbid;
public ProcessDefinitionQueryImpl(CommandService commandService) {
super(commandService);
}
- public List<ProcessDefinition> execute() {
- return (List) commandService.execute(this);
+ public ProcessDefinitionQueryImpl(Session session) {
+ super(session);
}
+ public ProcessDefinition uniqueResult() {
+ List<ProcessDefinition> list = execute();
+ if (list.isEmpty()) {
+ return null;
+ }
+ if (list.size()>1) {
+ throw new JbpmException("result not unique: "+list.size());
+ }
+ return list.get(0);
+ }
+
+ public Object execute(Session session) {
+ List<Map<String, Object>> propertyMaps = (List<Map<String, Object>>) super.execute(session);
+
+ List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
+ for (Map<String, Object> properties: propertyMaps) {
+ ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
+ processDefinition.setName((String)properties.get("name"));
+ processDefinition.setKey((String)properties.get("key"));
+ processDefinition.setId((String)properties.get("id"));
+ processDefinition.setDeploymentDbid((Long)properties.get("deploymentDbid"));
+ Long versionLong = (Long)properties.get("version");
+ processDefinition.setVersion(versionLong.intValue());
+
+ processDefinitions.add(processDefinition);
+ }
+
+ return processDefinitions;
+ }
+
public String hql() {
StringBuffer hql = new StringBuffer();
- hql.append("select pd ");
+ hql.append("select new map( idProperty.objectName as name, " +
+ "idProperty.stringValue as id," +
+ "idProperty.deployment.dbid as deploymentDbid, " +
+ "keyProperty.stringValue as key, " +
+ "versionProperty.longValue as version ) ");
hql.append("from ");
- hql.append(ProcessDefinitionImpl.class.getName());
- hql.append(" as pd ");
+ hql.append(DeploymentImpl.class.getName());
+ hql.append(" as deployment, ");
+ hql.append(DeploymentProperty.class.getName());
+ hql.append(" as idProperty, ");
+ hql.append(DeploymentProperty.class.getName());
+ hql.append(" as keyProperty, ");
+ hql.append(DeploymentProperty.class.getName());
+ hql.append(" as versionProperty ");
+
+ appendWhereClause("idProperty.key = 'id'", hql);
+ appendWhereClause("idProperty.deployment = deployment ", hql);
+ appendWhereClause("keyProperty.key = 'key' ", hql);
+ appendWhereClause("keyProperty.objectName = idProperty.objectName ", hql);
+ appendWhereClause("keyProperty.deployment = deployment ", hql);
+
+ appendWhereClause("versionProperty.key = 'version' ", hql);
+ appendWhereClause("versionProperty.objectName = idProperty.objectName ", hql);
+ appendWhereClause("versionProperty.deployment = deployment ", hql);
+
+ if (id!=null) {
+ appendWhereClause("idProperty.stringValue = '"+id+"'", hql);
+ }
+
if (nameLike!=null) {
- appendWhereClause("pd.name like '"+nameLike+"'", hql);
+ appendWhereClause("idProperty.objectName like '"+nameLike+"' ", hql);
}
- if (keyLike!=null) {
- appendWhereClause("pd.key like '"+keyLike+"'", hql);
+ if (name!=null) {
+ appendWhereClause("idProperty.objectName = '"+nameLike+"' ", hql);
}
+
+ if (key!=null) {
+ appendWhereClause("keyProperty.stringValue = '"+key+"' ", hql);
+ }
+ if (deploymentDbid!=null) {
+ appendWhereClause("idProperty.deployment.dbid = "+deploymentDbid+" ", hql);
+ }
+
appendOrderByClause(hql);
return hql.toString();
@@ -73,23 +143,43 @@
protected void applyParameters(Query query) {
}
+ public ProcessDefinitionQuery id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public ProcessDefinitionQuery key(String key) {
+ this.key = key;
+ return this;
+ }
+
public ProcessDefinitionQuery nameLike(String name) {
this.nameLike = name;
return this;
}
- public ProcessDefinitionQuery keyLike(String key) {
- this.keyLike = key;
+ public ProcessDefinitionQuery name(String name) {
+ this.name = name;
return this;
}
+ public ProcessDefinitionQuery deploymentDbid(long deploymentDbid) {
+ this.deploymentDbid = deploymentDbid;
+ return this;
+ }
+
public ProcessDefinitionQuery orderAsc(String property) {
- addOrderByClause("pd."+property+" asc");
+ addOrderByClause(property+" asc");
return this;
}
public ProcessDefinitionQuery orderDesc(String property) {
- addOrderByClause("pd."+property+" desc");
+ addOrderByClause(property+" desc");
return this;
}
+
+ public ProcessDefinitionQuery page(int firstResult, int maxResults) {
+ this.page = new Page(firstResult, maxResults);
+ return this;
+ }
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.repository;
-
-import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.repository.api.RepositorySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeployCmd implements Command<Long> {
-
- private static final long serialVersionUID = 1L;
-
- private static Log log = Log.getLog(DeployCmd.class.getName());
-
- DeploymentImpl deployment;
-
- public DeployCmd(DeploymentImpl deployment) {
- this.deployment = deployment;
- }
-
- public Long execute(Environment environment) throws Exception {
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- long deploymentDbid = repositorySession.deploy(deployment);
-
- if (deployment.hasProblems()) {
- String problemsText = deployment.getProblemsText();
- if (problemsText!=null) {
- String errorMsg = "problems during deployment of "+deployment+": "+problemsText;
- log.info(errorMsg);
- throw new JbpmException(errorMsg);
- }
- }
-
- return deploymentDbid;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployExecutionService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployExecutionService.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployExecutionService.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,36 +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.repository;
-
-import org.jbpm.Execution;
-import org.jbpm.pvm.internal.svc.ExecutionServiceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeployExecutionService extends ExecutionServiceImpl {
-
- public Execution startProcessInstanceByKey(String processDefinitionKey) {
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionKey, null, null));
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -31,10 +31,9 @@
List<Deployer> deployers;
- public Object deploy(DeploymentImpl deployment) {
+ public void deploy(DeploymentImpl deployment) {
for (Deployer deployer: deployers) {
deployer.deploy(deployment);
}
- return null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -24,6 +24,7 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.ObjectStreamException;
+import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -32,12 +33,18 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import org.jbpm.Deployment;
import org.jbpm.JbpmException;
+import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.lob.Lob;
-import org.jbpm.pvm.internal.repository.api.Deployment;
import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
+import org.jbpm.pvm.internal.stream.InputStreamInput;
+import org.jbpm.pvm.internal.stream.ResourceStreamInput;
import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.stream.StringStreamInput;
+import org.jbpm.pvm.internal.stream.UrlStreamInput;
import org.jbpm.pvm.internal.util.IoUtil;
import org.jbpm.pvm.internal.xml.ProblemList;
@@ -50,11 +57,9 @@
protected long dbid;
protected String name;
protected long timestamp;
-
protected Map<String, Lob> resources;
protected CommandService commandService;
-
protected Map<String, Object> objects;
protected Set<DeploymentProperty> objectProperties;
@@ -68,32 +73,25 @@
public long deploy() {
return commandService.execute(new DeployCmd(this));
}
- public void setName(String name) {
- this.name = name;
- }
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
+ public Deployment addResourceFromClasspath(String resourceName) {
+ addResourceFromStreamInput(resourceName, new ResourceStreamInput(resourceName));
+ return this;
}
- public Deployment addStreamInput(String name, StreamInput streamInput) {
- if (resources==null) {
- resources = new HashMap<String, Lob>();
- }
- byte[] bytes = IoUtil.readBytes(streamInput.openStream());
- Lob lob = new Lob(bytes);
- resources.put(name, lob);
+ public Deployment addResourceFromString(String resourceName, String text) {
+ addResourceFromStreamInput(resourceName, new StringStreamInput(text));
return this;
}
-
- public Deployment addZipInputStream(ZipInputStream zipInputStream) {
+
+ public Deployment addResourcesFromZipInputStream(ZipInputStream zipInputStream) {
try {
ZipEntry zipEntry = zipInputStream.getNextEntry();
while(zipEntry!=null) {
String entryName = zipEntry.getName();
byte[] bytes = IoUtil.readBytes(zipInputStream);
if (bytes!=null) {
- addStreamInput(entryName, new ByteArrayStreamInput(bytes));
+ addResourceFromStreamInput(entryName, new ByteArrayStreamInput(bytes));
}
zipEntry = zipInputStream.getNextEntry();
}
@@ -102,7 +100,27 @@
}
return this;
}
-
+
+ public Deployment addResourceFromInputStream(String resourceName, InputStream inputStream) {
+ addResourceFromStreamInput(resourceName, new InputStreamInput(inputStream));
+ return this;
+ }
+
+ public Deployment addResourceFromUrl(URL url) {
+ addResourceFromStreamInput(url.toString(), new UrlStreamInput(url));
+ return this;
+ }
+
+ public Deployment addResourceFromStreamInput(String name, StreamInput streamInput) {
+ if (resources==null) {
+ resources = new HashMap<String, Lob>();
+ }
+ byte[] bytes = IoUtil.readBytes(streamInput.openStream());
+ Lob lob = new Lob(bytes);
+ resources.put(name, lob);
+ return this;
+ }
+
public Set<String> getResourceNames() {
if (resources==null) {
return Collections.EMPTY_SET;
@@ -128,14 +146,16 @@
objects.put(objectName, object);
}
- public void addObjectProperty(String objectName, String key, String value) {
+ public void addObjectProperty(String objectName, String key, Object value) {
if (objectProperties==null) {
objectProperties = new HashSet<DeploymentProperty>();
}
- objectProperties.add(new DeploymentProperty(this, objectName, key, value));
+ DeploymentProperty deploymentProperty = new DeploymentProperty(this, objectName, key);
+ deploymentProperty.setValue(value);
+ objectProperties.add(deploymentProperty);
}
- public String getObjectProperty(String objectName, String key) {
+ public Object getObjectProperty(String objectName, String key) {
if (objectProperties!=null) {
for (DeploymentProperty deploymentProperty: objectProperties) {
if ( (deploymentProperty.getObjectName().equals(objectName))
@@ -148,6 +168,17 @@
return null;
}
+ public boolean hasObjectProperties(String objectName) {
+ if (objectProperties!=null) {
+ for (DeploymentProperty deploymentProperty: objectProperties) {
+ if (deploymentProperty.getObjectName().equals(objectName)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
protected Object writeReplace() throws ObjectStreamException {
commandService = null;
return this;
@@ -156,16 +187,29 @@
public long getDbid() {
return dbid;
}
+ public Map<String, Object> getObjects() {
+ return objects;
+ }
+ public Set<DeploymentProperty> getObjectProperties() {
+ return objectProperties;
+ }
public String getName() {
return name;
}
+ public DeploymentImpl setName(String name) {
+ this.name = name;
+ return this;
+ }
public long getTimestamp() {
return timestamp;
}
- public Map<String, Object> getObjects() {
- return objects;
+ public DeploymentImpl setTimestamp(long timestamp) {
+ this.timestamp = timestamp;
+ return this;
}
- public Set<DeploymentProperty> getObjectProperties() {
- return objectProperties;
+
+
+ public Deployment addProcessDefinition(ClientProcessDefinition processDefinition) {
+ throw new UnsupportedOperationException("implement me");
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentProperty.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentProperty.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentProperty.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -23,7 +23,9 @@
import java.io.Serializable;
+import org.jbpm.JbpmException;
+
/**
* @author Tom Baeyens
*/
@@ -35,20 +37,20 @@
protected DeploymentImpl deployment;
protected String objectName;
protected String key;
- protected String value;
+ protected String stringValue;
+ protected Long longValue;
public DeploymentProperty() {
}
- public DeploymentProperty(DeploymentImpl deployment, String objectName, String key, String value) {
+ public DeploymentProperty(DeploymentImpl deployment, String objectName, String key) {
this.deployment = deployment;
this.objectName = objectName;
this.key = key;
- this.value = value;
}
public String toString() {
- return "{"+objectName+","+key+","+value+"}";
+ return "{"+objectName+","+key+","+(stringValue!=null?stringValue:longValue)+"}";
}
public String getObjectName() {
@@ -57,10 +59,39 @@
public String getKey() {
return key;
}
- public String getValue() {
- return value;
- }
public DeploymentImpl getDeployment() {
return deployment;
}
+ public String getStringValue() {
+ return stringValue;
+ }
+ public Long getLongValue() {
+ return longValue;
+ }
+ public void setStringValue(String stringValue) {
+ this.stringValue = stringValue;
+ }
+ public void setLongValue(Long longValue) {
+ this.longValue = longValue;
+ }
+
+ public void setValue(Object value) {
+ if (value==null) {
+ stringValue = null;
+ longValue = null;
+ } else if (value instanceof String) {
+ stringValue = (String)value;
+ } else if (value instanceof Long) {
+ longValue = (Long)value;
+ } else {
+ throw new JbpmException("value type "+value.getClass().getName()+" not supported (only string and long)");
+ }
+ }
+
+ public Object getValue() {
+ if (stringValue!=null) {
+ return stringValue;
+ }
+ return longValue;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -41,15 +41,19 @@
}
public void set(long deploymentDbid, Map<String, Object> objects) {
- Map<String, Object> deploymentObjects = deployments.get(deploymentDbid);
- if (deploymentObjects==null) {
- deploymentObjects = new HashMap<String, Object>();
- deployments.put(deploymentDbid, deploymentObjects);
+ if (objects==null) {
+ deployments.put(deploymentDbid, null);
+ } else {
+ Map<String, Object> deploymentObjects = deployments.get(deploymentDbid);
+ if (deploymentObjects==null) {
+ deploymentObjects = new HashMap<String, Object>();
+ deployments.put(deploymentDbid, deploymentObjects);
+ }
+ for (String objectName: objects.keySet()) {
+ Object object = objects.get(objectName);
+ deploymentObjects.put(objectName, object);
+ }
}
- for (String objectName: objects.keySet()) {
- Object object = objects.get(objectName);
- deploymentObjects.put(objectName, object);
- }
}
public void clear() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -23,9 +23,13 @@
import java.io.InputStream;
+import org.jbpm.Deployment;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.RepositoryService;
import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.repository.api.Deployment;
-import org.jbpm.pvm.internal.repository.api.RepositoryService;
+import org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd;
+import org.jbpm.pvm.internal.cmd.GetResourceAsStreamCmd;
+import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
/**
* @author Tom Baeyens
@@ -38,10 +42,20 @@
return new DeploymentImpl(commandService);
}
- public void deleteDeployment(long deploymentdbid) {
+ public void deleteDeployment(long deploymentDbid) {
+ commandService.execute(new DeleteDeploymentCmd(deploymentDbid));
}
-
- public InputStream getResource(String deploymentId, String resource) {
- return null;
+
+ public void deleteDeploymentCascade(long deploymentDbid) {
+ commandService.execute(new DeleteDeploymentCmd(deploymentDbid, true));
}
+
+ public InputStream getResourceAsStream(long deploymentDbid, String resource) {
+ return commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ }
+
+ public ProcessDefinitionQuery createProcessDefinitionQuery() {
+ return new ProcessDefinitionQueryImpl(commandService);
+ }
+
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,14 +21,18 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.io.InputStream;
import java.util.ArrayList;
-import java.util.List;
import org.hibernate.Session;
+import org.jbpm.Deployment;
import org.jbpm.JbpmException;
import org.jbpm.Problem;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.repository.api.RepositorySession;
+import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
+import org.jbpm.session.RepositorySession;
/**
* @author Tom Baeyens
@@ -37,33 +41,37 @@
private static Log log = Log.getLog(RepositorySessionImpl.class.getName());
- Session session;
- RepositoryCache repositoryCache;
- DeployerManager deployerManager;
+ protected Session session;
+ protected RepositoryCache repositoryCache;
+ protected DeployerManager deployerManager;
- public long deploy(DeploymentImpl deployment) {
- session.save(deployment);
+ public long deploy(Deployment deployment) {
+ DeploymentImpl deploymentImpl = (DeploymentImpl) deployment;
+ session.save(deploymentImpl);
- deployment.setTimestamp(System.currentTimeMillis());
- deployment.setProblems(new ArrayList<Problem>());
+ deploymentImpl.setProblems(new ArrayList<Problem>());
- deployerManager.deploy(deployment);
+ deployerManager.deploy(deploymentImpl);
- if (deployment.hasProblems()) {
- for (Problem problem: deployment.getProblems()) {
+ if (deploymentImpl.hasProblems()) {
+ for (Problem problem: deploymentImpl.getProblems()) {
Throwable cause = problem.getCause();
if (cause!=null) {
log.debug("deployment exception", cause);
}
}
- throw new JbpmException("problems during deployment: "+deployment.getProblemsText());
+ throw new JbpmException("problems during deployment: "+deploymentImpl.getProblemsText());
} else {
- repositoryCache.set(deployment.getDbid(), deployment.getObjects());
+ repositoryCache.set(deploymentImpl.getDbid(), deploymentImpl.getObjects());
}
- return deployment.getDbid();
+ return deploymentImpl.getDbid();
}
+
+ public DeploymentImpl getDeployment(long deploymentDbid) {
+ return (DeploymentImpl) session.get(DeploymentImpl.class, deploymentDbid);
+ }
public Object getObject(long deploymentDbid, String objectName) {
Object object = repositoryCache.get(deploymentDbid, objectName);
@@ -83,41 +91,36 @@
}
return object;
}
+
+ public InputStream getResourceAsStream(long deploymentDbid, String resourceName) {
+ DeploymentImpl deployment = getDeployment(deploymentDbid);
+ if (deployment==null) {
+ throw new JbpmException("deployment "+deploymentDbid+" doesn't exist");
+ }
+ return deployment.getResourceAsStream(resourceName);
+ }
- public Object findObjectByPropertyValue(String key, String value) {
+ // queries //////////////////////////////////////////////////////////////////
+
+ public ProcessDefinitionQuery createProcessDefinitionQuery() {
+ return new ProcessDefinitionQueryImpl(session);
+ }
+
+ public ClientProcessDefinition loadProcessDefinitionById(String processDefinitionId) {
DeploymentProperty deploymentProperty = (DeploymentProperty) session.createQuery(
"select deploymentProperty " +
"from "+DeploymentProperty.class.getName()+" as deploymentProperty " +
- "where deploymentProperty.key = '"+key+"' " +
- " and deploymentProperty.value = '"+value+"' " +
- "order by deploymentProperty.deployment.timestamp desc "
- ).uniqueResult();
+ "where deploymentProperty.key = 'id' " +
+ " and deploymentProperty.stringValue = '"+processDefinitionId+"' "
+ ).setMaxResults(1).uniqueResult();
if (deploymentProperty!=null) {
long deploymentDbid = deploymentProperty.getDeployment().getDbid();
String objectName = deploymentProperty.getObjectName();
- return getObject(deploymentDbid, objectName);
+ return (ClientProcessDefinition) getObject(deploymentDbid, objectName);
}
return null;
}
-
- public List<String> findObjectNames(String key, String value) {
- return session.createQuery(
- "select distinct deploymentProperty.objectName " +
- "from "+DeploymentProperty.class.getName()+" as deploymentProperty " +
- "where deploymentProperty.key = '"+key+"' " +
- " and deploymentProperty.value = '"+value+"' "
- ).list();
- }
-
- public List<String> findObjectPropertyValues(String objectName, String key) {
- return session.createQuery(
- "select distinct deploymentProperty.value " +
- "from "+DeploymentProperty.class.getName()+" as deploymentProperty " +
- "where deploymentProperty.objectName = '"+objectName+"' " +
- " and deploymentProperty.key = '"+key+"' "
- ).list();
- }
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/StartExecutionInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/StartExecutionInLatestCmd.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/StartExecutionInLatestCmd.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,81 +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.repository;
-
-import java.util.Map;
-
-import org.hibernate.Session;
-import org.jbpm.Execution;
-import org.jbpm.JbpmException;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.client.ClientProcessInstance;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.cmd.VariablesCmd;
-import org.jbpm.pvm.internal.repository.api.RepositorySession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StartExecutionInLatestCmd extends VariablesCmd<Execution> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionKey;
- protected String executionKey;
-
- public StartExecutionInLatestCmd(String processDefinitionKey, Map<String, Object> variables, String executionKey) {
- if (processDefinitionKey==null) {
- throw new JbpmException("processDefinitionKey is null");
- }
- this.processDefinitionKey = processDefinitionKey;
- this.variables = variables;
- this.executionKey = executionKey;
- }
-
- public Execution execute(Environment environment) throws Exception {
- ClientProcessDefinition processDefinition = null;
-
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- processDefinition = (ClientProcessDefinition) repositorySession
- .findObjectByPropertyValue("jpdl.key", processDefinitionKey);
-
- if (processDefinition==null) {
- throw new JbpmException("no process definition with key '"+processDefinitionKey+"'");
- }
-
- ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
- processInstance.setVariables(variables);
- processInstance.start();
-
- Session session = Environment.getFromCurrent(Session.class);
- session.save(processInstance);
- return processInstance;
- }
-
- public String getExecutionKey() {
- return executionKey;
- }
- public void setExecutionKey(String executionKey) {
- this.executionKey = executionKey;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/Deployment.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/Deployment.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -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.repository.api;
-
-import java.util.zip.ZipInputStream;
-
-import org.jbpm.pvm.internal.stream.StreamInput;
-
-/**
- * @author Tom Baeyens
- */
-public interface Deployment {
-
- void setName(String name);
-
- Deployment addStreamInput(String name, StreamInput streamInput);
- Deployment addZipInputStream(ZipInputStream zipInputStream);
-
- /** @return deploymentId */
- long deploy();
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositoryService.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositoryService.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,38 +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.repository.api;
-
-import java.io.InputStream;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface RepositoryService {
-
- public abstract Deployment createDeployment();
-
- public abstract void deleteDeployment(long deploymentDbid);
-
- public abstract InputStream getResource(String deploymentId, String resource);
-
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositorySession.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/api/RepositorySession.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.repository.api;
-
-import java.util.List;
-
-import org.jbpm.pvm.internal.repository.DeploymentImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface RepositorySession {
-
- Object getObject(long deploymentDbid, String objectName);
-
- long deploy(DeploymentImpl deployment);
-
- List<String> findObjectNames(String propertyKey, String propertyValue);
- List<String> findObjectPropertyValues(String objectName, String propertyKey);
- Object findObjectByPropertyValue(String propertyKey, String propertyValue);
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,365 +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.svc;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.jbpm.Deployment;
-import org.jbpm.JbpmException;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
-import org.jbpm.pvm.internal.stream.FileStreamInput;
-import org.jbpm.pvm.internal.stream.InputStreamInput;
-import org.jbpm.pvm.internal.stream.ResourceStreamInput;
-import org.jbpm.pvm.internal.stream.StreamInput;
-import org.jbpm.pvm.internal.stream.StringStreamInput;
-import org.jbpm.pvm.internal.stream.UrlStreamInput;
-import org.jbpm.pvm.internal.util.IoUtil;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.jbpm.pvm.internal.xml.ProblemImpl;
-import org.jbpm.pvm.internal.xml.ProblemList;
-import org.w3c.dom.Document;
-
-
-/** a deployment unit, containing all information in source format from which
- * a process definition will be created and stored in the process repository.
- *
- * For more info, see Deployment.
- *
- * @author Tom Baeyens
- */
-public class DeploymentImpl extends ProblemList implements Deployment, Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(DeploymentImpl.class.getName());
-
- private static final Parser parser = new Parser();
-
- protected ProcessServiceImpl processServiceImpl;
-
- protected String name;
- protected long timestamp;
-
- /** maps file names to stream source */
- protected Map<String, StreamInput> files = new HashMap<String,StreamInput>();
- /** maps file names to dom so that duplicate xml parsing can be avoided. */
- protected Map<String, Document> fileDocuments = new HashMap<String, Document>();
- /** maps file names to file types */
- protected Map<String, String> fileTypes = new HashMap<String,String>();
- /** process definitions */
- protected List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
-
- public DeploymentImpl(ProcessServiceImpl processServiceImpl) {
- this.processServiceImpl = processServiceImpl;
- this.problems = new ArrayList<ProblemImpl>();
- }
-
- public Deployment addResource(String resource) {
- addStreamSource(resource, new ResourceStreamInput(resource));
- return this;
- }
-
- public Deployment addFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamInput(file));
- return this;
- }
-
- public Deployment addUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamInput(url));
- return this;
- }
-
- public Deployment addInputStream(String name, InputStream inputStream) {
- addStreamSource(name, new InputStreamInput(inputStream));
- return this;
- }
-
- public Deployment addString(String name, String string) {
- addStreamSource(name, new StringStreamInput(string));
- return this;
- }
-
- public Deployment addArchiveResource(String resource) {
- this.name = resource;
- ResourceStreamInput streamSource = new ResourceStreamInput(resource);
- addStreamSource(resource, streamSource);
- return this;
- }
-
- public Deployment addArchiveFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamInput(file));
- return this;
- }
-
- public Deployment addArchiveUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamInput(url));
- return this;
- }
-
- public Deployment addArchive(ZipInputStream zipInputStream) {
- try {
- ZipEntry zipEntry = zipInputStream.getNextEntry();
- while(zipEntry!=null) {
- String entryName = zipEntry.getName();
- byte[] bytes = IoUtil.readBytes(zipInputStream);
- if (bytes!=null) {
- addStreamSource(entryName, new ByteArrayStreamInput(bytes));
- }
- zipEntry = zipInputStream.getNextEntry();
- }
- } catch (Exception e) {
- throw new JbpmException("couldn't read zip archive", e);
- }
- return this;
- }
-
- /** recursively adds all files in a directory using the relative file names */
- public Deployment addDirectory(String directory) {
- if (directory==null) {
- throw new JbpmException("directory is null");
- }
- addDirectory(new File(directory), "", false);
- return this;
- }
-
- /** recursively adds all files in a directory using the canonical file names */
- public Deployment addDirectoryCanonical(String directory) {
- if (directory==null) {
- throw new JbpmException("directory is null");
- }
- addDirectory(new File(directory), "", true);
- return this;
- }
-
- /** recursively adds all files in a directory using the relative file names */
- public Deployment addDirectory(File directory) {
- addDirectory(directory, "", false);
- return this;
- }
-
- /** recursively adds all files in a directory using the canonical file names */
- public Deployment addDirectoryCanonical(File directory) {
- addDirectory(directory, "", true);
- return this;
- }
-
- protected Deployment addDirectory(File directory, String relativeDirectoryName, boolean canonicalPathNames) {
- if (directory==null) {
- throw new JbpmException("directory is null");
- }
- if (!directory.isDirectory()) {
- throw new JbpmException(directory.getAbsolutePath()+" is not a directory");
- }
-
- File[] files = directory.listFiles();
- if (files!=null) {
- for (File file: files) {
- String relativeFileName = (canonicalPathNames ? null : relativeDirectoryName+"/"+file.getName());
- if (file.isFile()) {
- if (canonicalPathNames) {
- try {
- addStreamSource(file.getCanonicalPath(), new FileStreamInput(file));
- } catch (IOException e) {
- throw new JbpmException("can't get canonical path name for "+file);
- }
- } else {
- addStreamSource(relativeFileName, new FileStreamInput(file));
- }
- } else if (file.isDirectory()) {
- addDirectory(file, relativeFileName, canonicalPathNames);
- }
- }
- }
- return this;
- }
-
- protected Deployment addStreamSource(String name, StreamInput streamSource) {
- if (this.name==null) {
- this.name = name;
- }
- if (files==null) {
- files = new HashMap<String, StreamInput>();
- }
- files.put(name, streamSource);
- return this;
- }
-
- public InputStream getFile(String name) {
- if (files==null) {
- return null;
- }
- StreamInput streamSource = files.get(name);
- return (streamSource!=null ? streamSource.openStream() : null);
- }
-
- public Set<String> getFileNames() {
- if (files==null) {
- return Collections.EMPTY_SET;
- }
- return files.keySet();
- }
-
- public Document getDocument(String name) {
- if ( (fileDocuments!=null)
- && (fileDocuments.containsKey(name))
- ) {
- return fileDocuments.get(name);
- }
- if ( (files!=null)
- && (files.containsKey(name))
- ) {
- InputStream fileStream = getFile(name);
- return parser.createParse()
- .setInputStream(fileStream)
- .execute()
- .checkProblems("deployment file "+name)
- .getDocument();
- }
- return null;
- }
-
- public String getName() {
- return name;
- }
- public Deployment setName(String name) {
- this.name = name;
- return this;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public Deployment setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- return this;
- }
-
- public Deployment addProcessDefinition(ProcessDefinition processDefinition) {
- processDefinitions.add(processDefinition);
- return this;
- }
-
- public Deployment deploy() {
- processDefinitions = processServiceImpl.deploy(this);
- return this;
- }
-
- public List<ProcessDefinition> getProcessDefinitions() {
- return processDefinitions;
- }
-
- // error logging ////////////////////////////////////////////////////////////
-
- public class DeploymentParse {
- String name;
- Parse parse;
- public DeploymentParse(String name, Parse parse) {
- this.name = name;
- this.parse = parse;
- }
- }
-
- public String toString() {
- if (name!=null) {
- return "deployment("+name+")";
- }
- return "deployment";
- }
-
- public void addDocument(String name, Document document) {
- if (fileDocuments==null) {
- fileDocuments = new HashMap<String, Document>();
- }
- fileDocuments.put(name, document);
- }
-
- /** throws an exception with appropriate message in case the parse contains
- * errors or fatal errors. This method also logs the problems with severity
- * 'warning'. */
- public Deployment checkProblems() {
- if (hasProblems()) {
- String problemsText = getProblemsText();
- if (problemsText!=null) {
- String errorMsg = "problems during deployment of "+this+":"+problemsText;
- log.info(errorMsg);
- throw new JbpmException(errorMsg);
- }
- }
- return this;
- }
-
- public Deployment setFileType(String fileName, String fileType) {
- if (fileTypes==null) {
- fileTypes = new HashMap<String, String>();
- }
- fileTypes.put(fileName, fileType);
- return this;
- }
-
- public List<String> getFileNamesForType(String type) {
- if (type==null) {
- throw new JbpmException("type is null");
- }
- List<String> fileNames = new ArrayList<String>();
- for (String fileName: fileTypes.keySet()) {
- if (fileTypes.get(fileName).equals(type)) {
- fileNames.add(fileName);
- }
- }
- return fileNames;
- }
-
- protected Object writeReplace() throws ObjectStreamException {
- if (files!=null) {
- Map<String, StreamInput> replacedFiles = new HashMap<String, StreamInput>();
- for (Map.Entry<String, StreamInput> entry: files.entrySet()) {
- if (! (entry.getValue() instanceof ByteArrayStreamInput)) {
- byte[] bytes = IoUtil.readBytes(entry.getValue().openStream());
- replacedFiles.put(entry.getKey(), new ByteArrayStreamInput(bytes));
- }
- }
- files = replacedFiles;
- }
-
- processServiceImpl = null;
-
- return this;
- }
-
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -37,8 +37,8 @@
import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
import org.jbpm.pvm.internal.cmd.SignalCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionInLatestCmd;
+import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
+import org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd;
import org.jbpm.pvm.internal.query.ExecutionQueryImpl;
@@ -48,35 +48,35 @@
public class ExecutionServiceImpl extends AbstractServiceImpl implements ExecutionService {
public Execution startProcessInstanceById(String processDefinitionId){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, null, null));
+ return commandService.execute(new StartProcessInstanceCmd(processDefinitionId, null, null));
}
public Execution startProcessInstanceById(String processDefinitionId, String executionKey) {
- return commandService.execute(new StartExecutionCmd(processDefinitionId, null, executionKey));
+ return commandService.execute(new StartProcessInstanceCmd(processDefinitionId, null, executionKey));
}
public Execution startProcessInstanceById(String processDefinitionId, Map<String, Object> variables){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, null));
+ return commandService.execute(new StartProcessInstanceCmd(processDefinitionId, variables, null));
}
public Execution startProcessInstanceById(String processDefinitionId, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, executionKey));
+ return commandService.execute(new StartProcessInstanceCmd(processDefinitionId, variables, executionKey));
}
public Execution startProcessInstanceByKey(String processDefinitionKey) {
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionKey, null, null));
+ return commandService.execute(new StartProcessInstanceInLatestCmd(processDefinitionKey, null, null));
}
public Execution startProcessInstanceByKey(String processDefinitionKey, Map<String, Object> variables){
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionKey, variables, null));
+ return commandService.execute(new StartProcessInstanceInLatestCmd(processDefinitionKey, variables, null));
}
public Execution startProcessInstanceByKey(String processDefinitionKey, String executionKey) {
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionKey, null, executionKey));
+ return commandService.execute(new StartProcessInstanceInLatestCmd(processDefinitionKey, null, executionKey));
}
public Execution startProcessInstanceByKey(String processDefinitionKey, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionKey, variables, executionKey));
+ return commandService.execute(new StartProcessInstanceInLatestCmd(processDefinitionKey, variables, executionKey));
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,86 +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.svc;
-
-import java.util.List;
-
-import org.jbpm.Deployment;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.ProcessDefinitionQuery;
-import org.jbpm.ProcessService;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.cmd.DeleteProcessDefinitionCmd;
-import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionByKeyCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionByIdCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionKeysCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsByKeyCmd;
-import org.jbpm.pvm.internal.cmd.GetAttachment;
-import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
-
-/** {@link ProcessService} implementation that delegates execution of the
- * methods to a {@link CommandService}.
- *
- * @author Tom Baeyens
- */
-public class ProcessServiceImpl extends AbstractServiceImpl implements ProcessService {
-
- public Deployment createDeployment() {
- return new DeploymentImpl(this);
- }
-
- public List<String> findProcessDefinitionKeys() {
- return commandService.execute(new FindProcessDefinitionKeysCmd());
- }
-
- public ProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey) {
- return commandService.execute(new FindLatestProcessDefinitionByKeyCmd(processDefinitionKey));
- }
-
- public List<ProcessDefinition> findProcessDefinitionsByKey(String processDefinitionName) {
- return (List)commandService.execute(new FindProcessDefinitionsByKeyCmd(processDefinitionName));
- }
-
- public ProcessDefinition findProcessDefinitionById(String processDefinitionId) {
- return commandService.execute(new FindProcessDefinitionByIdCmd(processDefinitionId));
- }
-
- public void deleteProcessDefinition(String processDefinitionId) {
- commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId));
- }
-
- public void deleteProcessDefinitionCascade(String processDefinitionId) {
- commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId, true, true));
- }
-
- public byte[] getAttachment(String processDefinitionId, String name) {
- return commandService.execute(new GetAttachment(processDefinitionId, name));
- }
-
- public ProcessDefinitionQuery createProcessDefinitionQuery() {
- return new ProcessDefinitionQueryImpl(commandService);
- }
-
- public List<ProcessDefinition> deploy(Deployment deployment) {
- return commandService.execute(new DeployCmd((DeploymentImpl)deployment));
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -39,6 +39,7 @@
import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
@@ -87,7 +88,9 @@
protected String state;
+ protected String taskDefinitionName;
protected TaskDefinitionImpl taskDefinition;
+
protected ExecutionImpl execution;
protected ExecutionImpl processInstance;
protected SwimlaneImpl swimlane;
@@ -350,7 +353,7 @@
}
public TaskHandler getTaskHandler() {
- if ( (taskDefinition==null)
+ if ( (getTaskDefinition()==null)
|| (taskDefinition.getTaskHandlerDescriptor()==null)
) {
return DEFAULT_TASK_HANDLER;
@@ -360,6 +363,26 @@
return taskHandler;
}
+ // special getters and setters //////////////////////////////////////////////
+
+ public TaskDefinitionImpl getTaskDefinition() {
+ if ( (taskDefinition==null)
+ && (taskDefinitionName!=null)
+ && (execution!=null)
+ ) {
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ taskDefinition = processDefinition.getTaskDefinition(taskDefinitionName);
+ }
+
+ return taskDefinition;
+ }
+
+ public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
+ this.taskDefinition = taskDefinition;
+ this.taskDefinitionName = taskDefinition.getName();
+ }
+
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
@@ -467,11 +490,6 @@
public void setSignalling(boolean isSignalling) {
this.isSignalling = isSignalling;
}
- public TaskDefinitionImpl getTaskDefinition() {
- return taskDefinition;
- }
- public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
- this.taskDefinition = taskDefinition;
- }
+
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AssignFileTypesBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,67 +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 java.util.List;
-
-import org.jbpm.pvm.internal.deploy.AssignFileTypeDeployer;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class AssignFileTypesBinding extends WireDescriptorBinding {
-
- private static final String ASSIGN_FILE_TYPE = "assign-file-type";
-
- public AssignFileTypesBinding() {
- super(ASSIGN_FILE_TYPE);
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- AssignFileTypeDeployer assignFileTypeDeployer = new AssignFileTypeDeployer();
-
- List<Element> fileElements = XmlUtil.elements(element, "file");
- if (fileElements.isEmpty()) {
- parse.addProblem("no files in "+ASSIGN_FILE_TYPE);
- } else {
- for(Element fileTypeElement : fileElements) {
- String extension = XmlUtil.attribute(fileTypeElement, "extension", true, parse);
- String type = XmlUtil.attribute(fileTypeElement, "type", true, parse);
- if ( (extension!=null)
- && (type!=null)
- ) {
- assignFileTypeDeployer.addFileType(extension, type);
- }
- }
- }
-
- ProvidedObjectDescriptor providedObjectDescriptor = new ProvidedObjectDescriptor(assignFileTypeDeployer);
-
- return providedObjectDescriptor;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProblemsBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProblemsBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProblemsBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.wire.binding;
-
-import org.jbpm.pvm.internal.deploy.CheckProblemsDeployer;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CheckProblemsBinding extends WireDescriptorBinding {
-
- public CheckProblemsBinding() {
- super("check-problems");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- CheckProblemsDeployer checkProblemsDeployer = new CheckProblemsDeployer();
- return new ProvidedObjectDescriptor(checkProblemsDeployer);
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProcessBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProcessBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/CheckProcessBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.wire.binding;
-
-import org.jbpm.pvm.internal.deploy.CheckProcessDeployer;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/** parses a descriptor creating a {@link CheckProcessDeployer version verification deployer}.
- *
- * See schema docs for more details.
- *
- * @author Tom Baeyens
- */
-public class CheckProcessBinding extends WireDescriptorBinding {
-
- public static final String TAG = "check-process";
-
- public CheckProcessBinding() {
- super(TAG);
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- CheckProcessDeployer checkProcessDeployer = new CheckProcessDeployer();
-
- Boolean assignVersion = XmlUtil.attributeBoolean(element, "assign-version", false, parse, null);
- if (assignVersion!=null) {
- checkProcessDeployer.setAssignVersion(assignVersion);
- }
-
- Boolean assignKey = XmlUtil.attributeBoolean(element, "assign-key", false, parse, null);
- if (assignKey!=null) {
- checkProcessDeployer.setAssignKey(assignKey);
- }
-
- return new ProvidedObjectDescriptor(checkProcessDeployer);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,14 +21,9 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.pvm.internal.deploy.DeployerManager;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.descriptor.DeployerManagerDescriptor;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.repository.DeployerManager;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+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;
@@ -49,24 +44,12 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- DeployerManagerDescriptor descriptor = new DeployerManagerDescriptor();
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor(DeployerManager.class);
- List<Descriptor> deployerDescriptors = new ArrayList<Descriptor>();
- descriptor.setDeployerDescriptors(deployerDescriptors);
+ ListBinding listBinding = new ListBinding();
+ ListDescriptor listDescriptor = (ListDescriptor) listBinding.parse(element, parse, parser);
+ objectDescriptor.addInjection("deployers", listDescriptor);
- List<Element> deployerElements = XmlUtil.elements(element);
- for (Element deployerElement: deployerElements) {
- Descriptor deployerDescriptor = (Descriptor) parser
- .parseElement(deployerElement,
- parse,
- WireParser.CATEGORY_DESCRIPTOR);
- deployerDescriptors.add(deployerDescriptor);
- }
-
- if (deployerDescriptors.isEmpty()) {
- parse.addProblem("no deployers defined for "+DEPLOYER_MANAGER_TAG);
- }
-
- return descriptor;
+ return objectDescriptor;
}
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -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.cmd.CommandService;
-import org.jbpm.pvm.internal.svc.ProcessServiceImpl;
-import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
-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 ProcessServiceBinding extends WireDescriptorBinding {
-
- public ProcessServiceBinding() {
- super("process-service");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(ProcessServiceImpl.class);
- descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
- return descriptor;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.repository.RepositoryCacheImpl;
+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 RepositoryCacheBinding extends WireDescriptorBinding {
+
+ public RepositoryCacheBinding() {
+ super("repository-cache");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor(RepositoryCacheImpl.class);
+ objectDescriptor.setAutoWireEnabled(true);
+ return objectDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryCacheBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.repository.RepositoryServiceImpl;
+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 RepositoryServiceBinding extends WireDescriptorBinding {
+
+ public RepositoryServiceBinding() {
+ super("repository-service");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor(RepositoryServiceImpl.class);
+ objectDescriptor.setAutoWireEnabled(true);
+ return objectDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositoryServiceBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.repository.RepositorySessionImpl;
+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 RepositorySessionBinding extends WireDescriptorBinding {
+
+ public RepositorySessionBinding() {
+ super("repository-session");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor(RepositorySessionImpl.class);
+ objectDescriptor.setAutoWireEnabled(true);
+ return objectDescriptor;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/RepositorySessionBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SaveBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SaveBinding.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SaveBinding.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -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.deploy.SaveDeployer;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/** parses a descriptor for creating a {@link SaveDeployer} deployer.
- *
- * See schema docs for more details.
- *
- * @author Tom Baeyens
- */
-public class SaveBinding extends WireDescriptorBinding {
-
- public SaveBinding() {
- super("save");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- SaveDeployer saveDeployer = new SaveDeployer();
- return new ProvidedObjectDescriptor(saveDeployer);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SavePolicy.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SavePolicy.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SavePolicy.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -30,7 +30,7 @@
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -52,6 +52,9 @@
log.debug("Apply " + this.getClass().getName());
PolicyEvaluation evaluation = new PolicyEvaluation();
+
+ /*
+ TODO
for (String fileName: deployment.getFileNamesForType("jpdl"))
{
@@ -137,7 +140,9 @@
}
}
+ */
+
return evaluation;
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/DeployerManagerDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/DeployerManagerDescriptor.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/DeployerManagerDescriptor.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,67 +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.descriptor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.pvm.internal.deploy.Deployer;
-import org.jbpm.pvm.internal.deploy.DeployerManager;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.WireDefinition;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeployerManagerDescriptor extends AbstractDescriptor {
-
- private static final long serialVersionUID = 1L;
-
- /** the list of descriptors for building the list of deployers */
- protected List<Descriptor> deployerDescriptors = new ArrayList<Descriptor>();
-
- public Object construct(WireContext wireContext) {
- return new DeployerManager();
- }
-
- public void initialize(Object object, WireContext wireContext) {
- DeployerManager deployerManager = (DeployerManager) object;
-
- List<Deployer> deployers = new ArrayList<Deployer>();
- for (Descriptor deployerDescriptor: deployerDescriptors) {
- Deployer deployer = (Deployer) wireContext.create(deployerDescriptor, true);
- deployers.add(deployer);
- }
-
- deployerManager.setDeployers(deployers);
- }
-
- public Class< ? > getType(WireDefinition wireDefinition) {
- return DeployerManager.class;
- }
-
- public void setDeployerDescriptors(List<Descriptor> deployerDescriptors) {
- this.deployerDescriptors = deployerDescriptors;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -297,7 +297,7 @@
if (autoWireValue!=null) {
try {
- log.debug("auto wiring field "+fieldName+" in "+name);
+ if (log.isTraceEnabled()) log.trace("auto wiring field "+fieldName+" in "+name);
ReflectUtil.set(field, object, autoWireValue);
} catch (JbpmException e) {
if(e.getCause() instanceof IllegalArgumentException) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,7 +28,7 @@
import org.jbpm.Problem;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
/** list of problems. Base class for {@link Parse}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -36,20 +36,6 @@
*/
public class BuilderTest extends BaseJbpmTestCase {
- public void testBuilderProcessDefinitionProperties() {
- ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess("p")
- .key("k")
- .version(5)
- .description("the description")
- .endProcess();
-
- assertEquals("p", processDefinition.getName());
- assertEquals("k", processDefinition.getKey());
- assertEquals(5, processDefinition.getVersion());
- assertEquals("the description", processDefinition.getDescription());
- }
-
public void testBuilderInitialActivity() {
ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
.startProcess("p")
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,614 +0,0 @@
-/**
- * Copyright (C) 2007 Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library 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
- * version 2.1 of the License.
- * This library 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
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301, USA.
- **/
-package org.jbpm.pvm.internal.db.model;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.model.Activity;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-import org.jbpm.session.DbSession;
-import org.jbpm.session.PvmDbSession;
-
-/**
- * @author Guillaume Porcher
- *
- */
-public class ProcessCacheDbTest extends EnvironmentDbTestCase {
-
- /**
- * Defines a simple process: only activities. persists it.
- */
- public void testCacheProcessDefinitionActivities() {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .endActivity()
- .startActivity("b")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endProcess();
-
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- pvmDbSession.save(processDefinition);
-
- environment.get(Session.class).flush();
-
- newTransaction(); // ///////////////////////////////////////////////////////
-
- // only the processDefinition.getDbid() is carried over from the previous
- // transaction
-
- pvmDbSession = environment.get(PvmDbSession.class);
- processDefinition = pvmDbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
- List<Activity> activities = processDefinition.getActivities();
- assertNotNull(activities);
-
- Activity a = activities.get(0);
- assertEquals("a", a.getName());
- assertTrue(a.getActivities().isEmpty());
-
- Activity b = activities.get(1);
- assertEquals("b", b.getName());
- assertTrue(b.getActivities().isEmpty());
-
- Activity c = activities.get(2);
- assertEquals("c", c.getName());
- assertTrue(c.getActivities().isEmpty());
-
- assertEquals(3, activities.size());
-
- newTransaction(); // ///////////////////////////////////////////////////////
-
- beginCacheTest(); // /////////////
- // only the processDefinition.getDbid() is carried over from the previous
- // transaction
-
- pvmDbSession = environment.get(PvmDbSession.class);
- processDefinition = pvmDbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
- activities = processDefinition.getActivities();
- assertNotNull(activities);
-
- a = activities.get(0);
- assertEquals("a", a.getName());
- assertTrue(a.getActivities().isEmpty());
-
- b = activities.get(1);
- assertEquals("b", b.getName());
- assertTrue(b.getActivities().isEmpty());
-
- c = activities.get(2);
- assertEquals("c", c.getName());
- assertTrue(c.getActivities().isEmpty());
-
- assertEquals(3, activities.size());
-
- endCacheTest(); // ///////////
- }
-
- /**
- * Defines a simple process: only activities. persists it.
- */
- public void testCacheProcessDefinitionActivityOrder() {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .endActivity()
- .startActivity("b")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endProcess();
-
- DbSession dbSession = environment.get(DbSession.class);
- dbSession.save(processDefinition);
-
- newTransaction(); // ///////////////////////////////////////////////////////
-
- // only the processDefinition.getDbid() is carried over from the previous
- // transaction
-
- dbSession = environment.get(DbSession.class);
- processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
- List<Activity> activities = processDefinition.getActivities();
- assertNotNull(activities);
- assertEquals(3, activities.size());
-
- Activity a = activities.get(0);
- assertEquals("a", a.getName());
- assertEquals(0, a.getActivities().size());
-
- Activity b = activities.get(1);
- assertEquals("b", b.getName());
- assertEquals(0, b.getActivities().size());
-
- Activity c = activities.get(2);
- assertEquals("c", c.getName());
- assertEquals(0, c.getActivities().size());
-
- newTransaction(); // ///////////////////////////////////////////////////////
-
- dbSession = environment.get(DbSession.class);
- processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
-
- activities = processDefinition.getActivities();
- assertNotNull(activities);
-
- // Pass a to the end -> activity order is "b,c,a"
- activities.add(activities.remove(0));
-
- activities = processDefinition.getActivities();
- b = activities.get(0);
- assertEquals("b", b.getName());
- assertEquals(0, b.getActivities().size());
-
- c = activities.get(1);
- assertEquals("c", c.getName());
- assertEquals(0, c.getActivities().size());
-
- a = activities.get(2);
- assertEquals("a", a.getName());
- assertEquals(0, a.getActivities().size());
-
- newTransaction(); // ///////////////////////////////////////////////////////
-
- dbSession = environment.get(DbSession.class);
- processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
- activities = processDefinition.getActivities();
- assertNotNull(activities);
- assertEquals(3, activities.size());
-
- b = activities.get(0);
- assertEquals("b", b.getName());
- assertEquals(0, b.getActivities().size());
-
- c = activities.get(1);
- assertEquals("c", c.getName());
- assertEquals(0, c.getActivities().size());
-
- a = activities.get(2);
- assertEquals("a", a.getName());
- assertEquals(0, a.getActivities().size());
-
- newTransaction(); // ///////////////////////////////////////////////////////
- beginCacheTest(); // /////////
-
- dbSession = environment.get(DbSession.class);
- processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(processDefinition);
- activities = processDefinition.getActivities();
- assertNotNull(activities);
- assertEquals(3, activities.size());
-
- b = activities.get(0);
- assertEquals("b", b.getName());
- assertEquals(0, b.getActivities().size());
-
- c = activities.get(1);
- assertEquals("c", c.getName());
- assertEquals(0, c.getActivities().size());
-
- a = activities.get(2);
- assertEquals("a", a.getName());
- assertEquals(0, a.getActivities().size());
-
- endCacheTest(); // //////////////
- }
-
- /**
- * Test processDefinition initial activity
- */
- public void testCacheProcessDefinitionInitialActivity() {
- ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
- ActivityImpl activity = (ActivityImpl) processDefinition.createActivity();
- activity.setName("initial activity");
- activity.setDescription("very important activity");
-
- processDefinition.setInitial(activity);
-
- environment.get(DbSession.class).save(processDefinition);
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- ProcessDefinitionImpl p = environment.get(DbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- ActivityImpl n = p.getInitial();
-
- assertNotNull(n);
- assertEquals(activity.getName(), n.getName());
- assertEquals(activity.getDescription(), n.getDescription());
-
- newTransaction(); // /////////////////////////////////////////////////////
- beginCacheTest(); // //////////
-
- p = environment.get(DbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- n = p.getInitial();
-
- assertNotNull(n);
- assertEquals(activity.getName(), n.getName());
- assertEquals(activity.getDescription(), n.getDescription());
-
- endCacheTest(); // ///////////
- }
-
- /**
- * Defines a simple process: only nested activities. persists it, reloads it and
- * tries to access the nested activities
- */
- public void testCacheProcessDefinitionNestedActivities() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .startActivity("a")
- .endActivity()
- .startActivity("b")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endActivity()
- .endProcess();
-
- persistenceSession.save(processDefinition);
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- persistenceSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) persistenceSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- assertNotSame(processDefinition, p);
- p.getActivities();
- assertNotNull(p.getInitial());
- assertNotNull(p.getInitial().getActivity("a"));
- assertNotNull(p.getInitial().getActivity("b"));
- assertNotNull(p.getInitial().getActivity("c"));
-
- newTransaction(); // /////////////////////////////////////////////////////
- beginCacheTest(); // /////////
-
- persistenceSession = (DbSession) environment.get(DbSession.class);
-
- p = (OpenProcessDefinition) persistenceSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- assertNotSame(processDefinition, p);
- p.getActivities();
- assertNotNull(p.getInitial());
- assertNotNull(p.getInitial().getActivity("a"));
- assertNotNull(p.getInitial().getActivity("b"));
- assertNotNull(p.getInitial().getActivity("c"));
-
- endCacheTest(); // ////////
- }
-
- /**
- * Defines a process with nested activities with nested activities. persists it, reloads
- * it and tries to access the nested activities
- */
- public void testCacheProcessDefinitionNestedNestedActivities() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .startActivity("a")
- .startActivity("aa")
- .endActivity()
- .startActivity("ab")
- .endActivity()
- .startActivity("ac")
- .endActivity()
- .endActivity()
- .startActivity("b")
- .startActivity("ba")
- .endActivity()
- .startActivity("bb")
- .endActivity()
- .startActivity("bc")
- .endActivity()
- .endActivity()
- .startActivity("c")
- .startActivity("ca")
- .endActivity()
- .startActivity("cb")
- .endActivity()
- .startActivity("cc")
- .endActivity()
- .endActivity()
- .endActivity()
- .endProcess();
-
- persistenceSession.save(processDefinition);
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- persistenceSession = (DbSession) environment.get(DbSession.class);
-
- ClientProcessDefinition p = persistenceSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- assertNotSame(processDefinition, p);
- p.getActivities();
- assertNotNull(p.getInitial());
- Activity n = p.getInitial().getActivity("a");
- assertNotNull(n);
- List<Activity> l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("aa", l.get(0).getName());
- assertEquals("ab", l.get(1).getName());
- assertEquals("ac", l.get(2).getName());
-
- n = p.getInitial().getActivity("b");
- assertNotNull(n);
- l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("ba", l.get(0).getName());
- assertEquals("bb", l.get(1).getName());
- assertEquals("bc", l.get(2).getName());
-
- n = p.getInitial().getActivity("c");
- assertNotNull(n);
- l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("ca", l.get(0).getName());
- assertEquals("cb", l.get(1).getName());
- assertEquals("cc", l.get(2).getName());
-
- newTransaction(); // /////////////////////////////////////////////////////
- beginCacheTest(); // //////////
-
- persistenceSession = (DbSession) environment.get(DbSession.class);
-
- p = persistenceSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- assertNotNull(p);
-
- assertNotSame(processDefinition, p);
- p.getActivities();
- assertNotNull(p.getInitial());
- n = p.getInitial().getActivity("a");
- assertNotNull(n);
- l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("aa", l.get(0).getName());
- assertEquals("ab", l.get(1).getName());
- assertEquals("ac", l.get(2).getName());
-
- n = p.getInitial().getActivity("b");
- assertNotNull(n);
- l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("ba", l.get(0).getName());
- assertEquals("bb", l.get(1).getName());
- assertEquals("bc", l.get(2).getName());
-
- n = p.getInitial().getActivity("c");
- assertNotNull(n);
- l = n.getActivities();
- assertEquals(3, l.size());
- assertEquals("ca", l.get(0).getName());
- assertEquals("cb", l.get(1).getName());
- assertEquals("cc", l.get(2).getName());
-
- endCacheTest(); // ///////////
- }
-
- /**
- * Defines a simple process: only activities and default transitions. persists it,
- * reloads and navigates through the transitions.
- */
- public void testCacheDefaultTransition() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .transition("a")
- .endActivity()
- .startActivity("a")
- .transition("b")
- .endActivity()
- .startActivity("b")
- .transition("c")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endProcess();
-
- persistenceSession.save(processDefinition);
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- DbSession testSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) testSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- Activity activity = p.getInitial();
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
-
- assertEquals(p.getActivity("a"), activity);
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
-
- assertEquals(p.getActivity("b"), activity);
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
- assertEquals(p.getActivity("c"), activity);
- assertNull(activity.getDefaultTransition());
-
- newTransaction(); // /////////////////////////////////////////////////////
- beginCacheTest(); // //////////
-
- testSession = (DbSession) environment.get(DbSession.class);
-
- p = (OpenProcessDefinition) testSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- activity = p.getInitial();
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
-
- assertEquals(p.getActivity("a"), activity);
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
-
- assertEquals(p.getActivity("b"), activity);
- assertNotNull(activity.getDefaultTransition());
- assertEquals(activity, activity.getDefaultTransition().getSource());
-
- activity = activity.getDefaultTransition().getDestination();
- assertEquals(p.getActivity("c"), activity);
- assertNull(activity.getDefaultTransition());
-
- endCacheTest(); // //////////
- }
-
- /**
- * Defines a simple process: only activities and transitions. persists it, reloads
- * and navigates through the transitions.
- */
- public void testCacheTwoTransitions() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .transition("a")
- .transition("b")
- .endActivity()
- .startActivity("a")
- .endActivity()
- .startActivity("b")
- .endActivity()
- .endProcess();
-
- persistenceSession.save(processDefinition);
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- DbSession testSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) testSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- Activity activity = p.getInitial();
- List<Transition> l = activity.getOutgoingTransitions();
- assertNotNull(l);
- assertEquals(2, l.size());
-
- Activity a = p.getActivity("a");
- assertNotNull(a);
-
- Activity b = p.getActivity("b");
- assertNotNull(b);
-
- assertEquals(activity, l.get(0).getSource());
- assertEquals(activity, l.get(1).getSource());
-
- assertEquals(a, l.get(0).getDestination());
- assertEquals(b, l.get(1).getDestination());
-
- List<Transition> la = a.getIncomingTransitions();
- assertNotNull(la);
- assertEquals(1, la.size());
- assertSame(la.get(0), l.get(0));
-
- List<Transition> lb = b.getIncomingTransitions();
- assertNotNull(lb);
- assertEquals(1, lb.size());
- assertSame(lb.get(0), l.get(1));
-
- newTransaction(); // /////////////////////////////////////////////////////
-
- testSession = (DbSession) environment.get(DbSession.class);
- beginCacheTest(); // ///////
-
- p = (OpenProcessDefinition) testSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- activity = p.getInitial();
- l = activity.getOutgoingTransitions();
- assertNotNull(l);
- assertEquals(2, l.size());
-
- a = p.getActivity("a");
- assertNotNull(a);
-
- b = p.getActivity("b");
- assertNotNull(b);
-
- assertEquals(activity, l.get(0).getSource());
- assertEquals(activity, l.get(1).getSource());
-
- assertEquals(a, l.get(0).getDestination());
- assertEquals(b, l.get(1).getDestination());
-
- la = a.getIncomingTransitions();
- assertNotNull(la);
- assertEquals(1, la.size());
- assertSame(la.get(0), l.get(0));
-
- lb = b.getIncomingTransitions();
- assertNotNull(lb);
- assertEquals(1, lb.size());
- assertSame(lb.get(0), l.get(1));
-
- endCacheTest(); // ////////
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,486 +0,0 @@
-/**
- * Copyright (C) 2007 Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library 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
- * version 2.1 of the License.
- * This library 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
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301, USA.
- **/
-package org.jbpm.pvm.internal.db.model;
-
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.model.Event;
-import org.jbpm.model.Activity;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.EventListenerReference;
-import org.jbpm.pvm.internal.model.ExceptionHandlerImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-import org.jbpm.session.DbSession;
-
-/**
- * @author Charles Souillard
- * @author Guillaume Porcher
- */
-public class ProcessDefinitionDbTest extends EnvironmentDbTestCase {
-
- public void testProcessDefinitionBasicProperties() {
- Date deploymentTime = new Date();
-
- ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
- processDefinition.setName("name");
- processDefinition.setDescription("description");
- processDefinition.setVersion(3);
- processDefinition.setDeploymentTime(deploymentTime);
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertEquals("name", processDefinition.getName());
- assertEquals("description", processDefinition.getDescription());
- assertEquals(3, processDefinition.getVersion());
- assertEquals(deploymentTime, processDefinition.getDeploymentTime());
- }
-
- public void testProcessDefinitionActivities() {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .endActivity()
- .startActivity("b")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertNotNull(processDefinition);
- List<Activity> activities = processDefinition.getActivities();
- assertNotNull(activities);
-
- Activity a = activities.get(0);
- assertEquals("a", a.getName());
- assertTrue(a.getActivities().isEmpty());
-
- Activity b = activities.get(1);
- assertEquals("b", b.getName());
- assertTrue(b.getActivities().isEmpty());
-
- Activity c = activities.get(2);
- assertEquals("c", c.getName());
- assertTrue(c.getActivities().isEmpty());
-
- assertEquals(3, activities.size());
- }
-
- public void testInitialActivity() {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .endActivity()
- .startActivity("b")
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- Activity initial = processDefinition.getInitial();
- assertNotNull(initial);
-
- // check that the initial activity is still in the list of activities
- assertSame(processDefinition.getActivity("a"), initial);
- // check that the initial activity is not two times in the list of activities
- assertEquals(3, processDefinition.getActivities().size());
- }
-
- public void testProcessDefinitionNestedActivities() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("top")
- .initial()
- .startActivity("a")
- .endActivity()
- .startActivity("b")
- .startActivity("b1")
- .endActivity()
- .startActivity("b2")
- .endActivity()
- .startActivity("b3")
- .endActivity()
- .endActivity()
- .startActivity("c")
- .endActivity()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertNotNull(processDefinition);
- Activity initial = processDefinition.getInitial();
- assertNotNull(initial);
- assertEquals(initial, processDefinition.getActivity("top"));
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- List<Activity> activities = processDefinition.getActivities();
- assertNotNull(activities);
- assertEquals("expected size 1. activity list was: " + activities.toString(), 1, activities.size());
- Activity top = activities.get(0);
- assertNotNull(top);
-
- activities = top.getActivities();
- assertNotNull(activities);
- assertEquals("expected size 3. activity list was: " + activities.toString(), 3, activities.size());
- assertEquals("a", activities.get(0).getName());
- assertEquals("b", activities.get(1).getName());
- assertEquals("c", activities.get(2).getName());
-
- activities = processDefinition.getActivity("top").getActivity("b").getActivities();
- assertNotNull(activities);
- assertEquals("expected size 3. activity list was: " + activities.toString(), 3, activities.size());
- assertEquals("b1", activities.get(0).getName());
- assertEquals("b2", activities.get(1).getName());
- assertEquals("b3", activities.get(2).getName());
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- Activity activity = processDefinition.findActivity("b2");
- assertNotNull(activity);
- assertEquals("b", activity.getParent().getName());
- assertEquals("top", activity.getParent().getParent().getName());
- }
-
- public void testDefaultTransition() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .transition("a")
- .transition("b", "tob")
- .transition("c", "toc")
- .endActivity()
- .startActivity("b")
- .transition("a", "toa")
- .transition("b")
- .transition("c", "toc")
- .endActivity()
- .startActivity("c")
- .transition("c")
- .endActivity()
- .startActivity("d")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertEquals("a", processDefinition.getActivity("a").getDefaultTransition().getDestination().getName());
- assertEquals("a", processDefinition.getActivity("b").getDefaultTransition().getDestination().getName());
- assertEquals("c", processDefinition.getActivity("c").getDefaultTransition().getDestination().getName());
- assertNull(processDefinition.getActivity("d").getDefaultTransition());
- }
-
- public void testTwoTransitionsWithoutAName() {
- DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(persistenceSession);
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .transition("a")
- .transition("b")
- .endActivity()
- .startActivity("a")
- .endActivity()
- .startActivity("b")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertNotNull(processDefinition);
- Activity activity = processDefinition.getInitial();
- List<Transition> l = activity.getOutgoingTransitions();
- assertNotNull(l);
- assertEquals(2, l.size());
-
- Activity a = processDefinition.getActivity("a");
- assertNotNull(a);
-
- Activity b = processDefinition.getActivity("b");
- assertNotNull(b);
-
- assertEquals(activity, l.get(0).getSource());
- assertEquals(activity, l.get(1).getSource());
-
- assertEquals(a, l.get(0).getDestination());
- assertEquals(b, l.get(1).getDestination());
-
- List<Transition> la = a.getIncomingTransitions();
- assertNotNull(la);
- assertEquals(1, la.size());
- assertSame(la.get(0), l.get(0));
-
- List<Transition> lb = b.getIncomingTransitions();
- assertNotNull(lb);
- assertEquals(1, lb.size());
- assertSame(lb.get(0), l.get(1));
- }
-
- public void testEventsOnProcessDefinition() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startEvent(Event.START)
- .listener("one")
- .listener("two")
- .endEvent()
- .startEvent(Event.END)
- .listener("three")
- .listener("four")
- .endEvent()
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- EventImpl event = processDefinition.getEvent(Event.START);
- List<EventListenerReference> listenerReferences = event.getListenerReferences();
- assertEquals("one", listenerReferences.get(0).getExpression());
- assertEquals("two", listenerReferences.get(1).getExpression());
-
- event = processDefinition.getEvent(Event.END);
- listenerReferences = event.getListenerReferences();
- assertEquals("three", listenerReferences.get(0).getExpression());
- assertEquals("four", listenerReferences.get(1).getExpression());
- }
-
- public void testEventsOnActivity() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .startEvent(Event.START)
- .listener("one")
- .listener("two")
- .endEvent()
- .startEvent(Event.END)
- .listener("three")
- .listener("four")
- .endEvent()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- EventImpl event = processDefinition.getActivity("a").getEvent(Event.START);
- List<EventListenerReference> listenerReferences = event.getListenerReferences();
- assertEquals("one", listenerReferences.get(0).getExpression());
- assertEquals("two", listenerReferences.get(1).getExpression());
-
- event = processDefinition.getActivity("a").getEvent(Event.END);
- listenerReferences = event.getListenerReferences();
- assertEquals("three", listenerReferences.get(0).getExpression());
- assertEquals("four", listenerReferences.get(1).getExpression());
- }
-
- public void testListenersOnTransition() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .startFlow("b")
- .listener("one")
- .listener("two")
- .endFlow()
- .endActivity()
- .startActivity("b")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- EventImpl event = processDefinition.getActivity("a").getDefaultTransition().getEvent();
- List<EventListenerReference> listenerReferences = event.getListenerReferences();
- assertEquals("one", listenerReferences.get(0).getExpression());
- assertEquals("two", listenerReferences.get(1).getExpression());
- }
-
- public void testExceptionHandlersOnProcessDefinition() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startExceptionHandler(IllegalArgumentException.class)
- .listener("one")
- .listener("two")
- .endExceptionHandler()
- .startExceptionHandler(RuntimeException.class)
- .listener("three")
- .listener("four")
- .endExceptionHandler()
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- List<ExceptionHandlerImpl> exceptionHandlers = processDefinition.getExceptionHandlers();
-
- ExceptionHandlerImpl exceptionHandler = exceptionHandlers.get(0);
- assertEquals(IllegalArgumentException.class.getName(), exceptionHandler.getExceptionClassName());
- assertEquals("one", exceptionHandler.getEventListenerReferences().get(0).getExpression());
- assertEquals("two", exceptionHandler.getEventListenerReferences().get(1).getExpression());
-
- exceptionHandler = exceptionHandlers.get(1);
- assertEquals(RuntimeException.class.getName(), exceptionHandler.getExceptionClassName());
- assertEquals("three", exceptionHandler.getEventListenerReferences().get(0).getExpression());
- assertEquals("four", exceptionHandler.getEventListenerReferences().get(1).getExpression());
- }
-
- public void testExceptionHandlersOnActivity() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .startExceptionHandler(IllegalArgumentException.class)
- .listener("one")
- .listener("two")
- .endExceptionHandler()
- .startExceptionHandler(RuntimeException.class)
- .listener("three")
- .listener("four")
- .endExceptionHandler()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- List<ExceptionHandlerImpl> exceptionHandlers = processDefinition.getActivity("a").getExceptionHandlers();
-
- ExceptionHandlerImpl exceptionHandler = exceptionHandlers.get(0);
- assertEquals(IllegalArgumentException.class.getName(), exceptionHandler.getExceptionClassName());
- assertEquals("one", exceptionHandler.getEventListenerReferences().get(0).getExpression());
- assertEquals("two", exceptionHandler.getEventListenerReferences().get(1).getExpression());
-
- exceptionHandler = exceptionHandlers.get(1);
- assertEquals(RuntimeException.class.getName(), exceptionHandler.getExceptionClassName());
- assertEquals("three", exceptionHandler.getEventListenerReferences().get(0).getExpression());
- assertEquals("four", exceptionHandler.getEventListenerReferences().get(1).getExpression());
- }
-
- public void testProcessDynamicProperties() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .property("key1", "val1")
- .property("key2", "val2")
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- assertEquals("val1", processDefinition.getProperty("key1"));
- assertEquals("val2", processDefinition.getProperty("key2"));
- }
-
- public void testActivityDynamicProperties() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startActivity()
- .initial()
- .property("key1", "val1")
- .property("key2", "val2")
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- Activity activity = processDefinition.getInitial();
- assertEquals("val1", activity.getProperty("key1"));
- assertEquals("val2", activity.getProperty("key2"));
- }
-
- public void testTransitionDynamicProperties() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startActivity("a")
- .initial()
- .startFlow("a")
- .property("key1", "val1")
- .property("key2", "val2")
- .endFlow()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- Transition transition = processDefinition.getInitial().getDefaultTransition();
- assertEquals("val1", transition.getProperty("key1"));
- assertEquals("val2", transition.getProperty("key2"));
- }
-
- public void testEventDynamicProperties() {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .startEvent(Event.START)
- .property("key1", "val1")
- .property("key2", "val2")
- .endEvent()
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- EventImpl event = processDefinition.getEvent(Event.START);
- assertEquals("val1", event.getProperty("key1"));
- assertEquals("val2", event.getProperty("key2"));
- }
-
- public void testProcessDefinitionAttachments() {
-
- if (true) {
- System.err.print("FIXME: JBPM-1972 finish process attachments");
- return;
- }
-
- StringBuffer text = new StringBuffer();
- for (int i=0; i<500; i++) {
- text.append("This is a lot of bytes! ");
- }
- byte[] bytes = text.toString().getBytes();
-
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess()
- .attachment("msgbytes", bytes)
- .endProcess();
-
- processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
-
- byte[] retrievedBytes = processDefinition.getAttachment("msgbytes");
- // assertTrue(Arrays.equals(bytes, retrievedBytes));
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,38 +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.db.model;
-
-import org.hibernate.SessionFactory;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class SessionFactoryDbTest extends EnvironmentDbTestCase
-{
-
- public void testSessionFactory()
- {
- environment.get(SessionFactory.class);
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,600 +0,0 @@
-/**
- * Copyright (C) 2007 Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library 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
- * version 2.1 of the License.
- * This library 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
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301, USA.
- **/
-package org.jbpm.pvm.internal.db.model;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.model.WireProperties;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.LongDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.MapDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.NullDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.SetDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor;
-import org.jbpm.pvm.internal.wire.operation.FieldOperation;
-import org.jbpm.pvm.internal.wire.operation.PropertyOperation;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-import org.jbpm.session.DbSession;
-
-/**
- * @author Guillaume Porcher
- *
- * This class uses process annotations to test wire descriptors
- * persistence
- */
-public class WireDbTest extends EnvironmentDbTestCase {
-
- public void testCharacterDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- CharacterDescriptor descriptor = new CharacterDescriptor();
- descriptor.setName("n");
- descriptor.setValue('c');
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (CharacterDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals('c', descriptor.construct(null));
- }
-
- public void testByteDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- ByteDescriptor descriptor = new ByteDescriptor();
- descriptor.setName("n");
- descriptor.setValue((byte) 6);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (ByteDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals((byte) 6, descriptor.construct(null));
- }
-
- public void testClassDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- ClassDescriptor descriptor = new ClassDescriptor();
- descriptor.setName("n");
- descriptor.setClassName(EventImpl.class.getName());
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (ClassDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(EventImpl.class, WireContext.create(descriptor));
- }
-
- public void testDoubleDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- DoubleDescriptor descriptor = new DoubleDescriptor();
- descriptor.setName("n");
- descriptor.setValue(6.666);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (DoubleDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(6.666, descriptor.construct(null));
- }
-
- public void testFalseDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- FalseDescriptor descriptor = new FalseDescriptor();
- descriptor.setName("n");
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (FalseDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(Boolean.FALSE, descriptor.construct(null));
- }
-
- public void testFloatDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- FloatDescriptor descriptor = new FloatDescriptor();
- descriptor.setName("n");
- descriptor.setValue((float) 6.666);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (FloatDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals((float) 6.666, descriptor.construct(null));
- }
-
- public void testIntegerDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- IntegerDescriptor descriptor = new IntegerDescriptor();
- descriptor.setName("n");
- descriptor.setValue(6);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (IntegerDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(6, descriptor.construct(null));
- }
-
- public void testLongDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- LongDescriptor descriptor = new LongDescriptor();
- descriptor.setName("n");
- descriptor.setValue(6L);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (LongDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(6L, descriptor.construct(null));
- }
-
- public void testNullDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- NullDescriptor descriptor = new NullDescriptor();
- descriptor.setName("n");
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (NullDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertNull(descriptor.construct(null));
- }
-
- public void testShortDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- ShortDescriptor descriptor = new ShortDescriptor();
- descriptor.setName("n");
- descriptor.setValue((short) 6);
-
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (ShortDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals((short) 6, descriptor.construct(null));
- }
-
- public void testStringDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- StringDescriptor descriptor = new StringDescriptor();
- descriptor.setName("n");
- descriptor.setValue("s");
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (StringDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals("s", descriptor.construct(null));
- }
-
- public void testTrueDescriptor() {
- DbSession dbSession = environment.get(DbSession.class);
-
- TrueDescriptor descriptor = new TrueDescriptor();
- descriptor.setName("n");
- dbSession.save(descriptor);
-
- newTransaction();
- dbSession = environment.get(DbSession.class);
-
- descriptor = (TrueDescriptor) dbSession.get(AbstractDescriptor.class, descriptor.getDbid());
- assertEquals("n", descriptor.getName());
- assertEquals(Boolean.TRUE, descriptor.construct(null));
- }
-
- public void testRefDescriptor() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- WireProperties configurations = new WireProperties();
-
- StringDescriptor referencedDescriptor = new StringDescriptor();
- referencedDescriptor.setName("referenced");
- referencedDescriptor.setValue("text");
- configurations.add(referencedDescriptor);
-
- ReferenceDescriptor descriptor = new ReferenceDescriptor();
- descriptor.setName("reference");
- descriptor.setValue("referenced");
- configurations.add(descriptor);
-
- dbSession.save(configurations);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- configurations = dbSession.get(WireProperties.class, configurations.getDbid());
-
- assertNotNull(configurations);
- assertEquals("text", configurations.get("reference"));
- }
-
- /**
- * Check that list descriptors are persisted
- */
- public void testListDescriptor() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- StringDescriptor stringD = new StringDescriptor();
- stringD.setValue("value");
-
- StringDescriptor string2D = new StringDescriptor();
- string2D.setValue("value2");
-
- List<Descriptor> listValues = new ArrayList<Descriptor>();
- listValues.add(stringD);
- listValues.add(string2D);
-
- ListDescriptor listD = new ListDescriptor();
- listD.setName("list");
- listD.setValueDescriptors(listValues);
- listD.setClassName(LinkedList.class.getName());
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(listD)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- List<String> result = (List<String>) p.getProperty("list");
- assertNotNull(result);
- assertEquals(2, result.size());
- assertEquals("value", result.get(0));
- assertEquals("value2", result.get(1));
-
- assertTrue(result instanceof LinkedList);
- }
-
- /**
- * Check that set descriptors are persisted
- */
- public void testSetDescriptor() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- StringDescriptor stringD = new StringDescriptor();
- stringD.setValue("value");
-
- StringDescriptor string2D = new StringDescriptor();
- string2D.setValue("value2");
-
- List<Descriptor> listValues = new ArrayList<Descriptor>();
- listValues.add(stringD);
- listValues.add(string2D);
-
- SetDescriptor setD = new SetDescriptor();
- setD.setName("set");
- setD.setValueDescriptors(listValues);
- setD.setClassName(TreeSet.class.getName());
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(setD)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- Set<String> result = (Set<String>) p.getProperty("set");
- assertNotNull(result);
- assertTrue(result.contains("value"));
- assertTrue(result.contains("value2"));
- assertEquals(2, result.size());
-
- assertTrue(result instanceof TreeSet);
- }
-
- /**
- * Check that map descriptors are persisted
- */
- public void testMapDescriptor() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- StringDescriptor keyD = new StringDescriptor();
- keyD.setValue("key");
-
- StringDescriptor key2D = new StringDescriptor();
- key2D.setValue("key2");
-
- StringDescriptor stringD = new StringDescriptor();
- stringD.setValue("value");
-
- StringDescriptor string2D = new StringDescriptor();
- string2D.setValue("value2");
-
- List<Descriptor> mapKeys = new ArrayList<Descriptor>();
- mapKeys.add(keyD);
- mapKeys.add(key2D);
-
- List<Descriptor> mapValues = new ArrayList<Descriptor>();
- mapValues.add(stringD);
- mapValues.add(string2D);
-
- MapDescriptor mapD = new MapDescriptor();
- mapD.setName("map");
- mapD.setValueDescriptors(mapValues);
- mapD.setKeyDescriptors(mapKeys);
- mapD.setClassName(TreeMap.class.getName());
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(mapD)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- Map<String, String> result = (Map<String, String>) p.getProperty("map");
- assertNotNull(result);
- assertEquals(2, result.size());
- assertEquals("value", result.get("key"));
- assertEquals("value2", result.get("key2"));
-
- assertTrue(result instanceof TreeMap);
- }
-
- /**
- * Check that map descriptors are persisted
- */
- public void testObjectDescriptor() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- ObjectDescriptor objDefault = new ObjectDescriptor();
- objDefault.setName("objectByEmptyConstr");
- objDefault.setClassName(Object.class.getName());
-
- ObjectDescriptor objConstr = new ObjectDescriptor();
- objConstr.setName("objectByConstr");
- objConstr.setClassName(Integer.class.getName());
-
- ArgDescriptor argObjConstr = new ArgDescriptor();
- argObjConstr.setTypeName(int.class.getName());
- IntegerDescriptor argObjConstrVal = new IntegerDescriptor();
- argObjConstrVal.setValue(42);
- argObjConstr.setDescriptor(argObjConstrVal);
-
- objConstr.addArgDescriptor(argObjConstr);
-
- ObjectDescriptor objStaticMethod = new ObjectDescriptor();
- objStaticMethod.setName("objectByStaticMethod");
- objStaticMethod.setClassName(Integer.class.getName());
- objStaticMethod.setMethodName("signum");
- ArgDescriptor argStaticMethod = new ArgDescriptor();
- argStaticMethod.setTypeName(int.class.getName());
- IntegerDescriptor argStaticMethodValue = new IntegerDescriptor();
- argStaticMethodValue.setValue(42);
- argStaticMethod.setDescriptor(argStaticMethodValue);
-
- objStaticMethod.addArgDescriptor(argStaticMethod);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(objDefault)
- .property(objConstr)
- .property(objStaticMethod)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- assertNotNull(p.getProperty("objectByEmptyConstr"));
- assertEquals(42, p.getProperty("objectByConstr"));
- assertTrue(p.getProperty("objectByConstr") instanceof Integer);
-
- assertEquals(1, p.getProperty("objectByStaticMethod"));
- }
-
- /**
- * Check that map descriptors are persisted
- */
- public void testFieldOperation() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- ObjectDescriptor objDescr = new ObjectDescriptor(VariableDefinitionImpl.class.getName());
- objDescr.setName("object");
-
- FieldOperation fieldOp = new FieldOperation();
- fieldOp.setFieldName("name");
-
- StringDescriptor varNameDescriptor = new StringDescriptor();
- varNameDescriptor.setValue("varName");
-
- fieldOp.setDescriptor(varNameDescriptor);
-
- objDescr.addOperation(fieldOp);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(objDescr)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- assertNotNull(p.getProperty("object"));
- assertTrue(p.getProperty("object") instanceof VariableDefinitionImpl);
- assertEquals("varName", ((VariableDefinitionImpl) p.getProperty("object")).getName());
- }
-
- /**
- * Check that map descriptors are persisted
- */
- public void testPropertyOperation() {
- DbSession dbSession = (DbSession) environment.get(DbSession.class);
- assertNotNull(dbSession);
-
- ObjectDescriptor objDescr = new ObjectDescriptor();
- objDescr.setName("object");
- objDescr.setClassName(VariableDefinitionImpl.class.getName());
-
- PropertyOperation propertyOp = new PropertyOperation();
- propertyOp.setPropertyName("name");
-
- StringDescriptor varNameDescriptor = new StringDescriptor();
- varNameDescriptor.setValue("varName");
-
- propertyOp.setDescriptor(varNameDescriptor);
-
- objDescr.addOperation(propertyOp);
-
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess()
- .property(objDescr)
- .startActivity()
- .initial()
- .endActivity()
- .endProcess();
-
- dbSession.save(processDefinition);
-
- newTransaction();
-
- dbSession = (DbSession) environment.get(DbSession.class);
-
- OpenProcessDefinition p = (OpenProcessDefinition) dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-
- assertNotNull(p);
- assertNotSame(processDefinition, p);
-
- assertNotNull(p.getProperty("object"));
- assertTrue(p.getProperty("object") instanceof VariableDefinitionImpl);
- assertEquals("varName", ((VariableDefinitionImpl) p.getProperty("object")).getName());
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,108 +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.db.model;
-
-import org.hibernate.Session;
-import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-import org.jbpm.session.DbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class WireTest extends EnvironmentDbTestCase
-{
-
- public void testObjectDescriptor()
- {
- DbSession persistenceSession = (DbSession)environment.get(DbSession.class);
-
- ObjectDescriptor objStaticMethod = new ObjectDescriptor();
- objStaticMethod.setName("objectByStaticMethod");
- objStaticMethod.setClassName(Integer.class.getName());
- objStaticMethod.setMethodName("signum");
- ArgDescriptor argStaticMethod = new ArgDescriptor();
- argStaticMethod.setTypeName(int.class.getName());
- IntegerDescriptor argStaticMethodValue = new IntegerDescriptor();
- argStaticMethodValue.setValue(42);
- argStaticMethod.setDescriptor(argStaticMethodValue);
-
- objStaticMethod.addArgDescriptor(argStaticMethod);
-
- persistenceSession.save(argStaticMethodValue);
- environment.get(Session.class).flush();
-
- persistenceSession.save(objStaticMethod);
- environment.get(Session.class).flush();
-
- persistenceSession.save(objStaticMethod);
- environment.get(Session.class).flush();
-
- }
-
- /*
- * public void testObjectDescriptor() { DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
- * assertNotNull(persistenceSession);
- *
- * ObjectDescriptor objDefault = new ObjectDescriptor(); objDefault.setName("objectByEmptyConstr");
- * objDefault.setClassName(Object.class.getName());
- *
- * ObjectDescriptor objConstr = new ObjectDescriptor(); objConstr.setName("objectByConstr");
- * objConstr.setClassName(Integer.class.getName());
- *
- * ArgDescriptor argObjConstr = new ArgDescriptor(); argObjConstr.setTypeName(int.class.getName()); IntegerDescriptor
- * argObjConstrVal = new IntegerDescriptor(); argObjConstrVal.setValue(42);
- * argObjConstr.setDescriptor(argObjConstrVal);
- *
- * objConstr.addArgDescriptor(argObjConstr);
- *
- * ObjectDescriptor objStaticMethod = new ObjectDescriptor(); objStaticMethod.setName("objectByStaticMethod");
- * objStaticMethod.setClassName(Integer.class.getName()); objStaticMethod.setMethodName("signum"); ArgDescriptor
- * argStaticMethod = new ArgDescriptor(); argStaticMethod.setTypeName(int.class.getName()); IntegerDescriptor
- * argStaticMethodValue = new IntegerDescriptor(); argStaticMethodValue.setValue(42);
- * argStaticMethod.setDescriptor(argStaticMethodValue);
- *
- * objStaticMethod.addArgDescriptor(argStaticMethod);
- *
- * ProcessDefinition processDefinition = ProcessFactory.build() .configuration(objDefault) .configuration(objConstr)
- * .configuration(objStaticMethod) .done();
- *
- * persistenceSession.save(processDefinition);
- *
- * newTransaction();
- *
- * DbSession testSession = (DbSession) environment.get(DbSession.class);
- *
- * ProcessDefinition p = (ProcessDefinition) testSession.get(ProcessDefinitionImpl.class,
- * processDefinition.getDbid());
- *
- * assertNotNull(p); assertNotSame(processDefinition, p);
- *
- * assertNotNull(p.getConfigurations()); assertNotNull(p.getConfigurations().get("objectByEmptyConstr"));
- * assertEquals(42 , p.getConfigurations().get("objectByConstr"));
- * assertTrue(p.getConfigurations().get("objectByConstr") instanceof Integer);
- *
- * assertEquals(1, p.getConfigurations().get("objectByStaticMethod")); }
- */
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/execution/PvmProcessExecutionTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,72 +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.execution;
-
-import org.jbpm.Deployment;
-import org.jbpm.Execution;
-import org.jbpm.ExecutionService;
-import org.jbpm.ProcessService;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.activities.AutomaticActivity;
-import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
-import org.jbpm.pvm.internal.svc.ProcessServiceImpl;
-import org.jbpm.pvm.test.EnvironmentFactoryTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class PvmProcessExecutionTest extends EnvironmentFactoryTestCase {
-
- public void testDeploy() {
- JbpmConfiguration environmentFactory = (JbpmConfiguration) getEnvironmentFactory();
- ProcessService processService = environmentFactory.get(ProcessService.class);
-
- ClientProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("test")
- .startActivity("start", WaitState.class)
- .initial()
- .transition("end", "end")
- .endActivity()
- .startActivity("end", AutomaticActivity.class)
- .endActivity()
- .endProcess();
-
- Deployment deployment = new DeploymentImpl((ProcessServiceImpl) processService);
- deployment.addProcessDefinition(processDefinition);
- deployment.deploy();
- }
-
- public void testStartProcessInstance() {
- JbpmConfiguration environmentFactory = (JbpmConfiguration) getEnvironmentFactory();
- ExecutionService executionService = environmentFactory.get(ExecutionService.class);
- Execution execution = executionService.startProcessInstanceById("test-1", "request17");
- }
-
- public void testResumeProcessInstance() {
- JbpmConfiguration environmentFactory = (JbpmConfiguration) getEnvironmentFactory();
- ExecutionService executionService = environmentFactory.get(ExecutionService.class);
- Execution execution = executionService.signalExecutionById("test.request17", "end");
- }
-
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,102 +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.jobexecutor;
-
-import org.hibernate.Session;
-import org.jbpm.Execution;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.activities.AutomaticActivity;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class AsyncContinuationsTest extends JbpmTestCase {
-
- public void testContinuations() {
- deployProcess();
-
- Execution execution = executionService.startProcessInstanceByKey("continuations");
-
- assertEquals("start", execution.getActivityName());
- assertEquals(Execution.STATE_ASYNC, execution.getState());
-
- executeAsyncMessage(execution);
- execution = executionService.findExecution(execution.getId());
-
- assertEquals("a", execution.getActivityName());
- assertEquals(Execution.STATE_ASYNC, execution.getState());
-
- executeAsyncMessage(execution);
- execution = executionService.findExecution(execution.getId());
-
- assertEquals("b", execution.getActivityName());
- assertEquals(Execution.STATE_ASYNC, execution.getState());
-
- executeAsyncMessage(execution);
- execution = executionService.findExecution(execution.getId());
-
- assertEquals("c", execution.getActivityName());
- assertEquals(Execution.STATE_ASYNC, execution.getState());
-
- executeAsyncMessage(execution);
-
- assertNull(executionService.findExecution(execution.getId()));
- }
-
- public void deployProcess() {
- commandService.execute(new Command<Object>() {
- public Object execute(Environment environment) throws Exception {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
- .key("continuations")
- .startActivity("start", AutomaticActivity.class)
- .initial()
- .asyncExecute()
- .transition("a")
- .endActivity()
- .startActivity("a", AutomaticActivity.class)
- .asyncExecute()
- .transition("b")
- .endActivity()
- .startActivity("b", AutomaticActivity.class)
- .asyncExecute()
- .transition("c")
- .endActivity()
- .startActivity("c", AutomaticActivity.class)
- .asyncExecute()
- .transition("end")
- .endActivity()
- .startActivity("end", AutomaticActivity.class)
- .endActivity()
- .endProcess();
-
- Session session = environment.get(Session.class);
- session.save(processDefinition);
- return null;
- }
- });
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,82 +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.variables;
-
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.type.Variable;
-import org.jbpm.pvm.internal.type.variable.DateVariable;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.test.EnvironmentDbTestCase;
-
-/**
- * @author Guillaume Porcher
- */
-public class CustomTypeVariableTest extends EnvironmentDbTestCase {
-
- private static final String ENVIRONMENT_CFG_XML = "org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml";
-
- public CustomTypeVariableTest() {
- super(ENVIRONMENT_CFG_XML);
- }
-
- public void testDateVariable() {
- ClientProcessDefinition clientProcessDefinition = ProcessDefinitionBuilder
- .startProcess()
- .startActivity(
- new ObjectDescriptor(WaitState.class)
- )
- .initial()
- .endActivity()
- .endProcess();
-
- getDbSession().save(clientProcessDefinition);
-
- ExecutionImpl execution = (ExecutionImpl) clientProcessDefinition.startProcessInstance();
-
- execution = reload(execution, ExecutionImpl.class);
-
- Calendar calendar = new GregorianCalendar();
- calendar.set(Calendar.YEAR, 2007);
- calendar.set(Calendar.MONTH, 10); // (10 == november)
- calendar.set(Calendar.DAY_OF_MONTH, 22);
- calendar.set(Calendar.HOUR_OF_DAY, 15);
- calendar.set(Calendar.MINUTE, 28);
- calendar.set(Calendar.SECOND, 57);
- calendar.set(Calendar.MILLISECOND, 374);
-
- execution.setVariable("v", calendar.getTime());
-
- execution = reload(execution, ExecutionImpl.class);
-
- Variable variable = execution.getVariableObject("v");
- assertEquals(DateVariable.class, variable.getClass());
-
- assertEquals(calendar.getTime(), execution.getVariable("v"));
- }
-
-}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,8 @@
<process-engine-context>
- <process-service />
+ <repository-service />
+ <repository-cache />
<execution-service />
<history-service />
<management-service />
@@ -18,16 +19,11 @@
<hibernate-configuration>
<cfg resource="jbpm.hibernate.cfg.xml" />
- <cache-configuration resource="jbpm.cache.xml"
- usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
<deployer-manager>
- <check-process />
- <check-problems />
- <save />
</deployer-manager>
<script-manager default-expression-language="juel"
@@ -57,6 +53,7 @@
<transaction-context>
<transaction />
+ <repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,12 +28,8 @@
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
- <many-to-one name="activity"
- class="org.jbpm.pvm.internal.model.ActivityImpl"
- column="ACT_"
- lazy="false"
- foreign-key="FK_EXEC_ACT"
- index="IDX_EXEC_ACT" />
+ <property name="activityName" column="ACTIVITYNAME_" />
+ <property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -63,19 +59,13 @@
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
- <many-to-one name="processDefinition"
- class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_EXEC_PROCESS"
- index="IDX_EXEC_PROCESS" />
+ <!-- many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" / -->
- <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
-
- <many-to-one name="transitionOrigin"
+ <!-- many-to-one name="transitionOrigin"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="TRANSORIG_"
foreign-key="FK_EXEC_TRANSORIG"
- index="IDX_EXEC_TRANSORIG" />
+ index="IDX_EXEC_TRANSORIG" / -->
<list name="executions"
cascade="all-delete-orphan"
@@ -212,7 +202,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -240,21 +230,22 @@
cascade="none"
foreign-key="FK_JOB_EXE"
index="IDX_JOB_EXE"/>
- <many-to-one name="commandDescriptor"
+
+ <!-- many-to-one name="commandDescriptor"
column="CMDDESCR_"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
cascade="all"
foreign-key="FK_JOB_CMDDESCR"
- index="IDX_JOB_CMDDESCR"/>
+ index="IDX_JOB_CMDDESCR"/ -->
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeActivityMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
<property name="signalName" column="SIGNAL_" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
column="NODE_"
cascade="none"
- foreign-key="FK_JOB_NODE"/>
+ foreign-key="FK_JOB_NODE"/ -->
</subclass>
<subclass name="org.jbpm.pvm.internal.model.op.TakeTransitionMessage" discriminator-value="TakeTrMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.ProceedToDestinationMessage" discriminator-value="ProceedDestMsg" />
@@ -357,22 +348,4 @@
]]>
</query>
- <query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query>
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinition.id = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -15,7 +15,7 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <mapping resource="jbpm.definition.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -18,11 +18,11 @@
<property name="state" column="STATE_" />
<property name="endActivityName" column="ENDACTIVITY_" />
- <many-to-one name="processDefinition"
+ <!-- many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
column="PROCDEF_"
foreign-key="FK_HISTPI_PROCDEF"
- index="IDX_HISTPI_PROCDEF" />
+ index="IDX_HISTPI_PROCDEF" / -->
<set name="historyActivityInstances"
cascade="all">
@@ -48,11 +48,11 @@
foreign-key="FK_HAI_HPI"
index="IDX_HAI_HPI" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="ACTIVITY_"
foreign-key="FK_HISTAI_ACT"
- index="IDX_HISTAI_ACT" />
+ index="IDX_HISTAI_ACT" / -->
<property name="type" column="TYPE_" />
<property name="executionId" column="EXECUTION_" />
Copied: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.repository.hbm.xml (from rev 4355, jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.repository.hbm.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.repository.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="name" column="NAME_" />
+ <property name="timestamp" column="TIMESTAMP_" />
+
+ <map name="resources" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_DEPLOYMENT">
+ <column name="DEPLOYMENT_" index="IDX_LOB_DEPLOYMENT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+
+ <set name="objectProperties"
+ table="JBPM_DEPLOYPROPS"
+ cascade="all">
+ <key column="DEPLOYMENT_" />
+ <one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="stringValue" column="STRINGVAL_" />
+ <property name="longValue" column="LONGVAL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
table="JBPM_ASSIGNDEF"
discriminator-value="A" >
@@ -32,8 +32,9 @@
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
+ -->
- <!-- ### TASK DEFINITION ################################################ -->
+ <!-- ### TASK DEFINITION ################################################
<subclass name="TaskDefinitionImpl" discriminator-value="T">
<property name="priority" column="PRIORITY_"/>
@@ -60,6 +61,7 @@
</list>
</subclass>
</class>
+ -->
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
@@ -116,11 +118,7 @@
column="SWIMLANE_"
foreign-key="FK_TASK_SWIML" />
- <many-to-one name="taskDefinition"
- column="TASKDEF_"
- class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
- foreign-key="FK_TSK_TASKDEF"
- index="IDX_TSK_TASKDEF" />
+ <property name="taskDefinitionName" column="TASKDEFNAME_"/>
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
@@ -169,10 +167,10 @@
<property name="name" column="NAME_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <many-to-one name="swimlaneDefinition"
+ <!-- many-to-one name="swimlaneDefinition"
class="SwimlaneDefinitionImpl"
column="SWIMLANEDEF_"
- foreign-key="FK_SWIMLANE_DEF" />
+ foreign-key="FK_SWIMLANE_DEF" / -->
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -50,6 +50,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositorySessionBinding" />
+
<!-- db sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
@@ -59,19 +61,16 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.HistoryServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.TaskServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryCacheBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AssignFileTypesBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProcessBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProblemsBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.SaveBinding" />
<!-- interceptors -->
<binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentInterceptorBinding" />
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/BaseJbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/BaseJbpmTestCase.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/BaseJbpmTestCase.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -58,14 +58,14 @@
static protected Log log = Log.getLog(BaseJbpmTestCase.class.getName());
protected void setUp() throws Exception {
- assertNull(Environment.getCurrent());
+ assertNull("there is already an environment open", Environment.getCurrent());
LogFormatter.resetIndentation();
log.debug("=== starting "+getName()+" =============================");
}
protected void tearDown() throws Exception {
log.debug("=== ending "+getName()+" =============================\n");
- assertNull(Environment.getCurrent());
+ assertNull("there is still an environment open", Environment.getCurrent());
}
public void assertTextPresent(String expected, String value) {
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-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -31,9 +31,9 @@
import org.jbpm.HistoryService;
import org.jbpm.IdentityService;
import org.jbpm.ManagementService;
-import org.jbpm.ProcessDefinition;
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.TaskService;
import org.jbpm.cmd.CommandService;
import org.jbpm.job.Job;
@@ -68,7 +68,7 @@
protected static ProcessEngine processEngine = null;
- protected static ProcessService processService;
+ protected static RepositoryService repositoryService;
protected static ExecutionService executionService;
protected static ManagementService managementService;
protected static TaskService taskService;
@@ -77,9 +77,9 @@
protected static CommandService commandService;
- /** registered process definitions will be deleted automatically in the tearDown.
- * This is a convenience function as each test is expected to clean up the DB. */
- protected List<ProcessDefinition> registeredProcessDefinitions;
+ /** registered deployments. registered deployments will be deleted automatically
+ * in the tearDown. This is a convenience function as each test is expected to clean up the DB. */
+ protected List<Long> registeredDeployments;
/** registered tasks will be deleted automatically in the tearDown.
* This is a convenience function as each test is expected to clean up the DB. */
protected List<Long> registeredTaskIds;
@@ -102,7 +102,7 @@
processEngine = configuration.buildProcessEngine();
- processService = processEngine.getProcessService();
+ repositoryService = processEngine.get(RepositoryService.class);
executionService = processEngine.getExecutionService();
historyService = processEngine.getHistoryService();
managementService = processEngine.getManagementService();
@@ -113,9 +113,9 @@
}
protected void tearDown() throws Exception {
- if (registeredProcessDefinitions!=null) {
- for (ProcessDefinition processDefinition : registeredProcessDefinitions) {
- processService.deleteProcessDefinitionCascade(processDefinition.getId());
+ if (registeredDeployments!=null) {
+ for (Long deploymentDbid : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
}
}
@@ -130,48 +130,32 @@
super.tearDown();
}
- public ProcessDefinition deployJpdlXmlString(String jpdlXmlString) {
- List<ProcessDefinition> deployedProcessDefinitions =
- processService.createDeployment()
- .addString("xmlstring.jpdl.xml", jpdlXmlString)
- .deploy()
- .getProcessDefinitions();
+ public long deployJpdlXmlString(String jpdlXmlString) {
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml", jpdlXmlString)
+ .deploy();
- return registerDeployedProcessDefinitions(deployedProcessDefinitions);
- }
-
- public ProcessDefinition deployJpdlResource(String resource) {
- List<ProcessDefinition> deployedProcessDefinitions =
- processService.createDeployment()
- .addResource(resource)
- .deploy()
- .getProcessDefinitions();
+ registerDeployment(deploymentDbid);
- return registerDeployedProcessDefinitions(deployedProcessDefinitions);
+ return deploymentDbid;
}
+
+ public void deployJpdlResource(String resource) {
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromClasspath(resource)
+ .deploy();
- protected ProcessDefinition addDeployedProcessDefinition(ProcessDefinition deployedProcessDefinition) {
- if (registeredProcessDefinitions==null) {
- registeredProcessDefinitions = new ArrayList<ProcessDefinition>();
- }
-
- registeredProcessDefinitions.add(deployedProcessDefinition);
-
- return deployedProcessDefinition;
+ registerDeployment(deploymentDbid);
}
- protected ProcessDefinition registerDeployedProcessDefinitions(List<ProcessDefinition> deployedProcessDefinitions) {
- if (registeredProcessDefinitions==null) {
- registeredProcessDefinitions = new ArrayList<ProcessDefinition>();
+ protected void registerDeployment(long deploymentDbid) {
+ if (registeredDeployments==null) {
+ registeredDeployments = new ArrayList<Long>();
}
- registeredProcessDefinitions.addAll(deployedProcessDefinitions);
-
- if (deployedProcessDefinitions.size()>=1) {
- return deployedProcessDefinitions.get(0);
- }
-
- return null;
+ registeredDeployments.add(deploymentDbid);
}
public long saveAndRegisterTask(Task task) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -48,7 +48,7 @@
.setXmlString(
"<jbpm-configuration>" +
" <process-engine-context>" +
- " <process-service />" +
+ " <repository-service />" +
" <execution-service />" +
" <management-service />" +
" </process-engine-context>" +
@@ -56,7 +56,6 @@
)
.buildProcessEngine();
assertNotNull(processEngine);
- assertNotNull(processEngine.getProcessService());
assertNotNull(processEngine.getExecutionService());
assertNotNull(processEngine.getManagementService());
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/StartExecutionTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -175,8 +175,6 @@
"</process>"
);
- ProcessDefinition processDefinition = processService.findProcessDefinitionsByKey("ICL").get(0);
-
// start an execution for the process with the given id
Execution execution = executionService.startProcessInstanceById("ICL-1");
assertNotNull(execution);
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java (from rev 4355, jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,106 @@
+/*
+ * 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.process;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+
+import org.jbpm.JbpmException;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentResourcesTest extends JbpmTestCase {
+
+ public void testProcessWithNameOnly() {
+ byte[] lotOfBytes = generateString("a lot of bytes ", 5000).getBytes();
+ byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
+
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='Insurance claim'>" +
+ " <start />" +
+ "</process>")
+ .addResourceFromInputStream("a lot of attachment", new ByteArrayInputStream(lotOfBytes))
+ .addResourceFromInputStream("other attachment", new ByteArrayInputStream(otherBytes))
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ InputStream stream = repositoryService.getResourceAsStream(deploymentDbid, "a lot of attachment");
+ byte[] retrievedLotOfBytes = readBytes(stream);
+ assertNotNull(retrievedLotOfBytes);
+ assertTrue(Arrays.equals(lotOfBytes, retrievedLotOfBytes));
+
+ stream = repositoryService.getResourceAsStream(deploymentDbid, "other attachment");
+ byte[] retrievedOtherBytes = readBytes(stream);
+ assertNotNull(retrievedOtherBytes);
+ assertTrue(Arrays.equals(otherBytes, retrievedOtherBytes));
+ }
+
+ protected String generateString(String base, int multiplier) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i=0; i<multiplier; i++) {
+ buffer.append(base);
+ }
+ String string = buffer.toString();
+ return string;
+ }
+
+ public static byte[] readBytes(InputStream inputStream) {
+ byte[] bytes = null;
+ if (inputStream==null) {
+ throw new JbpmException("inputStream is null");
+ }
+ try {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ transfer(inputStream, outputStream);
+ bytes = outputStream.toByteArray();
+ outputStream.close();
+ return bytes;
+ } catch (IOException e) {
+ throw new JbpmException("couldn't read bytes from inputStream", e);
+ }
+ }
+ public static int transfer(InputStream in, OutputStream out) {
+ int total = 0;
+ byte[] buffer = new byte[4096];
+ try {
+ int bytesRead = in.read( buffer );
+ while ( bytesRead != -1 ) {
+ out.write( buffer, 0, bytesRead );
+ total += bytesRead;
+ bytesRead = in.read( buffer );
+ }
+ return total;
+ } catch (IOException e) {
+ throw new JbpmException("couldn't write bytes to output stream", e);
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessAttachmentsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessAttachmentsTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessAttachmentsTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,68 +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.test.process;
-
-import java.io.ByteArrayInputStream;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jbpm.ProcessDefinition;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessAttachmentsTest extends JbpmTestCase {
-
- public void testProcessWithNameOnly() {
- byte[] lotOfBytes = generateString("a lot of bytes ", 5000).getBytes();
- byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
-
- List<ProcessDefinition> deployedProcessDefinitions =
- processService.createDeployment()
- .addString("xmlstring.jpdl.xml",
- "<process name='Insurance claim'>" +
- " <start />" +
- "</process>")
- .addInputStream("a lot of attachment", new ByteArrayInputStream(lotOfBytes))
- .addInputStream("other attachment", new ByteArrayInputStream(otherBytes))
- .deploy()
- .getProcessDefinitions();
- ProcessDefinition processDefinition = registerDeployedProcessDefinitions(deployedProcessDefinitions);
-
- byte[] retrievedLotOfBytes = processService.getAttachment(processDefinition.getId(), "a lot of attachment");
- assertTrue(Arrays.equals(lotOfBytes, retrievedLotOfBytes));
-
- byte[] retrievedOtherBytes = processService.getAttachment(processDefinition.getId(), "other attachment");
- assertTrue(Arrays.equals(otherBytes, retrievedOtherBytes));
- }
-
- protected String generateString(String base, int multiplier) {
- StringBuffer buffer = new StringBuffer();
- for (int i=0; i<multiplier; i++) {
- buffer.append(base);
- }
- String string = buffer.toString();
- return string;
- }
-}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -34,7 +34,7 @@
public class ProcessDefinitionQueryTest extends JbpmTestCase {
public void testQueryProcessDefinitionsEmpty() {
- List<ProcessDefinition> processDefinitions = processService
+ List<ProcessDefinition> processDefinitions = repositoryService
.createProcessDefinitionQuery()
.execute();
@@ -72,7 +72,7 @@
"</process>"
);
- List<ProcessDefinition> processDefinitions = processService.createProcessDefinitionQuery()
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
.nameLike("%make%")
.orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
.execute();
@@ -125,15 +125,14 @@
"</process>"
);
- List<ProcessDefinition> processDefinitions = processService.createProcessDefinitionQuery()
- .keyLike("make%")
- .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
- .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .nameLike("make%")
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_ID)
.execute();
- assertEquals("make_friends-3", processDefinitions.get(0).getId());
+ assertEquals("make_friends-1", processDefinitions.get(0).getId());
assertEquals("make_friends-2", processDefinitions.get(1).getId());
- assertEquals("make_friends-1", processDefinitions.get(2).getId());
+ assertEquals("make_friends-3", processDefinitions.get(2).getId());
assertEquals("make_print-1", processDefinitions.get(3).getId());
}
}
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/ProcessServiceTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -1,356 +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.test.process;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.jbpm.JbpmException;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessServiceTest extends JbpmTestCase {
-
- public void testProcessWithNameOnly() {
- ProcessDefinition processDefinition = deployJpdlXmlString(
- "<process name='Insurance claim'>" +
- " <start />" +
- "</process>"
- );
-
- assertNotNull(processDefinition);
- assertEquals("Insurance claim", processDefinition.getName());
- assertEquals("Insurance_claim", processDefinition.getKey());
- assertEquals(1, processDefinition.getVersion());
- assertEquals("Insurance_claim-1", processDefinition.getId());
- }
-
- public void testProcessWithNameAndKey() {
- deployJpdlXmlString(
- "<process name='Insurance claim' key='ICL'>" +
- " <start />" +
- "</process>"
- );
-
- ProcessDefinition processDefinition = processService.findLatestProcessDefinitionByKey("ICL");
-
- assertNotNull(processDefinition);
- assertEquals("Insurance claim", processDefinition.getName());
- assertEquals("ICL", processDefinition.getKey());
- assertEquals(1, processDefinition.getVersion());
- assertEquals("ICL-1", processDefinition.getId());
- }
-
- // interface methods ////////////////////////////////////////////////////////
-
- public void testFindProcessDefinitionKeys() {
- deployMultipleVersionsOfProcesses();
-
- List<String> processKeys = processService.findProcessDefinitionKeys();
-
- List<String> expected = new ArrayList<String>();
- expected.add("nuclear_fusion");
- expected.add("publish_book");
- expected.add("ultimate_seduction");
-
- assertEquals(expected, processKeys);
- }
-
-
- public void testFindProcessByKey() {
- deployJpdlXmlString(
- "<process name='Name with spaces'>" +
- " <start />" +
- "</process>"
- );
-
- ProcessDefinition processDefinition = processService.findLatestProcessDefinitionByKey("Name_with_spaces");
- assertNotNull(processDefinition);
- assertEquals("Name with spaces", processDefinition.getName());
- assertEquals("Name_with_spaces", processDefinition.getKey());
- assertEquals(1, processDefinition.getVersion());
- assertEquals("Name_with_spaces-1", processDefinition.getId());
- }
-
- public void testFindProcessDefinitions() {
- deployMultipleVersionsOfProcesses();
-
- List<ProcessDefinition> processDefinitions = processService.findProcessDefinitionsByKey("nuclear_fusion");
- assertNotNull(processDefinitions);
-
- assertEquals("expected 3 but was " + processDefinitions.size() + ": " + processDefinitions, 3, processDefinitions.size());
- assertEquals("nuclear fusion", processDefinitions.get(0).getName());
- assertEquals(3, processDefinitions.get(0).getVersion());
-
- assertEquals("nuclear fusion", processDefinitions.get(1).getName());
- assertEquals(2, processDefinitions.get(1).getVersion());
-
- assertEquals("nuclear fusion", processDefinitions.get(2).getName());
- assertEquals(1, processDefinitions.get(2).getVersion());
- }
-
- public void testFindLatestProcessDefinition() {
- deployMultipleVersionsOfProcesses();
-
- ProcessDefinition retrieved = processService.findLatestProcessDefinitionByKey("nuclear_fusion");
- assertNotNull(retrieved);
-
- assertEquals(3, retrieved.getVersion());
- assertEquals("nuclear fusion", retrieved.getName());
- assertEquals("nuclear_fusion", retrieved.getKey());
- }
-
- public void testFindProcessDefinitionById() {
- deployJpdlXmlString(
- "<process name='given' version='33'>" +
- " <start />" +
- "</process>"
- );
-
- // load it
- ProcessDefinition processDefinition = processService.findProcessDefinitionById("given-33");
- assertNotNull(processDefinition);
- assertEquals("given", processDefinition.getName());
- assertEquals(33, processDefinition.getVersion());
- }
-
- public void testDeleteProcessDefinition() {
- processService.createDeployment()
- .addString("xmlstring.jpdl.xml",
- "<process name='deleteme' version='33'>" +
- " <start />" +
- "</process>")
- .deploy();
-
- // delete it
- processService.deleteProcessDefinition("deleteme-33");
-
- // check if the db is empty
- assertEquals(0, processService.createProcessDefinitionQuery().execute().size());
- }
-
- public void testDeleteProcessDefinitionAndInstances() {
- processService.createDeployment()
- .addString("xmlstring.jpdl.xml",
- "<process name='deleteme' version='33'>" +
- " <start>" +
- " <transition to='w' />" +
- " </start>" +
- " <state name='w' />" +
- "</process>")
- .deploy();
-
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
-
- // delete it all
- processService.deleteProcessDefinitionCascade("deleteme-33");
-
- // check if the db is empty
- assertEquals(0, processService.createProcessDefinitionQuery().execute().size());
- assertEquals(0, executionService.createExecutionQuery().execute().size());
- }
-
- public void testDeleteProcessDefinitionButNotInstances() {
- deployJpdlXmlString(
- "<process name='deleteme' version='33'>" +
- " <start>" +
- " <transition to='w' />" +
- " </start>" +
- " <state name='w' />" +
- "</process>"
- );
-
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
- executionService.startProcessInstanceByKey("deleteme");
-
- // delete it all
- try {
- processService.deleteProcessDefinition("deleteme-33");
- fail("expected exception");
- } catch (JbpmException e) {
- assertTextPresent("still 4 process instances for process definition deleteme-33", e.getMessage());
- }
- }
-
- // various other aspects ////////////////////////////////////////////////////
-
- public void testAutomaticVersioning() {
- deployJpdlXmlString(
- "<process name='versionme'>" +
- " <start />" +
- "</process>"
- );
-
- // look it up again
- List<ProcessDefinition> processDefinitions = processService.findProcessDefinitionsByKey("versionme");
- assertNotNull(processDefinitions);
- // verify that there is only one
- assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
- ProcessDefinition processDefinition = processDefinitions.get(0);
- // and check that automatically assigned version starts with 1
- assertEquals(1, processDefinition.getVersion());
-
- deployJpdlXmlString(
- "<process name='versionme'>" +
- " <start />" +
- "</process>"
- );
-
- // look them up again
- processDefinitions = processService.findProcessDefinitionsByKey("versionme");
- // verify that there is only one
- assertEquals(processDefinitions.toString(), 2, processDefinitions.size());
- // and check that automatically assigned version starts with 1
- assertEquals(2, processDefinitions.get(0).getVersion());
- assertEquals(1, processDefinitions.get(1).getVersion());
- }
-
- public void testUserProvidedVersion() {
- deployJpdlXmlString(
- "<process name='takethis' version='234'>" +
- " <start />" +
- "</process>"
- );
-
- // load it
- List<ProcessDefinition> processDefinitions = processService.findProcessDefinitionsByKey("takethis");
- assertNotNull(processDefinitions);
- assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
- ProcessDefinition processDefinition = processDefinitions.get(0);
- // verify that the user specified version was used
- // (and not overwritten by an automatically assigned versioning)
- assertEquals(234, processDefinition.getVersion());
- }
-
- public void testDuplicateUserProvidedVersion() {
- deployJpdlXmlString(
- "<process name='takethis' version='234'>" +
- " <start />" +
- "</process>"
- );
-
- try {
- deployJpdlXmlString(
- "<process name='takethis' version='234'>" +
- " <start />" +
- "</process>"
- );
- fail("expected exception");
- } catch (JbpmException e) {
- assertTextPresent("process 'takethis-234' already exists", e.getMessage());
- }
- }
-
- /**
- * deploys 3 versions of process with name 'nuclear fusion', 2 versions of the processes 'ultimate seduction' and
- * 'publish book'
- */
- void deployMultipleVersionsOfProcesses() {
- deployJpdlXmlString(
- "<process name='nuclear fusion'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='ultimate seduction'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='ultimate seduction'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='ultimate seduction'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='ultimate seduction'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='publish book'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='nuclear fusion'>" +
- " <start />" +
- "</process>"
- );
-
- deployJpdlXmlString(
- "<process name='nuclear fusion'>" +
- " <start />" +
- "</process>"
- );
- }
-
- public void testMinimalProcess() {
- deployJpdlXmlString(
- "<process name='minimal'>" +
- " <start>" +
- " <transition to='end' />" +
- " </start>" +
- " <end name='end' />" +
- "</process>"
- );
-
- Execution execution = executionService.startProcessInstanceByKey("minimal");
-
- assertEquals("end", execution.getActivityName());
- assertTrue(execution.isEnded());
- assertFalse(execution.isActive());
- }
-
- public void testMostMinimalProcess() {
- deployJpdlXmlString(
- "<process name='minimal'>" +
- " <start />" +
- "</process>"
- );
-
- Execution execution = executionService.startProcessInstanceByKey("minimal");
-
- assertTrue(execution.isEnded());
- assertFalse(execution.isActive());
- }
-}
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java (from rev 4355, jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,379 @@
+/*
+ * 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.process;
+
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryServiceTest extends JbpmTestCase {
+
+ public void testProcessWithNameOnly() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("Insurance_claim")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("Insurance_claim", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Insurance_claim-1", processDefinition.getId());
+ }
+
+ public void testProcessWithNameAndKey() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("ICL")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("ICL", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("ICL-1", processDefinition.getId());
+ }
+
+ // interface methods ////////////////////////////////////////////////////////
+
+ public void testFindProcessByKey() {
+ deployJpdlXmlString(
+ "<process name='Name with spaces'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("Name_with_spaces")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Name with spaces", processDefinition.getName());
+ assertEquals("Name_with_spaces", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Name_with_spaces-1", processDefinition.getId());
+ }
+
+ public void testFindProcessDefinitions() {
+ deployMultipleVersionsOfProcesses();
+
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("nuclear_fusion")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .execute();
+ assertNotNull(processDefinitions);
+
+ assertEquals("expected 3 but was " + processDefinitions.size() + ": " + processDefinitions, 3, processDefinitions.size());
+ assertEquals("nuclear fusion", processDefinitions.get(0).getName());
+ assertEquals(3, processDefinitions.get(0).getVersion());
+
+ assertEquals("nuclear fusion", processDefinitions.get(1).getName());
+ assertEquals(2, processDefinitions.get(1).getVersion());
+
+ assertEquals("nuclear fusion", processDefinitions.get(2).getName());
+ assertEquals(1, processDefinitions.get(2).getVersion());
+ }
+
+ public void testFindLatestProcessDefinition() {
+ deployMultipleVersionsOfProcesses();
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("nuclear_fusion")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+ assertNotNull(processDefinition);
+
+ assertEquals(3, processDefinition.getVersion());
+ assertEquals("nuclear fusion", processDefinition.getName());
+ assertEquals("nuclear_fusion", processDefinition.getKey());
+ }
+
+ public void testFindProcessDefinitionById() {
+ deployJpdlXmlString(
+ "<process name='given' version='33'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // load it
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id("given-33")
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("given", processDefinition.getName());
+ assertEquals(33, processDefinition.getVersion());
+ }
+
+ public void testDeleteDeployment() {
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='deleteme' version='33'>" +
+ " <start />" +
+ "</process>")
+ .deploy();
+
+ // delete it
+ repositoryService.deleteDeployment(deploymentDbid);
+
+ // check if the db is empty
+ assertEquals(0, repositoryService.createProcessDefinitionQuery().execute().size());
+ }
+
+ public void testDeleteProcessDefinitionAndInstances() {
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='deleteme' version='33'>" +
+ " <start>" +
+ " <transition to='w' />" +
+ " </start>" +
+ " <state name='w' />" +
+ "</process>")
+ .deploy();
+
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+
+ // delete it all
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ // check if the db is empty
+ assertEquals(0, repositoryService.createProcessDefinitionQuery().execute().size());
+ assertEquals(0, executionService.createExecutionQuery().execute().size());
+ }
+
+ public void testDeleteProcessDefinitionButNotInstances() {
+ long deploymentDbid = deployJpdlXmlString(
+ "<process name='deleteme' version='33'>" +
+ " <start>" +
+ " <transition to='w' />" +
+ " </start>" +
+ " <state name='w' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+
+ // delete it all
+ try {
+ repositoryService.deleteDeployment(deploymentDbid);
+ fail("expected exception");
+ } catch (JbpmException e) {
+ assertTextPresent("cannot delete deployment", e.getMessage());
+ assertTextPresent("still executions for process(deleteme): ", e.getMessage());
+ }
+ }
+
+ // various other aspects ////////////////////////////////////////////////////
+
+ public void testAutomaticVersioning() {
+ deployJpdlXmlString(
+ "<process name='versionme'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // look it up again
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("versionme")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .execute();
+
+ assertNotNull(processDefinitions);
+ // verify that there is only one
+ assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
+ ProcessDefinition processDefinition = processDefinitions.get(0);
+ // and check that automatically assigned version starts with 1
+ assertEquals(1, processDefinition.getVersion());
+
+ deployJpdlXmlString(
+ "<process name='versionme'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // look them up again
+ processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("versionme")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .execute();
+
+ // verify that there is only one
+ assertEquals(processDefinitions.toString(), 2, processDefinitions.size());
+ // and check that automatically assigned version starts with 1
+ assertEquals(2, processDefinitions.get(0).getVersion());
+ assertEquals(1, processDefinitions.get(1).getVersion());
+ }
+
+ public void testUserProvidedVersion() {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // load it
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("takethis")
+ .execute();
+
+ assertNotNull(processDefinitions);
+ assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
+ ProcessDefinition processDefinition = processDefinitions.get(0);
+ // verify that the user specified version was used
+ // (and not overwritten by an automatically assigned versioning)
+ assertEquals(234, processDefinition.getVersion());
+ }
+
+ public void testDuplicateUserProvidedVersion() {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ try {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+ fail("expected exception");
+ } catch (JbpmException e) {
+ assertTextPresent("process 'takethis-234' already exists", e.getMessage());
+ }
+ }
+
+ /**
+ * deploys 3 versions of process with name 'nuclear fusion', 2 versions of the processes 'ultimate seduction' and
+ * 'publish book'
+ */
+ void deployMultipleVersionsOfProcesses() {
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='publish book'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+ }
+
+ public void testMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start>" +
+ " <transition to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("minimal");
+
+ assertEquals("end", execution.getActivityName());
+ assertTrue(execution.isEnded());
+ assertFalse(execution.isActive());
+ }
+
+ public void testMostMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("minimal");
+
+ assertTrue(execution.isEnded());
+ assertFalse(execution.isActive());
+ }
+}
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,8 @@
<process-engine-context>
- <process-service />
+ <repository-service />
+ <repository-cache />
<execution-service />
<history-service />
<management-service />
@@ -18,20 +19,12 @@
<hibernate-configuration>
<cfg resource="jbpm.hibernate.cfg.xml" />
- <cache-configuration resource="jbpm.cache.xml"
- usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
<deployer-manager>
- <assign-file-type>
- <file extension=".jpdl.xml" type="jpdl" />
- </assign-file-type>
- <parse-jpdl />
- <check-process />
- <check-problems />
- <save />
+ <jpdl-deployer />
</deployer-manager>
<script-manager default-expression-language="juel"
@@ -61,6 +54,7 @@
<transaction-context>
<transaction />
+ <repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -28,12 +28,8 @@
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
- <many-to-one name="activity"
- class="org.jbpm.pvm.internal.model.ActivityImpl"
- column="ACT_"
- lazy="false"
- foreign-key="FK_EXEC_ACT"
- index="IDX_EXEC_ACT" />
+ <property name="activityName" column="ACTIVITYNAME_" />
+ <property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -63,19 +59,13 @@
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
- <many-to-one name="processDefinition"
- class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_EXEC_PROCESS"
- index="IDX_EXEC_PROCESS" />
+ <!-- many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" / -->
- <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
-
- <many-to-one name="transitionOrigin"
+ <!-- many-to-one name="transitionOrigin"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="TRANSORIG_"
foreign-key="FK_EXEC_TRANSORIG"
- index="IDX_EXEC_TRANSORIG" />
+ index="IDX_EXEC_TRANSORIG" / -->
<list name="executions"
cascade="all-delete-orphan"
@@ -212,7 +202,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -240,21 +230,22 @@
cascade="none"
foreign-key="FK_JOB_EXE"
index="IDX_JOB_EXE"/>
- <many-to-one name="commandDescriptor"
+
+ <!-- many-to-one name="commandDescriptor"
column="CMDDESCR_"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
cascade="all"
foreign-key="FK_JOB_CMDDESCR"
- index="IDX_JOB_CMDDESCR"/>
+ index="IDX_JOB_CMDDESCR"/ -->
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeActivityMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
<property name="signalName" column="SIGNAL_" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
column="NODE_"
cascade="none"
- foreign-key="FK_JOB_NODE"/>
+ foreign-key="FK_JOB_NODE"/ -->
</subclass>
<subclass name="org.jbpm.pvm.internal.model.op.TakeTransitionMessage" discriminator-value="TakeTrMsg" />
<subclass name="org.jbpm.pvm.internal.model.op.ProceedToDestinationMessage" discriminator-value="ProceedDestMsg" />
@@ -357,22 +348,4 @@
]]>
</query>
- <query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query>
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinition.id = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -15,7 +15,7 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <mapping resource="jbpm.definition.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -18,11 +18,11 @@
<property name="state" column="STATE_" />
<property name="endActivityName" column="ENDACTIVITY_" />
- <many-to-one name="processDefinition"
+ <!-- many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
column="PROCDEF_"
foreign-key="FK_HISTPI_PROCDEF"
- index="IDX_HISTPI_PROCDEF" />
+ index="IDX_HISTPI_PROCDEF" / -->
<set name="historyActivityInstances"
cascade="all">
@@ -48,11 +48,11 @@
foreign-key="FK_HAI_HPI"
index="IDX_HAI_HPI" />
- <many-to-one name="activity"
+ <!-- many-to-one name="activity"
class="org.jbpm.pvm.internal.model.ActivityImpl"
column="ACTIVITY_"
foreign-key="FK_HISTAI_ACT"
- index="IDX_HISTAI_ACT" />
+ index="IDX_HISTAI_ACT" / -->
<property name="type" column="TYPE_" />
<property name="executionId" column="EXECUTION_" />
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -3,7 +3,7 @@
<hibernate-mapping default-access="field">
- <subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
+ <!-- subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
discriminator-value="jpdl">
<map name="swimlaneDefinitions"
@@ -22,7 +22,7 @@
<map-key type="string" column="NAME_" />
<one-to-many class="org.jbpm.pvm.internal.task.TaskDefinitionImpl" />
</map>
- </subclass>
+ </subclass -->
<subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
extends="org.jbpm.pvm.internal.model.ExecutionImpl"
@@ -38,7 +38,7 @@
</map>
</subclass>
- <class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -118,5 +118,6 @@
index="IDX_ACT_TASKDEF" />
</subclass>
</class>
+ -->
</hibernate-mapping>
\ No newline at end of file
Copied: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.repository.hbm.xml (from rev 4355, jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.repository.hbm.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.repository.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="name" column="NAME_" />
+ <property name="timestamp" column="TIMESTAMP_" />
+
+ <map name="resources" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_DEPLOYMENT">
+ <column name="DEPLOYMENT_" index="IDX_LOB_DEPLOYMENT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+
+ <set name="objectProperties"
+ table="JBPM_DEPLOYPROPS"
+ cascade="all">
+ <key column="DEPLOYMENT_" />
+ <one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.internal.repository.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="stringValue" column="STRINGVAL_" />
+ <property name="longValue" column="LONGVAL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -4,7 +4,7 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
table="JBPM_ASSIGNDEF"
discriminator-value="A" >
@@ -32,8 +32,9 @@
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
+ -->
- <!-- ### TASK DEFINITION ################################################ -->
+ <!-- ### TASK DEFINITION ################################################
<subclass name="TaskDefinitionImpl" discriminator-value="T">
<property name="priority" column="PRIORITY_"/>
@@ -60,6 +61,7 @@
</list>
</subclass>
</class>
+ -->
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
@@ -116,11 +118,7 @@
column="SWIMLANE_"
foreign-key="FK_TASK_SWIML" />
- <many-to-one name="taskDefinition"
- column="TASKDEF_"
- class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
- foreign-key="FK_TSK_TASKDEF"
- index="IDX_TSK_TASKDEF" />
+ <property name="taskDefinitionName" column="TASKDEFNAME_"/>
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
@@ -169,10 +167,10 @@
<property name="name" column="NAME_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <many-to-one name="swimlaneDefinition"
+ <!-- many-to-one name="swimlaneDefinition"
class="SwimlaneDefinitionImpl"
column="SWIMLANEDEF_"
- foreign-key="FK_SWIMLANE_DEF" />
+ foreign-key="FK_SWIMLANE_DEF" / -->
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 17:03:18 UTC (rev 4359)
@@ -50,6 +50,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositorySessionBinding" />
+
<!-- db sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
@@ -59,19 +61,16 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.HistoryServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.TaskServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RepositoryCacheBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.AssignFileTypesBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProcessBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.CheckProblemsBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.SaveBinding" />
<!-- interceptors -->
<binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentInterceptorBinding" />
@@ -88,6 +87,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.EnlistBinding" />
<!-- jpdl bindings -->
- <binding class="org.jbpm.jpdl.internal.xml.ParseJpdlBinding" />
+ <binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
</wire-bindings>
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-03-30 15:42:32 UTC (rev 4358)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-03-30 17:03:18 UTC (rev 4359)
@@ -32,7 +32,7 @@
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
@@ -119,7 +119,7 @@
public Object execute(Environment environment) throws Exception {
MessageSession messageSession = environment.get(MessageSession.class);
for (int i = 0; i < nbrOfTestExecutions; i++) {
- Execution execution = new StartExecutionCmd("excl:1", null, "execution-" + i).execute(environment);
+ Execution execution = new StartProcessInstanceCmd("excl:1", null, "execution-" + i).execute(environment);
for (int j = 0; j < nbrOfTestMessagesPerExecution; j++) {
CommandMessage exclusiveTestMessage = ExclusiveTestCommand.createMessage(execution);
15 years, 1 month
JBoss JBPM SVN: r4358 - projects/gwt-console/branches.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-03-30 11:42:32 -0400 (Mon, 30 Mar 2009)
New Revision: 4358
Added:
projects/gwt-console/branches/hbraun/
Log:
Start mosaic refactoring
Copied: projects/gwt-console/branches/hbraun (from rev 4357, projects/gwt-console/trunk)
15 years, 1 month
JBoss JBPM SVN: r4357 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-03-30 11:40:57 -0400 (Mon, 30 Mar 2009)
New Revision: 4357
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
Log:
Fix task selection by GroupRef
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-03-30 15:40:57 UTC (rev 4357)
@@ -57,8 +57,10 @@
UserRef user = new UserRef(idRef);
List<Task> assignedTasks = taskService.findTasksByAssignment(user);
List<Task> userTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, user);
- List<Task> groupTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, new GroupRef(idRef));
+ GroupRef[] groups = getGroupIdsForIdentityRef(idRef);
+ List<Task> groupTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, groups);
+
adoptTasks(assignedTasks, results);
adoptTasks(userTasks, results);
adoptTasks(groupTasks, results);
@@ -79,17 +81,19 @@
}
}
- private List<String> getGroupIdsForIdentityRef(String idRef)
+ private GroupRef[] getGroupIdsForIdentityRef(String idRef)
{
IdentityService idService = this.processEngine.get(IdentityService.class);
List<Group> groups = idService.findGroupsByUser(idRef);
- List<String> groupIds = new ArrayList<String>();
+ GroupRef[] groupRefs = new GroupRef[groups.size()];
+ int i = 0;
for(Group g : groups)
{
- groupIds.add(g.getId());
+ groupRefs[i] = new GroupRef(g.getId());
+ i++;
}
- return groupIds;
+ return groupRefs;
}
public TaskRef getTaskById(long taskId)
15 years, 1 month
JBoss JBPM SVN: r4356 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/task and 28 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-03-30 09:27:06 -0400 (Mon, 30 Mar 2009)
New Revision: 4356
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java
jbpm4/trunk/modules/db/jbpm4-db.iml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
jbpm4/trunk/modules/examples/jbpm4-examples.iml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/integration/console/integration-console.iml
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml
jbpm4/trunk/modules/integration/spi/integration-spi.iml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/test-db/jbpm4-test-db.iml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Log:
Use IdendityRef where appropriate. Query tasks by Participation.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskQuery.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,12 +22,17 @@
package org.jbpm;
import java.util.List;
+import java.util.Set;
import org.jbpm.task.Task;
+import org.jbpm.task.IdentityRef;
+import org.jbpm.task.UserRef;
+import org.jbpm.task.GroupRef;
/**
* @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
*/
public interface TaskQuery {
@@ -38,17 +43,26 @@
public static final String PROPERTY_PRIORITY = "priority";
public static final String PROPERTY_PROGRESS = "progress";
- /** only find tasks for which the given user is the assignee */
+ /**
+ * only find tasks for which the given user is the assignee
+ * */
TaskQuery assignee(String userId);
- /** only find tasks that are unassigned. These tasks can still
- * potentially have candidates. */
+ /**
+ * query for tasks that are unassigned.
+ * These tasks can still potentially have candidates.
+ * */
TaskQuery unassigned();
- /** only find tasks for which the given user is a candidate */
- TaskQuery candidate(String userId);
+ /**
+ * query by participating user and participation type
+ */
+ TaskQuery participatingUser(String participation, UserRef user);
- TaskQuery candidateGroups(List<String> groups);
+ /**
+ * query by participating groups and participation type
+ */
+ TaskQuery participatingGroups(String participation, GroupRef... groups);
TaskQuery page(int firstResult, int maxResults);
TaskQuery orderAsc(String property);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -29,13 +29,14 @@
import org.jbpm.model.Comment;
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
import org.jbpm.task.Task;
import org.jbpm.task.UserRef;
/**
* Human task management facility.
* @author Alejandro Guizar
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
*/
public interface TaskService {
@@ -63,7 +64,7 @@
Task getTask(long taskDbid);
/** assigns this task to the given asignee. */
- void assignTask(long taskDbid, String assigneeUserId);
+ void assignTask(long taskDbid, UserRef user);
/** Deletes this task, marks the related history task as completed.
* If the task was created in the context
@@ -99,34 +100,34 @@
/** add a role to a given task.
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
- * @param participation specifies the kind of involvement of the participant
- * in this task. see {@link Participant} for default constants. */
+ * @param participation specifies the kind of involvement of the participatingUser
+ * in this task. see {@link Participation} for default constants. */
void addTaskParticipant(long taskDbid, IdentityRef identityRef, String participation);
/** get roles related to a given task. */
- List<Participant> getTaskParticipants(long taskDbid);
+ List<Participation> getTaskParticipants(long taskDbid);
/** removes a role to a given task. Nothing happens (no exception) if
* the role does not exist.
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
- * @param participation specifies the kind of involvement of the participant
- * in this task. see {@link Participant} for default constants. */
+ * @param participation specifies the kind of involvement of the participatingUser
+ * in this task. see {@link Participation} for default constants. */
void removeTaskParticipant(long taskDbid, IdentityRef identityRef, String participation);
/** add a role from a given swimlane.
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
- * @param participation specifies the kind of involvement of the participant
- * in this swimlane. see {@link Participant} for default constants. */
+ * @param participation specifies the kind of involvement of the participatingUser
+ * in this swimlane. see {@link Participation} for default constants. */
void addSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
/** get roles related to a given swimlane. */
- List<Participant> getSwimlaneParticipants(long swimlaneDbid);
+ List<Participation> getSwimlaneParticipants(long swimlaneDbid);
/** remove a role from a given swimlane.
* @param identityRef wither a new {@link UserRef} or a new {@link GroupRef}
- * @param participation specifies the kind of involvement of the participant
- * in this swimlane. see {@link Participant} for default constants. */
+ * @param participation specifies the kind of involvement of the participatingUser
+ * in this swimlane. see {@link Participation} for default constants. */
void removeSwimlaneParticipant(long swimlaneDbid, IdentityRef identityRef, String participation);
/** create a new query for tasks */
@@ -134,19 +135,26 @@
/**
* retrieves a list of tasks assigned to a particular user
+ *
+ * @see org.jbpm.TaskQuery
*/
- List<Task> getAssigneeTaskList(String userId, int firstResult, int maxResults);
+ List<Task> findTasksByAssignment(UserRef user);
/**
- * retrieves a list of unassigned tasks for a candidate user.
- * */
- List<Task> getUserTaskList(String userId, int firstResult, int maxResults);
+ * retrieves a list of tasks for a user
+ * and a particular {@link org.jbpm.task.Participation} type
+ *
+ * @see org.jbpm.TaskQuery
+ */
+ List<Task> findTasksByParticipation(String participation, UserRef user);
/**
- * retrieves a list of unassigned tasks for
- * a candidate group or a list of candidate groups.
+ * retrieves a list of tasks for a group
+ * and a particular {@link org.jbpm.task.Participation} type
+ *
+ * @see org.jbpm.TaskQuery
*/
- List<Task> getGroupTaskList(List<String> groupIds, int firstResult, int maxResults);
+ List<Task> findTasksByParticipation(String participation, GroupRef... groups);
/** get the subtasks for this task. Only goes one level deep at a time. */
List<Task> getSubTasks(long taskDbid);
@@ -181,12 +189,4 @@
/** retrieves a map of variables */
Map<String, Object> getVariables(long taskDbid, Set<String> variableNames);
-
- /** provide a userId that will be used in the next method invocation
- * on this service by this thread. */
- void setUserId(String userId);
-
- /** provide a JDBC connection that will be used in the next method
- * invocation on this service by this thread. */
- void setConnection(Connection connection);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/IdentityRef.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,7 +27,14 @@
/**
+ * references an identity. usally a user or group.
+ *
+ * @see org.jbpm.task.UserRef
+ * @see org.jbpm.task.GroupRef
+ * @see org.jbpm.task.Participation
+ *
* @author Tom Baeyens
+ * @author Heiko Braun
*/
public abstract class IdentityRef implements Serializable {
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.task;
-
-
-/** a link to a participant (user or group) and the type of
- * involvement of that participant.
- *
- * @author Tom Baeyens
- */
-public interface Participant {
-
- /** alternative owner, but as long as this person is not the owner.
- * This person is allowed to make comments, but nothing else. */
- String CANDIDATE = "candidate";
-
- /** the person with ultimate responsibility over a task. */
- String OWNER = "owner";
-
- /** person that will be using the result of this task. This person is
- * allowed to make comments, but nothing else. */
- String CLIENT = "client";
-
- /** person that is allowed to watch-but-not-touch this task */
- String VIEWER = "viewer";
-
- /** a person that was assigned to a task, but got replaced because of
- * absence or another reason. This way, a trace can be left in case
- * this person returns and wants to take back his tasks that got
- * reassigned. */
- String REPLACED_ASSIGNEE = "replaced-assignee";
-
- long getDbid();
-
- IdentityRef getIdentityRef();
-
- /** see constants for default participations */
- String getParticipation();
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java (from rev 4353, jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participant.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.task;
+
+
+/**
+ * a link to a participating identity (user or group) and the type of involvement.
+ *
+ * @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ */
+public interface Participation
+{
+
+ /** alternative owner, but as long as this person is not the owner.
+ * This person is allowed to make comments, but nothing else. */
+ String CANDIDATE = "candidate";
+
+ /** the person with ultimate responsibility over a task. */
+ String OWNER = "owner";
+
+ /** person that will be using the result of this task. This person is
+ * allowed to make comments, but nothing else. */
+ String CLIENT = "client";
+
+ /** person that is allowed to watch-but-not-touch this task */
+ String VIEWER = "viewer";
+
+ /** a person that was assigned to a task, but got replaced because of
+ * absence or another reason. This way, a trace can be left in case
+ * this person returns and wants to take back his tasks that got
+ * reassigned. */
+ String REPLACED_ASSIGNEE = "replaced-assignee";
+
+ long getDbid();
+
+ IdentityRef getIdentityRef();
+
+ /** see constants for default participations */
+ String getType();
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Participation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/db/jbpm4-db.iml
===================================================================
--- jbpm4/trunk/modules/db/jbpm4-db.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/db/jbpm4-db.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -12,6 +12,7 @@
<orderEntry type="module" module-name="toplevel" />
<orderEntry type="module" module-name="pvm" />
<orderEntry type="module" module-name="jpdl" />
+ <orderEntry type="module" module-name="api" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:compile">
<CLASSES>
Modified: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -78,9 +78,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -138,7 +138,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -181,9 +181,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -179,9 +179,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
===================================================================
--- jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -11,10 +11,11 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-server-integration" exported="" />
<orderEntry type="module" module-name="toplevel" exported="" />
- <orderEntry type="module" module-name="gwt-server-integration" exported="" />
<orderEntry type="module" module-name="pvm" exported="" />
<orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: cargo:cargo:jar:0.5:test">
<CLASSES>
Modified: jbpm4/trunk/modules/examples/jbpm4-examples.iml
===================================================================
--- jbpm4/trunk/modules/examples/jbpm4-examples.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/jbpm4-examples.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,9 +9,10 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="toplevel" exported="" />
- <orderEntry type="module" module-name="pvm" exported="" />
- <orderEntry type="module" module-name="jpdl" exported="" />
+ <orderEntry type="module" module-name="toplevel" />
+ <orderEntry type="module" module-name="pvm" />
+ <orderEntry type="module" module-name="jpdl" />
+ <orderEntry type="module" module-name="api" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
<CLASSES>
@@ -96,17 +97,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.1:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
@@ -125,15 +115,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
@@ -161,15 +142,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: antlr:antlr:jar:2.7.6:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel-engine:jar:2.1.0:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
@@ -179,15 +151,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: asm:asm:jar:1.5.3:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javassist:javassist:jar:3.4.GA:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
@@ -291,130 +254,166 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:runtime">
+ <library name="M2 Dep: juel:juel-impl:jar:2.1.0:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: juel:juel-impl:jar:2.1.0:runtime">
+ <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:runtime">
+ <library name="M2 Dep: org.jbpm.jbpm4.dependencies.esb:test-util:jar:4.4.0.GA:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm4/dependencies/esb/test-util/4.4.0.GA/test-util-4.4.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:runtime">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: cglib:cglib:jar:2.1_3:runtime">
+ <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:runtime">
+ <library name="M2 Dep: org.jboss.client:jbossall-client:jar:5.0.0.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/client/jbossall-client/5.0.0.GA/jbossall-client-5.0.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4.dependencies.esb:test-util:jar:4.4.0.GA:test">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm4/dependencies/esb/test-util/4.4.0.GA/test-util-4.4.0.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:runtime">
+ <library name="M2 Dep: log4j:log4j:jar:1.2.14:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:runtime">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:runtime">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.client:jbossall-client:jar:5.0.0.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: antlr:antlr:jar:2.7.6:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/client/jbossall-client/5.0.0.GA/jbossall-client-5.0.0.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:runtime">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: asm:asm:jar:1.5.3:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: log4j:log4j:jar:1.2.14:runtime">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
</CLASSES>
<JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: cglib:cglib:jar:2.1_3:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:test">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignee/TaskAssigneeTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,6 +27,7 @@
import org.jbpm.Execution;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -35,6 +36,8 @@
*/
public class TaskAssigneeTest extends JbpmTestCase {
+ UserRef userRef = new UserRef("johndoe");
+
public void testTaskAssignee() {
deployJpdlResource("org/jbpm/examples/task/assignee/process.jpdl.xml");
@@ -42,8 +45,8 @@
variables.put("order", new Order("johndoe"));
Execution execution = executionService.startProcessInstanceByKey("TaskAssignee", variables);
String executionId = execution.getId();
-
- List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+
+ List<Task> taskList = taskService.findTasksByAssignment(userRef);
assertEquals(1, taskList.size());
Task task = taskList.get(0);
assertEquals("review", task.getName());
@@ -53,7 +56,7 @@
taskService.completeTask(task.getDbid());
// verify that the task list is now empty
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(userRef);
assertEquals(0, taskList.size());
// verify that process moved to the next state
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,6 +24,7 @@
import java.util.List;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
/**
@@ -31,12 +32,14 @@
*/
public class TaskAssignmentHandlerTest extends JbpmTestCase {
+ UserRef userRef = new UserRef("johndoe");
+
public void testTaskAssignmentHandler() {
deployJpdlResource("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml");
executionService.startProcessInstanceByKey("TaskAssignmentHandler");
- List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ List<Task> taskList = taskService.findTasksByAssignment(userRef);
assertEquals(1, taskList.size());
Task task = taskList.get(0);
assertEquals("review", task.getName());
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/cancel/TaskCancelTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -36,7 +36,7 @@
Execution execution = executionService.startProcessInstanceByKey("TaskCancel");
String executionId = execution.getId();
- Task task = taskService.getAssigneeTaskList("johndoe",0,1).get(0);
+ Task task = taskService.findTasksByAssignment("johndoe",0,1).get(0);
executionService.signalExecutionById(executionId);
@@ -59,7 +59,7 @@
taskService.submitTask(task.getDbid());
// verify that the task list is now empty
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment("johndoe", 0, 10);
assertEquals(0, taskList.size());
// verify that process moved to the next state
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,10 +22,12 @@
package org.jbpm.examples.task.candidates;
import java.util.List;
-import java.util.ArrayList;
import org.jbpm.Execution;
import org.jbpm.task.Task;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.Participation;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -37,6 +39,9 @@
public void testGroupCandidateAssignment() {
// create johndoe and joesmoe as members of the sales-test-group group
String salesGroupId = identityService.createGroup("sales-test-group");
+ GroupRef salesGroup = new GroupRef(salesGroupId);
+ UserRef johndoe = new UserRef("johndoe");
+ UserRef joesmoe = new UserRef("joesmoe");
identityService.createUser("johndoe", "johndoe", "John", "Doe");
identityService.createMembership("johndoe", salesGroupId);
@@ -50,30 +55,20 @@
Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
String executionId = execution.getId();
- List<String> groupIds = new ArrayList<String>();
- groupIds.add(salesGroupId);
-
- List<Task> taskList = taskService.getGroupTaskList(groupIds, 0, 10);
+ List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
assertEquals("Expected a single task being created", 1, taskList.size());
Task task = taskList.get(0);
assertEquals("review", task.getName());
-
- taskList = taskService.getGroupTaskList(groupIds, 0, 10);
- assertEquals("Expected a single task being created", 1, taskList.size());
- task = taskList.get(0);
- assertEquals("review", task.getName());
-
+
// lets assume that johndoe takes the task
- taskService.assignTask(task.getDbid(), "johndoe");
+ taskService.assignTask(task.getDbid(), johndoe);
// verify that the group task lists are now empty
- taskList = taskService.getGroupTaskList(groupIds, 0, 10);
- assertEquals("Expected a no task to remain", 0, taskList.size());
- taskList = taskService.getGroupTaskList(groupIds, 0, 10);
- assertEquals("Expected a no task to remain",0, taskList.size());
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
+ assertEquals("Expected a no task to remain", 0, taskList.size());
// verify that the task now shows up in the personal task list for johndoe
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("review", task.getName());
@@ -83,7 +78,7 @@
taskService.completeTask(task.getDbid());
// verify that the task list is now empty
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(0, taskList.size());
// verify that process moved to the next state
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,13 +21,15 @@
*/
package org.jbpm.examples.task.swimlane;
-import java.util.List;
-import java.util.ArrayList;
-
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.Participation;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
+import java.util.List;
+
/**
* @author Tom Baeyens
*/
@@ -36,6 +38,8 @@
public void testTaskSwimlane() {
// create johndoe and joesmoe as members of the sales group
String salesGroupId = identityService.createGroup("sales");
+ GroupRef salesGroup = new GroupRef(salesGroupId);
+ UserRef johndoe = new UserRef("johndoe");
identityService.createUser("johndoe", "johndoe", "John", "Doe");
identityService.createMembership("johndoe", salesGroupId);
@@ -44,20 +48,17 @@
executionService.startProcessInstanceByKey("TaskSwimlane");
- List<String> groupIds = new ArrayList<String>();
- groupIds.add(salesGroupId);
-
- List<Task> taskList = taskService.getGroupTaskList(groupIds, 0, 10);
+ List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup);
assertEquals(1, taskList.size());
Task task = taskList.get(0);
long taskDbid = task.getDbid();
assertEquals("enter order data", task.getName());
assertNull(task.getAssignee());
- assertEquals(0, taskService.getAssigneeTaskList("johndoe", 0, 10).size());
+ assertEquals(0, taskService.findTasksByAssignment(johndoe).size());
// lets assume that johndoe takes the task
- taskService.assignTask(taskDbid, "johndoe");
+ taskService.assignTask(taskDbid, johndoe);
// the next task will be created and assigned directly to johndoe
// this is because johndoe was the person that took the previous task
@@ -65,10 +66,10 @@
// to know the context of this case
// we'll check that the group task lists for johndoe and joesmoe are empty
- assertEquals(0, taskService.getGroupTaskList(groupIds, 0, 10).size());
+ assertEquals(0, taskService.findTasksByParticipation(Participation.CANDIDATE, salesGroup).size());
// and that the task is directly assigned to johndoe
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("enter order data", task.getName());
@@ -77,7 +78,7 @@
// submit the task
taskService.completeTask(taskDbid);
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("calculate quote", task.getName());
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -29,6 +29,7 @@
import org.jbpm.Execution;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -40,12 +41,14 @@
public void testTaskAssignee() {
deployJpdlResource("org/jbpm/examples/task/variables/process.jpdl.xml");
- Map<String, Object> variables = new HashMap<String, Object>();
+ UserRef johndoe = new UserRef("johndoe");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
variables.put("category", "big");
variables.put("dollars", 100000);
Execution execution = executionService.startProcessInstanceByKey("TaskVariables", variables);
- List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ List<Task> taskList = taskService.findTasksByAssignment(johndoe);
assertFalse("Task list for assignee was empty", taskList.isEmpty());
Task task = taskList.get(0);
long taskDbid = task.getDbid();
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -179,9 +179,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/integration/console/integration-console.iml
===================================================================
--- jbpm4/trunk/modules/integration/console/integration-console.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/integration-console.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,10 +9,11 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="toplevel" exported="" />
- <orderEntry type="module" module-name="gwt-server-integration" exported="" />
- <orderEntry type="module" module-name="pvm" exported="" />
- <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="gwt-server-integration" />
+ <orderEntry type="module" module-name="toplevel" />
+ <orderEntry type="module" module-name="pvm" />
+ <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="api" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
<CLASSES>
@@ -32,15 +33,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
@@ -69,8 +61,8 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-spi/1.0.0-SNAPSHOT/idm-spi-1.0.0-SNAPSHOT.jar!/" />
</CLASSES>
@@ -78,19 +70,17 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: junit:junit:jar:3.8.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
@@ -98,8 +88,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar!/" />
</CLASSES>
@@ -107,8 +97,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
</CLASSES>
@@ -116,8 +106,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
</CLASSES>
@@ -125,8 +115,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/cache/jbosscache-core/3.0.2.GA/jbosscache-core-3.0.2.GA.jar!/" />
</CLASSES>
@@ -134,26 +124,26 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: antlr:antlr:jar:2.7.6:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: juel:juel-engine:jar:2.1.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: juel:juel-engine:jar:2.1.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: antlr:antlr:jar:2.7.6:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: asm:asm:jar:1.5.3:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: asm:asm:jar:1.5.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
</CLASSES>
@@ -161,8 +151,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javassist:javassist:jar:3.4.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.4.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
</CLASSES>
@@ -170,8 +160,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0-SNAPSHOT:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0-SNAPSHOT:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-api/1.0.0-SNAPSHOT/idm-api-1.0.0-SNAPSHOT.jar!/" />
</CLASSES>
@@ -179,8 +169,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/" />
</CLASSES>
@@ -188,8 +178,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0-SNAPSHOT:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0-SNAPSHOT:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm/1.0.0-SNAPSHOT/idm-1.0.0-SNAPSHOT.jar!/" />
</CLASSES>
@@ -197,35 +187,35 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: juel:juel:jar:2.1.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0-SNAPSHOT:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0-SNAPSHOT/idm-common-1.0.0-SNAPSHOT.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: juel:juel:jar:2.1.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0-SNAPSHOT:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0-SNAPSHOT/idm-common-1.0.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jgroups/jgroups/2.6.7.GA/jgroups-2.6.7.GA.jar!/" />
</CLASSES>
@@ -235,17 +225,26 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:provided">
<CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:provided">
+ <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.8/jaxb-impl-2.1.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
</CLASSES>
@@ -253,8 +252,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar!/" />
</CLASSES>
@@ -262,8 +261,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: juel:juel-impl:jar:2.1.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: juel:juel-impl:jar:2.1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
</CLASSES>
@@ -271,8 +270,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
</CLASSES>
@@ -280,8 +279,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: dom4j:dom4j:jar:1.6.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
</CLASSES>
@@ -291,8 +290,8 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: cglib:cglib:jar:2.1_3:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: cglib:cglib:jar:2.1_3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
</CLASSES>
@@ -300,8 +299,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: asm:asm-attrs:jar:1.5.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
</CLASSES>
@@ -309,8 +308,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
</CLASSES>
@@ -320,8 +319,8 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
</CLASSES>
@@ -329,8 +328,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
</CLASSES>
@@ -338,8 +337,8 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
@@ -349,8 +348,8 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: log4j:log4j:jar:1.2.14:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: log4j:log4j:jar:1.2.14:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
</CLASSES>
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -120,10 +120,10 @@
task.setProcessId( execution.getProcessInstance().getProcessInstance().getId() );
- // participants
- for(Participant p0 : cast.getParticipants())
+ // participations
+ for(Participation p0 : cast.getParticipations())
{
- if(p0.getParticipation().equals(Participant.CANDIDATE))
+ if(p0.getType().equals(Participation.CANDIDATE))
{
IdentityRef idRef = p0.getIdentityRef();
ParticipantRef participant = new ParticipantRef("candidate", idRef.getId());
@@ -144,7 +144,7 @@
}
else
{
- throw new IllegalArgumentException("Unknown participation type: " +p0.getParticipation());
+ throw new IllegalArgumentException("Unknown participation type: " +p0.getType());
}
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -51,12 +51,13 @@
TaskService taskService = this.processEngine.get(TaskService.class);
List<TaskRef> results = new ArrayList<TaskRef>();
- if(null==participationType || participationType.equals(Participant.CANDIDATE))
+ if(null==participationType || participationType.equals(Participation.CANDIDATE))
{
// TODO: Paging
- List<Task> assignedTasks = taskService.getAssigneeTaskList(idRef, 0 , 100);
- List<Task> userTasks = taskService.getUserTaskList(idRef, 0 , 100);
- List<Task> groupTasks = taskService.getGroupTaskList(getGroupIdsForIdentityRef(idRef), 0 , 100);
+ UserRef user = new UserRef(idRef);
+ List<Task> assignedTasks = taskService.findTasksByAssignment(user);
+ List<Task> userTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, user);
+ List<Task> groupTasks = taskService.findTasksByParticipation(Participation.CANDIDATE, new GroupRef(idRef));
adoptTasks(assignedTasks, results);
adoptTasks(userTasks, results);
@@ -101,13 +102,13 @@
public void assignTask(long taskId, String idRef)
{
TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, idRef);
+ taskService.assignTask(taskId, new UserRef(idRef));
}
public void releaseTask(long taskId)
{
TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, null);
+ taskService.assignTask(taskId, null); // TODO: verify API usage
}
public void completeTask(long taskId, String outcome)
Modified: jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/jboss5/integration-jboss5.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -12,7 +12,7 @@
<orderEntry type="module" module-name="toplevel" exported="" />
<orderEntry type="module" module-name="pvm" exported="" />
<orderEntry type="module" module-name="jpdl" exported="" />
- <orderEntry type="module" module-name="integration-spi" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:compile">
<CLASSES>
@@ -217,15 +217,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.man:jboss-metatype:jar:2.0.0.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar!/" />
Modified: jbpm4/trunk/modules/integration/spi/integration-spi.iml
===================================================================
--- jbpm4/trunk/modules/integration/spi/integration-spi.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/integration/spi/integration-spi.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -9,9 +9,10 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="toplevel" exported="" />
- <orderEntry type="module" module-name="pvm" exported="" />
- <orderEntry type="module" module-name="jpdl" exported="" />
+ <orderEntry type="module" module-name="toplevel" />
+ <orderEntry type="module" module-name="pvm" />
+ <orderEntry type="module" module-name="jpdl" />
+ <orderEntry type="module" module-name="api" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
<CLASSES>
@@ -438,15 +439,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.man:jboss-metatype:jar:2.0.0.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar!/" />
@@ -1089,15 +1081,13 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,7 +32,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
@@ -93,8 +93,8 @@
// copy the swimlane assignments to the task
task.setAssignee(swimlane.getAssignee());
- for (ParticipantImpl participant: swimlane.getParticipants()) {
- task.addParticipant(participant.getIdentityRef(), participant.getParticipation());
+ for (ParticipationImpl participant: swimlane.getParticipations()) {
+ task.addParticipant(participant.getIdentityRef(), participant.getType());
}
}
@@ -123,7 +123,7 @@
assignableDefinition.getCandidateUsersExpressionLanguage());
StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
while (tokenizer.hasMoreTokens()) {
- String candidateUser = tokenizer.nextToken();
+ String candidateUser = tokenizer.nextToken().trim();
assignable.addCandidateUser(candidateUser);
}
}
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -179,9 +179,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -22,6 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.JbpmException;
+import org.jbpm.task.UserRef;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.session.TaskDbSession;
@@ -35,11 +36,11 @@
private static final long serialVersionUID = 1L;
protected long taskDbid;
- protected String assigneeUserId;
+ protected UserRef userRef;
- public AssignTaskCmd(long taskDbid, String assigneeUserId) {
+ public AssignTaskCmd(long taskDbid, UserRef user) {
this.taskDbid = taskDbid;
- this.assigneeUserId = assigneeUserId;
+ this.userRef = user;
}
public Void execute(Environment environment) {
@@ -48,7 +49,7 @@
if (task==null) {
throw new JbpmException("task "+taskDbid+" does not exist");
}
- task.setAssignee(assigneeUserId, true);
+ task.setAssignee(userRef.getId(), true);
return null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,16 +26,15 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
-import org.jbpm.task.Participant;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
+import org.jbpm.task.Participation;
/**
* @author Tom Baeyens
*/
-public class GetParticipantsCmd extends AbstractCommand<List<Participant>> {
+public class GetParticipantsCmd extends AbstractCommand<List<Participation>> {
private static final long serialVersionUID = 1L;
@@ -47,10 +46,10 @@
this.swimlaneDbid = swimlaneDbid;
}
- public List<Participant> execute(Environment environment) throws Exception {
+ public List<Participation> execute(Environment environment) throws Exception {
StringBuffer hql = new StringBuffer();
hql.append("select role from ");
- hql.append(ParticipantImpl.class.getName());
+ hql.append(ParticipationImpl.class.getName());
hql.append(" as role where ");
if (taskDbid!=null) {
@@ -73,7 +72,7 @@
query.setLong("swimlaneDbid", swimlaneDbid);
}
- List<Participant> participants = query.list();
- return participants;
+ List<Participation> participations = query.list();
+ return participations;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,9 +26,8 @@
import org.hibernate.Session;
import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.task.IdentityRef;
@@ -43,13 +42,13 @@
protected Long taskDbid;
protected Long swimlaneDbid;
protected IdentityRef identityRef;
- protected String participation;
+ protected String participationType;
- public RemoveParticipantCmd(Long taskDbid, Long swimlaneDbid, IdentityRef identityRef, String participation) {
+ public RemoveParticipantCmd(Long taskDbid, Long swimlaneDbid, IdentityRef identityRef, String participationType) {
this.swimlaneDbid = swimlaneDbid;
this.taskDbid = taskDbid;
this.identityRef = identityRef;
- this.participation = participation;
+ this.participationType = participationType;
}
public Object execute(Environment environment) throws Exception {
@@ -62,10 +61,10 @@
throw new JbpmException("task "+taskDbid+" was not found");
}
- Set<ParticipantImpl> participants = new HashSet<ParticipantImpl>(task.getParticipants());
- for (ParticipantImpl participant : participants) {
+ Set<ParticipationImpl> participants = new HashSet<ParticipationImpl>(task.getParticipations());
+ for (ParticipationImpl participant : participants) {
if ( participant.getIdentityRef().equals(identityRef)
- && participant.getParticipation().equals(participation)
+ && participant.getType().equals(participationType)
) {
task.removeParticipant(participant);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,15 +21,15 @@
*/
package org.jbpm.pvm.internal.identity.impl;
-import java.util.List;
-
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.identity.Group;
import org.jbpm.identity.User;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+import java.util.List;
+
/**
* @author Tom Baeyens
*/
@@ -37,16 +37,18 @@
protected Session session;
- public void createUser(String userName, String password, String givenName, String familyName) {
+ public String createUser(String userName, String password, String givenName, String familyName) {
UserImpl user = new UserImpl();
user.setId(userName);
user.setPassword(password);
user.setGivenName(givenName);
user.setFamilyName(familyName);
session.save(user);
+
+ return user.getId();
}
- public UserImpl findUserById(String userId) {
+ public User findUserById(String userId) {
UserImpl user = (UserImpl) session.createQuery(
"select user " +
"from "+UserImpl.class.getName()+" as user " +
@@ -62,7 +64,7 @@
}
public void deleteUser(String userId) {
- UserImpl user = findUserById(userId);
+ User user = findUserById(userId);
session.delete(user);
}
@@ -123,7 +125,7 @@
}
public void createMembership(String userId, String groupId, String role) {
- UserImpl user = findUserById(userId);
+ User user = findUserById(userId);
GroupImpl group = findGroupById(groupId);
MembershipImpl membership = new MembershipImpl();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -61,7 +61,7 @@
transaction.enlistResource(identitySessionResource);
}
- public void createUser(String userName, String password, String givenName, String lastName) {
+ public String createUser(String userName, String password, String givenName, String lastName) {
try {
Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
@@ -76,6 +76,9 @@
} catch (IdentityException e) {
throw new JbpmException("couldn't create user "+userName, e);
}
+
+ throw new RuntimeException("Not yet implemented");
+ // TODO: create and return user
}
public List<User> findUsers() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/MembershipImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -21,7 +21,10 @@
*/
package org.jbpm.pvm.internal.identity.impl;
+import org.jbpm.identity.User;
+import org.jbpm.identity.Group;
+
/**
* @author Tom Baeyens
*/
@@ -30,23 +33,23 @@
protected long dbid;
protected int dbversion;
- protected UserImpl user;
- protected GroupImpl group;
+ protected User user;
+ protected Group group;
protected String role;
- public UserImpl getUser() {
+ public User getUser() {
return user;
}
- public void setUser(UserImpl user) {
+ public void setUser(User user) {
this.user = user;
}
- public GroupImpl getGroup() {
+ public Group getGroup() {
return group;
}
- public void setGroup(GroupImpl group) {
+ public void setGroup(Group group) {
this.group = group;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/spi/IdentitySession.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -33,7 +33,7 @@
public interface IdentitySession {
/** create a new user */
- void createUser(String userId, String password, String givenName, String familyName);
+ String createUser(String userId, String password, String givenName, String familyName);
/** lookup a user
* @return the user or null if no such user exists */
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,12 +32,11 @@
import org.jbpm.pvm.internal.cmd.*;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.task.TaskQueryImpl;
-import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.Task;
+import org.jbpm.task.*;
/**
* @author Alejandro Guizar, Tom Baeyens
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
*/
public class TaskServiceImpl extends AbstractServiceImpl implements TaskService {
@@ -70,7 +69,7 @@
public void completeTask(long taskDbid) {
completeTask(taskDbid, null);
}
-
+
public void completeTask(long taskDbid, String outcome) {
CompleteTaskCmd cmd = new CompleteTaskCmd(taskDbid, outcome);
commandService.execute(cmd);
@@ -81,7 +80,7 @@
commandService.execute(cmd);
}
- public List<Participant> getTaskParticipants(long taskDbid) {
+ public List<Participation> getTaskParticipants(long taskDbid) {
GetParticipantsCmd cmd = new GetParticipantsCmd(taskDbid, null);
return commandService.execute(cmd);
}
@@ -96,7 +95,7 @@
commandService.execute(cmd);
}
- public List<Participant> getSwimlaneParticipants(long swimlaneDbid) {
+ public List<Participation> getSwimlaneParticipants(long swimlaneDbid) {
GetParticipantsCmd cmd = new GetParticipantsCmd(null, swimlaneDbid);
return commandService.execute(cmd);
}
@@ -106,31 +105,29 @@
commandService.execute(cmd);
}
- public List<Task> getAssigneeTaskList(String identityRefId, int firstResult, int maxResults) {
+ public List<Task> findTasksByAssignment(UserRef user) {
return createTaskQuery()
- .assignee(identityRefId)
- .orderDesc(TaskQuery.PROPERTY_PRIORITY)
- .page(firstResult, maxResults)
- .execute();
+ .assignee(user.getId())
+ .orderDesc(TaskQuery.PROPERTY_PRIORITY)
+ .execute();
}
- public List<Task> getUserTaskList(String userId, int firstResult, int maxResults)
+ public List<Task> findTasksByParticipation(String participation, UserRef user)
{
- return createTaskQuery()
- .unassigned()
- .candidate(userId)
- .orderDesc(TaskQuery.PROPERTY_PRIORITY)
- .page(firstResult, maxResults)
- .execute();
+ return createTaskQuery()
+ .unassigned()
+ .participatingUser(Participation.CANDIDATE, user)
+ .orderDesc(TaskQuery.PROPERTY_PRIORITY)
+ .execute();
}
- public List<Task> getGroupTaskList(List<String> groupIds, int firstResult, int maxResults) {
+ public List<Task> findTasksByParticipation(String participation, GroupRef... groups)
+ {
return createTaskQuery()
- .unassigned()
- .candidateGroups(groupIds)
- .orderDesc(TaskQuery.PROPERTY_PRIORITY)
- .page(firstResult, maxResults)
- .execute();
+ .unassigned()
+ .participatingGroups(Participation.CANDIDATE, groups)
+ .orderDesc(TaskQuery.PROPERTY_PRIORITY)
+ .execute();
}
public TaskQuery createTaskQuery() {
@@ -167,8 +164,8 @@
return commandService.execute(cmd);
}
- public void assignTask(long taskDbid, String assigneeUserId) {
- AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, assigneeUserId);
+ public void assignTask(long taskDbid, UserRef user) {
+ AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, user);
addTxWireObjects(cmd);
commandService.execute(cmd);
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.task;
-
-import java.io.Serializable;
-
-import org.jbpm.JbpmException;
-import org.jbpm.task.Assignable;
-import org.jbpm.task.GroupRef;
-import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.UserRef;
-
-
-/** the relation between a task and a person.
- * @author Tom Baeyens
- */
-public class ParticipantImpl implements Serializable, Participant {
-
- private static final long serialVersionUID = 1L;
-
- protected long dbid;
- protected int dbversion;
-
- protected String userId;
- protected String groupId;
- protected String participation;
- protected TaskImpl task;
- protected SwimlaneImpl swimlane;
-
- public ParticipantImpl() {
- }
-
- public ParticipantImpl(IdentityRef identityRef, String participation) {
- setIdentityRef(identityRef);
- this.participation = participation;
- }
-
- public IdentityRef getIdentityRef() {
- if (userId!=null) {
- return new UserRef(userId);
- }
- return new GroupRef(groupId);
- }
-
- public void setIdentityRef(IdentityRef identityRef) {
- if (identityRef==null) {
- throw new JbpmException("identityRef is null");
- }
-
- if (identityRef instanceof UserRef) {
- userId = identityRef.getId();
- } else if (identityRef instanceof GroupRef) {
- groupId = identityRef.getId();
- } else {
- throw new JbpmException("invalid identity type: "+identityRef.getClass().getName());
- }
- }
-
- public TaskImpl getTask() {
- return task;
- }
- public void setTask(TaskImpl task) {
- this.task = task;
- }
- public long getDbid() {
- return dbid;
- }
- public SwimlaneImpl getSwimlane() {
- return swimlane;
- }
- public void setSwimlane(SwimlaneImpl swimlane) {
- this.swimlane = swimlane;
- }
- public String getParticipation() {
- return participation;
- }
- public void setParticipation(String participation) {
- this.participation = participation;
- }
- public String getUserId() {
- return userId;
- }
- public void setUserId(String userId) {
- this.userId = userId;
- }
- public String getGroupId() {
- return groupId;
- }
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java (from rev 4353, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipantImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+import java.io.Serializable;
+
+import org.jbpm.JbpmException;
+import org.jbpm.task.GroupRef;
+import org.jbpm.task.IdentityRef;
+import org.jbpm.task.Participation;
+import org.jbpm.task.UserRef;
+
+
+/** the relation between a task and a person.
+ * @author Tom Baeyens
+ */
+public class ParticipationImpl implements Serializable, Participation
+{
+
+ private static final long serialVersionUID = 1L;
+
+ protected long dbid;
+ protected int dbversion;
+
+ protected String userId;
+ protected String groupId;
+ protected String participation;
+ protected TaskImpl task;
+ protected SwimlaneImpl swimlane;
+
+ public ParticipationImpl() {
+ }
+
+ public ParticipationImpl(IdentityRef identityRef, String participation) {
+ setIdentityRef(identityRef);
+ this.participation = participation;
+ }
+
+ public IdentityRef getIdentityRef() {
+ if (userId!=null) {
+ return new UserRef(userId);
+ }
+ return new GroupRef(groupId);
+ }
+
+ public void setIdentityRef(IdentityRef identityRef) {
+ if (identityRef==null) {
+ throw new JbpmException("identityRef is null");
+ }
+
+ if (identityRef instanceof UserRef) {
+ userId = identityRef.getId();
+ } else if (identityRef instanceof GroupRef) {
+ groupId = identityRef.getId();
+ } else {
+ throw new JbpmException("invalid identity type: "+identityRef.getClass().getName());
+ }
+ }
+
+ public TaskImpl getTask() {
+ return task;
+ }
+ public void setTask(TaskImpl task) {
+ this.task = task;
+ }
+ public long getDbid() {
+ return dbid;
+ }
+ public SwimlaneImpl getSwimlane() {
+ return swimlane;
+ }
+ public void setSwimlane(SwimlaneImpl swimlane) {
+ this.swimlane = swimlane;
+ }
+ public String getType() {
+ return participation;
+ }
+ public void setParticipation(String participation) {
+ this.participation = participation;
+ }
+ public String getUserId() {
+ return userId;
+ }
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+ public String getGroupId() {
+ return groupId;
+ }
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/ParticipationImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,7 +24,7 @@
import java.io.Serializable;
/**
- * is a process role (aka participant).
+ * is a process role (aka participatingUser).
*/
public class SwimlaneDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -32,7 +32,7 @@
import org.jbpm.task.Assignable;
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
import org.jbpm.task.Swimlane;
import org.jbpm.task.UserRef;
@@ -48,7 +48,7 @@
protected String name = null;
protected String assignee = null;
protected ExecutionImpl execution = null;
- protected Set<ParticipantImpl> participants = null;
+ protected Set<ParticipationImpl> participations = null;
protected SwimlaneDefinitionImpl swimlaneDefinition = null;
// assignment methods ///////////////////////////////////////////////////////
@@ -61,50 +61,50 @@
this.assignee = assignee;
}
- // participants /////////////////////////////////////////////////////////////
+ // participations /////////////////////////////////////////////////////////////
- public Set<ParticipantImpl> getParticipants() {
- if (participants==null) {
+ public Set<ParticipationImpl> getParticipations() {
+ if (participations ==null) {
return Collections.emptySet();
}
- return participants;
+ return participations;
}
- public Participant addParticipant(IdentityRef identityRef, String participation) {
+ public Participation addParticipant(IdentityRef identityRef, String participation) {
if (identityRef==null) {
throw new JbpmException("identityRef is null");
}
if (participation==null) {
throw new JbpmException("participation is null");
}
- return addParticipant(new ParticipantImpl(identityRef, participation));
+ return addParticipant(new ParticipationImpl(identityRef, participation));
}
public void addCandidateGroup(String groupId) {
- addParticipant(new GroupRef(groupId), Participant.CANDIDATE);
+ addParticipant(new GroupRef(groupId), Participation.CANDIDATE);
}
public void addCandidateUser(String userId) {
- addParticipant(new UserRef(userId), Participant.CANDIDATE);
+ addParticipant(new UserRef(userId), Participation.CANDIDATE);
}
- private Participant addParticipant(ParticipantImpl participant) {
+ private Participation addParticipant(ParticipationImpl participant) {
participant.setSwimlane(this);
- if (participants==null) {
- participants = new HashSet<ParticipantImpl>();
+ if (participations ==null) {
+ participations = new HashSet<ParticipationImpl>();
}
- participants.add(participant);
+ participations.add(participant);
return participant;
}
- public void removeParticipant(ParticipantImpl participant) {
+ public void removeParticipant(ParticipationImpl participant) {
if (participant==null) {
throw new JbpmException("participant is null");
}
- if ( (participants!=null)
- && (participants.remove(participant))
+ if ( (participations !=null)
+ && (participations.remove(participant))
) {
- ((ParticipantImpl)participant).setSwimlane(null);
+ ((ParticipationImpl)participant).setSwimlane(null);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -48,7 +48,7 @@
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
import org.jbpm.task.OpenTask;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
import org.jbpm.task.Swimlane;
import org.jbpm.task.Task;
import org.jbpm.task.TaskHandler;
@@ -73,7 +73,7 @@
protected String assignee;
protected String nomination;
- protected Set<ParticipantImpl> participants;
+ protected Set<ParticipationImpl> participations;
protected Date create;
protected Date dueDate;
@@ -126,64 +126,64 @@
}
}
- // participants /////////////////////////////////////////////////////////////
+ // participations /////////////////////////////////////////////////////////////
// TODO: Why does it return the impl. not the interface?
- public Set<ParticipantImpl> getParticipants() {
- if (participants==null) {
+ public Set<ParticipationImpl> getParticipations() {
+ if (participations ==null) {
return Collections.emptySet();
}
- return participants;
+ return participations;
}
- public Set<ParticipantImpl> getAllParticipants() {
- Set<ParticipantImpl> allRoles = null;
- if (participants!=null) {
- allRoles = new HashSet<ParticipantImpl>(participants);
+ public Set<ParticipationImpl> getAllParticipants() {
+ Set<ParticipationImpl> allRoles = null;
+ if (participations !=null) {
+ allRoles = new HashSet<ParticipationImpl>(participations);
} else {
- allRoles = new HashSet<ParticipantImpl>();
+ allRoles = new HashSet<ParticipationImpl>();
}
if (swimlane!=null) {
- allRoles.addAll((Set)swimlane.getParticipants());
+ allRoles.addAll((Set)swimlane.getParticipations());
}
return allRoles;
}
- public Participant addParticipant(IdentityRef identityRef, String participation) {
+ public Participation addParticipant(IdentityRef identityRef, String participation) {
if (identityRef==null) {
throw new JbpmException("identityRef is null");
}
if (participation==null) {
throw new JbpmException("participation is null");
}
- return addParticipant(new ParticipantImpl(identityRef, participation));
+ return addParticipant(new ParticipationImpl(identityRef, participation));
}
public void addCandidateGroup(String groupId) {
- addParticipant(new GroupRef(groupId), Participant.CANDIDATE);
+ addParticipant(new GroupRef(groupId), Participation.CANDIDATE);
}
public void addCandidateUser(String userId) {
- addParticipant(new UserRef(userId), Participant.CANDIDATE);
+ addParticipant(new UserRef(userId), Participation.CANDIDATE);
}
- private Participant addParticipant(ParticipantImpl participant) {
+ private Participation addParticipant(ParticipationImpl participant) {
participant.setTask(this);
- if (participants==null) {
- participants = new HashSet<ParticipantImpl>();
+ if (participations ==null) {
+ participations = new HashSet<ParticipationImpl>();
}
- participants.add(participant);
+ participations.add(participant);
return participant;
}
- public void removeParticipant(ParticipantImpl participant) {
+ public void removeParticipant(ParticipationImpl participant) {
if (participant==null) {
throw new JbpmException("participant is null");
}
- if ( (participants!=null)
- && (participants.remove(participant))
+ if ( (participations !=null)
+ && (participations.remove(participant))
) {
- ((ParticipantImpl)participant).setTask(null);
+ ((ParticipationImpl)participant).setTask(null);
}
}
@@ -443,8 +443,8 @@
public void setSuperTaskDbid(Long parentTaskDbid) {
this.superTaskDbid = parentTaskDbid;
}
- public void setParticipants(Set<ParticipantImpl> participants) {
- this.participants = participants;
+ public void setParticipations(Set<ParticipationImpl> participations) {
+ this.participations = participations;
}
public void setState(String state) {
this.state = state;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -26,13 +26,17 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.pvm.internal.query.AbstractQuery;
import org.jbpm.pvm.internal.query.Page;
-import org.jbpm.task.Task;
+import org.jbpm.task.*;
import java.util.List;
+import java.util.Set;
+import java.util.ArrayList;
+import java.util.HashSet;
/**
* @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
*/
public class TaskQueryImpl extends AbstractQuery implements TaskQuery {
@@ -41,10 +45,9 @@
private static final String UNASSIGNED = "unassigned";
protected String assignee = null;
- protected String candidate = null;
+
+ protected Set<Participation> participations = new HashSet<Participation>();
- protected List<String> groupIds = null;
-
public TaskQueryImpl(CommandService commandService) {
super(commandService);
}
@@ -53,19 +56,20 @@
this.assignee = assignee;
return this;
}
-
- public TaskQuery candidate(String userId) {
- this.candidate = userId;
+
+ public TaskQuery participatingUser(String participation, UserRef user)
+ {
+ this.participations.add(new ParticipationImpl(user, participation));
return this;
}
- public TaskQuery candidateGroups(List<String> groups)
+ public TaskQuery participatingGroups(String participation, GroupRef... groups)
{
- if(candidate!=null)
- throw new IllegalArgumentException("Illegal query: Can either select by candiate or candidateGroup, not both");
-
- this.groupIds = groups;
- return this;
+ for(GroupRef g : groups)
+ {
+ this.participations.add(new ParticipationImpl(g, participation));
+ }
+ return this;
}
public TaskQuery unassigned() {
@@ -97,13 +101,26 @@
query.setString("assignee", assignee);
}
- if(candidate!=null)
- {
- query.setString("candidate", candidate);
- }
+ if(participations.size() > 0)
+ {
+ Participation participation = participations.iterator().next();
+ IdentityRef idRef = participation.getIdentityRef();
- if (groupIds!=null) {
- query.setParameterList("groupIds", groupIds);
+ query.setString("participation", participation.getType());
+ if(idRef instanceof UserRef)
+ {
+ query.setString("userId", idRef.getId());
+ }
+ else
+ {
+ List<String> groupIds = new ArrayList<String>();
+ for(Participation p : participations)
+ {
+ groupIds.add(p.getIdentityRef().getId());
+ }
+
+ query.setParameterList("groupIds", groupIds);
+ }
}
}
@@ -114,21 +131,23 @@
hql.append(TaskImpl.class.getName());
hql.append(" as task ");
- // participants
- if(candidate!=null || groupIds!=null)
+ // participations
+ if(participations.size() > 0)
{
hql.append(", ");
- hql.append(ParticipantImpl.class.getName());
+ hql.append(ParticipationImpl.class.getName());
hql.append(" as participant ");
appendWhereClause("participant.task = task ", hql);
- appendWhereClause("participant.participation = 'candidate' ", hql);
+ appendWhereClause("participant.participation = :participation ", hql);
- if(candidate!=null)
+ Participation sample = participations.iterator().next();
+ if(sample.getIdentityRef() instanceof UserRef)
{
- appendWhereClause("(participant.userId = :candidate)", hql);
+ appendWhereClause("(participant.userId = :userId)", hql);
}
- else if (groupIds!=null && !groupIds.isEmpty()) {
+ else
+ {
appendWhereClause("(participant.groupId in (:groupIds) ) ", hql);
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -179,9 +179,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/test-db/jbpm4-test-db.iml
===================================================================
--- jbpm4/trunk/modules/test-db/jbpm4-test-db.iml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/jbpm4-test-db.iml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -17,6 +17,7 @@
<orderEntry type="module" module-name="toplevel" exported="" />
<orderEntry type="module" module-name="pvm" exported="" />
<orderEntry type="module" module-name="jpdl" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
<CLASSES>
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,6 +27,8 @@
import org.jbpm.Execution;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
+import org.jbpm.task.Participation;
import org.jbpm.test.JbpmTestCase;
@@ -35,6 +37,9 @@
*/
public class TaskCandidatesTest extends JbpmTestCase {
+ UserRef johndoe = new UserRef("johndoe");
+ UserRef joesmoe = new UserRef("joesmoe");
+
public void testCommaSeparatedTaskCandidates() {
deployJpdlXmlString(
"<process name='TaskCandidates'>" +
@@ -51,28 +56,28 @@
Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
String executionId = execution.getId();
-
- List<Task> taskList = taskService.getUserTaskList("johndoe", 0, 10);
+
+ List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
assertEquals(1, taskList.size());
Task task = taskList.get(0);
assertEquals("review", task.getName());
- taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("review", task.getName());
// lets assume that johndoe takes the task
- taskService.assignTask(task.getDbid(), "johndoe");
+ taskService.assignTask(task.getDbid(), johndoe);
// verify that the group task lists are now empty
- taskList = taskService.getUserTaskList("johndoe", 0, 10);
+ taskList =taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
assertEquals(0, taskList.size());
- taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
assertEquals(0, taskList.size());
// verify that the task now shows up in the personal task list for johndoe
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("review", task.getName());
@@ -82,7 +87,7 @@
taskService.completeTask(task.getDbid());
// verify that the task list is now empty
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(0, taskList.size());
// verify that process moved to the next state
@@ -110,27 +115,27 @@
Execution execution = executionService.startProcessInstanceByKey("TaskCandidates", variables);
String executionId = execution.getId();
- List<Task> taskList = taskService.getUserTaskList("johndoe", 0, 10);
+ List<Task> taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
assertEquals(1, taskList.size());
Task task = taskList.get(0);
assertEquals("review", task.getName());
- taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("review", task.getName());
// take the task
- taskService.assignTask(task.getDbid(), "johndoe");
+ taskService.assignTask(task.getDbid(), johndoe);
// verify that the group task lists are now empty
- taskList = taskService.getUserTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, johndoe);
assertEquals(0, taskList.size());
- taskList = taskService.getUserTaskList("joesmoe", 0, 10);
+ taskList = taskService.findTasksByParticipation(Participation.CANDIDATE, joesmoe);
assertEquals(0, taskList.size());
// verify that the task now shows up in the personal task list for johndoe
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(1, taskList.size());
task = taskList.get(0);
assertEquals("review", task.getName());
@@ -140,7 +145,7 @@
taskService.completeTask(task.getDbid());
// verify that the task list is now empty
- taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(johndoe);
assertEquals(0, taskList.size());
// verify that process moved to the next state
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskListTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -24,6 +24,7 @@
import java.util.List;
import org.jbpm.task.Task;
+import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -32,6 +33,9 @@
*/
public class TaskListTest extends JbpmTestCase {
+ UserRef johndoe = new UserRef("johndoe");
+ UserRef joesmoe = new UserRef("joesmoe");
+
public void testPersonalTaskList() {
Task task = taskService.newTask();
task.setName("do laundry");
@@ -53,13 +57,13 @@
task.setAssignee("joesmoe");
saveAndRegisterTask(task);
- List<Task> taskList = taskService.getAssigneeTaskList("johndoe", 0, 10);
+ List<Task> taskList = taskService.findTasksByAssignment(johndoe);
assertNotNull(taskList);
assertEquals("do laundry", taskList.get(0).getName());
assertEquals(1, taskList.size());
- taskList = taskService.getAssigneeTaskList("joesmoe", 0, 10);
+ taskList = taskService.findTasksByAssignment(joesmoe);
assertNotNull(taskList);
assertContainsTask(taskList, "get good idea");
@@ -100,7 +104,7 @@
task.setPriority(10);
saveAndRegisterTask(task);
- List<Task> taskList = taskService.getAssigneeTaskList("joesmoe", 0, 10);
+ List<Task> taskList = taskService.findTasksByAssignment(joesmoe);
assertNotNull(taskList);
// default sort order is based on the priority
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskParticipationsTest.java 2009-03-30 13:27:06 UTC (rev 4356)
@@ -27,7 +27,7 @@
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
-import org.jbpm.task.Participant;
+import org.jbpm.task.Participation;
import org.jbpm.task.Task;
import org.jbpm.task.UserRef;
import org.jbpm.test.JbpmTestCase;
@@ -43,15 +43,15 @@
task.setName("do laundry");
long taskDbid = saveAndRegisterTask(task);
- taskService.addTaskParticipant(taskDbid, new UserRef("johndoe"), Participant.CANDIDATE);
- taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.CANDIDATE);
- taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.OWNER);
- taskService.addTaskParticipant(taskDbid, new GroupRef("losers"), Participant.CANDIDATE);
- taskService.addTaskParticipant(taskDbid, new GroupRef("dummies"), Participant.CANDIDATE);
+ taskService.addTaskParticipant(taskDbid, new UserRef("johndoe"), Participation.CANDIDATE);
+ taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.CANDIDATE);
+ taskService.addTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.OWNER);
+ taskService.addTaskParticipant(taskDbid, new GroupRef("losers"), Participation.CANDIDATE);
+ taskService.addTaskParticipant(taskDbid, new GroupRef("dummies"), Participation.CANDIDATE);
- List<Participant> taskParticipants = taskService.getTaskParticipants(taskDbid);
+ List<Participation> taskParticipations = taskService.getTaskParticipants(taskDbid);
- Set<IdentityRef> candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.CANDIDATE);
+ Set<IdentityRef> candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.CANDIDATE);
Set<IdentityRef> expectedIdentityRefs = new HashSet<IdentityRef>();
expectedIdentityRefs.add(new UserRef("johndoe"));
@@ -61,20 +61,20 @@
assertEquals(expectedIdentityRefs, candidateIdentityRefs);
- candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.OWNER);
+ candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.OWNER);
expectedIdentityRefs = new HashSet<IdentityRef>();
expectedIdentityRefs.add(new UserRef("joesmoe"));
assertEquals(expectedIdentityRefs, candidateIdentityRefs);
- taskService.removeTaskParticipant(taskDbid, new UserRef("joesmoe"), Participant.OWNER);
- taskService.removeTaskParticipant(taskDbid, new GroupRef("losers"), Participant.CANDIDATE);
+ taskService.removeTaskParticipant(taskDbid, new UserRef("joesmoe"), Participation.OWNER);
+ taskService.removeTaskParticipant(taskDbid, new GroupRef("losers"), Participation.CANDIDATE);
- taskParticipants = taskService.getTaskParticipants(taskDbid);
+ taskParticipations = taskService.getTaskParticipants(taskDbid);
- candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.CANDIDATE);
+ candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.CANDIDATE);
expectedIdentityRefs = new HashSet<IdentityRef>();
expectedIdentityRefs.add(new UserRef("johndoe"));
@@ -83,18 +83,18 @@
assertEquals(expectedIdentityRefs, candidateIdentityRefs);
- candidateIdentityRefs = getIdentityRefs(taskParticipants, Participant.OWNER);
+ candidateIdentityRefs = getIdentityRefs(taskParticipations, Participation.OWNER);
expectedIdentityRefs = new HashSet<IdentityRef>();
assertEquals(expectedIdentityRefs, candidateIdentityRefs);
}
- public Set<IdentityRef> getIdentityRefs(List<Participant> taskParticipants, String participation) {
+ public Set<IdentityRef> getIdentityRefs(List<Participation> taskParticipations, String participation) {
Set<IdentityRef> identityRefs = new HashSet<IdentityRef>();
- for (Participant participant: taskParticipants) {
- if (participation.equals(participant.getParticipation())) {
- identityRefs.add(participant.getIdentityRef());
+ for (Participation p : taskParticipations) {
+ if (participation.equals(p.getType())) {
+ identityRefs.add(p.getIdentityRef());
}
}
return identityRefs;
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -76,9 +76,9 @@
<property name="description" column="DESCR_"/>
<property name="assignee" column="ASSIGNEE_"/>
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="TASK_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
<property name="priority" column="PRIORITY_"/>
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -179,9 +179,9 @@
column="EXECUTION_"
foreign-key="none" />
- <set name="participants" cascade="all-delete-orphan">
+ <set name="participations" cascade="all-delete-orphan">
<key column="SWIMLANE_" />
- <one-to-many class="ParticipantImpl" />
+ <one-to-many class="ParticipationImpl" />
</set>
</class>
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-03-30 12:44:46 UTC (rev 4355)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-03-30 13:27:06 UTC (rev 4356)
@@ -250,7 +250,7 @@
external participant notifies the process system that the activity is
completed. So an execution is either executing or waiting on an external
participant. Typically, you'll see that the processes are mostly
- waiting for external participants. Especially humans tend to be slow :-)
+ waiting for external participations. Especially humans tend to be slow :-)
The time consumed by the process system between two wait states is
typically very small.
</para>
15 years, 1 month
JBoss JBPM SVN: r4355 - jbpm4/trunk/modules/deployment.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-30 08:44:46 -0400 (Mon, 30 Mar 2009)
New Revision: 4355
Modified:
jbpm4/trunk/modules/deployment/
Log:
adding target to svn:ignore
Property changes on: jbpm4/trunk/modules/deployment
___________________________________________________________________
Name: svn:ignore
+ target
15 years, 1 month
JBoss JBPM SVN: r4354 - in jbpm4/branches/tbaeyens/modules: deployment/src/test/java/org/jbpm/deploy/test and 17 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-30 05:13:39 -0400 (Mon, 30 Mar 2009)
New Revision: 4354
Removed:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
Modified:
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/ProcessEngine.java
jbpm4/branches/tbaeyens/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java
jbpm4/branches/tbaeyens/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.execution.hbm.xml
jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.wire.bindings.xml
jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/branches/tbaeyens/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml
jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.execution.hbm.xml
jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.execution.hbm.xml
jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.wire.bindings.xml
Log:
replaced process service with repository service
Modified: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/ProcessEngine.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/ProcessEngine.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/ProcessEngine.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -29,11 +29,6 @@
*/
public interface ProcessEngine {
- /** the {@link ProcessService process service} that provides access
- * to the process repository.
- * @deprecated */
- ProcessService getProcessService();
-
/** the {@link RepositoryService repository service} that provides access
* to the process repository. */
RepositoryService getRepositoryService();
Modified: jbpm4/branches/tbaeyens/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -72,7 +72,6 @@
protected static ProcessEngine processEngine = null;
protected static RepositoryService repositoryService;
- protected static ProcessService processService;
protected static ExecutionService executionService;
protected static ManagementService managementService;
protected static TaskService taskService;
@@ -107,7 +106,6 @@
processEngine = configuration.buildProcessEngine();
repositoryService = processEngine.get(RepositoryService.class);
- processService = processEngine.getProcessService();
executionService = processEngine.getExecutionService();
historyService = processEngine.getHistoryService();
managementService = processEngine.getManagementService();
Modified: jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/cfg/part1.jbpm.cfg.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -6,7 +6,6 @@
<repository-service />
<repository-cache />
- <process-service />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/resources/config-tool/jbpm/wire.bindings/part1.jbpm.wire.bindings.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -61,7 +61,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -28,7 +28,7 @@
import junit.framework.Test;
import org.jbpm.ExecutionService;
-import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
@@ -82,7 +82,7 @@
.endProcess();
// deploy process
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -31,6 +31,7 @@
import org.jbpm.Execution;
import org.jbpm.ExecutionService;
import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
@@ -130,7 +131,7 @@
public void testHappyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
@@ -175,7 +176,7 @@
public void testNoisyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(NoisyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
@@ -228,7 +229,7 @@
public void testCyclicTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(ProcessService.class)
+ environment.get(RepositoryService.class)
.createDeployment()
.addProcessDefinition(processDefinition)
.deploy();
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestServlet.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -21,9 +21,11 @@
*/
package org.jbpm.test.deployer;
+import org.jbpm.ProcessDefinitionQuery;
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
import org.jbpm.ProcessDefinition;
+import org.jbpm.RepositoryService;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -56,10 +58,12 @@
tx.begin();
ProcessEngine processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
- ProcessService processService = processEngine.getProcessService();
+ RepositoryService repositoryService = processEngine.getRepositoryService();
- ProcessDefinition def =
- processService.findLatestProcessDefinitionByKey(JBPM_DEPLOYER_TEST_V5);
+ ProcessDefinition def = repositoryService.createProcessDefinitionQuery()
+ .key(JBPM_DEPLOYER_TEST_V5)
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .uniqueResult();
tx.commit();
Modified: jbpm4/branches/tbaeyens/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -1,51 +1,42 @@
package org.jbpm.examples.services;
+import junit.framework.TestCase;
+
import org.jbpm.Configuration;
-import org.jbpm.Deployment;
-import org.jbpm.Execution;
import org.jbpm.ExecutionService;
+import org.jbpm.HistoryService;
+import org.jbpm.ManagementService;
import org.jbpm.ProcessEngine;
-import org.jbpm.ProcessService;
-import org.jbpm.test.BaseJbpmTestCase;
+import org.jbpm.RepositoryService;
+import org.jbpm.TaskService;
-/** example on how to create process engine objects starting from a configuration
+/** shows explicitely the part of the API that is
+ * provided by JbpmTestCase as a convenience.
*
- * @author Koen Aers
+ * @author Koen Aers, Tom Baeyens
*/
-public class ProcessEngineTest extends BaseJbpmTestCase {
+public class ProcessEngineTest extends TestCase {
- /** creation of a process engine with the default configuration */
- public void testDefaultProcessEngine() {
+ public void testBasicApiUsage() {
+ // create a configuration
Configuration configuration = new Configuration();
+ // build a process engine from a configuration
ProcessEngine processEngine = configuration.buildProcessEngine();
- ProcessService processService = processEngine.getProcessService();
+
+ // Obtain the services from the process engine
+ // ProcessEngine and Services are to be used as singletons. (ie they are threadsafe)
+ RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionService executionService = processEngine.getExecutionService();
+ TaskService taskService = processEngine.getTaskService();
+ HistoryService historyService = processEngine.getHistoryService();
+ ManagementService managementService = processEngine.getManagementService();
- Deployment deployment = processService.createDeployment();
- deployment.addResourceFromClasspath("org/jbpm/examples/services/process.jpdl.xml");
- deployment.deploy();
-
- Execution processInstance = executionService.startProcessInstanceByKey("simple");
- executionService.signalExecutionById(processInstance.getId());
- assertEquals("state", processInstance.getActivityName());
-
- }
+ // Deploying a process
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/services/process.jpdl.xml")
+ .deploy();
- /** creation of a process engine with a custom configuration */
- public void testCustomProcessEngineCreation() {
- Configuration configuration = new Configuration().setXmlString(
- "<jbpm-configuration>" +
- " <process-engine-context>" +
- " <process-service />" +
- " </process-engine-context>" +
- "</jbpm-configuration>");
- ProcessEngine processEngine = configuration.buildProcessEngine();
-
- // All services but the process service are created with the above configuration
- assertNotNull(processEngine);
- assertNotNull(processEngine.getProcessService());
- assertNull(processEngine.getTaskService());
+ repositoryService.deleteDeployment(deploymentDbid);
}
-
}
Modified: jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.cfg.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -6,7 +6,6 @@
<repository-service />
<repository-cache />
- <process-service />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -348,22 +348,4 @@
]]>
</query>
- <!-- query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query -->
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinitionId = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/examples/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -61,7 +61,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
Modified: jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -21,35 +21,34 @@
*/
package org.jbpm.integration.console;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.TaskRef;
import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
-
+import org.jbpm.ProcessDefinition;
import org.jbpm.model.OpenExecution;
-import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.model.Transition;
-import org.jbpm.task.Task;
-import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.task.Task;
-import java.util.Date;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class ModelAdaptor
{
- public static ProcessDefinitionRef adoptDefinition(OpenProcessDefinition p0)
+ public static ProcessDefinitionRef adoptDefinition(ProcessDefinition processDefinition)
{
ProcessDefinitionRef def = new ProcessDefinitionRef();
- def.setId( p0.getId() );
- def.setName(p0.getName());
- def.setVersion(p0.getVersion());
- def.setKey( p0.getKey() );
+ def.setId( processDefinition.getId() );
+ def.setName(processDefinition.getName());
+ def.setVersion(processDefinition.getVersion());
+ def.setKey( processDefinition.getKey() );
// def.setDescription(p0.getDescription());
// def.setPackageName(p0.getPackageName());
Modified: jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -21,19 +21,23 @@
*/
package org.jbpm.integration.console;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.server.integration.ProcessManagement;
-import org.jbpm.*;
+import org.jbpm.Execution;
+import org.jbpm.ExecutionQuery;
+import org.jbpm.ExecutionService;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.ProcessDefinitionQuery;
+import org.jbpm.ProcessService;
+import org.jbpm.RepositoryService;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.OpenProcessDefinition;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -44,20 +48,15 @@
{
List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
- ProcessService processService = this.processEngine.getProcessService();
- List<String> keys = processService.findProcessDefinitionKeys();
- Set<ProcessDefinition> definitions = new HashSet<ProcessDefinition>();
- for(String key : keys)
- {
- definitions.addAll(
- processService.findProcessDefinitionsByKey(key)
- );
- }
-
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ List<ProcessDefinition> definitions = repositoryService.createProcessDefinitionQuery()
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
+ .execute();
+
// adopt ProcessDefinition to console model
- for(ProcessDefinition p0 : definitions)
+ for(ProcessDefinition processDefinition : definitions)
{
- results.add( ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0) );
+ results.add( ModelAdaptor.adoptDefinition(processDefinition) );
}
return results;
@@ -66,15 +65,22 @@
public ProcessDefinitionRef getProcessDefinition(String procDefId)
{
- ProcessService processService = this.processEngine.getProcessService();
- ProcessDefinition p0 = processService.findProcessDefinitionById(procDefId);
- return ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0);
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id(procDefId)
+ .uniqueResult();
+ return ModelAdaptor.adoptDefinition(processDefinition);
}
public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId)
{
- ProcessService processService = this.processEngine.getProcessService();
- processService.deleteProcessDefinitionCascade(procDefId);
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id(procDefId)
+ .uniqueResult();
+ if (processDefinition!=null) {
+ repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentDbid());
+ }
return getProcessDefinitions();
}
@@ -162,11 +168,10 @@
public void deploy(String fileName, String contentType, InputStream deployment)
{
- this.processEngine.getProcessService()
+ this.processEngine.getRepositoryService()
.createDeployment()
.addResourceFromInputStream(fileName, deployment)
.deploy();
-
}
}
Modified: jbpm4/branches/tbaeyens/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -28,7 +28,6 @@
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
-import org.jbpm.ProcessService;
import org.jbpm.RepositoryService;
import org.jbpm.internal.log.Log;
@@ -55,11 +54,11 @@
tx.begin();
// deploy to process engine
- ProcessService processService = jbpmService.getProcessEngine().getProcessService();
+ RepositoryService repositoryService = jbpmService.getProcessEngine().getRepositoryService();
String deploymentName = deploymentMetData.getWatch().getPath();
File deploymentFile = new File(deploymentName);
- long deploymentDbid = processService.createDeployment()
+ long deploymentDbid = repositoryService.createDeployment()
.addResourceFromUrl(deploymentMetData.getProcessDescriptor())
.setTimestamp(deploymentFile.lastModified())
.setName(deploymentName)
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.cfg.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.cfg.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -6,7 +6,6 @@
<repository-service />
<repository-cache />
- <process-service />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -348,22 +348,4 @@
]]>
</query>
- <!-- query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query -->
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinitionId = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -61,7 +61,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -154,9 +154,6 @@
public ManagementService getManagementService() {
return environmentFactoryCtxWireContext.get(ManagementService.class);
}
- public ProcessService getProcessService() {
- return environmentFactoryCtxWireContext.get(ProcessService.class);
- }
public TaskService getTaskService() {
return environmentFactoryCtxWireContext.get(TaskService.class);
}
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -1,83 +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.svc;
-
-import java.util.List;
-
-import org.jbpm.Deployment;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.ProcessDefinitionQuery;
-import org.jbpm.ProcessService;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.cmd.DeleteProcessDefinitionCmd;
-import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionByKeyCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionByIdCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionKeysCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsByKeyCmd;
-import org.jbpm.pvm.internal.cmd.GetResourceAsStreamCmd;
-import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
-import org.jbpm.pvm.internal.repository.DeploymentImpl;
-
-/** {@link ProcessService} implementation that delegates execution of the
- * methods to a {@link CommandService}.
- *
- * @author Tom Baeyens
- */
-public class ProcessServiceImpl extends AbstractServiceImpl implements ProcessService {
-
- public Deployment createDeployment() {
- return new DeploymentImpl(commandService);
- }
-
- public List<String> findProcessDefinitionKeys() {
- return commandService.execute(new FindProcessDefinitionKeysCmd());
- }
-
- public ProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey) {
- return commandService.execute(new FindLatestProcessDefinitionByKeyCmd(processDefinitionKey));
- }
-
- public List<ProcessDefinition> findProcessDefinitionsByKey(String processDefinitionName) {
- return (List)commandService.execute(new FindProcessDefinitionsByKeyCmd(processDefinitionName));
- }
-
- public ProcessDefinition findProcessDefinitionById(String processDefinitionId) {
- return commandService.execute(new FindProcessDefinitionByIdCmd(processDefinitionId));
- }
-
- public void deleteProcessDefinition(String processDefinitionId) {
- commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId));
- }
-
- public void deleteProcessDefinitionCascade(String processDefinitionId) {
- commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId, true, true));
- }
-
- public ProcessDefinitionQuery createProcessDefinitionQuery() {
- return new ProcessDefinitionQueryImpl(commandService);
- }
-
- public Long deploy(Deployment deployment) {
- return commandService.execute(new DeployCmd((DeploymentImpl)deployment));
- }
-}
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -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.cmd.CommandService;
-import org.jbpm.pvm.internal.svc.ProcessServiceImpl;
-import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
-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 ProcessServiceBinding extends WireDescriptorBinding {
-
- public ProcessServiceBinding() {
- super("process-service");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(ProcessServiceImpl.class);
- descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
- return descriptor;
- }
-}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.cfg.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -6,7 +6,6 @@
<repository-service />
<repository-cache />
- <process-service />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -348,22 +348,4 @@
]]>
</query>
- <!-- query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query -->
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinitionId = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -61,7 +61,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
Modified: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -69,7 +69,6 @@
protected static ProcessEngine processEngine = null;
protected static RepositoryService repositoryService;
- protected static ProcessService processService;
protected static ExecutionService executionService;
protected static ManagementService managementService;
protected static TaskService taskService;
@@ -104,7 +103,6 @@
processEngine = configuration.buildProcessEngine();
repositoryService = processEngine.get(RepositoryService.class);
- processService = processEngine.getProcessService();
executionService = processEngine.getExecutionService();
historyService = processEngine.getHistoryService();
managementService = processEngine.getManagementService();
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/cfg/ConfigurationTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -48,7 +48,7 @@
.setXmlString(
"<jbpm-configuration>" +
" <process-engine-context>" +
- " <process-service />" +
+ " <repository-service />" +
" <execution-service />" +
" <management-service />" +
" </process-engine-context>" +
@@ -56,7 +56,6 @@
)
.buildProcessEngine();
assertNotNull(processEngine);
- assertNotNull(processEngine.getProcessService());
assertNotNull(processEngine.getExecutionService());
assertNotNull(processEngine.getManagementService());
}
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/DeploymentResourcesTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -42,7 +42,7 @@
byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
long deploymentDbid =
- processService.createDeployment()
+ repositoryService.createDeployment()
.addResourceFromString("xmlstring.jpdl.xml",
"<process name='Insurance claim'>" +
" <start />" +
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/ProcessDefinitionQueryTest.java 2009-03-30 09:13:39 UTC (rev 4354)
@@ -34,7 +34,7 @@
public class ProcessDefinitionQueryTest extends JbpmTestCase {
public void testQueryProcessDefinitionsEmpty() {
- List<ProcessDefinition> processDefinitions = processService
+ List<ProcessDefinition> processDefinitions = repositoryService
.createProcessDefinitionQuery()
.execute();
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.cfg.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -6,7 +6,6 @@
<repository-service />
<repository-cache />
- <process-service />
<execution-service />
<history-service />
<management-service />
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.execution.hbm.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -348,22 +348,4 @@
]]>
</query>
- <!-- query name="findExecutionByKey">
- <![CDATA[
- select execution
- from org.jbpm.pvm.internal.model.ExecutionImpl as execution
- where execution.key = :executionKey
- and execution.processDefinition.name = :processDefinitionName
- ]]>
- </query -->
-
- <query name="findProcessInstanceIds">
- <![CDATA[
- select processInstance.id
- from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
- where processInstance.processDefinitionId = :processDefinitionId
- and processInstance.parent is null
- ]]>
- </query>
-
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 07:35:41 UTC (rev 4353)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/resources/jbpm.wire.bindings.xml 2009-03-30 09:13:39 UTC (rev 4354)
@@ -61,7 +61,6 @@
<binding class="org.jbpm.pvm.internal.wire.binding.TypesBinding" />
<!-- services -->
<binding class="org.jbpm.pvm.internal.wire.binding.CommandServiceBinding" />
- <binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdentityServiceBinding" />
15 years, 1 month
JBoss JBPM SVN: r4353 - jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-30 03:35:41 -0400 (Mon, 30 Mar 2009)
New Revision: 4353
Modified:
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
Log:
revisiting deployment
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2009-03-30 05:38:21 UTC (rev 4352)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/process/RepositoryServiceTest.java 2009-03-30 07:35:41 UTC (rev 4353)
@@ -208,7 +208,8 @@
repositoryService.deleteDeployment(deploymentDbid);
fail("expected exception");
} catch (JbpmException e) {
- assertTextPresent("cannot delete deployment 23: still executions for process(deleteme): ", e.getMessage());
+ assertTextPresent("cannot delete deployment", e.getMessage());
+ assertTextPresent("still executions for process(deleteme): ", e.getMessage());
}
}
15 years, 1 month
JBoss JBPM SVN: r4352 - jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-30 01:38:21 -0400 (Mon, 30 Mar 2009)
New Revision: 4352
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/jbpm-oracle-ds.xml
Log:
JBPM-1367: replace server, port and database in oracle-ds with url
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/jbpm-oracle-ds.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/jbpm-oracle-ds.xml 2009-03-29 21:31:02 UTC (rev 4351)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/jbpm-oracle-ds.xml 2009-03-30 05:38:21 UTC (rev 4352)
@@ -5,9 +5,7 @@
<jndi-name>JbpmDS</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
- <xa-datasource-property name="ServerName">${jdbc.oracle.server}</xa-datasource-property>
- <xa-datasource-property name="PortNumber">${jdbc.oracle.port}</xa-datasource-property>
- <xa-datasource-property name="DatabaseName">${jdbc.oracle.database}</xa-datasource-property>
+ <xa-datasource-property name="URL">${jdbc.oracle.url}</xa-datasource-property>
<user-name>${jdbc.oracle.username}</user-name>
<password>${jdbc.oracle.password}</password>
15 years, 1 month
JBoss JBPM SVN: r4351 - jbpm3/branches/jbpm-3.2.5.SP/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-29 17:31:02 -0400 (Sun, 29 Mar 2009)
New Revision: 4351
Modified:
jbpm3/branches/jbpm-3.2.5.SP/hudson/profiles.xml.local.qa
Log:
JBPM-1367 add oracle properties to local qa profile
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/profiles.xml.local.qa
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/profiles.xml.local.qa 2009-03-29 18:14:35 UTC (rev 4350)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/profiles.xml.local.qa 2009-03-29 21:31:02 UTC (rev 4351)
@@ -35,6 +35,13 @@
<jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
<jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
<jdbc.postgresql.password></jdbc.postgresql.password>
+
+ <jdbc.oracle.server>localhost</jdbc.oracle.server>
+ <jdbc.oracle.port>1521</jdbc.oracle.port>
+ <jdbc.oracle.database>XE</jdbc.oracle.database>
+ <jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
+ <jdbc.oracle.username>jbpmtest</jdbc.oracle.username>
+ <jdbc.oracle.password>jbpmtest</jdbc.oracle.password>
</properties>
</profile>
15 years, 1 month
JBoss JBPM SVN: r4350 - in jbpm3/branches/jbpm-3.2.5.SP: modules/core and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-29 14:14:35 -0400 (Sun, 29 Mar 2009)
New Revision: 4350
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml
jbpm3/branches/jbpm-3.2.5.SP/pom.xml
Log:
set version to 3.2.5-SNAPSHOT
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -21,7 +21,7 @@
<!ENTITY security SYSTEM "modules/security.xml">
<!ENTITY tdd SYSTEM "modules/tdd.xml">
<!ENTITY pluggable SYSTEM "modules/pluggable.xml">
-<!ENTITY version "3.2.5.SP4">
+<!ENTITY version "3.2.5-SNAPSHOT">
]>
<book lang="en">
<bookinfo>
Modified: jbpm3/branches/jbpm-3.2.5.SP/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-03-29 16:51:56 UTC (rev 4349)
+++ jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-03-29 18:14:35 UTC (rev 4350)
@@ -18,7 +18,7 @@
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>3.2.5.SP4</version>
+ <version>3.2.5-SNAPSHOT</version>
<!-- Parent -->
<parent>
15 years, 1 month