JBoss JBPM SVN: r4329 - in jbpm4/trunk/modules/deployment/src/main/java/org/jbpm: pvm and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-25 17:58:50 -0400 (Wed, 25 Mar 2009)
New Revision: 4329
Modified:
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java
Log:
revisiting deployment
Modified: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java 2009-03-25 18:08:31 UTC (rev 4328)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java 2009-03-25 21:58:50 UTC (rev 4329)
@@ -63,12 +63,21 @@
String processDefinitionName = processDefinition.getName();
processDefinition.setDeploymentDbid(deployment.getDbid());
- checkKey(processDefinition, deployment);
- checkId(processDefinition, deployment);
+
+ String key = deployment.getObjectProperty(processDefinitionName, "jpdl.key");
+ if (key!=null) {
+ String id = deployment.getObjectProperty(processDefinitionName, "jpdl.id");
+ processDefinition.setId(id);
+ processDefinition.setKey(key);
+
+ } else {
+ checkKey(processDefinition, deployment);
+ checkId(processDefinition, deployment);
- deployment.addObject(processDefinitionName, processDefinition);
- deployment.addObjectProperty(processDefinitionName, "jpdl.key", processDefinition.getKey());
- deployment.addObjectProperty(processDefinitionName, "jpdl.id", processDefinition.getId());
+ deployment.addObject(processDefinitionName, processDefinition);
+ deployment.addObjectProperty(processDefinitionName, "jpdl.key", processDefinition.getKey());
+ deployment.addObjectProperty(processDefinitionName, "jpdl.id", processDefinition.getId());
+ }
}
}
}
Modified: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java 2009-03-25 21:58:50 UTC (rev 4329)
@@ -135,6 +135,19 @@
objectProperties.add(new DeploymentProperty(this, objectName, key, value));
}
+ public String getObjectProperty(String objectName, String key) {
+ if (objectProperties!=null) {
+ for (DeploymentProperty deploymentProperty: objectProperties) {
+ if ( (deploymentProperty.getObjectName().equals(objectName))
+ && (deploymentProperty.getKey().equals(key))
+ ) {
+ return deploymentProperty.getValue();
+ }
+ }
+ }
+ return null;
+ }
+
protected Object writeReplace() throws ObjectStreamException {
commandService = null;
return this;
Modified: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java 2009-03-25 21:58:50 UTC (rev 4329)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm;
+import java.util.HashMap;
import java.util.Map;
@@ -28,11 +29,26 @@
* @author Tom Baeyens
*/
public class RepositoryCacheImpl implements RepositoryCache {
+
+ Map<Long, Map<String, Object>> deployments = new HashMap<Long, Map<String,Object>>();
public Object get(long deploymentDbid, String objectName) {
- return null;
+ Map<String, Object> deploymentObjects = deployments.get(deploymentDbid);
+ if (deploymentObjects==null) {
+ return null;
+ }
+ return deploymentObjects.get(objectName);
}
- public void set(long deploymentdbid, Map<String, Object> deployedObjects) {
+ 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);
+ }
+ for (String objectName: objects.keySet()) {
+ Object object = deploymentObjects.get(objectName);
+ deploymentObjects.put(objectName, object);
+ }
}
}
17 years, 1 month
JBoss JBPM SVN: r4328 - in jbpm4/trunk/modules: deployment and 20 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-25 14:08:31 -0400 (Wed, 25 Mar 2009)
New Revision: 4328
Added:
jbpm4/trunk/modules/deployment/
jbpm4/trunk/modules/deployment/.classpath
jbpm4/trunk/modules/deployment/.project
jbpm4/trunk/modules/deployment/pom.xml
jbpm4/trunk/modules/deployment/src/
jbpm4/trunk/modules/deployment/src/main/
jbpm4/trunk/modules/deployment/src/main/java/
jbpm4/trunk/modules/deployment/src/main/java/org/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositorySession.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/StartExecutionInLatestCmd.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployCmd.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/Deployer.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployerManager.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentProperty.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCache.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryServiceImpl.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositorySessionImpl.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployExecutionService.java
jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployProcessService.java
jbpm4/trunk/modules/deployment/src/test/
jbpm4/trunk/modules/deployment/src/test/java/
jbpm4/trunk/modules/deployment/src/test/java/org/
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/StartExecutionTest.java
jbpm4/trunk/modules/deployment/src/test/resources/
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cache.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.definition.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.lifecycle.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.variable.types.xml
jbpm4/trunk/modules/deployment/src/test/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/deployment/src/test/resources/logging.properties
jbpm4/trunk/modules/deployment/target/
Removed:
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/Deployer.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/Deployment.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/RepositoryCache.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/RepositorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
Log:
revisiting deployment
Added: jbpm4/trunk/modules/deployment/.classpath
===================================================================
--- jbpm4/trunk/modules/deployment/.classpath (rev 0)
+++ jbpm4/trunk/modules/deployment/.classpath 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/deployment/.project
===================================================================
--- jbpm4/trunk/modules/deployment/.project (rev 0)
+++ jbpm4/trunk/modules/deployment/.project 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>deployment</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/trunk/modules/deployment/pom.xml
===================================================================
--- jbpm4/trunk/modules/deployment/pom.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/pom.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>jBPM 4 - PVM</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-deployment</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <showDeprecation>false</showDeprecation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*TestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/Deployment.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/Deployment.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api;
+
+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();
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositoryService.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositoryService.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api;
+
+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
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositoryService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositorySession.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositorySession.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -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.api;
+
+import java.util.List;
+
+import org.jbpm.pvm.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);
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/api/RepositorySession.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/StartExecutionInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/StartExecutionInLatestCmd.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/StartExecutionInLatestCmd.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,81 @@
+/*
+ * 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.cmd;
+
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.api.RepositorySession;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.cmd.VariablesCmd;
+
+
+/**
+ * @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;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/cmd/StartExecutionInLatestCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,117 @@
+/*
+ * 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;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.jbpm.api.RepositorySession;
+import org.jbpm.env.Environment;
+import org.jbpm.internal.log.Log;
+import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.Deployer;
+import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.xml.Parse;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JpdlDeployer implements Deployer {
+
+ private static Log log = Log.getLog(JpdlDeployer.class.getName());
+
+ 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 ( (processDefinition!=null)
+ && (processDefinition.getName()!=null)
+ ) {
+ String processDefinitionName = processDefinition.getName();
+
+ processDefinition.setDeploymentDbid(deployment.getDbid());
+ checkKey(processDefinition, deployment);
+ checkId(processDefinition, deployment);
+
+ deployment.addObject(processDefinitionName, processDefinition);
+ deployment.addObjectProperty(processDefinitionName, "jpdl.key", processDefinition.getKey());
+ deployment.addObjectProperty(processDefinitionName, "jpdl.id", processDefinition.getId());
+ }
+ }
+ }
+
+ protected void checkKey(ProcessDefinitionImpl processDefinition, DeploymentImpl deployment) {
+ String processDefinitionName = processDefinition.getName();
+ String processDefinitionKey = processDefinition.getKey();
+
+ // if no key was specified in the jpdl process file
+ if (processDefinitionKey==null) {
+ // derive the key from the name
+ // replace any non-word character with an underscore
+ processDefinitionKey = processDefinitionName.replaceAll("\\W", "_");
+ processDefinition.setKey(processDefinitionKey);
+ }
+
+ 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<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+"'");
+ }
+ }
+
+ 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);
+ processDefinition.setId(id);
+ }
+
+ RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ if (repositorySession.findObjectByPropertyValue("jpdl.id", id) != null) {
+ deployment.addProblem("process '" + id + "' already exists");
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/jpdl/JpdlDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployCmd.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployCmd.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+import org.jbpm.JbpmException;
+import org.jbpm.api.RepositorySession;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.internal.log.Log;
+
+
+/**
+ * @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;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/Deployer.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/Deployer.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/Deployer.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface Deployer {
+
+ void deploy(DeploymentImpl deployment);
+
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/Deployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployerManager.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployerManager.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import java.util.List;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployerManager {
+
+ List<Deployer> deployers;
+
+ public Object deploy(DeploymentImpl deployment) {
+ for (Deployer deployer: deployers) {
+ deployer.deploy(deployment);
+ }
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeployerManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,158 @@
+/*
+ * 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;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.ObjectStreamException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.JbpmException;
+import org.jbpm.api.Deployment;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.IoUtil;
+import org.jbpm.pvm.internal.xml.ProblemList;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentImpl extends ProblemList implements Deployment {
+
+ 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;
+
+ public DeploymentImpl() {
+ }
+
+ public DeploymentImpl(CommandService commandService) {
+ this.commandService = commandService;
+ }
+
+ 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 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);
+ return this;
+ }
+
+ public Deployment addZipInputStream(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));
+ }
+ zipEntry = zipInputStream.getNextEntry();
+ }
+ } catch (Exception e) {
+ throw new JbpmException("couldn't read zip archive", e);
+ }
+ return this;
+ }
+
+ public Set<String> getResourceNames() {
+ if (resources==null) {
+ return Collections.EMPTY_SET;
+ }
+ return resources.keySet();
+ }
+
+ public InputStream getResourceAsStream(String resourceName) {
+ if (resources!=null) {
+ Lob lob = resources.get(resourceName);
+ if (lob!=null) {
+ byte[] bytes = lob.extractBytes();
+ return new ByteArrayInputStream(bytes);
+ }
+ }
+ return null;
+ }
+
+ public void addObject(String objectName, Object object) {
+ if (objects==null) {
+ objects = new HashMap<String, Object>();
+ }
+ objects.put(objectName, object);
+ }
+
+ public void addObjectProperty(String objectName, String key, String value) {
+ if (objectProperties==null) {
+ objectProperties = new HashSet<DeploymentProperty>();
+ }
+ objectProperties.add(new DeploymentProperty(this, objectName, key, value));
+ }
+
+ protected Object writeReplace() throws ObjectStreamException {
+ commandService = null;
+ return this;
+ }
+
+ public long getDbid() {
+ return dbid;
+ }
+ public String getName() {
+ return name;
+ }
+ public long getTimestamp() {
+ return timestamp;
+ }
+ public Map<String, Object> getObjects() {
+ return objects;
+ }
+ public Set<DeploymentProperty> getObjectProperties() {
+ return objectProperties;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentProperty.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentProperty.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentProperty.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,66 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentProperty implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ long dbid;
+ protected DeploymentImpl deployment;
+ protected String objectName;
+ protected String key;
+ protected String value;
+
+ public DeploymentProperty() {
+ }
+
+ public DeploymentProperty(DeploymentImpl deployment, String objectName, String key, String value) {
+ this.deployment = deployment;
+ this.objectName = objectName;
+ this.key = key;
+ this.value = value;
+ }
+
+ public String toString() {
+ return "{"+objectName+","+key+","+value+"}";
+ }
+
+ public String getObjectName() {
+ return objectName;
+ }
+ public String getKey() {
+ return key;
+ }
+ public String getValue() {
+ return value;
+ }
+ public DeploymentImpl getDeployment() {
+ return deployment;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/DeploymentProperty.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCache.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCache.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm;
+
+import java.util.Map;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositoryCache {
+
+ void set(long deploymentdbid, Map<String, Object> deployedObjects);
+ Object get(long deploymentDbid, String objectName);
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCache.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryCacheImpl implements RepositoryCache {
+
+ public Object get(long deploymentDbid, String objectName) {
+ return null;
+ }
+
+ public void set(long deploymentdbid, Map<String, Object> deployedObjects) {
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryCacheImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryServiceImpl.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryServiceImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm;
+
+import java.io.InputStream;
+
+import org.jbpm.api.Deployment;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.cmd.CommandService;
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryServiceImpl implements RepositoryService {
+
+ CommandService commandService;
+
+ public Deployment createDeployment() {
+ return new DeploymentImpl(commandService);
+ }
+
+ public void deleteDeployment(long deploymentdbid) {
+ }
+
+ public InputStream getResource(String deploymentId, String resource) {
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositoryServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositorySessionImpl.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositorySessionImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,123 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.JbpmException;
+import org.jbpm.Problem;
+import org.jbpm.api.RepositorySession;
+import org.jbpm.internal.log.Log;
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositorySessionImpl implements RepositorySession {
+
+ private static Log log = Log.getLog(RepositorySessionImpl.class.getName());
+
+ Session session;
+ RepositoryCache repositoryCache;
+ DeployerManager deployerManager;
+
+ public long deploy(DeploymentImpl deployment) {
+ session.save(deployment);
+
+ deployment.setTimestamp(System.currentTimeMillis());
+ deployment.setProblems(new ArrayList<Problem>());
+
+ deployerManager.deploy(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());
+ } else {
+
+ repositoryCache.set(deployment.getDbid(), deployment.getObjects());
+ }
+
+ return deployment.getDbid();
+ }
+
+ public Object getObject(long deploymentDbid, String objectName) {
+ Object object = repositoryCache.get(deploymentDbid, objectName);
+ if (object!=null) {
+ log.trace("repository cache hit");
+
+ } else {
+ log.trace("loading deployment "+deploymentDbid+" from db");
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ deploy(deployment);
+
+ object = repositoryCache.get(deploymentDbid, objectName);
+
+ if (object==null) {
+ throw new JbpmException("deployment "+deploymentDbid+" doesn't contain object "+objectName);
+ }
+ }
+ return object;
+ }
+
+ public Object findObjectByPropertyValue(String key, String value) {
+ 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();
+
+ if (deploymentProperty!=null) {
+ long deploymentDbid = deploymentProperty.getDeployment().getDbid();
+ String objectName = deploymentProperty.getObjectName();
+
+ return 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();
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/pvm/RepositorySessionImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployExecutionService.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployExecutionService.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployExecutionService.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,37 @@
+/*
+ * 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.tmp;
+
+import org.jbpm.Execution;
+import org.jbpm.cmd.StartExecutionInLatestCmd;
+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));
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployExecutionService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployProcessService.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployProcessService.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployProcessService.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.tmp;
+
+import org.jbpm.pvm.internal.svc.ProcessServiceImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployProcessService extends ProcessServiceImpl {
+}
Property changes on: jbpm4/trunk/modules/deployment/src/main/java/org/jbpm/tmp/DeployProcessService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,246 @@
+/*
+ * 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.deploy.test;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import org.jbpm.Configuration;
+import org.jbpm.Execution;
+import org.jbpm.ExecutionService;
+import org.jbpm.HistoryService;
+import org.jbpm.IdentityService;
+import org.jbpm.ManagementService;
+import org.jbpm.ProcessEngine;
+import org.jbpm.ProcessService;
+import org.jbpm.TaskService;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.job.Job;
+import org.jbpm.pvm.internal.stream.StringStreamInput;
+import org.jbpm.task.Task;
+import org.jbpm.test.BaseJbpmTestCase;
+import org.jbpm.test.Db;
+
+/** base class for persistent jBPM tests.
+ *
+ * This class exposes a lot of extra convenience methods for testing
+ * process executions.
+ *
+ * The ProcessEngine services will be initialized and available as
+ * member fields.
+ *
+ * This test assumes that each test will clean the DB itself and that
+ * no data is in the DB tables when the test finishes.
+ *
+ * During tearDown, a check will be done if all the DB tables are
+ * empty. If not, that is logged with a F I X M E and the DB tables
+ * are cleaned.
+ *
+ * Convenience methods {@link #deployJpdlXmlString(String)} and
+ * {@link #deployJpdlResource(String)} will automatically keep track
+ * of the deployed process and delete it (and all the related executions)
+ * before the check is done.
+ *
+ * Similarly, the {@link #saveAndRegisterTask(Task)} will delete
+ * the task before the check is done in the tearDown.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class JbpmTestCase extends BaseJbpmTestCase {
+
+ 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;
+ protected static HistoryService historyService;
+ protected static IdentityService identityService;
+
+ protected static CommandService commandService;
+
+ /** 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;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ initialize();
+ }
+
+ protected synchronized void initialize() {
+ if (processEngine==null) {
+
+ String jbpmTestCfgType = System.getProperty("jbpm.test.cfg.type");
+ Configuration configuration = new Configuration(jbpmTestCfgType);
+
+ String jbpmTestCfgResource = System.getProperty("jbpm.test.cfg.resource");
+ if (jbpmTestCfgResource!=null) {
+ configuration.setResource(jbpmTestCfgResource);
+ }
+
+ processEngine = configuration.buildProcessEngine();
+
+ repositoryService = processEngine.get(RepositoryService.class);
+ processService = processEngine.getProcessService();
+ executionService = processEngine.getExecutionService();
+ historyService = processEngine.getHistoryService();
+ managementService = processEngine.getManagementService();
+ taskService = processEngine.getTaskService();
+ identityService = processEngine.getIdentityService();
+ commandService = processEngine.get(CommandService.class);
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ if (registeredDeployments!=null) {
+ for (Long deploymentDbid : registeredDeployments) {
+ repositoryService.deleteDeployment(deploymentDbid);
+ }
+ }
+
+ if (registeredTaskIds != null) {
+ for (Long taskDbid : registeredTaskIds) {
+ taskService.cancelTask(taskDbid);
+ }
+ }
+
+ Db.verifyClean(processEngine);
+
+ super.tearDown();
+ }
+
+ public void deployJpdlXmlString(String jpdlXmlString) {
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addStreamInput("xmlstring.jpdl.xml", new StringStreamInput(jpdlXmlString))
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+ }
+
+ protected void registerDeployment(long deploymentDbid) {
+ if (registeredDeployments==null) {
+ registeredDeployments = new ArrayList<Long>();
+ }
+
+ registeredDeployments.add(deploymentDbid);
+ }
+
+ public long saveAndRegisterTask(Task task) {
+ long taskDbid = taskService.saveTask(task);
+
+ if (registeredTaskIds == null) {
+ registeredTaskIds = new ArrayList<Long>();
+ }
+ registeredTaskIds.add(taskDbid);
+
+ return taskDbid;
+ }
+
+ public HashSet<String> getActivityNames(String processInstanceId) {
+ HashSet<String> activityNames = new HashSet<String>();
+
+ List<Execution> executions = executionService.findExecutions(processInstanceId);
+ for (Execution execution: executions) {
+ String activityName = execution.getActivityName();
+ if (activityName!=null) {
+ activityNames.add(activityName);
+ }
+ }
+
+ return activityNames;
+ }
+
+ public Execution findExecution(String processInstanceId, String activityName) {
+ List<Execution> executions = executionService.findExecutions(processInstanceId);
+ for (Execution execution: executions) {
+ if (activityName.equals(execution.getActivityName())) {
+ return execution;
+ }
+ }
+
+ return null;
+ }
+
+ public static Task getTask(List<Task> taskList, String taskName) {
+ for (Task task : taskList) {
+ if (taskName.equals(task.getName())) {
+ return task;
+ }
+ }
+ return null;
+ }
+
+ public static void assertContainsTask(List<Task> taskList, String taskName) {
+ if (getTask(taskList, taskName)==null) {
+ fail("tasklist doesn't contain task '"+taskName+"': "+taskList);
+ }
+ }
+
+ public static Task getTask(List<Task> taskList, String taskName, String assignee) {
+ for (Task task : taskList) {
+ if (taskName.equals(task.getName())) {
+ if (assignee==null) {
+ if (task.getAssignee()==null) {
+ return task;
+ }
+ } else {
+ if (assignee.equals(task.getAssignee())) {
+ return task;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public void executeAsyncMessage(Execution execution) {
+ List<Job> jobs = managementService
+ .createJobQuery()
+ .messages()
+ .processInstanceId(execution.getId())
+ .execute();
+
+ if (jobs.isEmpty()) {
+ fail("no async message");
+ }
+
+ if (jobs.size()>1) {
+ fail("more then one async message");
+ }
+
+ managementService.executeJob(jobs.get(0).getDbid());
+ }
+
+ public static void assertContainsTask(List<Task> taskList, String taskName, String assignee) {
+ if (getTask(taskList, taskName, assignee)==null) {
+ fail("tasklist doesn't contain task '"+taskName+"' for assignee '"+assignee+"': "+taskList);
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/JbpmTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/StartExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/StartExecutionTest.java (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/StartExecutionTest.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.deploy.test;
+
+import org.jbpm.Execution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartExecutionTest extends JbpmTestCase {
+
+ public void testStartNewExecutionByKey() {
+ deployJpdlXmlString(
+ "<process name='InsuranceClaim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+
+ assertNotNull(execution);
+ assertEquals("a", execution.getActivityName());
+ }
+}
Property changes on: jbpm4/trunk/modules/deployment/src/test/java/org/jbpm/deploy/test/StartExecutionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cache.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cache.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cache.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,39 @@
+<hibernate-cache>
+
+ <class-cache class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.ActivityImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.TransitionImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.EventImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.ExceptionHandlerImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.ObjectReference" />
+ <class-cache class="org.jbpm.pvm.internal.model.VariableDefinitionImpl" />
+ <class-cache class="org.jbpm.pvm.internal.model.TimerDefinitionImpl" />
+ <class-cache class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.attachments" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.activities" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.variableDefinitions" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.timerDefinitions" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.incomingTransitions" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.outgoingTransitions" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.exceptionHandlers" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.events" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.exceptionHandlers" />
+ <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.listenerReferences" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.model.ExceptionHandlerImpl.eventListenerReferences" />
+
+ <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.argDescriptors" />
+ <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.operations" />
+
+</hibernate-cache>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cache.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cfg.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+ <process-engine-context>
+
+ <object class="org.jbpm.pvm.RepositoryServiceImpl" auto-wire="true" />
+ <object class="org.jbpm.pvm.RepositoryCacheImpl" />
+
+ <object class="org.jbpm.tmp.DeployExecutionService" auto-wire="true" />
+
+ <process-service />
+ <history-service />
+ <management-service />
+ <task-service />
+ <identity-service />
+
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ <standard-transaction-interceptor />
+ </command-service>
+
+ <hibernate-configuration>
+ <cfg resource="jbpm.hibernate.cfg.xml" />
+ <cache-configuration resource="jbpm.cache.xml"
+ usage="nonstrict-read-write" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <object class="org.jbpm.pvm.DeployerManager">
+ <field name="deployers">
+ <list>
+ <object class="org.jbpm.jpdl.JpdlDeployer" />
+ </list>
+ </field>
+ </object>
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine"
+ write-context="">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <authentication />
+
+ <job-executor auto-start="false" />
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <transaction />
+
+ <object class="org.jbpm.pvm.RepositorySessionImpl" auto-wire="true" />
+
+ <pvm-db-session />
+ <job-db-session />
+ <task-db-session />
+ <message-session />
+ <timer-session />
+ <history-session />
+ <hibernate-session />
+ <identity-session />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.definition.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.definition.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,646 @@
+<?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 package="org.jbpm.pvm.internal.model" default-access="field">
+
+ <!-- ### PROCESS DEFINITION ############################################# -->
+ <class name="ProcessDefinitionImpl"
+ table="JBPM_PROCESS"
+ discriminator-value="pvm">
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator><column name="CLASS_" /></discriminator>
+
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="properties"
+ class="WireProperties"
+ column="PROPS_"
+ foreign-key="FK_PROCDEF_PROPS"
+ index="IDX_PROCDEF_PROPS"
+ cascade="all" />
+ <list name="exceptionHandlers" cascade="all">
+ <key foreign-key="FK_EXHDLR_PROCESS">
+ <column name="PROCESS_" index="IDX_EXHDLR_PROCESS"/>
+ </key>
+ <index column="PROCESS_IDX_" />
+ <one-to-many class="ExceptionHandlerImpl"/>
+ </list>
+
+ <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="name" column="NAME_" />
+ <property name="description" column="DESCR_" />
+ <map name="events" cascade="all-delete-orphan">
+ <key foreign-key="FK_EVENT_PROCESS">
+ <column name="PROCESS_" index="IDX_EVENT_PROCESS" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.model.EventImpl"/>
+ </map>
+
+ <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <list name="activities" cascade="all" inverse="false">
+ <key foreign-key="FK_ACTS_PROCESS">
+ <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
+ </key>
+ <list-index column="ACTSPROCESS_IDX_" />
+ <one-to-many class="ActivityImpl" />
+ </list>
+ <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
+ <list name="variableDefinitions" cascade="all">
+ <key foreign-key="FK_VARDEF_PROCESS">
+ <column name="PROCESS_" index="IDX_VARDEF_PROCESS"/>
+ </key>
+ <index column="PROCESS_IDX_" />
+ <one-to-many class="VariableDefinitionImpl" />
+ </list>
+ <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
+ <set name="timerDefinitions" cascade="all">
+ <key foreign-key="FK_TMRDEF_PROCESS">
+ <column name="PROCESS_" index="IDX_TMRDEF_PROCESS"/>
+ </key>
+ <one-to-many class="TimerDefinitionImpl" />
+ </set>
+
+ <!-- ProcessDefinitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="key" column="KEY_" />
+ <property name="id" column="ID_" unique="true" />
+
+ <property name="packageName" column="PACKAGE_" />
+ <property name="version" column="VERSION_" />
+ <property name="deploymentTime" column="DEPLOYED_" />
+ <many-to-one name="initial"
+ column="INITIAL_"
+ class="ActivityImpl"
+ cascade="all"
+ foreign-key="FK_PROCDEF_INITIAL"
+ index="IDX_PROCDEF_INIT"
+ fetch="select" />
+
+ <map name="attachments" cascade="all-delete-orphan">
+ <key foreign-key="FK_LOB_PROCESS">
+ <column name="PROCESS_" index="IDX_LOB_PROCESS" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
+ </map>
+ </class>
+
+ <!-- ### Activity ############################################################## -->
+ <class name="ActivityImpl" table="JBPM_ACTIVITY">
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="processDefinition"
+ class="ProcessDefinitionImpl"
+ column="PROCESS_"
+ foreign-key="FK_ACT_PROCESS"
+ index="IDX_ACT_PROCESS" />
+ <many-to-one name="properties"
+ class="WireProperties"
+ column="PROPS_"
+ foreign-key="FK_ACT_PROPS"
+ index="IDX_ACT_PROPS"
+ cascade="all" />
+ <list name="exceptionHandlers" cascade="all">
+ <key foreign-key="FK_EXHDLR_ACT">
+ <column name="ACT_" index="IDX_EXHDLR_ACT"/>
+ </key>
+ <index column="ACT_IDX_" />
+ <one-to-many class="ExceptionHandlerImpl" />
+ </list>
+
+ <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="name" column="NAME_"/>
+ <property name="description" column="DESCR_"/>
+ <map name="events" cascade="all-delete-orphan">
+ <key foreign-key="FK_EVENT_ACT">
+ <column name="ACT_" index="IDX_EVENT_ACT" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
+ </map>
+
+ <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <list name="activities" cascade="all" inverse="false">
+ <key column="PARENT_" foreign-key="none" />
+ <list-index column="PARENT_IDX_" />
+ <one-to-many class="ActivityImpl" />
+ </list>
+ <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
+ <list name="variableDefinitions" cascade="all">
+ <key foreign-key="FK_VARDEF_ACT">
+ <column name="ACT_" index="IDX_VARDEF_ACT"/>
+ </key>
+ <index column="ACT_IDX_" />
+ <one-to-many class="VariableDefinitionImpl" />
+ </list>
+ <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
+ <set name="timerDefinitions" cascade="all">
+ <key foreign-key="FK_TMRDEF_ACT">
+ <column name="ACT_" index="IDX_TMRDEF_ACT"/>
+ </key>
+ <one-to-many class="TimerDefinitionImpl" />
+ </set>
+
+ <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="type" column="TYPE_" />
+ <property name="isLocalScope" column="LOCAL_SCOPE_" />
+ <property name="isExecutionAsync" column="EXEC_ASYNC_" />
+ <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
+ <property name="isPreviousNeeded" column="PREV_NEEDED_" />
+
+ <many-to-one name="parentActivity"
+ column="PARENT_"
+ class="ActivityImpl"
+ cascade="all"
+ foreign-key="FK_ACT_PARENT"
+ index="IDX_ACT_PARENT" />
+
+ <many-to-one name="defaultTransition"
+ column="DEFTRANS_"
+ class="TransitionImpl"
+ fetch="select"
+ foreign-key="FK_ACT_DEFTRANS"
+ index="IDX_ACT_DEFTRANS" />
+
+ <list name="incomingTransitions" inverse="false">
+ <key column="DESTINATION_" />
+ <index column="IN_IDX_" />
+ <one-to-many class="TransitionImpl" />
+ </list>
+
+ <list name="outgoingTransitions" inverse="false" cascade="all">
+ <key column="SOURCE_" />
+ <index column="OUT_IDX_" />
+ <one-to-many class="TransitionImpl" />
+ </list>
+
+ <component name="behaviourReference" class="ObjectReference">
+ <many-to-one name="descriptor"
+ column="BEHAV_DESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_NODE_BEHAV_DESCR"
+ index="IDX_NODE_BEHAV_DESCR" />
+ <any name="object" id-type="long" cascade="all">
+ <!-- TODO: Specify names for classes -->
+ <!-- <meta-value value="bpel::activity" class="org.jbpm.pvm.bpel.BpelActivity"/> -->
+ <column name="BEHAV_CLASS_" />
+ <column name="BEHAV_ID_" />
+ </any>
+ </component>
+ </class>
+
+ <!-- ### TRANSITION ##################################################### -->
+ <class name="TransitionImpl" table="JBPM_TRANSITION">
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="processDefinition"
+ class="ProcessDefinitionImpl"
+ column="PROCESS_"
+ foreign-key="FK_TRANS_PROCDEF"
+ index="IDX_TRANS_PROCDEF" />
+ <many-to-one name="properties"
+ class="WireProperties"
+ column="PROPS_"
+ foreign-key="FK_TRANS_PROPS"
+ index="IDX_TRANS_PROPS"
+ cascade="all" />
+ <list name="exceptionHandlers" cascade="all">
+ <key foreign-key="FK_EXHDLR_TRANS">
+ <column name="TRANSITION_" index="IDX_EXHDLR_TRANS" />
+ </key>
+ <index column="TRANSITION_IDX_" />
+ <one-to-many class="ExceptionHandlerImpl" />
+ </list>
+
+ <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="name" column="NAME_" />
+ <property name="description" column="DESCR_" />
+ <map name="events" cascade="all-delete-orphan">
+ <key foreign-key="FK_EVENT_TRANS">
+ <column name="TRANSITION_" index="IDX_EVENT_TRANS" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
+ </map>
+
+ <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <many-to-one name="source"
+ column="SRC_"
+ class="ActivityImpl"
+ fetch="select"
+ foreign-key="FK_TRANS_SRC"
+ index="IDX_TRANS_SRC" />
+
+ <many-to-one name="destination"
+ column="DEST_"
+ class="ActivityImpl"
+ fetch="select"
+ cascade="all"
+ foreign-key="FK_TRANS_DST"
+ index="IDX_TRANS_DST" />
+
+ <many-to-one name="conditionDescriptor"
+ column="COND_DESCR_"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ cascade="all"
+ foreign-key="FK_TRANS_COND"
+ index="IDX_TRANS_COND" />
+
+ <!--
+ <many-to-one name="waitConditionDescriptor"
+ column="WAIT_DESCR_"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ cascade="all"
+ foreign-key="FK_TRANS_WAIT_DESCR"
+ index="IDX_TRANS_WAIT_DESCR" />
+ -->
+
+ <property name="isTakeAsync" column="TAKEASYNC_" />
+ </class>
+
+ <!-- ### EVENT ########################################################## -->
+ <class name="EventImpl" table="JBPM_EVENT">
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="processDefinition"
+ class="ProcessDefinitionImpl"
+ column="PROCESSDEF_"
+ foreign-key="FK_EVENT_PROCDEF"
+ index="IDX_EVENT_PROCDEF" />
+ <many-to-one name="properties"
+ class="WireProperties"
+ column="PROPS_"
+ foreign-key="FK_EVENT_PROPS"
+ index="IDX_EVENT_PROPS"
+ cascade="all" />
+ <list name="exceptionHandlers" cascade="all">
+ <key foreign-key="FK_EXHDLR_EVENT">
+ <column name="EVENT_" index="IDX_EXHDLR_EVENT"/>
+ </key>
+ <index column="EVENT_IDX_" />
+ <one-to-many class="ExceptionHandlerImpl" />
+ </list>
+
+ <!-- EventImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <property name="name" column="NAME_" />
+ <list name="listenerReferences" table="JBPM_OBJECTREFERENCES" cascade="all-delete-orphan">
+ <key foreign-key="FK_OBJECTREF_EVENT">
+ <column name="EVENT_" index="IDX_OBJREF_EVENT"/>
+ </key>
+ <list-index column="EVENT_IDX_" />
+ <one-to-many class="EventListenerReference" />
+ </list>
+ </class>
+
+ <!-- ### EXCEPTION HANDLER ############################################## -->
+ <class name="ExceptionHandlerImpl" table="JBPM_EXCEPTHNDLR">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <property name="exceptionClassName" column="EXCEPT_CLASS_" />
+ <property name="isTransactional" column="TRANSACT_" />
+ <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
+ <property name="transitionName" column="TRANSITIONNAME_" />
+ <property name="activityName" column="NODENAME_" />
+ <list name="eventListenerReferences"
+ inverse="false"
+ cascade="all-delete-orphan"
+ table="JBPM_OBJECTREFERENCES">
+ <key foreign-key="FK_OBJREF_EXHNDLR" not-null="false">
+ <column name="EXHNDLR_" index="IDX_OBJREF_EXHNDLR" />
+ </key>
+ <list-index column="EXHNDLR_IDX_" />
+ <one-to-many class="ObjectReference" />
+ </list>
+ </class>
+
+ <!-- ### OBJECT REFERENCE ############################################### -->
+ <class name="ObjectReference" discriminator-value="objref" table="JBPM_OBJECTREF">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="descriptor"
+ column="OBJ_DESCR_"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ cascade="all"
+ foreign-key="FK_OBJREF_EVENT"
+ index="IDX_OBJREF_EVENT"/>
+ <any name="object" id-type="long" cascade="all">
+ <!-- TODO: Specify names for classes -->
+ <column name="OBJ_CLASS_" />
+ <column name="OBJ_ID_" />
+ </any>
+ <property name="expression" column="OBJ_EXPRESSION_"/>
+ <property name="expressionLanguage" column="OBJ_EXPRLANG_"/>
+
+ <subclass name="EventListenerReference" discriminator-value="evtlis">
+ <property name="isPropagationEnabled" column="PROPAGATE_" />
+ </subclass>
+
+ </class>
+
+ <!-- ### VARIABLE DEFINITION ############################################ -->
+ <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <property name="name" column="NAME_"/>
+ <property name="typeName" column="TYPE_"/>
+
+ <property name="inVariableName" column="INVAR_" />
+ <property name="inExpression" column="INEXPR_" />
+ <many-to-one name="inDescriptor"
+ column="INDESCR_"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ cascade="all"
+ foreign-key="FK_VARDEF_INDES"
+ index="IDX_VARDEF_INDES"/>
+ <property name="outVariableName" column="OUTVAR_" />
+ <property name="outExpression" column="OUTEXPR_" />
+ </class>
+
+ <!-- ### TIMER DEFINITION ############################################### -->
+ <class name="TimerDefinitionImpl" table="JBPM_TIMERDEF">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <property name="dueDateDescription" column="DUEDATEDESCR_"/>
+ <property name="repeat" column="REPEAT_"/>
+ <property name="isExclusive" column="ISEXCL_"/>
+ <property name="retries" column="RETRIES_"/>
+ <property name="eventName" column="EVENT_"/>
+ <property name="signalName" column="SIGNAL_"/>
+ <property name="dueDate" column="DUEDATE_" type="timestamp"/>
+ </class>
+
+ <!-- ### DESCRIPTORS #################################################### -->
+ <class name="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
+ discriminator-value="abstract">
+ <!--
+ byte : ByteDescriptor
+ string : StringDescriptor
+ char : CharacterDescriptor
+ class : ClassDescriptor
+ double : DoubleDescriptor
+ expr : ExpressionDescriptor
+ float : FloatDescriptor
+ long : LongDescriptor
+ int : IntegerDescriptor
+ short : ShortDescriptor
+ coll : CollectionDescriptor
+ map : MapDescriptor
+ list : ListDescriptor
+ set : SetDescriptor
+ object : ObjectDescriptor
+ ref : ReferenceDescriptor
+ null : NullDescriptor
+ true : TrueDescriptor
+ false : FalseDescriptor
+ provided : ProvidedObjectDescriptor
+ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="name" column="NAME_" />
+ <property name="init" column="INIT_" />
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.NullDescriptor" discriminator-value="null_" />
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor" discriminator-value="true" />
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor" discriminator-value="false" />
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.StringDescriptor" discriminator-value="string">
+ <property name="text" column="TEXT_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor" discriminator-value="char">
+ <property name="text" column="TEXT_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor" discriminator-value="class">
+ <property name="text" column="TEXT_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor" discriminator-value="ref">
+ <property name="text" column="TEXT_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor" discriminator-value="double">
+ <property name="doubleVal" column="DOUBLEVAL_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor" discriminator-value="float">
+ <property name="doubleVal" column="DOUBLEVAL_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.LongDescriptor" discriminator-value="long">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor" discriminator-value="int">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor" discriminator-value="short">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor" discriminator-value="byte">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.CollectionDescriptor" discriminator-value="coll">
+ <property name="className" column="CLASSNAME_" />
+ <list name="valueDescriptors" cascade="all-delete-orphan">
+ <key foreign-key="FK_DESCR_VALDESCR">
+ <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
+ </key>
+ <list-index column="VALUEDESCR_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
+ </list>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.MapDescriptor" discriminator-value="map">
+ <list name="keyDescriptors" cascade="all-delete-orphan">
+ <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
+ <list-index column="KEYDESCR_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
+ </list>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor" discriminator-value="list" />
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.SetDescriptor" discriminator-value="set" />
+ </subclass>
+
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor" discriminator-value="object">
+ <property name="className" column="TEXT_" />
+ <property name="methodName" column="METHOD_" />
+ <property name="isAutoWireEnabled" column="BOOLVAL_" />
+ <property name="factoryObjectName" column="FACTORYNAME_" />
+
+ <many-to-one name="factoryDescriptor" class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" column="FACTORYDESCR_"
+ foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
+
+ <list name="argDescriptors" cascade="all-delete-orphan">
+ <key foreign-key="FK_OBJARG_DESCR">
+ <column name="OBJARG_DESCR_" index="IDX_OBJARG_DESCR" />
+ </key>
+ <list-index column="OBJARG_DESCR_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
+ </list>
+
+ <list name="operations" cascade="all-delete-orphan">
+ <key foreign-key="FK_OBJOPER_DESCR">
+ <column name="OBJOPER_DESCR_" index="IDX_OBJOPER_DESCR" />
+ </key>
+ <list-index column="OBJOPER_DESCR_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
+ </list>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor" discriminator-value="expr">
+ <property name="expr" column="TEXT_" />
+ <property name="lang" column="METHOD_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor" discriminator-value="provided">
+ <any name="providedObject" id-type="long" cascade="all">
+ <column name="TEXT_" />
+ <column name="LONGVAL_" />
+ </any>
+ <property name="exposeType" column="BOOLVAL_" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.descriptor.EnvDescriptor" discriminator-value="env">
+ <property name="objectName" column="TEXT_" />
+ <property name="typeName" column="CLASSNAME_" />
+ </subclass>
+
+ </class>
+
+ <!-- ### OPERATIONS ##################################################### -->
+ <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
+ table="JBPM_OPERATION" discriminator-value="oper">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+
+ <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
+ discriminator-value="field">
+ <property name="fieldName" column="TEXT_" />
+ <many-to-one name="descriptor" column="DESCR_" cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
+ discriminator-value="prop">
+ <property name="setterName" column="TEXT_" />
+ <many-to-one name="descriptor" column="DESCR_" cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
+ discriminator-value="invoke">
+ <property name="methodName" column="TEXT_" />
+ <list name="argDescriptors" cascade="all-delete-orphan">
+ <key foreign-key="FK_ARGDSCR_OPER">
+ <column name="OPER_" index="IDX_ARGDSCR_OPER" />
+ </key>
+ <list-index column="OPER_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
+ </list>
+ </subclass>
+ </class>
+
+ <!-- ### ARG DESCRIPTOR ################################################# -->
+ <class name="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <property name="typeName" column="TYPENAME_" />
+ <many-to-one name="descriptor" column="DESCRIPTOR_"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
+ </class>
+
+ <!-- ### PROPERTIES ##################################################### -->
+ <class name="org.jbpm.pvm.internal.model.WireProperties" table="JBPM_WIREPROPS">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <component name="wireContext" class="org.jbpm.pvm.internal.wire.WireContext">
+ <component name="wireDefinition" class="org.jbpm.pvm.internal.wire.WireDefinition">
+ <map name="descriptors" cascade="all-delete-orphan" lazy="false">
+ <key foreign-key="FK_DESCR_PROPS">
+ <column name="PROPS_" index="IDX_DESCR_PROPS" />
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
+ </map>
+ </component>
+ </component>
+ </class>
+
+
+ <!-- ### QUERIES ######################################################## -->
+
+ <query name="findProcessDefinitionKeys">
+ <![CDATA[
+ select distinct process.key
+ from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
+ order by process.key asc
+ ]]>
+ </query>
+
+ <query name="findProcessDefinitionsByKey">
+ <![CDATA[
+ select process
+ from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
+ where process.key = :key
+ order by process.version desc
+ ]]>
+ </query>
+
+ <query name="findProcessDefinitionById">
+ <![CDATA[
+ select process
+ from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
+ where process.id = :id
+ ]]>
+ </query>
+
+ <query name="findProcessDefinitionKeysByName">
+ <![CDATA[
+ select process.key
+ from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
+ where process.name = :name
+ ]]>
+ </query>
+
+ <query name="findProcessDefinitionNamesByKey">
+ <![CDATA[
+ select process.name
+ from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
+ where process.key = :key
+ ]]>
+ </query>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.definition.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.execution.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.execution.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,378 @@
+<?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 package="org.jbpm.pvm.internal.model" default-access="field">
+
+ <!-- ### TYPEDEFS ####################################################### -->
+ <typedef name="converter" class="org.jbpm.pvm.internal.hibernate.ConverterType">
+ <param name="org.jbpm.pvm.internal.type.converter.BooleanToStringConverter" >bool-str</param>
+ <param name="org.jbpm.pvm.internal.type.converter.ByteToLongConverter" >byte-long</param>
+ <param name="org.jbpm.pvm.internal.type.converter.CharacterToStringConverter" >char-str</param>
+ <param name="org.jbpm.pvm.internal.type.converter.DateToLongConverter" >date-long</param>
+ <param name="org.jbpm.pvm.internal.type.converter.DateToStringConverter" >date-str</param>
+ <param name="org.jbpm.pvm.internal.type.converter.DoubleToStringConverter" >double-str</param>
+ <param name="org.jbpm.pvm.internal.type.converter.FloatToDoubleConverter" >float-double</param>
+ <param name="org.jbpm.pvm.internal.type.converter.FloatToStringConverter" >float-str</param>
+ <param name="org.jbpm.pvm.internal.type.converter.IntegerToLongConverter" >int-long</param>
+ <param name="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter">ser-bytes</param>
+ <param name="org.jbpm.pvm.internal.type.converter.ShortToLongConverter" >short-long</param>
+ </typedef>
+
+ <!-- ### PROCESS DEFINITION ############################################# -->
+ <class name="ExecutionImpl"
+ table="JBPM_EXECUTION"
+ discriminator-value="pvm">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <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="hasVariables" column="HASVARS_" />
+ <map name="variables"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_VAR_EXECUTION">
+ <column name="EXECUTION_" index="IDX_VAR_EXECUTION"/>
+ </key>
+ <map-key type="string" column="KEY_" />
+ <one-to-many class="org.jbpm.pvm.internal.type.Variable" />
+ </map>
+
+ <property name="hasTimers" column="HASTIMERS_" />
+ <set name="timers"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_TMR_EXECUTION">
+ <column name="EXECUTION_" />
+ </key>
+ <one-to-many class="org.jbpm.pvm.internal.job.TimerImpl" />
+ </set>
+
+ <property name="name" column="NAME_" />
+ <property name="key" column="KEY_" />
+ <property name="id" column="ID_" unique="true" />
+
+ <property name="state" column="STATE_" />
+
+ <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="transitionOrigin"
+ class="org.jbpm.pvm.internal.model.ActivityImpl"
+ column="TRANSORIG_"
+ foreign-key="FK_EXEC_TRANSORIG"
+ index="IDX_EXEC_TRANSORIG" />
+
+ <list name="executions"
+ cascade="all-delete-orphan"
+ inverse="false">
+ <key column="PARENT_" foreign-key="FK_EXEC_PARENT" />
+ <list-index column="PARENT_IDX_" />
+ <one-to-many class="ExecutionImpl" />
+ </list>
+
+ <many-to-one name="parent"
+ column="PARENT_"
+ class="ExecutionImpl"
+ foreign-key="FK_EXEC_PARENT"
+ index="IDX_EXEC_PARENT" />
+
+ <many-to-one name="processInstance"
+ class="ExecutionImpl"
+ column="INSTANCE_"
+ foreign-key="FK_EXEC_INSTANCE"
+ index="IDX_EXEC_INSTANCE" />
+
+ <many-to-one name="superProcessExecution"
+ column="SUPEREXEC_"
+ class="ExecutionImpl"
+ foreign-key="FK_EXEC_SUPEREXEC"
+ index="IDX_EXEC_SUPEREXEC" />
+
+ </class>
+
+ <!-- ### COMMENTS ####################################################### -->
+ <class name="CommentImpl" table="JBPM_COMMENT">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="userId" column="USERID_" />
+ <property name="time" column="TIME_" />
+ <property name="message" column="MESSAGE_" />
+
+ <list name="comments"
+ cascade="all-delete-orphan"
+ inverse="false">
+ <key column="PARENT_" foreign-key="none" />
+ <list-index column="PARENT_IDX_" />
+ <one-to-many class="CommentImpl" />
+ </list>
+ </class>
+
+ <!-- ### VARIABLE ####################################################### -->
+ <class name="org.jbpm.pvm.internal.type.Variable" abstract="true" discriminator-value=" " table="JBPM_VARIABLE">
+ <!-- discriminator values:
+ date : org.jbpm.pvm.internal.type.variable.DateVariable
+ double : org.jbpm.pvm.internal.type.variable.DoubleVariable
+ hibl : org.jbpm.pvm.internal.type.variable.HibernateLongVariable
+ long : org.jbpm.pvm.internal.type.variable.LongVariable
+ hibs : org.jbpm.pvm.internal.type.variable.HibernateStringVariable
+ string : org.jbpm.pvm.internal.type.variable.StringVariable
+ null : org.jbpm.pvm.internal.type.variable.NullVariable
+ blob : org.jbpm.pvm.internal.type.variable.BlobVariable
+ clob : org.jbpm.pvm.internal.type.variable.ClobVariable
+ -->
+
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_"/>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="key" column="KEY_"/>
+ <property name="queryText" column="QUERYTEXT_" />
+ <property name="converter" type="converter" column="CONVERTER_" />
+ <many-to-one name="processInstance"
+ column="PROCINST_"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ foreign-key="FK_VAR_PROCINST"
+ index="IDX_VAR_PROCINST"/>
+ </class>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.DateVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="T">
+ <property name="date" column="DATE_VALUE_" type="timestamp"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.DoubleVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="D">
+ <property name="d" column="DOUBLE_VALUE_" type="double"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="l">
+ <property name="hibernatable" column="LONG_VALUE_" type="long"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.LongVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="L">
+ <property name="l" column="LONG_VALUE_" type="long"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="s">
+ <property name="hibernatable" column="STRING_VALUE_" type="string"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.StringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="S">
+ <property name="string" column="STRING_VALUE_" type="string"/>
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.NullVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="N">
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.BlobVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="B">
+ <many-to-one name="lob"
+ column="LOB_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.lob.Lob"
+ foreign-key="FK_VAR_LOB"
+ index="IDX_VAR_LOB" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.type.variable.ClobVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="C">
+ <many-to-one name="lob"
+ column="LOB_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.lob.Lob"
+ foreign-key="none"/>
+ </subclass>
+
+ <!-- ### LOB ############################################################ -->
+ <class name="org.jbpm.pvm.internal.lob.Lob" table="JBPM_LOB">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+ <property name="blob" type="blob"><column name="BLOB_VALUE_" /></property>
+ <property name="bytes" type="binary" column="BINARY_VALUE_"/>
+ <property name="clob" type="clob" column="CLOB_VALUE_" />
+ <property name="text" type="text" column="TEXT_VALUE_"/>
+ </class>
+
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="dueDate" column="DUEDATE_" type="timestamp" index="IDX_JOBDUEDATE" />
+ <property name="isSuspended" column="ISSUSPENDED_" />
+ <property name="isExclusive" column="ISEXCLUSIVE_" />
+ <property name="lockOwner" column="LOCKOWNER_" />
+ <property name="lockExpirationTime" column="LOCKEXPTIME_" index="IDX_JOBLOCKEXP" />
+ <property name="info" column="INFO_" />
+ <property name="exception" column="EXCEPTION_" type="text" />
+ <property name="retries" column="RETRIES_" index="IDX_JOBRETRIES" />
+
+ <many-to-one name="processInstance"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="PROCESSINSTANCE_"
+ cascade="none"
+ foreign-key="FK_JOB_PRINST"
+ index="IDX_JOB_PRINST"/>
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ cascade="none"
+ foreign-key="FK_JOB_EXE"
+ index="IDX_JOB_EXE"/>
+ <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"/>
+
+ <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"
+ column="NODE_"
+ cascade="none"
+ 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" />
+ <subclass name="org.jbpm.pvm.internal.job.CommandMessage" discriminator-value="CmdMsg" />
+ </subclass>
+
+ <subclass name="org.jbpm.pvm.internal.job.TimerImpl" discriminator-value="Timer">
+ <property name="signalName" column="SIGNAL_" />
+ <property name="eventName" column="EVENT_" />
+ <property name="repeat" column="REPEAT_" />
+ </subclass>
+
+ </class>
+
+ <!-- ### HibernatePvmDbSession QUERIES ################################## -->
+
+ <query name="findTimers">
+ <![CDATA[
+ select t
+ from org.jbpm.pvm.internal.job.TimerImpl as t
+ order by dueDate asc
+ ]]>
+ </query>
+
+ <query name="findMessages">
+ <![CDATA[
+ select m
+ from org.jbpm.pvm.internal.job.MessageImpl as m
+ ]]>
+ </query>
+
+ <query name="findJobsWithException">
+ <![CDATA[
+ select job
+ from org.jbpm.pvm.internal.job.JobImpl as job
+ where job.retries = 0
+ order by dueDate asc
+ ]]>
+ </query>
+
+ <!-- ### HibernateJobDbSession QUERIES ################################## -->
+ <query name="findFirstAcquirableJob">
+ <![CDATA[
+ select job
+ from org.jbpm.pvm.internal.job.JobImpl as job
+ where ( ( (job.lockExpirationTime is null)
+ or (job.lockExpirationTime <= :now)
+ )
+ and
+ ( (job.dueDate is null)
+ or (job.dueDate <= :now)
+ )
+ and
+ ( job.retries > 0 )
+ )
+ order by job.dueDate asc
+ ]]>
+ </query>
+
+ <query name="findExclusiveJobs">
+ <![CDATA[
+ select job
+ from org.jbpm.pvm.internal.job.JobImpl as job
+ where job.lockOwner is null
+ and job.processInstance = :processInstance
+ and job.isExclusive = true
+ and job.retries > 0
+ and ( (job.dueDate is null)
+ or (job.dueDate <= :now)
+ )
+ order by job.dueDate asc
+ ]]>
+ </query>
+
+ <query name="findFirstDueJob">
+ <![CDATA[
+ select job
+ from org.jbpm.pvm.internal.job.JobImpl as job
+ where job.lockOwner is null
+ and job.retries > 0
+ order by job.dueDate asc
+ ]]>
+ </query>
+
+ <!-- ### HibernatePvmDbSession QUERIES ############################################# -->
+ <query name="findExecutionById">
+ <![CDATA[
+ select execution
+ from org.jbpm.pvm.internal.model.ExecutionImpl as execution
+ where execution.id = :id
+ ]]>
+ </query>
+
+ <query name="findProcessInstanceById">
+ <![CDATA[
+ select processInstance
+ from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
+ where processInstance.id = :processInstanceId
+ and processInstance.parent is null
+ ]]>
+ </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
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.execution.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.hibernate.cfg.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <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.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.jpdl.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+ <mapping resource="jbpm.repository.hbm.xml" />
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.history.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.history.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,75 @@
+<?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 package="org.jbpm.pvm.internal.history.model" default-access="field">
+
+ <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
+ <class name="HistoryProcessInstanceImpl" table="JBPM_HIST_PROCINST">
+ <id name="processInstanceId" column="ID_">
+ <generator class="assigned" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="processDefinitionId" column="PROCDEFID_" />
+ <property name="key" column="KEY_" />
+ <property name="startTime" column="START_" type="timestamp" />
+ <property name="endTime" column="END_" type="timestamp" />
+ <property name="duration" column="DURATION_" />
+ <property name="state" column="STATE_" />
+ <property name="endActivityName" column="ENDACTIVITY_" />
+
+ <many-to-one name="processDefinition"
+ class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
+ column="PROCDEF_"
+ foreign-key="FK_HISTPI_PROCDEF"
+ index="IDX_HISTPI_PROCDEF" />
+
+ <set name="historyActivityInstances"
+ cascade="all">
+ <key>
+ <column name="HPI_" />
+ </key>
+ <one-to-many class="HistoryActivityInstanceImpl" />
+ </set>
+
+ </class>
+
+ <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
+ <class name="HistoryActivityInstanceImpl" table="JBPM_HIST_ACTINST" discriminator-value="ACT">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+
+ <many-to-one name="historyProcessInstance"
+ class="HistoryProcessInstanceImpl"
+ column="HPI_"
+ foreign-key="FK_HAI_HPI"
+ index="IDX_HAI_HPI" />
+
+ <many-to-one name="activity"
+ class="org.jbpm.pvm.internal.model.ActivityImpl"
+ column="ACTIVITY_"
+ foreign-key="FK_HISTAI_ACT"
+ index="IDX_HISTAI_ACT" />
+
+ <property name="type" column="TYPE_" />
+ <property name="executionId" column="EXECUTION_" />
+ <property name="activityName" column="ACTIVITY_NAME_" />
+ <property name="startTime" column="START_" type="timestamp" />
+ <property name="endTime" column="END_" type="timestamp" />
+ <property name="duration" column="DURATION_" />
+ <property name="transitionName" column="TRANSITION_" />
+
+ <subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
+ <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ </subclass>
+
+ <subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
+ <property name="assignee" column="ASSIGNEE_" />
+ <property name="state" column="STATE_" />
+ </subclass>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.history.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.identity.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,59 @@
+<?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 package="org.jbpm.pvm.internal.identity.impl" default-access="field">
+
+ <!-- ### USER ########################################################### -->
+ <class name="UserImpl" table="JBPM_ID_USER">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
+ <property name="givenName" column="GIVENNAME_" />
+ <property name="familyName" column="FAMILYNAME_" />
+ </class>
+
+ <!-- ### MEMBERSHIP ##################################################### -->
+ <class name="MembershipImpl" table="JBPM_ID_MEMBERSHIP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <many-to-one name="user"
+ column="USER_"
+ class="UserImpl"
+ foreign-key="FK_MEM_USER"
+ index="IDX_MEM_USER"/>
+
+ <many-to-one name="group"
+ column="GROUP_"
+ class="GroupImpl"
+ foreign-key="FK_MEM_GROUP"
+ index="IDX_MEM_GROUP"/>
+
+ <property name="role" column="NAME_" />
+ </class>
+
+ <!-- ### GROUP ########################################################### -->
+ <class name="GroupImpl" table="JBPM_ID_GROUP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="id" column="ID_" />
+ <property name="name" column="NAME_" />
+ <property name="type" column="TYPE_" />
+
+ <many-to-one name="parent"
+ column="PARENT_"
+ class="GroupImpl"
+ foreign-key="FK_GROUP_PARENT"
+ index="IDX_GROUP_PARENT"/>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.identity.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.activities.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.activities.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,17 @@
+<activities>
+ <schema resource="jpdl.xsd" />
+ <activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.ForkBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.JoinBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.TaskBinding" />
+</activities>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.activities.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,122 @@
+<?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">
+
+ <subclass name="org.jbpm.jpdl.internal.model.JpdlProcessDefinition"
+ extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
+ discriminator-value="jpdl">
+ <map name="swimlaneDefinitions"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_SWLDEF_PROCESS">
+ <column name="PROCESS_SWL_" index="IDX_SWLDEF_PROCESS"/>
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl" />
+ </map>
+ <map name="taskDefinitions"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_TSKDEF_PROCESS">
+ <column name="PROCESS_" index="IDX_TSKDEF_PROCESS"/>
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.task.TaskDefinitionImpl" />
+ </map>
+ </subclass>
+
+ <subclass name="org.jbpm.jpdl.internal.model.JpdlExecution"
+ extends="org.jbpm.pvm.internal.model.ExecutionImpl"
+ discriminator-value="jpdl">
+
+ <map name="swimlanes"
+ cascade="all-delete-orphan">
+ <key foreign-key="FK_SWIMLANE_EXEC">
+ <column name="EXECUTION_" index="IDX_SWIMLANE_EXEC"/>
+ </key>
+ <map-key type="string" column="NAME_" />
+ <one-to-many class="org.jbpm.pvm.internal.task.SwimlaneImpl" />
+ </map>
+ </subclass>
+
+ <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>
+ <discriminator column="CLASS_" />
+ <subclass name="org.jbpm.jpdl.internal.activity.StartActivity" discriminator-value="start" />
+ <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr">
+ <property name="expr" column="TEXT_" />
+ <property name="lang" column="TEXT2_" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler">
+ <property name="exclusiveHandlerName" column="TEXT_" />
+ <many-to-one name="exclusiveHandlerDescriptor"
+ column="EXCLDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_ACT_EXCLDESCR"
+ index="IDX_ACT_EXCLDESCR" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.StateActivity" discriminator-value="state" />
+ <subclass name="org.jbpm.jpdl.internal.activity.EndActivity" discriminator-value="end">
+ <property name="endProcessInstance" column="ENDPI_" />
+ <property name="state" column="TEXT_" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.ForkActivity" discriminator-value="fork" />
+ <subclass name="org.jbpm.jpdl.internal.activity.JoinActivity" discriminator-value="join" />
+ <subclass name="org.jbpm.jpdl.internal.activity.HqlActivity" discriminator-value="hql">
+ <property name="query" column="TEXT_" />
+ <property name="resultVariableName" column="TEXT2_" />
+ <property name="isResultUnique" column="ISUNIQ_" />
+ <many-to-one name="parametersDescriptor"
+ column="PARAMDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor"
+ foreign-key="FK_ACT_PARAMDESCR"
+ index="IDX_ACT_PARAMDESCR" />
+
+ <subclass name="org.jbpm.jpdl.internal.activity.SqlActivity" discriminator-value="sql" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.JavaActivity" discriminator-value="java">
+ <property name="methodName" column="TEXT_" />
+ <property name="variableName" column="TEXT2_" />
+ <many-to-one name="descriptor"
+ column="JAVADESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_ACT_JAVADESCR"
+ index="IDX_ACT_JAVADESCR" />
+ <many-to-one name="invokeOperation"
+ column="INVOPER_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
+ foreign-key="FK_ACT_INVKOPER"
+ index="IDX_ACT_INVKOPER" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.ScriptActivity" discriminator-value="script">
+ <property name="script" column="TEXT_" />
+ <property name="language" column="TEXT2_" />
+ <property name="variableName" column="TEXT3_" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.EsbActivity" discriminator-value="esb">
+ <property name="service" column="TEXT_" />
+ <property name="category" column="TEXT2_" />
+ <many-to-one name="partsListDescriptor"
+ column="PARTSDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor"
+ foreign-key="FK_ACT_PARTSDESCR"
+ index="IDX_ACT_PARTSDESCR" />
+ </subclass>
+ <subclass name="org.jbpm.jpdl.internal.activity.TaskActivity" discriminator-value="task">
+ <many-to-one name="taskDefinition"
+ column="TASKDEF_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.task.TaskDefinitionImpl"
+ foreign-key="FK_ACT_TASKDEF"
+ index="IDX_ACT_TASKDEF" />
+ </subclass>
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.jpdl.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.repository.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.repository.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.repository.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,48 @@
+<?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.DeploymentImpl"
+ table="JBPM_DEPLOYMENT">
+
+ <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <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.DeploymentProperty" />
+ </set>
+
+ </class>
+
+ <class name="org.jbpm.pvm.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <many-to-one name="deployment"
+ class="org.jbpm.pvm.DeploymentImpl"
+ column="DEPLOYMENT_"
+ foreign-key="FK_DEPLPROP_DEPL"
+ index="IDX_DEPLPROP_DEPL" />
+ <property name="objectName" column="OBJNAME_" />
+ <property name="key" column="KEY_" />
+ <property name="value" column="VALUE_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.repository.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,199 @@
+<?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 auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
+
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="name" column="NAME_"/>
+ <property name="description" column="DESCR_"/>
+ <property name="assigneeExpression" column="ASS_EXPR_"/>
+ <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
+ <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
+ <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
+ <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
+ <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
+
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSHNDLR_DESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
+
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
+ <!-- ### TASK DEFINITION ################################################ -->
+ <subclass name="TaskDefinitionImpl" discriminator-value="T">
+
+ <property name="priority" column="PRIORITY_"/>
+ <property name="dueDateDuration" column="DUEDATE_"/>
+
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
+ <many-to-one name="swimlaneDefinition"
+ column="SWIMLDEF_"
+ cascade="all"
+ class="SwimlaneDefinitionImpl"
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
+
+ <list name="subTaskDefinitions" cascade="all-delete-orphan">
+ <key column="TASKDEF_" />
+ <list-index column="TASKDEF_IDX_" />
+ <one-to-many class="TaskDefinitionImpl" />
+ </list>
+ </subclass>
+ </class>
+
+ <!-- ### TASK ########################################################### -->
+ <class name="TaskImpl"
+ table="JBPM_TASK"
+ discriminator-value="T">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator type="char" column="CLASS_"/>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="id" column="ID_" unique="true" />
+ <property name="name" column="NAME_"/>
+ <property name="description" column="DESCR_"/>
+ <property name="assignee" column="ASSIGNEE_"/>
+
+ <set name="participants" cascade="all-delete-orphan">
+ <key column="TASK_" />
+ <one-to-many class="ParticipantImpl" />
+ </set>
+
+ <property name="priority" column="PRIORITY_"/>
+ <property name="create" column="CREATE_"/>
+ <property name="dueDate" column="DUEDATE_"/>
+ <property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
+
+ <!--
+ <many-to-one name="variableMap"
+ class="org.jbpm.pvm.impl.VariableMap"
+ column="VARMAP_"
+ foreign-key="FK_TASK_VARMAP"
+ cascade="all" />
+ -->
+
+ <many-to-one name="superTask"
+ class="TaskImpl"
+ column="SUPERTASK_"
+ foreign-key="FK_TASK_SUPERTASK"
+ index="IDX_TASK_SUPERTASK" />
+
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="none" />
+
+ <many-to-one name="processInstance"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="PROCINST_"
+ foreign-key="none" />
+
+ <many-to-one name="swimlane"
+ class="SwimlaneImpl"
+ 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" />
+
+ <list name="comments" cascade="all-delete-orphan">
+ <key column="TASK_" />
+ <list-index column="TASK_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.model.CommentImpl" />
+ </list>
+
+ <set name="subTasks" cascade="all-delete-orphan">
+ <key column="SUPERTASK_" />
+ <one-to-many class="TaskImpl" />
+ </set>
+
+ </class>
+
+ <!-- ### PARTICIPANT #################################################### -->
+ <class name="ParticipantImpl" table="JBPM_PARTICIPANT">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="groupId" column="GROUPID_"/>
+ <property name="userId" column="USERID_"/>
+ <property name="participation" column="PARTICIPATION_" />
+
+ <many-to-one name="task"
+ class="TaskImpl"
+ column="TASK_"
+ index="IDX_PART_TASK"
+ foreign-key="FK_PART_TASK" />
+
+ <many-to-one name="swimlane"
+ class="SwimlaneImpl"
+ column="SWIMLANE_"
+ foreign-key="FK_PART_SWIMLANE" />
+
+ </class>
+
+ <!-- ### SWIMLANE ####################################################### -->
+ <class name="SwimlaneImpl" table="JBPM_SWIMLANE">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="name" column="NAME_"/>
+ <property name="assignee" column="ASSIGNEE_"/>
+
+ <many-to-one name="swimlaneDefinition"
+ class="SwimlaneDefinitionImpl"
+ column="SWIMLANEDEF_"
+ foreign-key="FK_SWIMLANE_DEF" />
+
+ <many-to-one name="execution"
+ class="org.jbpm.pvm.internal.model.ExecutionImpl"
+ column="EXECUTION_"
+ foreign-key="none" />
+
+ <set name="participants" cascade="all-delete-orphan">
+ <key column="SWIMLANE_" />
+ <one-to-many class="ParticipantImpl" />
+ </set>
+
+ </class>
+
+
+ <!-- ### QUERIES ######################################################## -->
+
+ <query name="findTasks">
+ <![CDATA[
+ select task
+ from org.jbpm.pvm.internal.task.TaskImpl as task
+ ]]>
+ </query>
+
+</hibernate-mapping>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.lifecycle.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.lifecycle.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.lifecycle.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,13 @@
+<task-lifecycle initial="open">
+ <state name="open">
+ <transition name="complete" to="completed" />
+ <transition name="suspend" to="suspended" />
+ <transition name="cancel" to="cancelled" />
+ </state>
+ <state name="suspended">
+ <transition name="resume" to="open" />
+ <transition name="cancel" to="cancelled" />
+ </state>
+ <state name="cancelled" />
+ <state name="completed" />
+</task-lifecycle>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.task.lifecycle.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.variable.types.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.variable.types.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.variable.types.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,34 @@
+<types>
+
+ <!-- types stored in a native column -->
+ <type name="string" class="java.lang.String" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="long" class="java.lang.Long" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="double" class="java.lang.Double" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- types converted to a string -->
+ <type name="date" class="java.util.Date" converter="org.jbpm.pvm.internal.type.converter.DateToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="boolean" class="java.lang.Boolean" converter="org.jbpm.pvm.internal.type.converter.BooleanToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="char" class="java.lang.Character" converter="org.jbpm.pvm.internal.type.converter.CharacterToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+
+ <!-- types converted to a long -->
+ <type name="byte" class="java.lang.Byte" converter="org.jbpm.pvm.internal.type.converter.ByteToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="short" class="java.lang.Short" converter="org.jbpm.pvm.internal.type.converter.ShortToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="integer" class="java.lang.Integer" converter="org.jbpm.pvm.internal.type.converter.IntegerToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+
+ <!-- types converted to a double -->
+ <type name="float" class="java.lang.Float" converter="org.jbpm.pvm.internal.type.converter.FloatToDoubleConverter" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- byte[] and char[] -->
+ <type name="byte[]" class="[B" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+ <type name="char[]" class="[C" variable-class="org.jbpm.pvm.internal.type.variable.ClobVariable" />
+
+ <type name="hibernate-long-id" class="hibernate" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
+ <type name="hibernate-string-id" class="hibernate" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />
+
+ <type name="serializable" class="serializable" converter="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+
+ <!-- TODO: add ejb3 entity bean support -->
+ <!-- TODO: add JCR activity support -->
+ <!-- TODO: add collection support -->
+
+</types>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.variable.types.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/jbpm.wire.bindings.xml (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/jbpm.wire.bindings.xml 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,93 @@
+<wire-bindings>
+
+ <!-- ########################### -->
+ <!-- ### Descriptor bindings ### -->
+ <!-- ########################### -->
+ <!-- basic types -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.TrueBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.FalseBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.CharBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.DoubleBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.FloatBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.IntBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ShortBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ByteBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.LongBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.StringBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.NullBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ClassBinding" />
+ <!-- object and ref -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.ObjectBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RefBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JndiBinding" />
+ <!-- collections -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.ListBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.SetBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.MapBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.PropertiesBinding" />
+ <!-- environment refs -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.EnvironmentFactoryRefBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.EnvRefBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.EnvBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ContextRefBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.TransactionRefBinding" />
+ <!-- various specials -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.TransactionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JobExecutorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JobTestHelperBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ScriptManagerBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.BusinessCalendarBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.IdGeneratorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.AuthenticationBinding" />
+ <!-- hibernate bindings -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.HibernateConfigurationBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.SeamHibernateSessionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.HibernateSessionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.HibernateSessionFactoryBinding" />
+ <!-- sessions -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.MessageSessionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.TimerSessionBinding" />
+ <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" />
+ <!-- db sessions -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.PvmDbSessionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JobDbSessionBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.TaskDbSessionBinding" />
+
+ <!-- dynamic type mapping configuration -->
+ <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" />
+
+ <!-- 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" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.AuthorizationInterceptorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.RetryInterceptorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.StandardTransactionInterceptorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.SerializeInterceptorBinding" />
+
+ <!-- operation -->
+ <binding class="org.jbpm.pvm.internal.wire.binding.PropertyBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.FieldBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.InvokeBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.SubscribeBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.EnlistBinding" />
+
+ <!-- jpdl bindings -->
+ <binding class="org.jbpm.jpdl.internal.xml.ParseJpdlBinding" />
+
+</wire-bindings>
Property changes on: jbpm4/trunk/modules/deployment/src/test/resources/jbpm.wire.bindings.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/deployment/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/deployment/src/test/resources/logging.properties (rev 0)
+++ jbpm4/trunk/modules/deployment/src/test/resources/logging.properties 2009-03-25 18:08:31 UTC (rev 4328)
@@ -0,0 +1,18 @@
+handlers= java.util.logging.ConsoleHandler
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
+
+org.jbpm.level=FINE
+# org.jbpm.pvm.internal.tx.level=FINE
+# org.jbpm.pvm.internal.wire.level=FINE
+# org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=INFO
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+org.hibernate.cfg.HbmBinder.level=SEVERE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -36,7 +36,7 @@
private static final long serialVersionUID = 1L;
- Map<String, Object> variables;
+ protected Map<String, Object> variables;
public void addVariable(String key, Object variable) {
if (variables==null) {
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-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -66,6 +66,9 @@
/** time this process was deployed */
protected Date deploymentTime;
+ /** ref to the deployment */
+ protected long deploymentDbid;
+
/** the activity which is executed when the process starts */
protected ActivityImpl initial;
@@ -203,4 +206,10 @@
public void setId(String id) {
this.id = id;
}
+ public long getDeploymentDbid() {
+ return deploymentDbid;
+ }
+ public void setDeploymentDbid(long deploymentDbid) {
+ this.deploymentDbid = deploymentDbid;
+ }
}
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-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -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.repository;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeployCmd implements Command<Long> {
-
- private static final long serialVersionUID = 1L;
-
- DeploymentImpl deployment;
-
- public DeployCmd(DeploymentImpl deployment) {
- this.deployment = deployment;
- }
-
- public Long execute(Environment environment) throws Exception {
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- return repositorySession.deploy(deployment);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.repository;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface Deployer {
-
- boolean matches(String fileName);
- Object deployFile(String fileName, byte[] bytes);
-
-}
Deleted: 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-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,44 +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.List;
-
-import org.jbpm.pvm.internal.xml.ProblemList;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeployerManager {
-
- List<Deployer> deployers;
-
- public Object deployFile(String fileName, byte[] bytes, ProblemList problemList) {
- for (Deployer deployer: deployers) {
- if (deployer.matches(fileName)) {
- return deployer.deployFile(fileName, bytes);
- }
- }
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -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;
-
-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/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,135 +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.io.ObjectStreamException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.jbpm.JbpmException;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.lob.Lob;
-import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
-import org.jbpm.pvm.internal.stream.StreamInput;
-import org.jbpm.pvm.internal.util.IoUtil;
-import org.jbpm.pvm.internal.xml.ProblemList;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeploymentImpl extends ProblemList implements Deployment {
-
- protected long dbid;
- protected String name;
- protected long timestamp;
-
- protected Map<String, Lob> storedFiles;
-
- protected Map<String, StreamInput> inputFiles;
- protected CommandService commandService;
-
- public DeploymentImpl(CommandService commandService) {
- this.commandService = commandService;
- }
-
- 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 addStreamInput(String name, StreamInput streamInput) {
- if (this.name==null) {
- this.name = name;
- }
- if (inputFiles==null) {
- inputFiles = new HashMap<String, StreamInput>();
- }
- inputFiles.put(name, streamInput);
- return this;
- }
-
- public Deployment addZipInputStream(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));
- }
- zipEntry = zipInputStream.getNextEntry();
- }
- } catch (Exception e) {
- throw new JbpmException("couldn't read zip archive", e);
- }
- return this;
- }
-
- protected Object writeReplace() throws ObjectStreamException {
- if (inputFiles!=null) {
- Map<String, StreamInput> replacedFiles = new HashMap<String, StreamInput>();
- for (Map.Entry<String, StreamInput> entry: inputFiles.entrySet()) {
- if (! (entry.getValue() instanceof ByteArrayStreamInput)) {
- byte[] bytes = IoUtil.readBytes(entry.getValue().openStream());
- replacedFiles.put(entry.getKey(), new ByteArrayStreamInput(bytes));
- }
- }
- inputFiles = replacedFiles;
- }
-
- commandService = null;
-
- return this;
- }
-
- public long getDbid() {
- return dbid;
- }
- public String getName() {
- return name;
- }
- public long getTimestamp() {
- return timestamp;
- }
-
- public Map<String, Lob> getStoredFiles() {
- return storedFiles;
- }
- public void setStoredFiles(Map<String, Lob> storedFiles) {
- this.storedFiles = storedFiles;
- }
- public Map<String, StreamInput> getInputFiles() {
- return inputFiles;
- }
- public void setInputFiles(Map<String, StreamInput> inputFiles) {
- this.inputFiles = inputFiles;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.repository;
-
-import java.util.Map;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface RepositoryCache {
-
- void store(Map<String, Object> deployedObjects);
-
-}
Deleted: 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-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -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.repository;
-
-import java.io.InputStream;
-
-import org.jbpm.cmd.CommandService;
-
-/**
- * @author Tom Baeyens
- */
-public class RepositoryServiceImpl {
-
- CommandService commandService;
-
- public Deployment createDeployment() {
- return new DeploymentImpl(commandService);
- }
-
- public void deleteDeployment(String deploymentId) {
- }
-
- public InputStream getResource(String deploymentId, String resource) {
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java 2009-03-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.repository;
-
-import java.io.InputStream;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface RepositorySession {
-
- InputStream getResource(String deploymentId, String name);
-
- Object getDeployedObject(String deploymentId, String name);
-
- long deploy(DeploymentImpl deployment);
-}
Deleted: 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-25 12:56:01 UTC (rev 4327)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-03-25 18:08:31 UTC (rev 4328)
@@ -1,98 +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.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.hibernate.Session;
-import org.jbpm.JbpmException;
-import org.jbpm.Problem;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.lob.Lob;
-import org.jbpm.pvm.internal.stream.StreamInput;
-import org.jbpm.pvm.internal.util.IoUtil;
-
-
-/**
- * @author Tom Baeyens
- */
-public class RepositorySessionImpl implements RepositorySession {
-
- private static Log log = Log.getLog(RepositorySessionImpl.class.getName());
-
- Session session;
- RepositoryCache repositoryCache;
- DeployerManager deployerManager;
-
- public long deploy(DeploymentImpl deployment) {
- Map<String, Object> deployedObjects = new HashMap<String, Object>();
-
- Map<String, StreamInput> inputFiles = deployment.getInputFiles();
- if (inputFiles==null) {
- deployment.addProblem("deployment is empty");
-
- } else {
-
- Map<String, Lob> storedFiles = new HashMap<String, Lob>();
- for (String fileName: inputFiles.keySet()) {
- StreamInput streamInput = inputFiles.get(fileName);
- byte[] bytes = IoUtil.readBytes(streamInput.openStream());
-
- Object deployedObject = deployerManager.deployFile(fileName, bytes, deployment);
- if (deployedObject!=null) {
- deployedObjects.put(fileName, deployedObject);
- }
-
- Lob lob = new Lob(bytes);
- storedFiles.put(fileName, lob);
- }
- deployment.setStoredFiles(storedFiles);
- }
-
-
- 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());
- } else {
-
- repositoryCache.store(deployedObjects);
- session.save(deployment);
- }
-
- return 0;
- }
-
- public Object getDeployedObject(String deploymentId, String name) {
- return null;
- }
-
- public InputStream getResource(String deploymentId, String name) {
- return null;
- }
-}
17 years, 1 month
JBoss JBPM SVN: r4327 - in jbpm4/trunk: .settings and 47 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-25 08:56:01 -0400 (Wed, 25 Mar 2009)
New Revision: 4327
Added:
jbpm4/trunk/.settings/
jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/api/.settings/
jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs
jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/devguide/.settings/
jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/enterprise/.settings/
jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/examples/.settings/
jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/integration/console/.settings/
jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/integration/jboss4/.settings/
jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/integration/jboss5/.settings/
jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/integration/spi/.settings/
jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/jpdl/.settings/
jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/log/.settings/
jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/pvm/.settings/
jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/
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/Deployer.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/Deployment.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/RepositoryCache.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/RepositorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/test-base/.settings/
jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
jbpm4/trunk/modules/test-load/.settings/
jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs
jbpm4/trunk/modules/test-pojo/.settings/
jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
Modified:
jbpm4/trunk/modules/api/.classpath
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
Log:
task fixes, attempt to control mavens build mania in eclipse, start of alternative deployment
Added: jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:34 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/api/.classpath
===================================================================
--- jbpm4/trunk/modules/api/.classpath 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/.classpath 2009-03-25 12:56:01 UTC (rev 4327)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ jbpm4/trunk/modules/api/.settings/org.eclipse.jdt.core.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,5 @@
+#Wed Mar 25 11:04:52 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/api/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:03:42 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,11 +47,11 @@
Task newTask();
/** Creates a new subtask for the given task.
- * Make sure that the parent task is saved before the
+ * Make sure that the super task is saved before the
* {@link Task#getDbid() dbid} is taken.
* The returned task will be transient.
* Use {@link #saveTask(Task)} to persist the task. */
- Task newTask(long parentTaskDbid);
+ Task newTask(long superTaskDbid);
/** Saves the given task to persistent storage.
* @return the taskDbid */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/TaskDbSession.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -37,4 +37,6 @@
void saveTask(Task task);
void deletingExecution(Execution execution);
+
+ Task findTaskByExecution(Execution execution);
}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -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.task;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DefaultTaskHandler implements TaskHandler {
-
- public boolean executionCreateTask(OpenTask task) {
- assign(task);
- task.historyTaskStart();
- return true;
- }
-
- protected void assign(OpenTask task) {
- }
-
- public void executionSignal(OpenTask task) {
- task.setSignalling(false);
- }
-
- public void taskCancel(OpenTask task, String reason) {
- task.historyTaskCancel(reason);
- }
-
- public void taskComplete(OpenTask task, String outcome) {
- task.historyTaskComplete(outcome);
-
- if (task.isSignalling()) {
- task.getExecution().signal(outcome);
- }
- }
-
- public void taskSubTaskComplete(OpenTask task, OpenTask subTask) {
- }
-}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -45,4 +45,6 @@
boolean isSignalling();
void setSignalling(boolean isSignalling);
+
+ void cancel(String reason);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -22,15 +22,53 @@
package org.jbpm.task;
-
-/**
+/** for advanced task customization.
+ *
+ * The default implementation can be found in {@link DefaultTaskHandler}.
+ *
* @author Tom Baeyens
*/
-public interface TaskHandler {
+public class TaskHandler {
- boolean executionCreateTask(OpenTask task);
- void executionSignal(OpenTask task);
- void taskComplete(OpenTask task, String outcome);
- void taskCancel(OpenTask task, String reason);
- void taskSubTaskComplete(OpenTask task, OpenTask subTask);
+ /** is called after the task is created according
+ * to the task definition. This method allows to
+ * create subtasks.
+ * @return indicates if the process execution should wait. */
+ public boolean executionCreateTask(OpenTask task) {
+ task.historyTaskStart();
+ return true;
+ }
+
+ /** is called when the related execution gets a
+ * signal. this method must either
+ * {@link OpenTask#setSignalling(boolean) remove signalling} from this task
+ * or {@link OpenTask#cancel(String) cancel} it. */
+ public void executionSignal(OpenTask task) {
+ task.setSignalling(false);
+ }
+
+ /** is called when this task is cancelled. */
+ public void taskCancel(OpenTask task, String reason) {
+ task.historyTaskCancel(reason);
+ }
+
+ /** is called when this task completes. The default behaviour
+ * will send a signal to the execution if this task is still signalling. */
+ public void taskComplete(OpenTask task, String outcome) {
+ task.historyTaskComplete(outcome);
+
+ if (task.isSignalling()) {
+ task.getExecution().signal(outcome);
+ }
+ }
+
+ /** is called when a subtask completes. this can be used to
+ * prematurely signal the execution. e.g. for "5 out of 7" scenarios.*/
+ public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+ }
+
+ /** is called when a variable is updated. This can be used to
+ * propagate the execution based on availability of variables. */
+ public void taskVariableUpdate(OpenTask task, String key, Object value) {
+ }
}
Added: jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/devguide/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:24 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignmentHandlerDescriptor"
- column="ASSIGN_DESCR_"
+ column="ASSHNDLR_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASS_ASIGN_DESCR"
- index="IDX_ASS_ASIGN_DESCR" />
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
@@ -38,15 +38,20 @@
<property name="priority" column="PRIORITY_"/>
<property name="dueDateDuration" column="DUEDATE_"/>
- <property name="isBlocking" column="BLOCK_"/>
- <property name="isSignalling" column="SIGNAL_"/>
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
<many-to-one name="swimlaneDefinition"
- column="SWIMLANE_DEF_"
+ column="SWIMLDEF_"
cascade="all"
class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIML_DEF"
- index="IDX_TSK_SWIML_DEF" />
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
<list name="subTaskDefinitions" cascade="all-delete-orphan">
<key column="TASKDEF_" />
@@ -111,6 +116,12 @@
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" />
+
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
<list-index column="TASK_IDX_" />
Added: jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/enterprise/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:46 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/examples/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:06:53 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignmentHandlerDescriptor"
- column="ASSIGN_DESCR_"
+ column="ASSHNDLR_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASS_ASIGN_DESCR"
- index="IDX_ASS_ASIGN_DESCR" />
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
@@ -38,15 +38,20 @@
<property name="priority" column="PRIORITY_"/>
<property name="dueDateDuration" column="DUEDATE_"/>
- <property name="isBlocking" column="BLOCK_"/>
- <property name="isSignalling" column="SIGNAL_"/>
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
<many-to-one name="swimlaneDefinition"
- column="SWIMLANE_DEF_"
+ column="SWIMLDEF_"
cascade="all"
class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIML_DEF"
- index="IDX_TSK_SWIML_DEF" />
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
<list name="subTaskDefinitions" cascade="all-delete-orphan">
<key column="TASKDEF_" />
@@ -111,6 +116,12 @@
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" />
+
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
<list-index column="TASK_IDX_" />
Added: jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/integration/console/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:00 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/integration/jboss4/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:08 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/integration/jboss5/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:14 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/integration/spi/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:24 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/jpdl/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:42 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,8 +47,8 @@
public void execute(ActivityExecution execution) {
JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class);
TaskImpl task = jpdlExecution.createTask(taskDefinition);
+
TaskHandler taskHandler = task.getTaskHandler();
-
boolean wait = taskHandler.executionCreateTask(task);
TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
@@ -67,6 +67,11 @@
}
execution.fire(signalName, activity);
+
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
+ TaskHandler taskHandler = task.getTaskHandler();
+ taskHandler.executionSignal(task);
Transition transition = activity.findOutgoingTransition(signalName);
if (transition!=null) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -67,6 +67,12 @@
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);
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -70,8 +70,10 @@
public TaskImpl createTask(TaskDefinitionImpl taskDefinition) {
TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
TaskImpl task = (TaskImpl) taskDbSession.createTask();
+ task.setTaskDefinition(taskDefinition);
task.setExecution(this);
task.setProcessInstance(processInstance);
+ task.setSignalling(true);
// initialize the name
if (taskDefinition.getName()!=null) {
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignmentHandlerDescriptor"
- column="ASSIGN_DESCR_"
+ column="ASSHNDLR_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASS_ASIGN_DESCR"
- index="IDX_ASS_ASIGN_DESCR" />
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
@@ -38,15 +38,20 @@
<property name="priority" column="PRIORITY_"/>
<property name="dueDateDuration" column="DUEDATE_"/>
- <property name="isBlocking" column="BLOCK_"/>
- <property name="isSignalling" column="SIGNAL_"/>
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
<many-to-one name="swimlaneDefinition"
- column="SWIMLANE_DEF_"
+ column="SWIMLDEF_"
cascade="all"
class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIML_DEF"
- index="IDX_TSK_SWIML_DEF" />
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
<list name="subTaskDefinitions" cascade="all-delete-orphan">
<key column="TASKDEF_" />
@@ -111,6 +116,12 @@
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" />
+
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
<list-index column="TASK_IDX_" />
Added: jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/log/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:07:50 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/pvm/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:11:53 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -42,7 +42,7 @@
public Task execute(Environment environment) throws Exception {
TaskDbSession taskDbSession = environment.get(TaskDbSession.class);
TaskImpl task = (TaskImpl) taskDbSession.createTask();
- task.setParentTaskDbid(parentTaskDbid);
+ task.setSuperTaskDbid(parentTaskDbid);
return task;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -47,10 +47,10 @@
public void saveTask(Task task) {
TaskImpl taskImpl = (TaskImpl) task;
- if (taskImpl.getParentTaskDbid()!=null) {
- TaskImpl parentTask = (TaskImpl) session.load(TaskImpl.class, taskImpl.getParentTaskDbid());
+ if (taskImpl.getSuperTaskDbid()!=null) {
+ TaskImpl parentTask = (TaskImpl) session.load(TaskImpl.class, taskImpl.getSuperTaskDbid());
parentTask.addSubTask(taskImpl);
- taskImpl.setParentTaskDbid(null);
+ taskImpl.setSuperTaskDbid(null);
}
if (! taskImpl.isPersisted()) {
@@ -108,4 +108,14 @@
session.delete(task);
}
}
+
+ public Task findTaskByExecution(Execution execution) {
+ Query query = session.createQuery(
+ "select task " +
+ "from "+TaskImpl.class.getName()+" as task " +
+ "where task.execution = :execution"
+ );
+ query.setEntity("execution", execution);
+ return (Task) query.uniqueResult();
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -27,14 +27,12 @@
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
-import java.util.StringTokenizer;
import org.jbpm.Execution;
import org.jbpm.JbpmException;
@@ -62,9 +60,6 @@
import org.jbpm.pvm.internal.history.events.ExclusiveEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
-import org.jbpm.pvm.internal.history.events.TaskComplete;
-import org.jbpm.pvm.internal.history.events.TaskCancel;
-import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.ExecuteActivity;
@@ -73,18 +68,9 @@
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.script.ScriptManager;
-import org.jbpm.pvm.internal.task.ParticipantImpl;
-import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
-import org.jbpm.pvm.internal.task.SwimlaneImpl;
-import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
-import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.session.MessageSession;
-import org.jbpm.session.TaskDbSession;
-import org.jbpm.task.Assignable;
-import org.jbpm.task.Task;
/**
* @author Tom Baeyens
@@ -105,6 +91,8 @@
public static final AtomicOperation TAKE_TRANSITION = new TakeTransition();
public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
+ // persistent member fields /////////////////////////////////////////////////
+
/** an optional name for this execution. can be used to
* differentiate concurrent paths of execution like e.g.
* the 'shipping' and 'billing' paths. */
@@ -122,17 +110,6 @@
/** current activity */
protected ActivityImpl activity;
- /** transition is not to be made persistable by default */
- protected TransitionImpl transition;
-
- /** the activity from which the transition was taken. This can be different from
- * the transition source in case a transition of an eclosing activity was taken.
- * transitionOrigin is not to be made persistable by default */
- protected ActivityImpl transitionOrigin;
-
- protected EventImpl event;
- protected ObservableElementImpl eventSource;
-
/** are concurrent executions that related to this execution. */
protected Collection<ExecutionImpl> executions;
@@ -159,7 +136,20 @@
protected Date historyActivityStart;
protected int priority = Priority.NORMAL;
+
+ // transient member fields //////////////////////////////////////////////////
+ /** transition is not to be made persistable by default */
+ protected TransitionImpl transition;
+
+ /** the activity from which the transition was taken. This can be different from
+ * the transition source in case a transition of an eclosing activity was taken.
+ * transitionOrigin is not to be made persistable by default */
+ protected ActivityImpl transitionOrigin;
+
+ protected EventImpl event;
+ protected ObservableElementImpl eventSource;
+
/** caches the child executions by execution name. This member might be
* null and is only created from the executions in case its needed. Note
* that not all executions are forced to have a name and duplicates are allowed.
@@ -167,8 +157,6 @@
* also updated (but a check needs to be added whether it exists). */
protected transient Map<String, OpenExecution> executionsMap = null;
- // transient members
-
/** the queue of atomic operations to be performed for this execution. */
protected Queue<AtomicOperation> atomicOperations;
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -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.repository;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployCmd implements Command<Long> {
+
+ private static final long serialVersionUID = 1L;
+
+ DeploymentImpl deployment;
+
+ public DeployCmd(DeploymentImpl deployment) {
+ this.deployment = deployment;
+ }
+
+ public Long execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ return repositorySession.deploy(deployment);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface Deployer {
+
+ boolean matches(String fileName);
+ Object deployFile(String fileName, byte[] bytes);
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -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.pvm.internal.repository;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.xml.ProblemList;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeployerManager {
+
+ List<Deployer> deployers;
+
+ public Object deployFile(String fileName, byte[] bytes, ProblemList problemList) {
+ for (Deployer deployer: deployers) {
+ if (deployer.matches(fileName)) {
+ return deployer.deployFile(fileName, bytes);
+ }
+ }
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,40 @@
+/*
+ * 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.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();
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,135 @@
+/*
+ * 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.io.ObjectStreamException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.JbpmException;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.IoUtil;
+import org.jbpm.pvm.internal.xml.ProblemList;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentImpl extends ProblemList implements Deployment {
+
+ protected long dbid;
+ protected String name;
+ protected long timestamp;
+
+ protected Map<String, Lob> storedFiles;
+
+ protected Map<String, StreamInput> inputFiles;
+ protected CommandService commandService;
+
+ public DeploymentImpl(CommandService commandService) {
+ this.commandService = commandService;
+ }
+
+ 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 addStreamInput(String name, StreamInput streamInput) {
+ if (this.name==null) {
+ this.name = name;
+ }
+ if (inputFiles==null) {
+ inputFiles = new HashMap<String, StreamInput>();
+ }
+ inputFiles.put(name, streamInput);
+ return this;
+ }
+
+ public Deployment addZipInputStream(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));
+ }
+ zipEntry = zipInputStream.getNextEntry();
+ }
+ } catch (Exception e) {
+ throw new JbpmException("couldn't read zip archive", e);
+ }
+ return this;
+ }
+
+ protected Object writeReplace() throws ObjectStreamException {
+ if (inputFiles!=null) {
+ Map<String, StreamInput> replacedFiles = new HashMap<String, StreamInput>();
+ for (Map.Entry<String, StreamInput> entry: inputFiles.entrySet()) {
+ if (! (entry.getValue() instanceof ByteArrayStreamInput)) {
+ byte[] bytes = IoUtil.readBytes(entry.getValue().openStream());
+ replacedFiles.put(entry.getKey(), new ByteArrayStreamInput(bytes));
+ }
+ }
+ inputFiles = replacedFiles;
+ }
+
+ commandService = null;
+
+ return this;
+ }
+
+ public long getDbid() {
+ return dbid;
+ }
+ public String getName() {
+ return name;
+ }
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public Map<String, Lob> getStoredFiles() {
+ return storedFiles;
+ }
+ public void setStoredFiles(Map<String, Lob> storedFiles) {
+ this.storedFiles = storedFiles;
+ }
+ public Map<String, StreamInput> getInputFiles() {
+ return inputFiles;
+ }
+ public void setInputFiles(Map<String, StreamInput> inputFiles) {
+ this.inputFiles = inputFiles;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.repository;
+
+import java.util.Map;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositoryCache {
+
+ void store(Map<String, Object> deployedObjects);
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -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.repository;
+
+import java.io.InputStream;
+
+import org.jbpm.cmd.CommandService;
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryServiceImpl {
+
+ CommandService commandService;
+
+ public Deployment createDeployment() {
+ return new DeploymentImpl(commandService);
+ }
+
+ public void deleteDeployment(String deploymentId) {
+ }
+
+ public InputStream getResource(String deploymentId, String resource) {
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,37 @@
+/*
+ * 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.io.InputStream;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface RepositorySession {
+
+ InputStream getResource(String deploymentId, String name);
+
+ Object getDeployedObject(String deploymentId, String name);
+
+ long deploy(DeploymentImpl deployment);
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySession.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: 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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,98 @@
+/*
+ * 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.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.jbpm.JbpmException;
+import org.jbpm.Problem;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.IoUtil;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositorySessionImpl implements RepositorySession {
+
+ private static Log log = Log.getLog(RepositorySessionImpl.class.getName());
+
+ Session session;
+ RepositoryCache repositoryCache;
+ DeployerManager deployerManager;
+
+ public long deploy(DeploymentImpl deployment) {
+ Map<String, Object> deployedObjects = new HashMap<String, Object>();
+
+ Map<String, StreamInput> inputFiles = deployment.getInputFiles();
+ if (inputFiles==null) {
+ deployment.addProblem("deployment is empty");
+
+ } else {
+
+ Map<String, Lob> storedFiles = new HashMap<String, Lob>();
+ for (String fileName: inputFiles.keySet()) {
+ StreamInput streamInput = inputFiles.get(fileName);
+ byte[] bytes = IoUtil.readBytes(streamInput.openStream());
+
+ Object deployedObject = deployerManager.deployFile(fileName, bytes, deployment);
+ if (deployedObject!=null) {
+ deployedObjects.put(fileName, deployedObject);
+ }
+
+ Lob lob = new Lob(bytes);
+ storedFiles.put(fileName, lob);
+ }
+ deployment.setStoredFiles(storedFiles);
+ }
+
+
+ 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());
+ } else {
+
+ repositoryCache.store(deployedObjects);
+ session.save(deployment);
+ }
+
+ return 0;
+ }
+
+ public Object getDeployedObject(String deploymentId, String name) {
+ return null;
+ }
+
+ public InputStream getResource(String deploymentId, String name) {
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -25,6 +25,7 @@
import java.util.List;
import org.jbpm.pvm.internal.util.Priority;
+import org.jbpm.pvm.internal.wire.Descriptor;
/**
* defines a task and how the actor(s) must be calculated at runtime.
@@ -33,30 +34,13 @@
private static final long serialVersionUID = 1L;
- /** @see #isBlocking() */
- protected boolean isBlocking;
-
- /** @see #isSignalling() */
- protected boolean isSignalling = true;
-
protected String dueDateDuration;
protected String form;
protected List<TaskDefinitionImpl> subTaskDefinitions;
protected int priority = Priority.NORMAL;
protected SwimlaneDefinitionImpl swimlaneDefinition;
+ protected Descriptor taskHandlerDescriptor;
- public boolean isBlocking() {
- return isBlocking;
- }
- public void setBlocking(boolean isBlocking) {
- this.isBlocking = isBlocking;
- }
- public boolean isSignalling() {
- return isSignalling;
- }
- public void setSignalling(boolean isSignalling) {
- this.isSignalling = isSignalling;
- }
public int getPriority() {
return priority;
}
@@ -87,4 +71,10 @@
public void setForm(String form) {
this.form = form;
}
+ public Descriptor getTaskHandlerDescriptor() {
+ return taskHandlerDescriptor;
+ }
+ public void setTaskHandlerDescriptor(Descriptor taskHandlerDescriptor) {
+ this.taskHandlerDescriptor = taskHandlerDescriptor;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -42,9 +42,9 @@
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
+import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Assignable;
-import org.jbpm.task.DefaultTaskHandler;
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
import org.jbpm.task.OpenTask;
@@ -65,7 +65,7 @@
private static Log log = Log.getLog(TaskImpl.class.getName());
- private static final TaskHandler DEFAULT_TASK_HANDLER = new DefaultTaskHandler();
+ private static final TaskHandler DEFAULT_TASK_HANDLER = new TaskHandler();
protected String id;
protected String name;
@@ -77,7 +77,7 @@
protected Date create;
protected Date dueDate;
protected Integer progress;
- protected boolean isSignalling = true;
+ protected boolean isSignalling;
// protected VariableMap variableMap;
protected List<CommentImpl> comments;
@@ -86,16 +86,16 @@
protected String state;
+ protected TaskDefinitionImpl taskDefinition;
protected ExecutionImpl execution;
protected ExecutionImpl processInstance;
-
protected SwimlaneImpl swimlane;
protected TaskImpl superTask;
protected Set<TaskImpl> subTasks;
protected Long executionDbid;
- protected Long parentTaskDbid;
+ protected Long superTaskDbid;
public TaskImpl() {
}
@@ -193,11 +193,25 @@
public void complete(String outcome) {
getTaskHandler().taskComplete(this, outcome);
+ if (superTask!=null) {
+ superTask.subTaskComplete(this, outcome);
+ }
}
+ protected void subTaskComplete(TaskImpl subTask, String outcome) {
+ getTaskHandler().taskSubTaskComplete(this, subTask, outcome);
+ }
+
public void cancel(String reason) {
getTaskHandler().taskCancel(this, reason);
}
+
+ // variables ////////////////////////////////////////////////////////////////
+
+ public void setVariable(String key, Object value) {
+ super.setVariable(key, value);
+ getTaskHandler().taskVariableUpdate(this, key, value);
+ }
// comments /////////////////////////////////////////////////////////////////
@@ -303,6 +317,47 @@
return dbid!=0;
}
+ public void cancelExecution(String signal) {
+ if (execution!=null){
+ execution.end("cancel");
+ }
+ }
+
+ public void historyTaskCancel(String reason) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskCancel(reason));
+ }
+ }
+
+ public void historyTaskComplete(String outcome) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskComplete(outcome));
+ }
+ }
+
+ public void historyTaskStart() {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskStart(this));
+ }
+ }
+
+ public void signalExecution(String signalName) {
+ if (execution!=null){
+ execution.signal(signalName);
+ }
+ }
+
+ public TaskHandler getTaskHandler() {
+ if ( (taskDefinition==null)
+ || (taskDefinition.getTaskHandlerDescriptor()==null)
+ ) {
+ return DEFAULT_TASK_HANDLER;
+ }
+
+ TaskHandler taskHandler = (TaskHandler) WireContext.create(taskDefinition.getTaskHandlerDescriptor());
+ return taskHandler;
+ }
+
// getters and setters //////////////////////////////////////////////////////
public long getDbid() {
@@ -380,11 +435,11 @@
public void setExecutionDbid(Long executionDbid) {
this.executionDbid = executionDbid;
}
- public Long getParentTaskDbid() {
- return parentTaskDbid;
+ public Long getSuperTaskDbid() {
+ return superTaskDbid;
}
- public void setParentTaskDbid(Long parentTaskDbid) {
- this.parentTaskDbid = parentTaskDbid;
+ public void setSuperTaskDbid(Long parentTaskDbid) {
+ this.superTaskDbid = parentTaskDbid;
}
public void setParticipants(Set<ParticipantImpl> participants) {
this.participants = participants;
@@ -410,38 +465,10 @@
public void setSignalling(boolean isSignalling) {
this.isSignalling = isSignalling;
}
-
- public void cancelExecution(String signal) {
- if (execution!=null){
- execution.end("cancel");
- }
+ public TaskDefinitionImpl getTaskDefinition() {
+ return taskDefinition;
}
-
- public void historyTaskCancel(String reason) {
- if (execution!=null){
- execution.fireHistoryEvent(new TaskCancel(reason));
- }
+ public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
+ this.taskDefinition = taskDefinition;
}
-
- public void historyTaskComplete(String outcome) {
- if (execution!=null){
- execution.fireHistoryEvent(new TaskComplete(outcome));
- }
- }
-
- public void historyTaskStart() {
- if (execution!=null){
- execution.fireHistoryEvent(new TaskStart(this));
- }
- }
-
- public void signalExecution(String signalName) {
- if (execution!=null){
- execution.signal(signalName);
- }
- }
-
- public TaskHandler getTaskHandler() {
- return DEFAULT_TASK_HANDLER;
- }
}
Modified: jbpm4/trunk/modules/pvm/src/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-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -44,7 +44,7 @@
private static final Log log = Log.getLog(ProblemList.class.getName());
- protected List<ProblemImpl> problems = null;
+ protected List<ProblemImpl> problems;
/** all problems encountered */
public List<Problem> getProblems() {
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignmentHandlerDescriptor"
- column="ASSIGN_DESCR_"
+ column="ASSHNDLR_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASS_ASIGN_DESCR"
- index="IDX_ASS_ASIGN_DESCR" />
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
@@ -38,15 +38,20 @@
<property name="priority" column="PRIORITY_"/>
<property name="dueDateDuration" column="DUEDATE_"/>
- <property name="isBlocking" column="BLOCK_"/>
- <property name="isSignalling" column="SIGNAL_"/>
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
<many-to-one name="swimlaneDefinition"
- column="SWIMLANE_DEF_"
+ column="SWIMLDEF_"
cascade="all"
class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIML_DEF"
- index="IDX_TSK_SWIML_DEF" />
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
<list name="subTaskDefinitions" cascade="all-delete-orphan">
<key column="TASKDEF_" />
@@ -111,6 +116,12 @@
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" />
+
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
<list-index column="TASK_IDX_" />
Added: jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/test-base/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:01 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/test-db/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:08 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,167 @@
+/*
+ * 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.task;
+
+import org.jbpm.Execution;
+import org.jbpm.task.OpenTask;
+import org.jbpm.task.Task;
+import org.jbpm.task.TaskHandler;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskHandlerTest extends JbpmTestCase {
+
+ static boolean isExecutionCreateTaskCalled;
+ static boolean isExecutionSignalledCalled;
+ static boolean isTaskCancelCalled;
+ static boolean isTaskCompleteCalled;
+ static boolean isSubTaskCompleteCalled;
+ static boolean isTaskVariableUpdateCalled;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ isExecutionCreateTaskCalled = false;
+ isExecutionSignalledCalled = false;
+ isTaskCancelCalled = false;
+ isTaskCompleteCalled = false;
+ isSubTaskCompleteCalled = false;
+ isTaskVariableUpdateCalled = false;
+ }
+
+ public static class ReviewHandler extends TaskHandler {
+ public boolean executionCreateTask(OpenTask task) {
+ isExecutionCreateTaskCalled = true;
+ return super.executionCreateTask(task);
+ }
+
+ public void executionSignal(OpenTask task) {
+ isExecutionSignalledCalled = true;
+ super.executionSignal(task);
+ }
+
+ public void taskCancel(OpenTask task, String reason) {
+ isTaskCancelCalled = true;
+ super.taskCancel(task, reason);
+ }
+
+ public void taskComplete(OpenTask task, String outcome) {
+ isTaskCompleteCalled = true;
+ super.taskComplete(task, outcome);
+ }
+
+ public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
+ isSubTaskCompleteCalled = true;
+ super.taskSubTaskComplete(task, subTask, outcome);
+ }
+
+ public void taskVariableUpdate(OpenTask task, String key, Object value) {
+ isTaskVariableUpdateCalled = true;
+ super.taskVariableUpdate(task, key, value);
+ }
+ }
+
+ public void testTaskHandlerBasicScenario() {
+ deployJpdlXmlString(
+ "<process name='TaskHandler'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review'>" +
+ " <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("TaskHandler");
+
+ assertTrue(isExecutionCreateTaskCalled);
+
+ Task task = taskService.createTaskQuery().execute().get(0);
+
+ long taskDbid = task.getDbid();
+ taskService.setVariable(taskDbid, "checked", "true");
+
+ assertTrue(isExecutionCreateTaskCalled);
+
+ Task subTask = taskService.newTask(taskDbid);
+ long subTaskDbid = taskService.saveTask(subTask);
+ taskService.completeTask(subTaskDbid);
+
+ assertTrue(isSubTaskCompleteCalled);
+
+ taskService.completeTask(taskDbid);
+
+ assertTrue(isTaskCompleteCalled);
+ }
+
+ public void testTaskHandlerCancelScenario() {
+ deployJpdlXmlString(
+ "<process name='TaskHandler'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review'>" +
+ " <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("TaskHandler");
+
+ Task task = taskService.createTaskQuery().execute().get(0);
+ long taskDbid = task.getDbid();
+
+ taskService.cancelTask(taskDbid);
+
+ assertTrue(isTaskCancelCalled);
+ }
+
+ public void testTaskHandlerExecutionSignalScenario() {
+ deployJpdlXmlString(
+ "<process name='TaskHandler'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review'>" +
+ " <task-handler class='"+ReviewHandler.class.getName()+"' />" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("TaskHandler");
+ String executionId = execution.getId();
+
+ executionService.signalExecutionById(executionId);
+
+ assertTrue(isExecutionSignalledCalled);
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
___________________________________________________________________
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-25 08:23:05 UTC (rev 4326)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-25 12:56:01 UTC (rev 4327)
@@ -24,11 +24,11 @@
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
<many-to-one name="assignmentHandlerDescriptor"
- column="ASSIGN_DESCR_"
+ column="ASSHNDLR_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASS_ASIGN_DESCR"
- index="IDX_ASS_ASIGN_DESCR" />
+ foreign-key="FK_ASSHNDLR_DESCR"
+ index="IDX_ASSHNDLR_DESCR" />
<subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
</subclass>
@@ -38,15 +38,20 @@
<property name="priority" column="PRIORITY_"/>
<property name="dueDateDuration" column="DUEDATE_"/>
- <property name="isBlocking" column="BLOCK_"/>
- <property name="isSignalling" column="SIGNAL_"/>
+ <many-to-one name="taskHandlerDescriptor"
+ column="TSKHNDLRDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
+ foreign-key="FK_TSKHNDLR_DESCR"
+ index="IDX_TSKHNDLR_DESCR" />
+
<many-to-one name="swimlaneDefinition"
- column="SWIMLANE_DEF_"
+ column="SWIMLDEF_"
cascade="all"
class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIML_DEF"
- index="IDX_TSK_SWIML_DEF" />
+ foreign-key="FK_TSK_SWIMLDEF"
+ index="IDX_TSK_SWIMLDEF" />
<list name="subTaskDefinitions" cascade="all-delete-orphan">
<key column="TASKDEF_" />
@@ -111,6 +116,12 @@
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" />
+
<list name="comments" cascade="all-delete-orphan">
<key column="TASK_" />
<list-index column="TASK_IDX_" />
Added: jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/test-load/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:16 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
Added: jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/test-pojo/.settings/org.maven.ide.eclipse.prefs 2009-03-25 12:56:01 UTC (rev 4327)
@@ -0,0 +1,8 @@
+#Wed Mar 25 11:12:26 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=
+version=1
17 years, 1 month
JBoss JBPM SVN: r4326 - in jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121: modules/core and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-25 04:23:05 -0400 (Wed, 25 Mar 2009)
New Revision: 4326
Modified:
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/db/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/enterprise/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/identity/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/simulation/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/pom.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/src/main/docbook/en/master.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/pom.xml
Log:
set version to jbpm-3.2.5.SP4_JBPM-2121
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/db/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/db/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/distribution/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/distribution/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/enterprise/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/enterprise/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/examples/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/examples/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/identity/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/identity/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/identity/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/simulation/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/simulation/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/simulation/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/src/main/docbook/en/master.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/userguide/src/main/docbook/en/master.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -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.SP4_JBPM-2121">
]>
<book lang="en">
<bookinfo>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/pom.xml 2009-03-25 07:36:35 UTC (rev 4325)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/pom.xml 2009-03-25 08:23:05 UTC (rev 4326)
@@ -16,7 +16,7 @@
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>3.2.5.SP4</version>
+ <version>3.2.5.SP4_JBPM-2121</version>
<!-- Parent -->
<parent>
17 years, 1 month
JBoss JBPM SVN: r4325 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-25 03:36:35 -0400 (Wed, 25 Mar 2009)
New Revision: 4325
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/TaskManagementImpl.java
Log:
console fixes after refactoring
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-25 07:29:28 UTC (rev 4324)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-03-25 07:36:35 UTC (rev 4325)
@@ -112,7 +112,6 @@
// TODO: verify usage
TaskImpl cast = ((TaskImpl) t0);
task.setSignalling( cast.isSignalling());
- task.setBlocking( cast.isBlocking());
ExecutionImpl execution = cast.getProcessInstance();
task.setProcessInstanceId( cast.getProcessInstance().getId() );
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-25 07:29:28 UTC (rev 4324)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-03-25 07:36:35 UTC (rev 4325)
@@ -59,10 +59,8 @@
public void reassignTask(long taskId, String actorId)
{
TaskService taskService = this.processEngine.get(TaskService.class);
- Authentication.setUserId(actorId);
- // TODO: Weird API
- taskService.takeTask(taskId);
+ taskService.assignTask(taskId, actorId);
}
public void closeTask(long taskId, String signalName)
17 years, 1 month
JBoss JBPM SVN: r4324 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/activity and 26 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-03-25 03:29:28 -0400 (Wed, 25 Mar 2009)
New Revision: 4324
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/cancel/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
Log:
JBPM-2104 task handler
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/TaskService.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -62,8 +62,8 @@
* the call returns <code>null</code>. */
Task getTask(long taskDbid);
- /** Takes a task from the group task list to the current user's personal task list. */
- void takeTask(long taskDbid);
+ /** assigns this task to the given asignee. */
+ void assignTask(long taskDbid, String assigneeUserId);
/** Deletes this task, marks the related history task as completed.
* If the task was created in the context
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -284,10 +284,4 @@
/** marks the end of an activity with a specific transitionName for history purposes. */
void historyActivityEnd(String transitionName);
-
- /** marks the start of a user task for history purposes. */
- void historyTaskStart(Task task);
-
- /** marks the end of a user task for history purposes. */
- void historyTaskComplete(String outcome);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/Assignable.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -27,7 +27,7 @@
*/
public interface Assignable {
- void setAssignee(String assigned);
+ void setAssignee(String assignee);
void addCandidateUser(String userId);
void addCandidateGroup(String groupId);
}
\ No newline at end of file
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.task;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DefaultTaskHandler implements TaskHandler {
+
+ public boolean executionCreateTask(OpenTask task) {
+ assign(task);
+ task.historyTaskStart();
+ return true;
+ }
+
+ protected void assign(OpenTask task) {
+ }
+
+ public void executionSignal(OpenTask task) {
+ task.setSignalling(false);
+ }
+
+ public void taskCancel(OpenTask task, String reason) {
+ task.historyTaskCancel(reason);
+ }
+
+ public void taskComplete(OpenTask task, String outcome) {
+ task.historyTaskComplete(outcome);
+
+ if (task.isSignalling()) {
+ task.getExecution().signal(outcome);
+ }
+ }
+
+ public void taskSubTaskComplete(OpenTask task, OpenTask subTask) {
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/DefaultTaskHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.task;
+
+import org.jbpm.client.ClientExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface OpenTask extends Task, Assignable {
+
+ ClientExecution getExecution();
+
+ OpenTask createSubTask();
+ OpenTask createSubTask(String name);
+
+ /** fires a history event that marks the start of this task. */
+ void historyTaskStart();
+
+ /** fires a history event that marks the completion of this task. */
+ void historyTaskComplete(String outcome);
+
+ /** fires a history event that marks the cancellation of this task. */
+ void historyTaskCancel(String reason);
+
+ boolean isSignalling();
+ void setSignalling(boolean isSignalling);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/OpenTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/SwimlaneDefinition.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.task;
-
-import java.io.Serializable;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface SwimlaneDefinition extends Serializable {
-
- String getName();
-
-}
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.task;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface TaskHandler {
+
+ boolean executionCreateTask(OpenTask task);
+ void executionSignal(OpenTask task);
+ void taskComplete(OpenTask task, String outcome);
+ void taskCancel(OpenTask task, String reason);
+ void taskSubTaskComplete(OpenTask task, OpenTask subTask);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/task/TaskHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-03-25 07:29:28 UTC (rev 4324)
@@ -315,7 +315,7 @@
</documentation></annotation>
<complexType>
<sequence>
- <element name="handler" minOccurs="0" type="tns:wireObjectType" />
+ <element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
<element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
@@ -449,6 +449,10 @@
invocation.</documentation></annotation>
<complexType >
<group ref="tns:wireObjectGroup" />
+ <attribute name="name" type="string">
+ <annotation><documentation>Name of the field in which the value should be injected.
+ </documentation></annotation>
+ </attribute>
</complexType>
</element>
</sequence>
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.task.assignmenthandler;
+
+import org.jbpm.model.OpenExecution;
+import org.jbpm.task.Assignable;
+import org.jbpm.task.AssignmentHandler;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignTask implements AssignmentHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ String assignee;
+
+ public void assign(Assignable assignable, OpenExecution execution) {
+ assignable.setAssignee(assignee);
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/AssignTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.task.assignmenthandler;
+
+import java.util.List;
+
+import org.jbpm.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskAssignmentHandlerTest extends JbpmTestCase {
+
+ public void testTaskAssignmentHandler() {
+ deployJpdlResource("org/jbpm/examples/task/assignmenthandler/process.jpdl.xml");
+
+ executionService.startProcessInstanceByKey("TaskAssignmentHandler");
+
+ List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(1, taskList.size());
+ Task task = taskList.get(0);
+ assertEquals("review", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -60,8 +60,7 @@
assertEquals("review", task.getName());
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -49,14 +49,12 @@
long taskDbid = task.getDbid();
assertEquals("enter order data", task.getName());
assertNull(task.getAssignee());
-
+
+ assertEquals(0, taskService.getPersonalTaskList("johndoe", 0, 10).size());
+
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(taskDbid);
+ taskService.assignTask(taskDbid, "johndoe");
- // submit the task
- taskService.completeTask(taskDbid);
-
// the next task will be created and assigned directly to johndoe
// this is because johndoe was the person that took the previous task
// in the salesRepresentative swimlane. so that person is most likely
@@ -69,6 +67,15 @@
taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
assertEquals(1, taskList.size());
task = taskList.get(0);
+ assertEquals("enter order data", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // submit the task
+ taskService.completeTask(taskDbid);
+
+ taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
+ assertEquals(1, taskList.size());
+ task = taskList.get(0);
assertEquals("calculate quote", task.getName());
assertEquals("johndoe", task.getAssignee());
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/variables/TaskVariablesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -27,6 +27,7 @@
import java.util.Map;
import java.util.Set;
+import org.jbpm.Execution;
import org.jbpm.task.Task;
import org.jbpm.test.JbpmTestCase;
@@ -42,7 +43,7 @@
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("category", "big");
variables.put("dollars", 100000);
- executionService.startProcessInstanceByKey("TaskVariables", variables);
+ Execution execution = executionService.startProcessInstanceByKey("TaskVariables", variables);
List<Task> taskList = taskService.getPersonalTaskList("johndoe", 0, 10);
Task task = taskList.get(0);
@@ -61,5 +62,19 @@
variables = taskService.getVariables(taskDbid, variableNames);
assertEquals(expectedVariables, variables);
+
+ variables = new HashMap<String, Object>();
+ variables.put("category", "small");
+ variables.put("lires", 923874893);
+ taskService.setVariables(taskDbid, variables);
+
+ expectedVariables = new HashMap<String, Object>();
+ expectedVariables.put("category", "small");
+ expectedVariables.put("lires", 923874893);
+ expectedVariables.put("dollars", 100000);
+
+ variables = executionService.getVariables(execution.getId(), expectedVariables.keySet());
+
+ assertEquals(expectedVariables, variables);
}
}
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="TaskAssignmentHandler" xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="review" />
+ </start>
+
+ <task name="review" g="96,16,127,52">
+ <assignment-handler class="org.jbpm.examples.task.assignmenthandler.AssignTask">
+ <field name="assignee">
+ <string value="johndoe" />
+ </field>
+ </assignment-handler>
+ <transition to="wait" />
+ </task>
+
+ <state name="wait" g="255,16,88,52" />
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/assignmenthandler/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/task/handler/process.jpdl.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="TaskHandler" xmlns="http://jbpm.org/4/jpdl">
-
- <start g="20,20,48,48">
- <transition to="open case" />
- </start>
-
- <task
- name="open case"
- g="96,16,127,52">
-
- <handler class="org.jbpm.examples.java.AssignTask">
- <field name="assignee"><string value="John Doe"/></field>
- </handler>
-
- <transition to="wait"/>
- </task>
-
- <state name="wait" g="255,16,88,52"/>
-
-</process>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -21,16 +21,13 @@
*/
package org.jbpm.jpdl.internal.activity;
-import java.util.ArrayList;
import java.util.List;
-import java.util.Set;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.operation.InvokeOperation;
-import org.jbpm.pvm.internal.wire.operation.Operation;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -43,8 +40,6 @@
public static final String TAG = "java";
- private static final WireParser wireParser = WireParser.getInstance();
-
public JavaBinding() {
super(TAG);
}
@@ -66,34 +61,8 @@
javaActivity.setInvokeOperation(invokeOperation);
}
- String className = XmlUtil.attribute(element, "class");
- if (className!=null) {
- ObjectDescriptor objectDescriptor = new ObjectDescriptor();
-
- objectDescriptor.setClassName(className);
-
- // read the operations elements
- List<Operation> operations = null;
- List<Element> elements = XmlUtil.elements(element);
-
- Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
- for (Element childElement: elements) {
- if (operationTagNames.contains(childElement.getTagName())) {
- Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
- if (operations==null) {
- operations = new ArrayList<Operation>();
- }
- operations.add(operation);
- }
- }
- objectDescriptor.setOperations(operations);
-
- // autowiring
- Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
- if (isAutoWireEnabled!=null) {
- objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
- }
-
+ if (element.hasAttribute("class")) {
+ ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(element, parse);
javaActivity.setDescriptor(objectDescriptor);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlActivityBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -23,11 +23,13 @@
import java.util.List;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.jpdl.internal.xml.UnresolvedTransitions;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.w3c.dom.Element;
@@ -36,6 +38,8 @@
* @author Tom Baeyens
*/
public abstract class JpdlActivityBinding extends TagBinding {
+
+ protected static final WireParser wireParser = JpdlParser.wireParser;
public JpdlActivityBinding(String tagName) {
super(tagName, "http://jbpm.org/4/jpdl", "activity");
@@ -68,6 +72,4 @@
unresolvedTransitions.add(transition, transitionElement);
}
}
-
}
-
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -29,10 +29,10 @@
import org.jbpm.jpdl.internal.model.JpdlExecution;
import org.jbpm.model.Activity;
import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.session.TaskDbSession;
+import org.jbpm.task.TaskHandler;
/**
@@ -47,12 +47,16 @@
public void execute(ActivityExecution execution) {
JpdlExecution jpdlExecution = execution.getExtension(JpdlExecution.class);
TaskImpl task = jpdlExecution.createTask(taskDefinition);
+ TaskHandler taskHandler = task.getTaskHandler();
+ boolean wait = taskHandler.executionCreateTask(task);
+
TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
taskDbSession.save(task);
-
- execution.historyTaskStart(task);
- execution.waitForSignal();
+
+ if (wait) {
+ execution.waitForSignal();
+ }
}
public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
@@ -72,7 +76,7 @@
}
}
- public SwimlaneDefinitionImpl getTaskDefinition() {
+ public TaskDefinitionImpl getTaskDefinition() {
return taskDefinition;
}
public void setTaskDefinition(TaskDefinitionImpl taskDefinition) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskBinding.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,9 +22,12 @@
package org.jbpm.jpdl.internal.activity;
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -65,34 +68,40 @@
}
}
- parseAssignmentAttributes(element, taskDefinition);
+ parseAssignmentAttributes(element, taskDefinition, parse);
return taskDefinition;
}
- public static void parseAssignmentAttributes(Element element, SwimlaneDefinitionImpl swimlaneDefinition) {
+ public static void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
Element descriptionElement = XmlUtil.element(element, "description");
if (descriptionElement!=null) {
String description = XmlUtil.getContentText(descriptionElement);
- swimlaneDefinition.setDescription(description);
+ assignableDefinition.setDescription(description);
}
-
+
+ Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
+ if (assignmentHandlerElement!=null) {
+ ObjectDescriptor objectDescriptor = JpdlParser.parseObjectDescriptor(assignmentHandlerElement, parse);
+ assignableDefinition.setAssignmentHandlerDescriptor(objectDescriptor);
+ }
+
String assigneeExpression = XmlUtil.attribute(element, "assignee");
- swimlaneDefinition.setAssigneeExpression(assigneeExpression);
+ assignableDefinition.setAssigneeExpression(assigneeExpression);
String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
- swimlaneDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
+ assignableDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
- swimlaneDefinition.setCandidateUsersExpression(candidateUsersExpression);
+ assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
- swimlaneDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
+ assignableDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
- swimlaneDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
+ assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
- swimlaneDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
+ assignableDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/model/JpdlExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -31,13 +31,17 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
+import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.ParticipantImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Assignable;
+import org.jbpm.task.AssignmentHandler;
/**
* @author Tom Baeyens
@@ -77,8 +81,6 @@
}
task.setDescription(taskDefinition.getDescription());
- task.setBlocking(taskDefinition.isBlocking());
- task.setSignalling(taskDefinition.isSignalling());
task.setPriority(taskDefinition.getPriority());
SwimlaneDefinitionImpl swimlaneDefinition = taskDefinition.getSwimlaneDefinition();
@@ -102,21 +104,21 @@
/** tasks and swimlane assignment.
* SwimlaneDefinitionImpl is base class for TaskDefinitionImpl.
* Both Task and Swimlane implement Assignable. */
- public void initializeAssignments(SwimlaneDefinitionImpl assignmentDefinition, Assignable assignable) {
- String assigneeExpression = assignmentDefinition.getAssigneeExpression();
+ public void initializeAssignments(AssignableDefinitionImpl assignableDefinition, Assignable assignable) {
+ String assigneeExpression = assignableDefinition.getAssigneeExpression();
if (assigneeExpression!=null) {
String assignee = resolveAssignmentExpression(assigneeExpression,
- assignmentDefinition.getAssigneeExpressionLanguage());
+ assignableDefinition.getAssigneeExpressionLanguage());
assignable.setAssignee(assignee);
if (log.isTraceEnabled()) log.trace("task "+name+" assigned to "+assignee+" using expression "+assigneeExpression);
}
- String candidateUsersExpression = assignmentDefinition.getCandidateUsersExpression();
+ String candidateUsersExpression = assignableDefinition.getCandidateUsersExpression();
if (candidateUsersExpression!=null) {
String candidateUsers =
resolveAssignmentExpression(candidateUsersExpression,
- assignmentDefinition.getCandidateUsersExpressionLanguage());
+ assignableDefinition.getCandidateUsersExpressionLanguage());
StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
while (tokenizer.hasMoreTokens()) {
String candidateUser = tokenizer.nextToken();
@@ -124,17 +126,27 @@
}
}
- String candidateGroupsExpression = assignmentDefinition.getCandidateGroupsExpression();
+ String candidateGroupsExpression = assignableDefinition.getCandidateGroupsExpression();
if (candidateGroupsExpression!=null) {
String candidateGroups =
resolveAssignmentExpression(candidateGroupsExpression,
- assignmentDefinition.getCandidateGroupsExpressionLanguage());
+ assignableDefinition.getCandidateGroupsExpressionLanguage());
StringTokenizer tokenizer = new StringTokenizer(candidateGroups, ",");
while (tokenizer.hasMoreTokens()) {
String candidateGroup = tokenizer.nextToken();
assignable.addCandidateGroup(candidateGroup);
}
}
+
+ Descriptor assignmentHandlerDescriptor = assignableDefinition.getAssignmentHandlerDescriptor();
+ if (assignmentHandlerDescriptor!=null) {
+ AssignmentHandler assignmentHandler = (AssignmentHandler) WireContext.create(assignmentHandlerDescriptor);
+ try {
+ assignmentHandler.assign(assignable, this);
+ } catch (Exception e) {
+ throw new JbpmException("assignment handler threw exception: "+e, e);
+ }
+ }
}
protected String resolveAssignmentExpression(String expression, String expressionLanguage) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,8 +22,10 @@
package org.jbpm.jpdl.internal.xml;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
+import java.util.Set;
import org.jbpm.activity.ActivityBehaviour;
import org.jbpm.internal.log.Log;
@@ -34,6 +36,9 @@
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.operation.Operation;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -45,6 +50,8 @@
private static final Log log = Log.getLog(JpdlParser.class.getName());
+ public static final WireParser wireParser = WireParser.getInstance();
+
public static final String[] DEFAULT_ACTIVITIES_RESOURCES = new String[]{
"jbpm.jpdl.activities.xml",
"jbpm.user.activities.xml"
@@ -125,7 +132,7 @@
if (swimlaneName!=null) {
SwimlaneDefinitionImpl swimlaneDefinition =
processDefinition.createSwimlaneDefinition(swimlaneName);
- TaskBinding.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition);
+ TaskBinding.parseAssignmentAttributes(swimlaneElement, swimlaneDefinition, parse);
}
}
@@ -165,4 +172,36 @@
return processDefinition;
}
+
+ public static ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor();
+
+ String className = XmlUtil.attribute(element, "class");
+ if (className!=null) {
+ objectDescriptor.setClassName(className);
+
+ // read the operations elements
+ List<Operation> operations = null;
+ List<Element> elements = XmlUtil.elements(element);
+
+ Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
+ for (Element childElement: elements) {
+ if (operationTagNames.contains(childElement.getTagName())) {
+ Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
+ if (operations==null) {
+ operations = new ArrayList<Operation>();
+ }
+ operations.add(operation);
+ }
+ }
+ objectDescriptor.setOperations(operations);
+
+ // autowiring
+ Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
+ if (isAutoWireEnabled!=null) {
+ objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
+ }
+ }
+ return objectDescriptor;
+ }
}
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.jbpm.JbpmException;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.session.TaskDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignTaskCmd extends AbstractCommand<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected long taskDbid;
+ protected String assigneeUserId;
+
+ public AssignTaskCmd(long taskDbid, String assigneeUserId) {
+ this.taskDbid = taskDbid;
+ this.assigneeUserId = assigneeUserId;
+ }
+
+ public Void execute(Environment environment) {
+ TaskDbSession taskDbession = environment.get(TaskDbSession.class);
+ TaskImpl task = (TaskImpl) taskDbession.findTaskByDbid(taskDbid);
+ if (task==null) {
+ throw new JbpmException("task "+taskDbid+" does not exist");
+ }
+ task.setAssignee(assigneeUserId, true);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/TakeTaskCmd.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.session.TaskDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TakeTaskCmd extends AbstractCommand<Void> {
-
- private static final long serialVersionUID = 1L;
-
- protected long taskDbid;
-
- public TakeTaskCmd(long taskDbid) {
- this.taskDbid = taskDbid;
- }
-
- public Void execute(Environment environment) {
- TaskDbSession taskDbession = environment.get(TaskDbSession.class);
- TaskImpl task = (TaskImpl) taskDbession.findTaskByDbid(taskDbid);
- if (task==null) {
- throw new JbpmException("task "+taskDbid+" does not exist");
- }
- task.take();
- return null;
- }
-}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCancel extends ActivityEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String reason;
+
+ public TaskCancel(String reason) {
+ this.reason = reason;
+ }
+
+ protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
+ super.updateHistoryActivityInstance(historyActivityInstance);
+
+ HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
+ historyTaskInstance.setState(reason);
+ }
+
+ protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
+ return HistoryTaskInstanceImpl.class;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCancel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.events;
-
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
-import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TaskDelete extends ActivityEnd {
-
- private static final long serialVersionUID = 1L;
-
- protected String reason;
-
- public TaskDelete(String reason) {
- this.reason = reason;
- }
-
- protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
- super.updateHistoryActivityInstance(historyActivityInstance);
-
- HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl) historyActivityInstance;
- historyTaskInstance.setState(reason);
- }
-
- protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
- return HistoryTaskInstanceImpl.class;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -35,6 +35,7 @@
import org.jboss.identity.idm.api.RoleType;
import org.jboss.identity.idm.exception.IdentityException;
import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
+import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.api.model.SimpleGroupType;
import org.jboss.identity.idm.p3p.P3PConstants;
@@ -62,10 +63,11 @@
public void createUser(String userName, String password, String givenName, String lastName) {
try {
+ Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
// TODO add the password
-
- Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
+ // identitySession.getAttributesManager().updateCredential(identity, new PasswordCredential(password));
+
Attribute[] attributes = new Attribute[] {
new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, new String[] { givenName }),
new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, new String[] { lastName })
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -63,7 +63,7 @@
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.history.events.TaskComplete;
-import org.jbpm.pvm.internal.history.events.TaskDelete;
+import org.jbpm.pvm.internal.history.events.TaskCancel;
import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
@@ -990,19 +990,7 @@
fireHistoryEvent(new ActivityEnd(transitionName));
}
- public void historyTaskStart(Task task) {
- fireHistoryEvent(new TaskStart(task));
- }
-
- public void historyTaskComplete(String outcome) {
- fireHistoryEvent(new TaskComplete(outcome));
- }
- public void historyTaskDelete(String reason) {
- fireHistoryEvent(new TaskDelete(reason));
- }
-
-
// extensions ///////////////////////////////////////////////////////////////
public <T> T getExtension(Class<T> extensionClass) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -105,7 +105,7 @@
throw new JbpmException("no scripting engine configured for language "+language);
}
- if (log.isDebugEnabled()) log.debug("evaluating "+language+" script :"+script);
+ if (log.isTraceEnabled()) log.trace("evaluating "+language+" script "+script);
if (execution==null) {
return evaluate(scriptEngine, script);
@@ -136,7 +136,7 @@
try {
Object result = scriptEngine.eval(script);
- log.debug("script evaluated to "+result);
+ if (log.isTraceEnabled()) log.trace("script evaluated to "+result);
return result;
} catch (ScriptException e) {
throw new JbpmException("script evaluation error: "+e.getMessage(), e);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -45,7 +45,7 @@
import org.jbpm.pvm.internal.cmd.RemoveParticipantCmd;
import org.jbpm.pvm.internal.cmd.SaveTaskCmd;
import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.TakeTaskCmd;
+import org.jbpm.pvm.internal.cmd.AssignTaskCmd;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.task.TaskQueryImpl;
import org.jbpm.task.IdentityRef;
@@ -173,8 +173,8 @@
return commandService.execute(cmd);
}
- public void takeTask(long taskDbid) {
- TakeTaskCmd cmd = new TakeTaskCmd(taskDbid);
+ public void assignTask(long taskDbid, String assigneeUserId) {
+ AssignTaskCmd cmd = new AssignTaskCmd(taskDbid, assigneeUserId);
addTxWireObjects(cmd);
commandService.execute(cmd);
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/Assignable.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.task;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface Assignable {
-
- void setAssignee(String assigned);
- void addCandidateUser(String userId);
- void addCandidateGroup(String groupId);
-}
\ No newline at end of file
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+import org.jbpm.pvm.internal.model.ProcessElementImpl;
+import org.jbpm.pvm.internal.util.EqualsUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignableDefinitionImpl extends ProcessElementImpl {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+ protected String description;
+
+ protected String assigneeExpression;
+ protected String assigneeExpressionLanguage;
+ protected String candidateUsersExpression;
+ protected String candidateUsersExpressionLanguage;
+ protected String candidateGroupsExpression;
+ protected String candidateGroupsExpressionLanguage;
+ protected Descriptor assignmentHandlerDescriptor;
+
+ // equals ///////////////////////////////////////////////////////////////////
+ // hack to support comparing hibernate proxies against the real objects
+ // since this always falls back to ==, we don't need to overwrite the hashcode
+ public boolean equals(Object o) {
+ return EqualsUtil.equals(this, o);
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
+ public String getAssigneeExpression() {
+ return assigneeExpression;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public void setAssigneeExpression(String assigneeExpression) {
+ this.assigneeExpression = assigneeExpression;
+ }
+ public Descriptor getAssignmentHandlerDescriptor() {
+ return assignmentHandlerDescriptor;
+ }
+ public void setAssignmentHandlerDescriptor(Descriptor assignmentHandlerDescriptor) {
+ this.assignmentHandlerDescriptor = assignmentHandlerDescriptor;
+ }
+ public String getAssigneeExpressionLanguage() {
+ return assigneeExpressionLanguage;
+ }
+ public void setAssigneeExpressionLanguage(String assigneeExpressionLanguage) {
+ this.assigneeExpressionLanguage = assigneeExpressionLanguage;
+ }
+ public String getCandidateUsersExpression() {
+ return candidateUsersExpression;
+ }
+ public void setCandidateUsersExpression(String candidateUsersExpression) {
+ this.candidateUsersExpression = candidateUsersExpression;
+ }
+ public String getCandidateUsersExpressionLanguage() {
+ return candidateUsersExpressionLanguage;
+ }
+ public void setCandidateUsersExpressionLanguage(String candidateUsersExpressionLanguage) {
+ this.candidateUsersExpressionLanguage = candidateUsersExpressionLanguage;
+ }
+ public String getCandidateGroupsExpression() {
+ return candidateGroupsExpression;
+ }
+ public void setCandidateGroupsExpression(String candidateGroupsExpression) {
+ this.candidateGroupsExpression = candidateGroupsExpression;
+ }
+ public String getCandidateGroupsExpressionLanguage() {
+ return candidateGroupsExpressionLanguage;
+ }
+ public void setCandidateGroupsExpressionLanguage(String candidateGroupsExpressionLanguage) {
+ this.candidateGroupsExpressionLanguage = candidateGroupsExpressionLanguage;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.task;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface OpenTaskDefinition {
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/OpenTaskDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/SwimlaneDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -22,98 +22,12 @@
package org.jbpm.pvm.internal.task;
import java.io.Serializable;
-import java.util.StringTokenizer;
-import org.jbpm.JbpmException;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessElementImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.util.EqualsUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.task.GroupRef;
-import org.jbpm.task.Participant;
-import org.jbpm.task.UserRef;
-
/**
* is a process role (aka participant).
*/
-public class SwimlaneDefinitionImpl extends ProcessElementImpl implements Serializable {
+public class SwimlaneDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
private static final long serialVersionUID = 1L;
- protected String name;
- protected String description;
-
- protected String assigneeExpression;
- protected String assigneeExpressionLanguage;
- protected String candidateUsersExpression;
- protected String candidateUsersExpressionLanguage;
- protected String candidateGroupsExpression;
- protected String candidateGroupsExpressionLanguage;
- protected Descriptor assignerDescriptor;
-
- // equals ///////////////////////////////////////////////////////////////////
- // hack to support comparing hibernate proxies against the real objects
- // since this always falls back to ==, we don't need to overwrite the hashcode
- public boolean equals(Object o) {
- return EqualsUtil.equals(this, o);
- }
-
- // getters and setters //////////////////////////////////////////////////////
-
- public String getAssigneeExpression() {
- return assigneeExpression;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public void setAssigneeExpression(String assigneeExpression) {
- this.assigneeExpression = assigneeExpression;
- }
- public Descriptor getAssignerDescriptor() {
- return assignerDescriptor;
- }
- public void setAssignerDescriptor(Descriptor assignerDescriptor) {
- this.assignerDescriptor = assignerDescriptor;
- }
- public String getAssigneeExpressionLanguage() {
- return assigneeExpressionLanguage;
- }
- public void setAssigneeExpressionLanguage(String assigneeExpressionLanguage) {
- this.assigneeExpressionLanguage = assigneeExpressionLanguage;
- }
- public String getCandidateUsersExpression() {
- return candidateUsersExpression;
- }
- public void setCandidateUsersExpression(String candidateUsersExpression) {
- this.candidateUsersExpression = candidateUsersExpression;
- }
- public String getCandidateUsersExpressionLanguage() {
- return candidateUsersExpressionLanguage;
- }
- public void setCandidateUsersExpressionLanguage(String candidateUsersExpressionLanguage) {
- this.candidateUsersExpressionLanguage = candidateUsersExpressionLanguage;
- }
- public String getCandidateGroupsExpression() {
- return candidateGroupsExpression;
- }
- public void setCandidateGroupsExpression(String candidateGroupsExpression) {
- this.candidateGroupsExpression = candidateGroupsExpression;
- }
- public String getCandidateGroupsExpressionLanguage() {
- return candidateGroupsExpressionLanguage;
- }
- public void setCandidateGroupsExpressionLanguage(String candidateGroupsExpressionLanguage) {
- this.candidateGroupsExpressionLanguage = candidateGroupsExpressionLanguage;
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskDefinitionImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -29,7 +29,7 @@
/**
* defines a task and how the actor(s) must be calculated at runtime.
*/
-public class TaskDefinitionImpl extends SwimlaneDefinitionImpl implements Serializable {
+public class TaskDefinitionImpl extends AssignableDefinitionImpl implements Serializable {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskExecution.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -21,16 +21,14 @@
*/
package org.jbpm.pvm.internal.task;
-import java.util.Map;
-import org.jbpm.task.Swimlane;
-import org.jbpm.task.Task;
-
/**
* @author Tom Baeyens
*/
public interface TaskExecution {
- Map<String, ? extends Task> getTasks();
- Map<String, ? extends Swimlane> getSwimlanes();
+ void decouple();
+
+ void complete();
+ void complete(boolean cascade);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -34,7 +34,9 @@
import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.env.Authentication;
+import org.jbpm.pvm.internal.history.events.TaskCancel;
+import org.jbpm.pvm.internal.history.events.TaskComplete;
+import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
@@ -42,11 +44,14 @@
import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.session.TaskDbSession;
import org.jbpm.task.Assignable;
+import org.jbpm.task.DefaultTaskHandler;
import org.jbpm.task.GroupRef;
import org.jbpm.task.IdentityRef;
+import org.jbpm.task.OpenTask;
import org.jbpm.task.Participant;
import org.jbpm.task.Swimlane;
import org.jbpm.task.Task;
+import org.jbpm.task.TaskHandler;
import org.jbpm.task.UserRef;
/**
@@ -54,12 +59,14 @@
* someones task list) and that can trigger the continuation of execution
* of the token upon completion.
*/
-public class TaskImpl extends ScopeInstanceImpl implements Serializable, Task, Assignable {
+public class TaskImpl extends ScopeInstanceImpl implements Serializable, OpenTask, Assignable {
private static final long serialVersionUID = 1L;
private static Log log = Log.getLog(TaskImpl.class.getName());
+ private static final TaskHandler DEFAULT_TASK_HANDLER = new DefaultTaskHandler();
+
protected String id;
protected String name;
protected String description;
@@ -70,6 +77,7 @@
protected Date create;
protected Date dueDate;
protected Integer progress;
+ protected boolean isSignalling = true;
// protected VariableMap variableMap;
protected List<CommentImpl> comments;
@@ -81,12 +89,9 @@
protected ExecutionImpl execution;
protected ExecutionImpl processInstance;
- protected boolean isSignalling = true;
- protected boolean isBlocking;
-
protected SwimlaneImpl swimlane;
- protected Assignable superTask;
+ protected TaskImpl superTask;
protected Set<TaskImpl> subTasks;
protected Long executionDbid;
@@ -103,23 +108,15 @@
// assignment ///////////////////////////////////////////////////////////////
- public void take() {
- if (assignee!=null) {
- throw new JbpmException("task "+dbid+" is already taken by "+assignee);
- }
- Authentication authentication = Environment.getFromCurrent(Authentication.class);
- assignee = authentication.getUserId();
- if (assignee==null) {
- throw new JbpmException("no currently authenticated user");
- }
- log.trace("user "+assignee+" takes "+this);
-
- propagateAssigneeToSwimlane();
+ public void setAssignee(String assignee) {
+ this.assignee = assignee;
}
- public void setAssignee(String assigned) {
- this.assignee = assigned;
- propagateAssigneeToSwimlane();
+ public void setAssignee(String assignee, boolean propagateToSwimlane) {
+ this.assignee = assignee;
+ if (propagateToSwimlane) {
+ propagateAssigneeToSwimlane();
+ }
}
protected void propagateAssigneeToSwimlane() {
@@ -195,21 +192,11 @@
}
public void complete(String outcome) {
- if (execution!=null) {
- execution.historyTaskComplete(outcome);
- execution.historyTaskDelete("completed");
-
- // TODO propagate the outjected variables to the execution
-
- // the outcome serves as the signal given to the execution.
- execution.signal(outcome);
- }
+ getTaskHandler().taskComplete(this, outcome);
}
public void cancel(String reason) {
- if (execution!=null) {
- execution.historyTaskDelete(reason);
- }
+ getTaskHandler().taskCancel(this, reason);
}
// comments /////////////////////////////////////////////////////////////////
@@ -248,17 +235,25 @@
return (Set) subTasks;
}
- public Task createSubTask(String name) {
+ public TaskImpl createSubTask() {
+ TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
+ TaskImpl subTask = (TaskImpl) taskDbSession.createTask();
if (subTasks==null) {
subTasks = new HashSet<TaskImpl>();
}
- TaskImpl subtask = new TaskImpl();
+ addSubTask(subTask);
+ return subTask;
+ }
+
+ public TaskImpl createSubTask(String name) {
+ // TODO look up the task definition in the current task's
+ // subtask definitions and in the process's task definitions
+ TaskImpl subtask = createSubTask();
subtask.setName(name);
- addSubTask(subtask);
return subtask;
}
- public Task addSubTask(TaskImpl subtask) {
+ public TaskImpl addSubTask(TaskImpl subtask) {
if (subTasks==null) {
subTasks = new HashSet<TaskImpl>();
}
@@ -331,18 +326,6 @@
public void setDescription(String description) {
this.description = description;
}
- public boolean isBlocking() {
- return isBlocking;
- }
- public void setBlocking(boolean isBlocking) {
- this.isBlocking = isBlocking;
- }
- public boolean isSignalling() {
- return isSignalling;
- }
- public void setSignalling(boolean isSignalling) {
- this.isSignalling = isSignalling;
- }
public int getPriority() {
return priority;
}
@@ -382,10 +365,10 @@
public void setSwimlane(SwimlaneImpl swimlane) {
this.swimlane = swimlane;
}
- public Assignable getSuperTask() {
+ public TaskImpl getSuperTask() {
return superTask;
}
- public void setSuperTask(Assignable superTask) {
+ public void setSuperTask(TaskImpl superTask) {
this.superTask = superTask;
}
public Integer getProgress() {
@@ -421,4 +404,44 @@
public void setProcessInstance(ExecutionImpl processInstance) {
this.processInstance = processInstance;
}
+ public boolean isSignalling() {
+ return isSignalling;
+ }
+ public void setSignalling(boolean isSignalling) {
+ this.isSignalling = isSignalling;
+ }
+
+ public void cancelExecution(String signal) {
+ if (execution!=null){
+ execution.end("cancel");
+ }
+ }
+
+ public void historyTaskCancel(String reason) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskCancel(reason));
+ }
+ }
+
+ public void historyTaskComplete(String outcome) {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskComplete(outcome));
+ }
+ }
+
+ public void historyTaskStart() {
+ if (execution!=null){
+ execution.fireHistoryEvent(new TaskStart(this));
+ }
+ }
+
+ public void signalExecution(String signalName) {
+ if (execution!=null){
+ execution.signal(signalName);
+ }
+ }
+
+ public TaskHandler getTaskHandler() {
+ return DEFAULT_TASK_HANDLER;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskCandidatesTest.java 2009-03-25 07:29:28 UTC (rev 4324)
@@ -63,8 +63,7 @@
assertEquals("review", task.getName());
// lets assume that johndoe takes the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
@@ -121,9 +120,8 @@
task = taskList.get(0);
assertEquals("review", task.getName());
- // submit the task
- taskService.setUserId("johndoe");
- taskService.takeTask(task.getDbid());
+ // take the task
+ taskService.assignTask(task.getDbid(), "johndoe");
// verify that the group task lists are now empty
taskList = taskService.getGroupTaskList("johndoe", 0, 10);
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.identity.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -11,6 +11,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="id" column="ID_" />
+ <property name="password" column="PASSWORD_" />
<property name="givenName" column="GIVENNAME_" />
<property name="familyName" column="FAMILYNAME_" />
</class>
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.task.hbm.xml 2009-03-25 07:29:28 UTC (rev 4324)
@@ -4,19 +4,18 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### SWIMLANE DEFINITION ############################################ -->
- <class name="SwimlaneDefinitionImpl"
- table="JBPM_TASKDEF"
- discriminator-value="S" >
+ <!-- ### ASSIGNABLE DEFINITIONS ######################################### -->
+ <class name="AssignableDefinitionImpl"
+ table="JBPM_ASSIGNDEF"
+ discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
+ <version name="dbversion" column="DBVERSION_" />
- <version name="dbversion" column="DBVERSION_" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
-
<property name="assigneeExpression" column="ASS_EXPR_"/>
<property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
<property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
@@ -24,13 +23,16 @@
<property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
<property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
- <many-to-one name="assignerDescriptor"
- column="ASSIGNER_DESCR_"
+ <many-to-one name="assignmentHandlerDescriptor"
+ column="ASSIGN_DESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_SWL_ASIG_DESCR"
- index="IDX_SWL_ASIG_DESCR" />
+ foreign-key="FK_ASS_ASIGN_DESCR"
+ index="IDX_ASS_ASIGN_DESCR" />
+ <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
+ </subclass>
+
<!-- ### TASK DEFINITION ################################################ -->
<subclass name="TaskDefinitionImpl" discriminator-value="T">
@@ -78,6 +80,7 @@
<property name="create" column="CREATE_"/>
<property name="dueDate" column="DUEDATE_"/>
<property name="progress" column="PROGRESS_"/>
+ <property name="isSignalling" column="SIGNALLING_"/>
<!--
<many-to-one name="variableMap"
17 years, 1 month
JBoss JBPM SVN: r4323 - jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-24 20:29:28 -0400 (Tue, 24 Mar 2009)
New Revision: 4323
Added:
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.lock.hbm.xml
Log:
JBPM-2121: provide alternative Join mapping with PARENTLOCKMODE_ column
Added: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.lock.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.lock.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.lock.hbm.xml 2009-03-25 00:29:28 UTC (rev 4323)
@@ -0,0 +1,13 @@
+<?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 auto-import="false" default-access="field" >
+
+ <subclass name="org.jbpm.graph.node.Join" discriminator-value="J"
+ extends="org.jbpm.graph.def.Node">
+ <property name="parentLockMode" column="PARENTLOCKMODE_"/>
+ </subclass>
+
+</hibernate-mapping>
17 years, 1 month
JBoss JBPM SVN: r4322 - jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/hudson/hudson-home/jobs/jBPM3-Container-Matrix.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-24 19:29:27 -0400 (Tue, 24 Mar 2009)
New Revision: 4322
Modified:
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml
Log:
adjust axes values in container matrix
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml 2009-03-24 23:19:15 UTC (rev 4321)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/hudson/hudson-home/jobs/jBPM3-Container-Matrix/config.xml 2009-03-24 23:29:27 UTC (rev 4322)
@@ -34,7 +34,6 @@
<axis>
<name>container</name>
<values>
- <string>jboss422</string>
<string>jboss423</string>
<string>jboss500</string>
</values>
@@ -42,8 +41,8 @@
<axis>
<name>database</name>
<values>
- <string>hsqldb</string>
- <string>mysql</string>
+ <string>postgresql</string>
+ <string>sybase</string>
</values>
</axis>
<axis>
17 years, 1 month
JBoss JBPM SVN: r4321 - in jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src: main/resources/org/jbpm/graph/node and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-24 19:19:15 -0400 (Tue, 24 Mar 2009)
New Revision: 4321
Modified:
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/java/org/jbpm/graph/node/Join.java
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
Log:
JBPM-2121: revert addition of PARENTLOCKMODE_ column
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/java/org/jbpm/graph/node/Join.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/java/org/jbpm/graph/node/Join.java 2009-03-24 18:31:57 UTC (rev 4320)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/java/org/jbpm/graph/node/Join.java 2009-03-24 23:19:15 UTC (rev 4321)
@@ -42,13 +42,13 @@
private static final long serialVersionUID = 1L;
/**
- * specifies wether what type of hibernate lock should be acquired.
+ * specifies what type of hibernate lock should be acquired.
* null value defaults to LockMode.UPGRADE
*/
String parentLockMode;
/**
- * specifies if this joinhandler is a discriminator.
+ * specifies if this join is a discriminator.
* a descriminator reactivates the parent when the first
* concurrent token enters the join.
*/
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml 2009-03-24 18:31:57 UTC (rev 4320)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/main/resources/org/jbpm/graph/node/Join.hbm.xml 2009-03-24 23:19:15 UTC (rev 4321)
@@ -6,8 +6,6 @@
<hibernate-mapping auto-import="false" default-access="field" >
<subclass name="org.jbpm.graph.node.Join" discriminator-value="J"
- extends="org.jbpm.graph.def.Node">
- <property name="parentLockMode" column="PARENTLOCKMODE_"/>
- </subclass>
+ extends="org.jbpm.graph.def.Node" />
</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-03-24 18:31:57 UTC (rev 4320)
+++ jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/modules/core/src/test/java/org/jbpm/graph/node/JoinDbTest.java 2009-03-24 23:19:15 UTC (rev 4321)
@@ -21,7 +21,6 @@
*/
package org.jbpm.graph.node;
-import org.hibernate.LockMode;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
@@ -44,17 +43,16 @@
try {
processDefinition = graphSession.findLatestProcessDefinition(getName());
+ // JBPM-2112 revert addition of PARENTLOCKMODE_ column
Join join = (Join) processDefinition.getNode("read");
- assertEquals(LockMode.READ.toString(), join.getParentLockMode());
+ assertNull(join.getParentLockMode());
join = (Join) processDefinition.getNode("nowait");
- assertEquals(LockMode.UPGRADE_NOWAIT.toString(), join.getParentLockMode());
+ assertNull(join.getParentLockMode());
join = (Join) processDefinition.getNode("upgrade");
- assertEquals(LockMode.UPGRADE.toString(), join.getParentLockMode());
+ assertNull(join.getParentLockMode());
} finally {
- newTransaction();
graphSession.deleteProcessDefinition(processDefinitionId);
}
-
}
}
17 years, 1 month
JBoss JBPM SVN: r4320 - jbpm3/branches.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-03-24 14:31:57 -0400 (Tue, 24 Mar 2009)
New Revision: 4320
Added:
jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121/
Log:
JBPM-2121: create patch branch
Copied: jbpm3/branches/jbpm-3.2.5.SP4_JBPM-2121 (from rev 4319, jbpm3/tags/jbpm-3.2.5.SP4)
17 years, 1 month