JBoss JBPM SVN: r4735 - in jbpm4/branches/ainze/modules: pvm/src/main/java/org/jbpm/pvm/internal/tx and 33 other directories.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-05-05 16:15:22 -0400 (Tue, 05 May 2009)
New Revision: 4735
Added:
jbpm4/branches/ainze/modules/test-spring/
jbpm4/branches/ainze/modules/test-spring/pom.xml
jbpm4/branches/ainze/modules/test-spring/src/
jbpm4/branches/ainze/modules/test-spring/src/main/
jbpm4/branches/ainze/modules/test-spring/src/main/java/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/SpringConfigurationFactoryBean.java
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java
jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/test/
jbpm4/branches/ainze/modules/test-spring/src/main/resources/
jbpm4/branches/ainze/modules/test-spring/src/test/
jbpm4/branches/ainze/modules/test-spring/src/test/java/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/Constants.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/DecisionTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/StateTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/InvokeTestBean.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/SpringBeanTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/ConfigurationTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/EventListenerTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/HqlEventListenerTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/ExecutionEagerLoadingTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/FindExecutionTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/SignalExecutionTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/StartExecutionTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/AvgDurationTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ChoiceDistributionTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/EndProcessInstanceTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ProcessInstanceHistoryTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/IdentityTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/JobQueryTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ActivityCoordinatesTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/DeploymentResourcesTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ProcessDefinitionQueryTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/RepositoryServiceTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/SubTaskTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCandidatesTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCommentsTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCreateUpdateDeleteTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskHandlerTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskListTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskParticipationsTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskQueryTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/BasicVariablesTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/VariableBasicTypesTest.java
jbpm4/branches/ainze/modules/test-spring/src/test/resources/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/applicationContext.xml
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/process.jpdl.xml
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.cfg.xml
jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.hibernate.cfg.xml
Modified:
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java
Log:
added spring test suite
Modified: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-05-05 19:34:12 UTC (rev 4734)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.tx;
+import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.env.Environment;
@@ -28,47 +29,68 @@
import org.jbpm.pvm.internal.spring.CommandTransactionCallback;
import org.jbpm.pvm.internal.svc.Interceptor;
import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
-import org.springframework.util.Assert;
-
-/** calls setRollbackOnly on the transaction in the environment
- * in case an exception occurs during execution of the command.
+/**
+ * calls setRollbackOnly on the transaction in the environment in case an
+ * exception occurs during execution of the command.
*
* @author Andries Inze
*/
public class SpringTransactionInterceptor extends Interceptor {
-
+
private static final Log log = Log.getLog(SpringTransactionInterceptor.class.getName());
+ private boolean useCurrent;
+
@SuppressWarnings("unchecked")
-public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
- if (environment==null) {
- throw new JbpmException("no environment for managing hibernate transaction");
- }
-
+ public <T> T execute(Command<T> command) {
+ Environment environment = Environment.getCurrent();
+ if (environment == null) {
+ throw new JbpmException("no environment for managing hibernate transaction");
+ }
+
StandardTransaction standardTransaction = environment.get(StandardTransaction.class);
- if (standardTransaction==null) {
- throw new JbpmException("no spring-transaction in environment");
+ if (standardTransaction == null) {
+ throw new JbpmException("no standard-transaction in environment");
}
+
+ PlatformTransactionManager platformTransactionManager = environment.get(PlatformTransactionManager.class);
+ if (platformTransactionManager == null) {
+ throw new JbpmException("No platformTransaction manager defined.");
+ }
+
standardTransaction.begin();
try {
- PlatformTransactionManager platformTransactionManager = environment.get(PlatformTransactionManager.class);
- Assert.notNull(platformTransactionManager);
- TransactionTemplate template = new TransactionTemplate(platformTransactionManager);
- TransactionCallback transactionCallback = new CommandTransactionCallback<T>(command, next, platformTransactionManager);
- return (T) template.execute(transactionCallback);
+ DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
+ if (useCurrent) {
+ definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_MANDATORY);
+ }
+
+ TransactionTemplate template = new TransactionTemplate(platformTransactionManager, definition);
+ TransactionCallback transactionCallback = new CommandTransactionCallback<T>(command, next, platformTransactionManager);
+ T t = (T) template.execute(transactionCallback);
+
+ Session session = environment.get(Session.class);
+ session.flush();
+ return t;
+// return next.execute(command);
} catch (RuntimeException e) {
standardTransaction.setRollbackOnly();
throw e;
-
+
} finally {
standardTransaction.complete();
}
}
+
+ public void setUseCurrent(Boolean useCurrent) {
+ this.useCurrent = useCurrent;
+ }
}
Modified: jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java
===================================================================
--- jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java 2009-05-05 19:34:12 UTC (rev 4734)
+++ jbpm4/branches/ainze/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/SpringTransactionInterceptorBinding.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -23,6 +23,7 @@
import org.jbpm.pvm.internal.tx.SpringTransactionInterceptor;
import org.jbpm.pvm.internal.tx.StandardTransactionInterceptor;
+import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
@@ -42,6 +43,13 @@
public Object parse(Element element, Parse parse, Parser parser) {
SpringTransactionInterceptor springTransactionInterceptor = new SpringTransactionInterceptor();
+
+ Boolean useCurrent = XmlUtil.attributeBoolean(element, "current", false, parse);
+ if (useCurrent!=null) {
+ // set it accordingly
+ springTransactionInterceptor.setUseCurrent(useCurrent);
+ }
+
return new ProvidedObjectDescriptor(springTransactionInterceptor);
}
}
Added: jbpm4/branches/ainze/modules/test-spring/pom.xml
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/pom.xml (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/pom.xml 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,90 @@
+<?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: pom.xml 3558 2008-12-27 12:58:42Z tom.baeyens(a)jboss.com $ -->
+<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 - Spring</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test-spring</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>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test-base</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-pvm</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-mock</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testSourceDirectory>
+ src/main/java
+ </testSourceDirectory>
+ <classesDirectory>target/classes</classesDirectory>
+ <testClassesDirectory>
+ target/classes
+ </testClassesDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Property changes on: jbpm4/branches/ainze/modules/test-spring/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/SpringConfigurationFactoryBean.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/SpringConfigurationFactoryBean.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/SpringConfigurationFactoryBean.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,80 @@
+/**
+ *
+ */
+package org.jbpm.spring.cfg;
+
+import org.hibernate.SessionFactory;
+import org.jbpm.api.cmd.CommandService;
+import org.jbpm.pvm.internal.cfg.SpringConfiguration;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+/**
+ * Factory that creates a singleton SpringConfiguration.
+ *
+ * @author Andries Inze
+ *
+ */
+public class SpringConfigurationFactoryBean implements FactoryBean, ApplicationContextAware {
+
+ private String jbpmConfigurationLocation;
+ private SessionFactory sessionFactory;
+ private CommandService commandService;
+
+ private ApplicationContext applicationContext;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getObject() throws Exception {
+ SpringConfiguration result = new SpringConfiguration(jbpmConfigurationLocation);
+ result.setApplicationContext(applicationContext);
+// result.setSessionFactory(sessionFactory);
+// if (commandService != null) {
+// result.set("commandService", commandService);
+// }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc)
+ */
+ @SuppressWarnings("unchecked")
+ public Class getObjectType() {
+ return SpringConfiguration.class;
+ }
+
+ /**
+ * {@inheritDoc)
+ */
+ public boolean isSingleton() {
+ return true;
+ }
+
+ /**
+ * @param jbpmConfigurationLocation the jbpmConfigurationLocation to set
+ */
+ public void setJbpmConfigurationLocation(String jbpmConfigurationLocation) {
+ this.jbpmConfigurationLocation = jbpmConfigurationLocation;
+ }
+
+ /**
+ * @param sessionFactory the sessionFactory to set
+ */
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext)
+ throws BeansException {
+ this.applicationContext = applicationContext;
+ }
+
+ public void setCommandService(CommandService commandService) {
+ this.commandService = commandService;
+ }
+
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/cfg/SpringConfigurationFactoryBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,163 @@
+/**
+ *
+ */
+package org.jbpm.spring.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.HistoryService;
+import org.jbpm.api.IdentityService;
+import org.jbpm.api.ManagementService;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.cmd.CommandService;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.Db;
+import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
+
+/**
+ * Abstract test class that - builds the application context - runs in 1
+ * transaction - adds convenience methods: e.g. deploying a process.
+ *
+ * @author Andries Inze
+ *
+ */
+public abstract class AbstractTransactionalSpringJbpmTestCase extends AbstractTransactionalDataSourceSpringContextTests {
+
+ private Configuration configuration;
+ protected ProcessEngine processEngine;
+
+ protected RepositoryService repositoryService;
+ protected ExecutionService executionService;
+ protected ManagementService managementService;
+ protected TaskService taskService;
+ protected HistoryService historyService;
+ protected IdentityService identityService;
+
+ protected CommandService commandService;
+
+ protected List<String> taskIds;
+
+ /** 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 = new ArrayList<Long>();
+
+ public AbstractTransactionalSpringJbpmTestCase() {
+ super();
+
+ // AUTOWIRE_BY_NAME is default behavior for Spring version 2.5.x
+ // AUTOWIRE_BY_TYPE is default behavior for Spring version 2.0.8, but
+ // fails because of Hibernate specific instances.
+ setAutowireMode(AUTOWIRE_BY_NAME);
+ }
+
+ /**
+ * {@inheritDoc)
+
+ */
+ protected void injectDependencies() throws Exception {
+ super.injectDependencies();
+
+ configuration = (Configuration) applicationContext.getBean("configuration");
+ processEngine = configuration.buildProcessEngine();
+
+ repositoryService = processEngine.get(RepositoryService.class);
+ executionService = processEngine.getExecutionService();
+ historyService = processEngine.getHistoryService();
+ managementService = processEngine.getManagementService();
+ taskService = processEngine.getTaskService();
+ identityService = processEngine.getIdentityService();
+ commandService = processEngine.get(CommandService.class);
+ }
+
+
+
+ @Override
+ protected void onSetUp() throws Exception {
+ super.onSetUp();
+
+ }
+
+
+
+ @Override
+ protected void onTearDownInTransaction() throws Exception {
+ super.onTearDownInTransaction();
+ for (Long deploymentDbid : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+ }
+
+// Db.verifyClean(processEngine);
+
+ }
+
+ /** deploys the process, keeps a reference to the deployment and
+ * automatically deletes the deployment in the tearDown */
+ public long deployJpdlXmlString(String jpdlXmlString) {
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml", jpdlXmlString)
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ return deploymentDbid;
+ }
+
+ /** registered deployments will be deleted in the tearDown */
+ protected void registerDeployment(long deploymentDbid) {
+ registeredDeployments.add(deploymentDbid);
+ }
+
+ public void assertTextPresent(String expected, String value) {
+
+ //TODO utility!
+ if ( (value==null)
+ || (value.indexOf(expected)==-1)
+ ) {
+ fail("expected presence of '"+expected+"' but was '"+value+"'");
+ }
+ }
+
+ public static void assertContainsTask(List<Task> taskList, String taskName) {
+ if (getTask(taskList, taskName)==null) {
+ fail("tasklist doesn't contain task '"+taskName+"': "+taskList);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ public static Task getTask(List<Task> taskList, String taskName) {
+ for (Task task : taskList) {
+ if (taskName.equals(task.getName())) {
+ return task;
+ }
+ }
+ return null;
+ }
+
+ 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;
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/main/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/Constants.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/Constants.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/Constants.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,31 @@
+/*
+ * 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.spring.test;
+
+
+/**
+ * @author Andries Inze
+ */
+public class Constants {
+
+ public final static String APPLICATIONCONTEXT_LOCATION = "classpath:org/jbpm/spring/test/applicationContext.xml";
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/Constants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/DecisionTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/DecisionTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/DecisionTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,103 @@
+/*
+ * 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.spring.test.activities;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionTest extends AbstractTransactionalSpringJbpmTestCase {
+
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testDecisionExpression() {
+ deployJpdlXmlString(
+ "<process name='Poolcar'>" +
+ " <start>" +
+ " <transition to='How far?' />" +
+ " </start>" +
+ " <decision name='How far?' expr='#{distance}'>" +
+ " <transition name='far' to='Big car' />" +
+ " <transition name='nearby' to='Small car' />" +
+ " </decision>" +
+ " <state name='Big car' />" +
+ " <state name='Small car' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("distance", "far");
+ Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Big car", execution.getActivityName());
+
+ variables.put("distance", "nearby");
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Small car", execution.getActivityName());
+ }
+
+ public void testDecisionWithConditions() {
+ deployJpdlXmlString(
+ "<process name='Poolcar'>" +
+ " <start>" +
+ " <transition to='How far?' />" +
+ " </start>" +
+ " <decision name='How far?'>" +
+ " <transition to='Big car'>" +
+ " <condition expr='#{distance > 10}' />" +
+ " </transition>" +
+ " <transition to='Small car'>" +
+ " <condition expr='#{distance >= 3}' />" +
+ " </transition>" +
+ " <transition to='No car' />" +
+ " </decision>" +
+ " <state name='Big car' />" +
+ " <state name='Small car' />" +
+ " <state name='No car' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("distance", new Integer(69));
+ Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Big car", execution.getActivityName());
+
+ variables.put("distance", new Integer(6));
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Small car", execution.getActivityName());
+
+ variables.put("distance", new Integer(2));
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("No car", execution.getActivityName());
+ }
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/DecisionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/StateTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/StateTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/StateTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,159 @@
+/*
+ * 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.spring.test.activities;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+/**
+ * @author Tom Baeyens
+ */
+public class StateTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testWaitStatesSequence() {
+ deployJpdlXmlString(
+ "<process name='ThreeStates'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'>" +
+ " <transition to='c' />" +
+ " </state>" +
+ " <state name='c'>" +
+ " <transition to='d' />" +
+ " </state>" +
+ " <end name='d' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceById("ThreeStates-1");
+ assertEquals("b", execution.getActivityName());
+
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId);
+ assertEquals("c", execution.getActivityName());
+
+ execution = executionService.signalExecutionById(executionId);
+ assertEquals("d", execution.getActivityName());
+ assertTrue(execution.isEnded());
+ }
+
+ public void testExternalDecision() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='ed' />" +
+ " </start>" +
+ " <state name='ed'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("p", "one");
+ assertEquals("ed", execution.getActivityName());
+ execution = executionService.signalExecutionById("p.one", "left");
+ assertEquals("b", execution.getActivityName());
+
+ executionService.startProcessInstanceById("p-1", "two");
+ execution = executionService.signalExecutionById("p.two", "middle");
+ assertEquals("c", execution.getActivityName());
+
+ executionService.startProcessInstanceById("p-1", "three");
+ execution = executionService.signalExecutionById("p.three", "right");
+ assertEquals("d", execution.getActivityName());
+ }
+
+ public void testDefaultSignalWithNamedTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("p", "one");
+ try {
+ executionService.signalExecutionById("p.one", "left");
+ } catch (JbpmException e) {
+ assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
+ }
+ }
+
+ public void testNamedSignalWithoutMatchingTransition() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("p", "one");
+ Execution execution = executionService.signalExecutionById("p.one", "up");
+ assertEquals("a", execution.getActivityName());
+ }
+
+ public void testDefaultSignalWithoutTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("p", "one");
+ Execution execution = executionService.signalExecutionById("p.one");
+ assertEquals("a", execution.getActivityName());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/activities/StateTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/InvokeTestBean.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/InvokeTestBean.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/InvokeTestBean.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.jbpm.spring.test.beans;
+
+
+/**
+ * @author Andries Inze
+ *
+ */
+public class InvokeTestBean {
+
+ private boolean testMethodHasRun;
+ private boolean testMethodWithParametersHasRun;
+ private boolean testSelectHasRun;
+
+ public void testMethod() {
+ testMethodHasRun = true;
+ }
+
+ public void testMethodWithParameters(String name) {
+ if ("a good test".equals(name)) {
+ testMethodWithParametersHasRun = true;
+ }
+ }
+
+// public String select(OpenExecution execution) {
+// testSelectHasRun = true;
+// return "yes";
+// }
+
+ /**
+ * @return the testMethodHasRun
+ */
+ public boolean isTestMethodHasRun() {
+ return testMethodHasRun;
+ }
+
+ /**
+ * @return the testMethodWithParametersHasRun
+ */
+ public boolean isTestMethodWithParametersHasRun() {
+ return testMethodWithParametersHasRun;
+ }
+
+ /**
+ * @return the testSelectHasRun
+ */
+ public boolean isTestSelectHasRun() {
+ return testSelectHasRun;
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/InvokeTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/SpringBeanTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/SpringBeanTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/SpringBeanTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.jbpm.spring.test.beans;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+/**
+ * @author AIEXM45
+ *
+ */
+public class SpringBeanTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testInvokeSpringBean() {
+ deployJpdlXmlString("org/jbpm/spring/test/beans/process.jpdl.xml");
+
+ InvokeTestBean invokeTestBean = (InvokeTestBean) applicationContext.getBean("testBean");
+
+ Execution execution = executionService
+ .startProcessInstanceByKey("Spring");
+ assertEquals("wait", execution.getActivityName());
+ assertTrue(invokeTestBean.isTestMethodHasRun());
+ assertTrue(invokeTestBean.isTestMethodWithParametersHasRun());
+ assertTrue(invokeTestBean.isTestSelectHasRun());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/beans/SpringBeanTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/ConfigurationTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/ConfigurationTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/ConfigurationTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,68 @@
+/*
+ * 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.spring.test.cfg;
+
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ConfigurationTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testDefaultConfiguration() {
+ ProcessEngine processEngine = new Configuration()
+ .buildProcessEngine();
+ assertNotNull(processEngine);
+ }
+
+ public void testMinimalConfiguration() {
+ ProcessEngine processEngine = new Configuration()
+ .setXmlString("<jbpm-configuration />")
+ .buildProcessEngine();
+ assertNotNull(processEngine);
+ }
+
+ public void testConfigurationServices() {
+ ProcessEngine processEngine = new Configuration()
+ .setXmlString(
+ "<jbpm-configuration>" +
+ " <process-engine-context>" +
+ " <repository-service />" +
+ " <execution-service />" +
+ " <management-service />" +
+ " </process-engine-context>" +
+ "</jbpm-configuration>"
+ )
+ .buildProcessEngine();
+ assertNotNull(processEngine);
+ assertNotNull(processEngine.getExecutionService());
+ assertNotNull(processEngine.getManagementService());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/cfg/ConfigurationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/EventListenerTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/EventListenerTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,241 @@
+/*
+ * 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.spring.test.eventlistener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.listener.EventListener;
+import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EventListenerTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ static boolean isInvoked = false;
+ static List<Integer> order;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ protected void onSetUpInTransaction() throws Exception {
+ isInvoked = false;
+ }
+
+ public static class ProcessStartListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) {
+ assertNotNull(execution.getActivity());
+ assertSame(execution.getActivity(), execution.getProcessDefinition().getInitial());
+ isInvoked = true;
+ }
+ }
+
+ public void testProcessStartListener() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <on event='start'>" +
+ " <event-listener class='"+ProcessStartListener.class.getName()+"' />" +
+ " </on>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+
+ assertTrue("process start listener not invoked", isInvoked);
+ }
+
+ public static class ProcessEndListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) {
+ assertNotNull(execution.getActivity());
+ assertSame(execution.getActivity(), execution.getProcessDefinition().getActivity("end"));
+ isInvoked = true;
+ }
+ }
+
+ public void testProcessEndListener() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <on event='end'>" +
+ " <event-listener class='"+ProcessEndListener.class.getName()+"' />" +
+ " </on>" +
+ " <start>" +
+ " <transition to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+
+ assertTrue("process end listener not invoked", isInvoked);
+ }
+
+ public static class ActivityStartListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) {
+ assertNotNull(execution.getActivity());
+ assertSame(execution.getActivity(), execution.getProcessDefinition().getActivity("s"));
+ isInvoked = true;
+ }
+ }
+
+ public void testActivityStartListener() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='s' />" +
+ " </start>" +
+ " <state name='s'>" +
+ " <on event='start'>" +
+ " <event-listener class='"+ActivityStartListener.class.getName()+"' />" +
+ " </on>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+
+ assertTrue("activity start listener not invoked", isInvoked);
+ }
+
+ public static class ActivityEndListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) {
+ assertNotNull(execution.getActivity());
+ assertSame(execution.getActivity(), execution.getProcessDefinition().getActivity("s"));
+ isInvoked = true;
+ }
+ }
+
+ public void testActivityEndListener() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='s' />" +
+ " </start>" +
+ " <state name='s'>" +
+ " <on event='end'>" +
+ " <event-listener class='"+ActivityStartListener.class.getName()+"' />" +
+ " </on>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+
+ assertFalse("activity end listener invoked too early", isInvoked);
+
+ executionService.signalExecutionById(execution.getId());
+
+ assertTrue("activity end listener not invoked", isInvoked);
+ }
+
+ public static class TransitionListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ public void notify(EventListenerExecution execution) {
+ assertNotNull(execution.getTransition());
+ isInvoked = true;
+ }
+ }
+
+ public void testTransitionListener() {
+ order = new ArrayList<Integer>();
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='end'>" +
+ " <event-listener class='"+TransitionListener.class.getName()+"' />" +
+ " </transition>" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+
+ assertTrue("transition listener not invoked", isInvoked);
+ }
+
+ public static class OrderListener implements EventListener {
+ private static final long serialVersionUID = 1L;
+ int i;
+ public void notify(EventListenerExecution execution) {
+ order.add(i);
+ }
+ }
+
+ public void testEventOrdering() {
+ order = new ArrayList<Integer>();
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='end'>" +
+ " <event-listener class='"+OrderListener.class.getName()+"'>" +
+ " <field name='i'><int value='1' /></field> " +
+ " </event-listener>" +
+ " <event-listener class='"+OrderListener.class.getName()+"'>" +
+ " <field name='i'><int value='2' /></field> " +
+ " </event-listener>" +
+ " <event-listener class='"+OrderListener.class.getName()+"'>" +
+ " <field name='i'><int value='3' /></field> " +
+ " </event-listener>" +
+ " <event-listener class='"+OrderListener.class.getName()+"'>" +
+ " <field name='i'><int value='4' /></field> " +
+ " </event-listener>" +
+ " <event-listener class='"+OrderListener.class.getName()+"'>" +
+ " <field name='i'><int value='5' /></field> " +
+ " </event-listener>" +
+ " </transition>" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+
+ List<Integer> expectedOrder = new ArrayList<Integer>();
+ expectedOrder.add(1);
+ expectedOrder.add(2);
+ expectedOrder.add(3);
+ expectedOrder.add(4);
+ expectedOrder.add(5);
+
+ assertEquals(expectedOrder, order);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/EventListenerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/HqlEventListenerTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/HqlEventListenerTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/HqlEventListenerTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,83 @@
+package org.jbpm.spring.test.eventlistener;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+public class HqlEventListenerTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ long taskLaundryDbid;
+ long taskDishesDbid;
+ long taskIronDbid;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ protected void onSetUpInTransaction() throws Exception {
+
+ // add task laundry
+ Task task = taskService.newTask();
+ task.setName("laundry");
+ taskLaundryDbid = taskService.saveTask(task);
+
+ // add task dishes
+ task = taskService.newTask();
+ task.setName("dishes");
+ taskDishesDbid = taskService.saveTask(task);
+
+ // add task iron
+ task = taskService.newTask();
+ task.setName("iron");
+ taskIronDbid = taskService.saveTask(task);
+ }
+
+ protected void onTearDownInTransaction() throws Exception {
+ taskService.deleteTask(taskLaundryDbid);
+ taskService.deleteTask(taskDishesDbid);
+ taskService.deleteTask(taskIronDbid);
+
+ }
+
+
+ public void testHql() {
+ deployJpdlXmlString(
+ "<process name='HqlEventListener' xmlns='http://jbpm.org/4.0/jpdl'>" +
+ " <start >" +
+ " <transition to='wait' />" +
+ " </start>" +
+ " <state name='wait'>" +
+ " <on event='start'>" +
+ " <hql var='tasknames with i'>" +
+ " <query>" +
+ " select task.name" +
+ " from org.jbpm.pvm.internal.task.TaskImpl as task" +
+ " where task.name like :taskName" +
+ " </query>" +
+ " <parameters>" +
+ " <string name='taskName' value='%i%' />" +
+ " </parameters>" +
+ " </hql>" +
+ " </on>" +
+ " </state>" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("HqlEventListener");
+ String executionId = execution.getId();
+
+ Set<String> expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("iron");
+ Collection<String> taskNames = (Collection<String>) executionService.getVariable(executionId, "tasknames with i");
+ taskNames = new HashSet<String>(taskNames);
+ assertEquals(expectedTaskNames, taskNames);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/eventlistener/HqlEventListenerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/ExecutionEagerLoadingTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/ExecutionEagerLoadingTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/ExecutionEagerLoadingTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,85 @@
+/*
+ * 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.spring.test.execution;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecutionEagerLoadingTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testEagerLoading() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='f' />" +
+ " </start>" +
+ " <fork name='f'>" +
+ " <transition to='f1' />" +
+ " <transition to='f2' />" +
+ " </fork>" +
+ " <fork name='f1'>" +
+ " <transition to='s11' />" +
+ " <transition to='s12' />" +
+ " </fork>" +
+ " <fork name='f2'>" +
+ " <transition to='s21' />" +
+ " <transition to='s22' />" +
+ " </fork>" +
+ " <state name ='s11' />" +
+ " <state name ='s12' />" +
+ " <state name ='s21' />" +
+ " <state name ='s22' />" +
+ "</process>"
+ );
+
+ Execution processInstance = executionService.startProcessInstanceByKey("p");
+
+ processInstance = executionService.findExecutionById(processInstance.getId());
+
+ assertNotNull(processInstance.findActiveExecutionIn("s11"));
+ assertNotNull(processInstance.findActiveExecutionIn("s12"));
+ assertNotNull(processInstance.findActiveExecutionIn("s21"));
+ assertNotNull(processInstance.findActiveExecutionIn("s22"));
+
+ processInstance = executionService.findExecutionById(processInstance.getId());
+
+ assertEquals(6, processInstance.getExecutions().size());
+
+ processInstance = executionService.findExecutionById(processInstance.getId());
+
+ assertEquals(1, processInstance.getExecutionsMap().size());
+
+ processInstance = executionService.findExecutionById(processInstance.getId());
+
+ assertNotNull(processInstance.getExecution(null));
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/ExecutionEagerLoadingTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/FindExecutionTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/FindExecutionTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/FindExecutionTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,56 @@
+/*
+ * 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.spring.test.execution;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindExecutionTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testFindExecutionById() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("p");
+
+ // take the id and see if the execution service can still find it back
+ execution = executionService.findExecutionById(execution.getId());
+ assertNotNull(execution);
+ assertEquals("a", execution.getActivityName());
+ }
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/FindExecutionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/SignalExecutionTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/SignalExecutionTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/SignalExecutionTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -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.spring.test.execution;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SignalExecutionTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testSignalExecutionById() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b' />" +
+ " </state>" +
+ " <state name='b'>" +
+ " <transition to='c' />" +
+ " </state>" +
+ " <state name='c' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL", "82436");
+
+ assertEquals("a", execution.getActivityName());
+
+ execution = executionService.signalExecutionById("ICL.82436");
+
+ assertEquals("b", execution.getActivityName());
+
+ execution = executionService.signalExecutionById("ICL.82436");
+
+ assertEquals("c", execution.getActivityName());
+ }
+
+ public void testSignalExecutionWithVariables() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <transition to='b' />" +
+ " </state>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL", "82436");
+
+ Map<String,Object> variables = new HashMap<String,Object>();
+ variables.put("customer", "John Doe");
+ variables.put("type", "Accident");
+ variables.put("amount", new Float(763.74));
+
+ execution = executionService.signalExecutionById("ICL.82436", variables);
+
+ assertNotNull(execution);
+ String executionId = execution.getId();
+ assertEquals("b", execution.getActivityName());
+
+ Map<String,Object> expectedVariables = new HashMap<String, Object>(variables);
+ Set<String> expectedVariableNames = new HashSet<String>(expectedVariables.keySet());
+ Set<String> variableNames = new HashSet<String>(executionService.getVariableNames(executionId));
+ assertEquals(expectedVariableNames, variableNames);
+
+ variables = executionService.getVariables(executionId, variableNames);
+ assertEquals(expectedVariables, variables);
+ }
+
+
+ public void testDefaultSignalWithoutTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("p");
+ execution = executionService.signalExecutionById(execution.getId());
+ assertEquals("a", execution.getActivityName());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/SignalExecutionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/StartExecutionTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/StartExecutionTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/StartExecutionTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,222 @@
+/*
+ * 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.spring.test.execution;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartExecutionTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testStartNewExecutionByKey() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+
+ assertNotNull(execution);
+ assertEquals("a", execution.getActivityName());
+ }
+
+ public void testStartNewExecutionInLatestProcessDefinition() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+
+ assertNotNull(execution);
+ assertEquals("a", execution.getActivityName());
+
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ execution = executionService.startProcessInstanceByKey("ICL");
+
+ assertNotNull(execution);
+ assertEquals("b", execution.getActivityName());
+ }
+
+ public void testStartExecutionInLatestByNameWithVariables() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b' />" +
+ "</process>"
+ );
+
+ // create variables that are fed into the process before it starts executing
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("a", new Integer(1));
+ variables.put("b", "text");
+
+ // feed the variables in
+ Execution execution = executionService.startProcessInstanceByKey("ICL", variables);
+ String executionId = execution.getId();
+ assertEquals("b", execution.getActivityName());
+
+ // verify that the variables are actually set
+ assertEquals(new Integer(1), executionService.getVariable(executionId, "a"));
+ assertEquals("text", executionService.getVariable(executionId, "b"));
+
+ // in the generated id, we can see if the right process definition version was taken
+ assertTrue(execution.getId().startsWith("ICL."));
+ }
+
+ public void testStartNewProcessInstanceWithAKey() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL", "one");
+
+ assertNotNull(execution);
+ assertEquals("ICL.one", execution.getId());
+ }
+
+ public void testStartNewProcessInstanceWithVariables() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ Map<String,Object> variables = new HashMap<String,Object>();
+ variables.put("customer", "John Doe");
+ variables.put("type", "Accident");
+ variables.put("amount", new Float(763.74));
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL", variables);
+
+ String executionId = execution.getId();
+
+ assertNotNull(execution);
+
+ Map<String,Object> expectedVariables = new HashMap<String, Object>(variables);
+ Set<String> expectedVariableNames = new HashSet<String>(expectedVariables.keySet());
+ Set<String> variableNames = new HashSet<String>(executionService.getVariableNames(executionId));
+ assertEquals(expectedVariableNames, variableNames);
+
+ variables = executionService.getVariables(executionId, variableNames);
+ assertEquals(expectedVariables, variables);
+ }
+
+ public void testStartExecutionById() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ // start an execution for the process with the given id
+ Execution execution = executionService.startProcessInstanceById("ICL-1");
+ assertNotNull(execution);
+
+ // checking the state
+ assertEquals("a", execution.getActivityName());
+
+ // checking the generated id
+ assertNull(execution.getName());
+ assertNull(execution.getKey());
+ // if there is no user defined name or key specified in the execution,
+ // the default id generator will create a unique id like this: processDefinitionId/execution.dbid
+ assertTrue(execution.getId().startsWith("ICL."));
+ // the last part of the execution key should be the dbid.
+ Long.parseLong(execution.getId().substring(4));
+ }
+
+ public void testStartExecutionByIdWithVariables() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ // create the map with variables
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("a", new Integer(1));
+ variables.put("b", "text");
+
+ // provide the variables in the start execution method
+ Execution execution = executionService.startProcessInstanceById("ICL-1", variables);
+ String executionId = execution.getId();
+
+ assertEquals(new Integer(1), executionService.getVariable(executionId, "a"));
+ assertEquals("text", executionService.getVariable(executionId, "b"));
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/execution/StartExecutionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/AvgDurationTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/AvgDurationTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/AvgDurationTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,89 @@
+/*
+ * 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.spring.test.history;
+
+import java.util.Map;
+
+import org.jbpm.api.Execution;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AvgDurationTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testAvgDuration() throws Exception {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='one' />" +
+ " </start>" +
+ " <state name='one'>" +
+ " <transition to='two' />" +
+ " </state>" +
+ " <state name='two'>" +
+ " <transition to='three' />" +
+ " </state>" +
+ " <state name='three'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executeProcess();
+ executeProcess();
+ executeProcess();
+
+ Map<String, Long> avgDurations = historyService.avgDurationPerActivity("ICL-1");
+
+
+ Long avgDurationOne = avgDurations.get("one");
+ assertNotNull(avgDurationOne);
+ assertTrue("expected avg duration bigger then 40, but was"+avgDurationOne, avgDurationOne>40);
+ Long avgDurationTwo = avgDurations.get("two");
+ assertNotNull(avgDurationTwo);
+ assertTrue("expected avg duration bigger then 10, but was"+avgDurationTwo, avgDurationTwo>10);
+ Long avgDurationThree = avgDurations.get("three");
+ assertNotNull(avgDurationThree);
+ assertTrue("expected avg duration bigger then 0, but was"+avgDurationThree, avgDurationThree>=0);
+
+ assertEquals(3, avgDurations.size());
+ }
+
+ protected void executeProcess() throws InterruptedException {
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+ Thread.sleep(50);
+ executionService.signalExecutionById(execution.getId());
+ Thread.sleep(20);
+ executionService.signalExecutionById(execution.getId());
+ executionService.signalExecutionById(execution.getId());
+ }
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/AvgDurationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ChoiceDistributionTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ChoiceDistributionTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ChoiceDistributionTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,80 @@
+/*
+ * 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.spring.test.history;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ChoiceDistributionTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testDecisionExpression() {
+ deployJpdlXmlString(
+ "<process name='Transport Selection' key='TRS'>" +
+ " <start>" +
+ " <transition to='How far?' />" +
+ " </start>" +
+ " <decision name='How far?' expr='#{distance}'>" +
+ " <transition name='far' to='Big car' />" +
+ " <transition name='nearby' to='Small car' />" +
+ " <transition name='other country' to='Airoplane' />" +
+ " </decision>" +
+ " <state name='Big car' />" +
+ " <state name='Small car' />" +
+ " <state name='Airoplane' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("distance", "far");
+ executionService.startProcessInstanceByKey("TRS", variables);
+
+ variables.put("distance", "nearby");
+ executionService.startProcessInstanceByKey("TRS", variables);
+ executionService.startProcessInstanceByKey("TRS", variables);
+ executionService.startProcessInstanceByKey("TRS", variables);
+
+ variables.put("distance", "other country");
+ executionService.startProcessInstanceByKey("TRS", variables);
+ executionService.startProcessInstanceByKey("TRS", variables);
+
+ Map<String, Integer> choiceDistribution = historyService.choiceDistribution("TRS-1", "How far?");
+
+ assertEquals(1, (int)choiceDistribution.get("far"));
+ assertEquals(3, (int)choiceDistribution.get("nearby"));
+ assertEquals(2, (int)choiceDistribution.get("other country"));
+
+ }
+
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ChoiceDistributionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/EndProcessInstanceTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/EndProcessInstanceTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/EndProcessInstanceTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,71 @@
+/*
+ * 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.spring.test.history;
+
+import java.util.List;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndProcessInstanceTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testCancelProcessInstance() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='wait' />" +
+ " </start>" +
+ " <state name='wait'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = execution.getId();
+ executionService.endProcessInstance(processInstanceId, Execution.STATE_CANCELLED);
+
+ List<Execution> executions = executionService.createProcessInstanceQuery()
+ .processInstanceId(processInstanceId)
+ .list();
+ assertEquals(0, executions.size());
+
+ HistoryProcessInstance historyProcessInstance = historyService.createHistoryProcessInstanceQuery()
+ .processInstanceId(processInstanceId)
+ .uniqueResult();
+
+ assertNotNull(historyProcessInstance.getEndTime());
+ assertEquals(Execution.STATE_CANCELLED, historyProcessInstance.getState());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/EndProcessInstanceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ProcessInstanceHistoryTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ProcessInstanceHistoryTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -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.spring.test.history;
+
+import java.util.List;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstanceQuery;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceHistoryTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testProcessInstanceHistory() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ICL");
+ executionService.startProcessInstanceByKey("ICL");
+ executionService.startProcessInstanceByKey("ICL");
+
+ List<HistoryProcessInstance> historyProcessInstances = historyService
+ .createHistoryProcessInstanceQuery()
+ .processDefinitionId("ICL-1")
+ .orderAsc(HistoryProcessInstanceQuery.PROPERTY_STARTTIME)
+ .list();
+
+ assertEquals(3, historyProcessInstances.size());
+
+ for (HistoryProcessInstance historyProcessInstance: historyProcessInstances) {
+ assertTrue(historyProcessInstance.getProcessInstanceId().startsWith("ICL"));
+ assertEquals(HistoryProcessInstance.STATE_ENDED, historyProcessInstance.getState());
+ assertNotNull(historyProcessInstance.getStartTime());
+ assertNotNull(historyProcessInstance.getEndTime());
+ }
+
+ // also check that the ended process instances have been removed from the
+ // runtime database
+ List<Execution> executions = executionService
+ .createProcessInstanceQuery()
+ .processDefinitionId("ICL-1")
+ .list();
+
+ assertEquals(0, executions.size());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/history/ProcessInstanceHistoryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/IdentityTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/IdentityTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/IdentityTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,84 @@
+/*
+ * 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.spring.test.identity;
+
+import java.util.List;
+
+import org.jbpm.api.IdentityService;
+import org.jbpm.api.identity.Group;
+import org.jbpm.api.identity.User;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class IdentityTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testSingleUser() throws Exception {
+ IdentityService identityService = processEngine.get(IdentityService.class);
+
+ identityService.createUser("johndoe", "johndoe", "John", "Doe");
+
+ List<User> users = identityService.findUsers();
+ assertNotNull(users);
+ assertEquals(1, users.size());
+
+ User johndoe = users.get(0);
+ assertEquals("johndoe", johndoe.getId());
+ assertEquals("John", johndoe.getGivenName());
+ assertEquals("Doe", johndoe.getFamilyName());
+ assertEquals("John Doe", johndoe.toString());
+
+ identityService.deleteUser("johndoe");
+
+ assertEquals(0, identityService.findUsers().size());
+ }
+
+ public void testSingleGroup() throws Exception {
+ IdentityService identityService = processEngine.get(IdentityService.class);
+
+ identityService.createUser("johndoe", "johndoe", "John", "Doe");
+ identityService.createUser("joesmoe", "joesmoe", "Joe", "Smoe");
+ identityService.createUser("jackblack", "jackblack", "Jack", "Black");
+
+ String redhatId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
+ String jbossId = identityService.createGroup("jboss", Group.TYPE_UNIT, "redhat");
+ String jbpmId = identityService.createGroup("jbpm", Group.TYPE_UNIT, "jboss");
+
+ identityService.createMembership("johndoe", jbpmId, "developer");
+ identityService.createMembership("joesmoe", jbpmId, "developer");
+ identityService.createMembership("jackblack", jbossId, "manager");
+
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("jackblack", Group.TYPE_UNIT);
+
+ assertEquals(1, groups.size());
+ Group group = groups.get(0);
+ assertEquals("unit.jboss", group.getId());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/identity/IdentityTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/JobQueryTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/JobQueryTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/JobQueryTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,115 @@
+package org.jbpm.spring.test.mgmt;
+
+import java.util.List;
+
+import org.jbpm.api.job.Job;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+public class JobQueryTest extends AbstractTransactionalSpringJbpmTestCase {
+
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testQueryOutstandingTimers() {
+ deployJpdlXmlString(
+ "<process name='TimerQueryTest' >" +
+ " <start>" +
+ " <transition to='t' />" +
+ " </start>" +
+ " <state name='t'>" +
+ " <transition name='timeout' to='t'>" +
+ " <timer duedate='20 seconds' />" +
+ " </transition>" +
+ " </state>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("TimerQueryTest");
+ executionService.startProcessInstanceByKey("TimerQueryTest");
+ executionService.startProcessInstanceByKey("TimerQueryTest");
+ executionService.startProcessInstanceByKey("TimerQueryTest");
+
+ List<Job> timers = managementService.createJobQuery()
+ .timers()
+ .list();
+
+ assertEquals(4, timers.size());
+ }
+
+ public void testQueryBacklogMessages() {
+ deployJpdlXmlString(
+ "<process name='MessagesQueryTest' >" +
+ " <start>" +
+ " <transition to='t' />" +
+ " </start>" +
+ " <state name='t' async='true' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("MessagesQueryTest");
+ executionService.startProcessInstanceByKey("MessagesQueryTest");
+ executionService.startProcessInstanceByKey("MessagesQueryTest");
+ executionService.startProcessInstanceByKey("MessagesQueryTest");
+
+ List<Job> timers = managementService.createJobQuery()
+ .messages()
+ .list();
+
+ assertEquals(4, timers.size());
+ }
+
+
+ public static class Dog {
+ public void bark() {
+ throw new RuntimeException("wooof");
+ }
+ }
+ public void testErrorMessages() {
+ deployJpdlXmlString(
+ "<process name='ErrorMsgQueryTest' >" +
+ " <start>" +
+ " <transition to='t' />" +
+ " </start>" +
+ " <java name='t' " +
+ " async='true' " +
+ " class='"+Dog.class.getName()+"'" +
+ " method='bark'>" +
+ " </java>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("ErrorMsgQueryTest");
+ executionService.startProcessInstanceByKey("ErrorMsgQueryTest");
+ executionService.startProcessInstanceByKey("ErrorMsgQueryTest");
+
+
+ List<Job> messages = managementService.createJobQuery()
+ .messages()
+ .list();
+
+ assertEquals(3, messages.size());
+
+ managementService.executeJob(messages.get(0).getDbid());
+ managementService.executeJob(messages.get(0).getDbid());
+ managementService.executeJob(messages.get(0).getDbid());
+
+ List<Job> errorJobs = managementService.createJobQuery()
+ .exception()
+ .list();
+
+ assertEquals(1, errorJobs.size());
+
+ assertTextPresent("wooof", errorJobs.get(0).getException());
+
+ messages = managementService.createJobQuery()
+ .messages()
+ .list();
+
+ assertEquals(2, messages.size());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/mgmt/JobQueryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ActivityCoordinatesTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ActivityCoordinatesTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ActivityCoordinatesTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,79 @@
+/*
+ * 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.spring.test.process;
+
+import org.jbpm.api.model.ActivityCoordinates;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityCoordinatesTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testActivityCoordinates() {
+ deployJpdlXmlString(
+ "<process name='ActivityCoordinatesProcess'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' g='96,16,75,52' />" +
+ "</process>"
+ );
+
+ String processDefinitionId = repositoryService.createProcessDefinitionQuery()
+ .key("ActivityCoordinatesProcess")
+ .uniqueResult()
+ .getId();
+
+ ActivityCoordinates activityCoordinates = repositoryService.getActivityCoordinates(processDefinitionId, "a");
+ assertEquals(96, activityCoordinates.getX());
+ assertEquals(16, activityCoordinates.getY());
+ assertEquals(75, activityCoordinates.getWidth());
+ assertEquals(52, activityCoordinates.getHeight());
+ }
+
+ public void testUnexistingCoordinates() {
+ deployJpdlXmlString(
+ "<process name='ActivityCoordinatesProcess'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ String processDefinitionId = repositoryService.createProcessDefinitionQuery()
+ .key("ActivityCoordinatesProcess")
+ .uniqueResult()
+ .getId();
+
+ ActivityCoordinates activityCoordinates = repositoryService.getActivityCoordinates(processDefinitionId, "a");
+ assertNull(activityCoordinates);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ActivityCoordinatesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/DeploymentResourcesTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/DeploymentResourcesTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/DeploymentResourcesTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,132 @@
+/*
+ * 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.spring.test.process;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeploymentResourcesTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testProcessWithNameOnly() {
+ byte[] lotOfBytes = generateString("a lot of bytes ", 5000).getBytes();
+ byte[] otherBytes = generateString("other bytes ", 5000).getBytes();
+
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='Insurance claim'>" +
+ " <start />" +
+ "</process>")
+ .addResourceFromInputStream("a lot of attachment", new ByteArrayInputStream(lotOfBytes))
+ .addResourceFromInputStream("other attachment", new ByteArrayInputStream(otherBytes))
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ InputStream stream = repositoryService.getResourceAsStream(deploymentDbid, "a lot of attachment");
+ byte[] retrievedLotOfBytes = readBytes(stream);
+ assertNotNull(retrievedLotOfBytes);
+ assertTrue(Arrays.equals(lotOfBytes, retrievedLotOfBytes));
+
+ stream = repositoryService.getResourceAsStream(deploymentDbid, "other attachment");
+ byte[] retrievedOtherBytes = readBytes(stream);
+ assertNotNull(retrievedOtherBytes);
+ assertTrue(Arrays.equals(otherBytes, retrievedOtherBytes));
+ }
+
+ public void testLoadProcessAsResource() {
+ ClassLoader classLoader = DeploymentResourcesTest.class.getClassLoader();
+ InputStream inputStream = classLoader.getResourceAsStream("org/jbpm/test/process/process.jpdl.xml");
+ assertNotNull(inputStream);
+
+ long deploymentDbid =
+ repositoryService.createDeployment()
+ .addResourceFromInputStream("process.jpdl.xml", inputStream)
+ .deploy();
+
+ registerDeployment(deploymentDbid);
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("Resource")
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ }
+
+ protected String generateString(String base, int multiplier) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i=0; i<multiplier; i++) {
+ buffer.append(base);
+ }
+ String string = buffer.toString();
+ return string;
+ }
+
+ public static byte[] readBytes(InputStream inputStream) {
+ byte[] bytes = null;
+ if (inputStream==null) {
+ throw new JbpmException("inputStream is null");
+ }
+ try {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ transfer(inputStream, outputStream);
+ bytes = outputStream.toByteArray();
+ outputStream.close();
+ return bytes;
+ } catch (IOException e) {
+ throw new JbpmException("couldn't read bytes from inputStream", e);
+ }
+ }
+ public static int transfer(InputStream in, OutputStream out) {
+ int total = 0;
+ byte[] buffer = new byte[4096];
+ try {
+ int bytesRead = in.read( buffer );
+ while ( bytesRead != -1 ) {
+ out.write( buffer, 0, bytesRead );
+ total += bytesRead;
+ bytesRead = in.read( buffer );
+ }
+ return total;
+ } catch (IOException e) {
+ throw new JbpmException("couldn't write bytes to output stream", e);
+ }
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/DeploymentResourcesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ProcessDefinitionQueryTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ProcessDefinitionQueryTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ProcessDefinitionQueryTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,146 @@
+/*
+ * 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.spring.test.process;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessDefinitionQuery;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessDefinitionQueryTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+
+
+ public void testQueryProcessDefinitionsNameLike() {
+ deployJpdlXmlString(
+ "<process name='make print'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='use phone'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='make friends'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='clean whiteboard'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='fix coffeemaker'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .nameLike("%make%")
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
+ .list();
+
+ assertEquals("fix coffeemaker", processDefinitions.get(0).getName());
+ assertEquals("make friends", processDefinitions.get(1).getName());
+ assertEquals("make print", processDefinitions.get(2).getName());
+ }
+
+ public void testQueryProcessDefinitionsEmpty() {
+ List<ProcessDefinition> processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .list();
+
+ assertEquals(0, processDefinitions.size());
+ }
+
+ public void testQueryProcessDefinitionsKeyLike() {
+ deployJpdlXmlString(
+ "<process name='make print'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='use phone'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='make friends'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='make friends'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='make friends'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='clean whiteboard'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='fix coffeemaker'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .nameLike("make%")
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_ID)
+ .list();
+
+ assertEquals("make_friends-1", processDefinitions.get(0).getId());
+ assertEquals("make_friends-2", processDefinitions.get(1).getId());
+ assertEquals("make_friends-3", processDefinitions.get(2).getId());
+ assertEquals("make_print-1", processDefinitions.get(3).getId());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/ProcessDefinitionQueryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/RepositoryServiceTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/RepositoryServiceTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/RepositoryServiceTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,385 @@
+/*
+ * 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.spring.test.process;
+
+import java.util.List;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessDefinitionQuery;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RepositoryServiceTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testProcessWithNameOnly() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("Insurance_claim")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("Insurance_claim", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Insurance_claim-1", processDefinition.getId());
+ }
+
+ public void testProcessWithNameAndKey() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("ICL")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("ICL", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("ICL-1", processDefinition.getId());
+ }
+
+ // interface methods ////////////////////////////////////////////////////////
+
+ public void testFindProcessByKey() {
+ deployJpdlXmlString(
+ "<process name='Name with spaces'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("Name_with_spaces")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("Name with spaces", processDefinition.getName());
+ assertEquals("Name_with_spaces", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Name_with_spaces-1", processDefinition.getId());
+ }
+
+ public void testFindProcessDefinitions() {
+ deployMultipleVersionsOfProcesses();
+
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("nuclear_fusion")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .list();
+ assertNotNull(processDefinitions);
+
+ assertEquals("expected 3 but was " + processDefinitions.size() + ": " + processDefinitions, 3, processDefinitions.size());
+ assertEquals("nuclear fusion", processDefinitions.get(0).getName());
+ assertEquals(3, processDefinitions.get(0).getVersion());
+
+ assertEquals("nuclear fusion", processDefinitions.get(1).getName());
+ assertEquals(2, processDefinitions.get(1).getVersion());
+
+ assertEquals("nuclear fusion", processDefinitions.get(2).getName());
+ assertEquals(1, processDefinitions.get(2).getVersion());
+ }
+
+ public void testFindLatestProcessDefinition() {
+ deployMultipleVersionsOfProcesses();
+
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .key("nuclear_fusion")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .page(0,1)
+ .uniqueResult();
+ assertNotNull(processDefinition);
+
+ assertEquals(3, processDefinition.getVersion());
+ assertEquals("nuclear fusion", processDefinition.getName());
+ assertEquals("nuclear_fusion", processDefinition.getKey());
+ }
+
+ public void testFindProcessDefinitionById() {
+ deployJpdlXmlString(
+ "<process name='given' version='33'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // load it
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .id("given-33")
+ .uniqueResult();
+
+ assertNotNull(processDefinition);
+ assertEquals("given", processDefinition.getName());
+ assertEquals(33, processDefinition.getVersion());
+ }
+
+ public void testDeleteDeployment() {
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='deleteme' version='33'>" +
+ " <start />" +
+ "</process>")
+ .deploy();
+
+ // delete it
+ repositoryService.deleteDeployment(deploymentDbid);
+
+ // check if the db is empty
+ assertEquals(0, repositoryService.createProcessDefinitionQuery().list().size());
+ }
+
+ public void testDeleteProcessDefinitionAndInstances() {
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml",
+ "<process name='deleteme' version='33'>" +
+ " <start>" +
+ " <transition to='w' />" +
+ " </start>" +
+ " <state name='w' />" +
+ "</process>")
+ .deploy();
+
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+
+ // delete it all
+ repositoryService.deleteDeploymentCascade(deploymentDbid);
+
+ // check if the db is empty
+ assertEquals(0, repositoryService.createProcessDefinitionQuery().list().size());
+ assertEquals(0, executionService.createProcessInstanceQuery().list().size());
+ }
+
+ public void testDeleteProcessDefinitionButNotInstances() {
+ long deploymentDbid = deployJpdlXmlString(
+ "<process name='deleteme' version='33'>" +
+ " <start>" +
+ " <transition to='w' />" +
+ " </start>" +
+ " <state name='w' />" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+ executionService.startProcessInstanceByKey("deleteme");
+
+ // delete it all
+ try {
+ repositoryService.deleteDeployment(deploymentDbid);
+ fail("expected exception");
+ } catch (JbpmException e) {
+ assertTextPresent("cannot delete deployment", e.getMessage());
+ assertTextPresent("still executions for process(deleteme): ", e.getMessage());
+ }
+ }
+
+ // various other aspects ////////////////////////////////////////////////////
+
+ public void testAutomaticVersioning() {
+ deployJpdlXmlString(
+ "<process name='versionme'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // look it up again
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("versionme")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .list();
+
+ assertNotNull(processDefinitions);
+ // verify that there is only one
+ assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
+ ProcessDefinition processDefinition = processDefinitions.get(0);
+ // and check that automatically assigned version starts with 1
+ assertEquals(1, processDefinition.getVersion());
+
+ deployJpdlXmlString(
+ "<process name='versionme'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // look them up again
+ processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("versionme")
+ .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
+ .list();
+
+ // verify that there is only one
+ assertEquals(processDefinitions.toString(), 2, processDefinitions.size());
+ // and check that automatically assigned version starts with 1
+ assertEquals(2, processDefinitions.get(0).getVersion());
+ assertEquals(1, processDefinitions.get(1).getVersion());
+ }
+
+ public void testUserProvidedVersion() {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ // load it
+ List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
+ .key("takethis")
+ .list();
+
+ assertNotNull(processDefinitions);
+ assertEquals(processDefinitions.toString(), 1, processDefinitions.size());
+ ProcessDefinition processDefinition = processDefinitions.get(0);
+ // verify that the user specified version was used
+ // (and not overwritten by an automatically assigned versioning)
+ assertEquals(234, processDefinition.getVersion());
+ }
+
+ public void testDuplicateUserProvidedVersion() {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ try {
+ deployJpdlXmlString(
+ "<process name='takethis' version='234'>" +
+ " <start />" +
+ "</process>"
+ );
+ fail("expected exception");
+ } catch (JbpmException e) {
+ assertTextPresent("process 'takethis-234' already exists", e.getMessage());
+ }
+ }
+
+ /**
+ * deploys 3 versions of process with name 'nuclear fusion', 2 versions of the processes 'ultimate seduction' and
+ * 'publish book'
+ */
+ void deployMultipleVersionsOfProcesses() {
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='ultimate seduction'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='publish book'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='nuclear fusion'>" +
+ " <start />" +
+ "</process>"
+ );
+ }
+
+ public void testMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start>" +
+ " <transition to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("minimal");
+
+ assertEquals("end", execution.getActivityName());
+ assertTrue(execution.isEnded());
+ assertFalse(execution.isActive());
+ }
+
+ public void testMostMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("minimal");
+
+ assertTrue(execution.isEnded());
+ assertFalse(execution.isActive());
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/process/RepositoryServiceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/SubTaskTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/SubTaskTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/SubTaskTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,171 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubTaskTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testTaskParticipants() {
+
+ // create top level task
+ // * clean da house
+
+ Task task = taskService.newTask();
+ task.setName("clean da house");
+ long taskDbid = taskService.saveTask(task);
+
+ // create 3 sub tasks:
+ // * clean da house
+ // * dishes
+ // * laundry
+ // * sweep floor
+
+ Task subTask = taskService.newTask(taskDbid);
+ subTask.setName("dishes");
+ long dishesTaskDbid = taskService.saveTask(subTask);
+
+ subTask = taskService.newTask(taskDbid);
+ subTask.setName("laundry");
+ long laundryTaskDbid = taskService.saveTask(subTask);
+
+ subTask = taskService.newTask(taskDbid);
+ subTask.setName("sweep floor");
+ long sweepFloorTaskDbid = taskService.saveTask(subTask);
+
+ // verify 3 sub tasks of clean da house
+
+ List<Task> subTasks = taskService.getSubTasks(taskDbid);
+ Set<String> subTaskNames = getTaskNames(subTasks);
+
+ Set<String> expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("laundry");
+ expectedTaskNames.add("sweep floor");
+
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ // add 3 sub tasks for sweep floor:
+ // * clean da house
+ // * dishes
+ // * laundry
+ // * sweep floor
+ // * find broom
+ // * find water
+ // * scrub
+
+ // now second level subtasks under sweep floor
+ subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask.setName("find broom");
+ taskService.saveTask(subTask);
+
+ subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask.setName("find water");
+ taskService.saveTask(subTask);
+
+ subTask = taskService.newTask(sweepFloorTaskDbid);
+ subTask.setName("scrub");
+ taskService.saveTask(subTask);
+
+ // verify all the sub tasks of 'clean da house' and 'sweep floor'
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("laundry");
+ expectedTaskNames.add("sweep floor");
+
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("find broom");
+ expectedTaskNames.add("find water");
+ expectedTaskNames.add("scrub");
+
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ // delete task dishes
+ taskService.deleteTask(dishesTaskDbid);
+
+ // verify all the sub tasks of 'clean da house' and 'sweep floor'
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("laundry");
+ expectedTaskNames.add("sweep floor");
+
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("find broom");
+ expectedTaskNames.add("find water");
+ expectedTaskNames.add("scrub");
+
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ // delete laundry and delete sweep floor
+ // NOTE: deleting sweep floor should recursively delete the subtasks
+ taskService.deleteTask(laundryTaskDbid);
+ taskService.deleteTask(sweepFloorTaskDbid);
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(taskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ subTaskNames = getTaskNames(taskService.getSubTasks(sweepFloorTaskDbid));
+
+ expectedTaskNames = new HashSet<String>();
+ assertEquals(expectedTaskNames, subTaskNames);
+
+ taskService.deleteTask(taskDbid);
+ }
+
+ private Set<String> getTaskNames(List<Task> tasks) {
+ Set<String> taskNames = new HashSet<String>();
+ for (Task task: tasks) {
+ taskNames.add(task.getName());
+ }
+ return taskNames;
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/SubTaskTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCandidatesTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCandidatesTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCandidatesTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,214 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCandidatesTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testCommaSeparatedTaskCandidates() {
+ deployJpdlXmlString(
+ "<process name='TaskCandidates'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review' " +
+ " candidate-users='johndoe, joesmoe'>" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("TaskCandidates");
+ String executionId = execution.getId();
+
+ // both johndoe and joesmoe will see the task in their *takable* task list
+ List<Task> taskList = taskService.findTakableTasks("johndoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ Task task = taskList.get(0);
+ assertEquals("review", task.getName());
+
+ taskList = taskService.findTakableTasks("joesmoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ task = taskList.get(0);
+ assertEquals("review", task.getName());
+
+ // johndoe and joesmoe will NOT see the task in their *assigned* task list
+
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ taskList = taskService.findAssignedTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // lets assume that johndoe takes the task
+ taskService.takeTask(task.getDbid(), "johndoe");
+
+ // johndoe's and joesmoe's takable task list is now empty
+ taskList = taskService.findTakableTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ taskList = taskService.findTakableTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // johndoe's assigned task list has the task in it
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ task = taskList.get(0);
+ assertEquals("review", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // joesmoe will not see the task in the assigned task list
+ taskList = taskService.findAssignedTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // now johndoe completes the task
+ taskService.completeTask(task.getDbid());
+
+ // verify that the task list is now empty
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ // verify that process moved to the next state
+ execution = executionService.findExecutionById(executionId);
+ assertEquals("wait", execution.getActivityName());
+ }
+
+ public void testTaskCandidatesExpression() {
+ deployJpdlXmlString(
+ "<process name='TaskCandidates'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review' " +
+ " candidate-users='#{userone}, #{usertwo}'>" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("userone", "johndoe");
+ variables.put("usertwo", "joesmoe");
+ Execution execution = executionService.startProcessInstanceByKey("TaskCandidates", variables);
+ String executionId = execution.getId();
+
+ // both johndoe and joesmoe will see the task in their *takable* task list
+ List<Task> taskList = taskService.findTakableTasks("johndoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ Task task = taskList.get(0);
+ assertEquals("review", task.getName());
+
+ taskList = taskService.findTakableTasks("joesmoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ task = taskList.get(0);
+ assertEquals("review", task.getName());
+
+ // johndoe and joesmoe will NOT see the task in their *assigned* task list
+
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ taskList = taskService.findAssignedTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // lets assume that johndoe takes the task
+ taskService.takeTask(task.getDbid(), "johndoe");
+
+ // johndoe's and joesmoe's takable task list is now empty
+ taskList = taskService.findTakableTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ taskList = taskService.findTakableTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // johndoe's assigned task list has the task in it
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals("Expected a single task being created", 1, taskList.size());
+ task = taskList.get(0);
+ assertEquals("review", task.getName());
+ assertEquals("johndoe", task.getAssignee());
+
+ // joesmoe will not see the task in the assigned task list
+ taskList = taskService.findAssignedTasks("joesmoe");
+ assertEquals(0, taskList.size());
+
+ // now johndoe completes the task
+ taskService.completeTask(task.getDbid());
+
+ // verify that the task list is now empty
+ taskList = taskService.findAssignedTasks("johndoe");
+ assertEquals(0, taskList.size());
+
+ // verify that process moved to the next state
+ execution = executionService.findExecutionById(executionId);
+ assertEquals("wait", execution.getActivityName());
+ }
+
+ public void testDoubleTake() {
+ deployJpdlXmlString(
+ "<process name='DoubleTake'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <task name='review' " +
+ " candidate-users='johndoe, joesmoe'>" +
+ " <transition to='wait' />" +
+ " </task>" +
+ " <state name='wait'/>" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("DoubleTake");
+ String executionId = execution.getId();
+
+ // both johndoe and joesmoe will see the task in their *takable* task list
+ long taskDbid = taskService.findTakableTasks("johndoe").get(0).getDbid();
+
+ taskService.takeTask(taskDbid, "johndoe");
+
+ try {
+ taskService.takeTask(taskDbid, "joesmoe");
+ } catch (JbpmException e) {
+ assertTextPresent("task already taken by johndoe", e.getMessage());
+ }
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCandidatesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCommentsTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCommentsTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCommentsTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,78 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.List;
+
+import org.jbpm.api.model.Comment;
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskCommentsTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testComments() {
+ Task task = taskService.newTask();
+ task.setName("clean da house");
+ long taskDbid = taskService.saveTask(task);
+
+ // what a party yesterday
+ // - what! you had a party while i was out ?!
+ // - euh yes. it was a great party :-)
+ // i'll clean up the mess
+ Comment comment = taskService.addTaskComment(taskDbid, "what a party yesterday");
+ long whatAPartyDbid = comment.getDbid();
+ comment = taskService.addReplyComment(whatAPartyDbid, "what! you had a party while i was out ?!");
+ long youHadAPartyDbid = comment.getDbid();
+ taskService.addReplyComment(youHadAPartyDbid, "euh yes. it was a great party :-)");
+
+ taskService.addTaskComment(taskDbid, "i'll clean up the mess");
+
+ List<Comment> taskComments = taskService.getTaskComments(taskDbid);
+ assertEquals("what a party yesterday", taskComments.get(0).getMessage());
+ assertEquals("i'll clean up the mess", taskComments.get(1).getMessage());
+
+ taskComments = taskComments.get(0).getComments();
+ assertEquals("what! you had a party while i was out ?!", taskComments.get(0).getMessage());
+
+ taskComments = taskComments.get(0).getComments();
+ assertEquals("euh yes. it was a great party :-)", taskComments.get(0).getMessage());
+
+ taskService.deleteComment(whatAPartyDbid);
+
+ taskComments = taskService.getTaskComments(taskDbid);
+ assertEquals("i'll clean up the mess", taskComments.get(0).getMessage());
+
+ // the following should delete the remaining comment. if not, this
+ // will show up as a fixme.
+ taskService.deleteTask(taskDbid);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCommentsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCreateUpdateDeleteTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCreateUpdateDeleteTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCreateUpdateDeleteTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,79 @@
+/*
+ * 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.spring.test.task;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class TaskCreateUpdateDeleteTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testNewTask() {
+ // creation of a new non-persisted task
+ Task task = taskService.newTask();
+ task = taskService.getTask(task.getDbid());
+ assertNull(task);
+ }
+
+ public void testSaveTask() {
+ Task task = taskService.newTask();
+ long taskDbid = taskService.saveTask(task);
+ // task was made persistent
+ task = taskService.getTask(taskDbid);
+ assertNotNull("expected non-null task", task);
+ // make some change
+ Date dueDate = new Date();
+ task.setDueDate(dueDate);
+ taskService.saveTask(task);
+ // verify change is applied
+ task = taskService.getTask(taskDbid);
+
+ // task.getDueDate() return an java.sql.Timestamp
+ DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
+ assertEquals(df.format(dueDate), df.format(task.getDueDate()));
+
+ taskService.deleteTask(taskDbid);
+ }
+
+ public void testDeleteTask() {
+ Task task = taskService.newTask();
+ long taskDbid = taskService.saveTask(task);
+
+ // task was made persistent
+ assertNotNull("expected non-null task", taskService.getTask(taskDbid));
+ // delete task and verify it does not exist
+ taskService.deleteTask(taskDbid);
+ task = taskService.getTask(taskDbid);
+ assertNull("expected null, but was " + task, task);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskCreateUpdateDeleteTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskHandlerTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskHandlerTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,172 @@
+/*
+ * 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.spring.test.task;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.task.OpenTask;
+import org.jbpm.api.task.Task;
+import org.jbpm.api.task.TaskHandler;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskHandlerTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ static boolean isExecutionCreateTaskCalled;
+ static boolean isExecutionSignalledCalled;
+ static boolean isTaskCancelCalled;
+ static boolean isTaskCompleteCalled;
+ static boolean isSubTaskCompleteCalled;
+ static boolean isTaskVariableUpdateCalled;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void onSetUpInTransaction() throws Exception {
+
+ 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().list().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().list().get(0);
+ long taskDbid = task.getDbid();
+
+ taskService.deleteTask(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/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskHandlerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskListTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskListTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskListTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,136 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.List;
+
+import org.jbpm.api.task.Task;
+import org.jbpm.api.task.UserRef;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskListTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ UserRef johndoe = new UserRef("johndoe");
+ UserRef joesmoe = new UserRef("joesmoe");
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testPersonalTaskList() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ task.setAssignee("johndoe");
+ long laundryTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("get good idea");
+ task.setAssignee("joesmoe");
+ long ideaTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("find venture capital");
+ task.setAssignee("joesmoe");
+ long capitalTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("start new business");
+ task.setAssignee("joesmoe");
+ long startBusinessTaskDbid = taskService.saveTask(task);
+
+ List<Task> taskList = taskService.findAssignedTasks("johndoe");
+ assertNotNull(taskList);
+
+ assertEquals("do laundry", taskList.get(0).getName());
+ assertEquals(1, taskList.size());
+
+ taskList = taskService.findAssignedTasks("joesmoe");
+ assertNotNull(taskList);
+
+ assertContainsTask(taskList, "get good idea");
+ assertContainsTask(taskList, "start new business");
+ assertContainsTask(taskList, "find venture capital");
+
+ assertEquals(3, taskList.size());
+
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(ideaTaskDbid);
+ taskService.deleteTask(laundryTaskDbid);
+ }
+
+ public void testPersonalTaskListDefaultSortOrder() {
+ Task task = taskService.newTask();
+ task.setName("get good idea");
+ task.setAssignee("joesmoe");
+ task.setPriority(3);
+ long ideaTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("find venture capital");
+ task.setAssignee("joesmoe");
+ task.setPriority(2);
+ long capitalTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("start new business");
+ task.setAssignee("joesmoe");
+ task.setPriority(1);
+ long startBusinessTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("take a day off");
+ task.setAssignee("joesmoe");
+ task.setPriority(-5);
+ long dayOffTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("make profit");
+ task.setAssignee("joesmoe");
+ task.setPriority(10);
+ long profitTaskDbid = taskService.saveTask(task);
+
+ List<Task> taskList = taskService.findAssignedTasks("joesmoe");
+ assertNotNull(taskList);
+
+ // default sort order is based on the priority
+ assertEquals("make profit", taskList.get(0).getName());
+ assertEquals("get good idea", taskList.get(1).getName());
+ assertEquals("find venture capital", taskList.get(2).getName());
+ assertEquals("start new business", taskList.get(3).getName());
+ assertEquals("take a day off", taskList.get(4).getName());
+
+ assertEquals(5, taskList.size());
+
+ taskService.deleteTask(profitTaskDbid);
+ taskService.deleteTask(dayOffTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(ideaTaskDbid);
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskListTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskParticipationsTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskParticipationsTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskParticipationsTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,128 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.task.Participation;
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskParticipationsTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testTaskParticipants() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ long taskDbid = taskService.saveTask(task);
+
+ taskService.addTaskParticipatingUser(taskDbid, "johndoe", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskDbid, "joesmoe", Participation.CANDIDATE);
+ taskService.addTaskParticipatingUser(taskDbid, "joesmoe", Participation.OWNER);
+ taskService.addTaskParticipatingGroup(taskDbid, "losers", Participation.CANDIDATE);
+ taskService.addTaskParticipatingGroup(taskDbid, "dummies", Participation.CANDIDATE);
+
+ List<Participation> taskParticipations = taskService.getTaskParticipations(taskDbid);
+
+ Set<String> candidateUserIds = extractParticipatingUserIds(taskParticipations, Participation.CANDIDATE);
+ Set<String> ownerUserIds = extractParticipatingUserIds(taskParticipations, Participation.OWNER);
+ Set<String> candidateGroupIds = extractParticipatingGroupIds(taskParticipations, Participation.CANDIDATE);
+
+ Set<String> expectedIds = new HashSet<String>();
+ expectedIds.add("johndoe");
+ expectedIds.add("joesmoe");
+
+ assertEquals(expectedIds, candidateUserIds);
+
+ expectedIds = new HashSet<String>();
+ expectedIds.add("joesmoe");
+
+ assertEquals(expectedIds, ownerUserIds);
+
+ expectedIds = new HashSet<String>();
+ expectedIds.add("losers");
+ expectedIds.add("dummies");
+
+ assertEquals(expectedIds, candidateGroupIds);
+
+ taskService.removeTaskParticipatingUser(taskDbid, "joesmoe", Participation.OWNER);
+ taskService.removeTaskParticipatingGroup(taskDbid, "losers", Participation.CANDIDATE);
+
+ taskParticipations = taskService.getTaskParticipations(taskDbid);
+
+ candidateUserIds = extractParticipatingUserIds(taskParticipations, Participation.CANDIDATE);
+ ownerUserIds = extractParticipatingUserIds(taskParticipations, Participation.OWNER);
+ candidateGroupIds = extractParticipatingGroupIds(taskParticipations, Participation.CANDIDATE);
+
+ expectedIds = new HashSet<String>();
+ expectedIds.add("johndoe");
+ expectedIds.add("joesmoe");
+
+ assertEquals(expectedIds, candidateUserIds);
+
+ expectedIds = new HashSet<String>();
+
+ assertEquals(expectedIds, ownerUserIds);
+
+ expectedIds = new HashSet<String>();
+ expectedIds.add("dummies");
+
+ assertEquals(expectedIds, candidateGroupIds);
+
+ taskService.deleteTask(taskDbid);
+ }
+
+ public Set<String> extractParticipatingUserIds(List<Participation> taskParticipations, String participationType) {
+ Set<String> userIds = new HashSet<String>();
+ for (Participation participation : taskParticipations) {
+ if (participationType.equals(participation.getType())) {
+ if (participation.getUserId()!=null) {
+ userIds.add(participation.getUserId());
+ }
+ }
+ }
+ return userIds;
+ }
+
+ public Set<String> extractParticipatingGroupIds(List<Participation> taskParticipations, String participationType) {
+ Set<String> groupIds = new HashSet<String>();
+ for (Participation participation : taskParticipations) {
+ if (participationType.equals(participation.getType())) {
+ if (participation.getGroupId()!=null) {
+ groupIds.add(participation.getGroupId());
+ }
+ }
+ }
+ return groupIds;
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskParticipationsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskQueryTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskQueryTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskQueryTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,127 @@
+/*
+ * 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.spring.test.task;
+
+import java.util.List;
+
+import org.jbpm.api.TaskQuery;
+import org.jbpm.api.task.Task;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskQueryTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testSimplestTaskQuery() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ task.setAssignee("johndoe");
+ task.setPriority(3);
+ long laudryTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("change dyper");
+ task.setAssignee("johndoe");
+ task.setPriority(1);
+ long dyperTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("start new business");
+ task.setAssignee("joesmoe");
+ task.setPriority(4);
+ long startBusinessTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("find venture capital");
+ task.setPriority(4);
+ long capitalTaskDbid = taskService.saveTask(task);
+
+ List<Task> taskList = taskService
+ .createTaskQuery()
+ .list();
+ assertNotNull(taskList);
+
+ assertContainsTask(taskList, "do laundry");
+ assertContainsTask(taskList, "change dyper");
+ assertContainsTask(taskList, "start new business");
+ assertContainsTask(taskList, "find venture capital");
+
+ assertEquals(4, taskList.size());
+
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(dyperTaskDbid);
+ taskService.deleteTask(laudryTaskDbid);
+ }
+
+ public void testSimplestTaskQuerySortBy() {
+ Task task = taskService.newTask();
+ task.setName("do laundry");
+ task.setAssignee("johndoe");
+ task.setPriority(3);
+ long laudryTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("change dyper");
+ task.setAssignee("johndoe");
+ task.setPriority(1);
+ long dyperTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("start new business");
+ task.setAssignee("joesmoe");
+ task.setPriority(4);
+ long startBusinessTaskDbid = taskService.saveTask(task);
+
+ task = taskService.newTask();
+ task.setName("find venture capital");
+ task.setPriority(7);
+ long capitalTaskDbid = taskService.saveTask(task);
+
+ List<Task> taskList = taskService
+ .createTaskQuery()
+ .orderAsc(TaskQuery.PROPERTY_NAME)
+ .list();
+ assertNotNull(taskList);
+
+ assertEquals("change dyper", taskList.get(0).getName());
+ assertEquals("do laundry", taskList.get(1).getName());
+ assertEquals("find venture capital", taskList.get(2).getName());
+ assertEquals("start new business", taskList.get(3).getName());
+
+ assertEquals(4, taskList.size());
+
+ taskService.deleteTask(capitalTaskDbid);
+ taskService.deleteTask(startBusinessTaskDbid);
+ taskService.deleteTask(dyperTaskDbid);
+ taskService.deleteTask(laudryTaskDbid);
+ }
+
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/task/TaskQueryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/BasicVariablesTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/BasicVariablesTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/BasicVariablesTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,122 @@
+/*
+ * 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.spring.test.variables;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class BasicVariablesTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ public void testStartProcessInstanceWithoutVariables() {
+ deployJpdlXmlString(
+ "<process name='var'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("var", "one");
+ Set<String> variableNames = executionService.getVariableNames("var.one");
+ assertNotNull(variableNames);
+ assertEquals(0, variableNames.size());
+ }
+
+ public void testStartProcessInstanceWithThreeVariables() {
+ deployJpdlXmlString(
+ "<process name='var'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'/>" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("customer", "John Doe");
+ variables.put("type", "Accident");
+ variables.put("amount", new Float(763.74));
+
+ Set<String> expectedVariableNames = new HashSet<String>(variables.keySet());
+ Map<String, Object> expectedVariables = new HashMap<String, Object>(variables);
+
+ executionService.startProcessInstanceByKey("var", variables, "one");
+
+ Set<String> variableNames = executionService.getVariableNames("var.one");
+ assertNotNull(variableNames);
+
+ assertEquals(expectedVariableNames, variableNames);
+
+ variables = executionService.getVariables("var.one", variableNames);
+
+ assertEquals(expectedVariables, variables);
+ }
+
+ public void testSetAndUpdateVariable() {
+ deployJpdlXmlString(
+ "<process name='var'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("var", "one");
+ executionService.setVariable("var.one", "msg", "hello");
+ assertEquals("hello", executionService.getVariable("var.one", "msg"));
+ executionService.setVariable("var.one", "msg", "world");
+ assertEquals("world", executionService.getVariable("var.one", "msg"));
+ }
+
+ public void testUpdateVariableToDifferentType() {
+ deployJpdlXmlString(
+ "<process name='var'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("var", "one");
+ executionService.setVariable("var.one", "msg", "hello");
+ assertEquals("hello", executionService.getVariable("var.one", "msg"));
+ executionService.setVariable("var.one", "msg", new Integer(5));
+ assertEquals(new Integer(5), executionService.getVariable("var.one", "msg"));
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/BasicVariablesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/VariableBasicTypesTest.java
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/VariableBasicTypesTest.java (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/VariableBasicTypesTest.java 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,149 @@
+/*
+ * 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.spring.test.variables;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.jbpm.spring.test.Constants;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableBasicTypesTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[]{Constants.APPLICATIONCONTEXT_LOCATION};
+ }
+
+ @Override
+ protected void onSetUpInTransaction() throws Exception {
+ super.onSetUpInTransaction();
+ }
+
+ private void checkVariableValue(Object variableValue) {
+ deployJpdlXmlString(
+ "<process name='var'>" +
+ " <start name='a'>" +
+ " <transition to='b' />" +
+ " </start>" +
+ " <state name='b'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("var", "one");
+ executionService.setVariable("var.one", "msg", variableValue);
+ assertEquals(variableValue, executionService.getVariable("var.one", "msg"));
+ }
+
+ public void testVariableTypeString() {
+ checkVariableValue("hello");
+ }
+
+ public void testVariableTypeCharacter() {
+ checkVariableValue(new Character('x'));
+ }
+
+ public void testVariableTypeBoolean() {
+ checkVariableValue(Boolean.TRUE);
+ }
+
+ public void testVariableTypeByte() {
+ checkVariableValue(new Byte((byte)5));
+ }
+
+ public void testVariableTypeShort() {
+ checkVariableValue(new Short((short)5));
+ }
+
+ public void testVariableTypeInteger() {
+ checkVariableValue(new Integer(5));
+ }
+
+ public void testVariableTypeLong() {
+ checkVariableValue(new Long(5));
+ }
+
+ public void testVariableTypeFloat() {
+ checkVariableValue(new Float(5.7));
+ }
+
+ public void testVariableTypeDouble() {
+ checkVariableValue(new Double(5.7));
+ }
+
+ public void testVariableTypeDate() {
+ checkVariableValue(new Date());
+ }
+
+ public static class SerializeMe implements Serializable {
+ private static final long serialVersionUID = 1L;
+ String text;
+ public SerializeMe(String text) {
+ this.text = text;
+ }
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((text == null) ? 0 : text.hashCode());
+ return result;
+ }
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SerializeMe other = (SerializeMe) obj;
+ if (text == null) {
+ if (other.text != null)
+ return false;
+ } else if (!text.equals(other.text))
+ return false;
+ return true;
+ }
+ }
+
+ public void testVariableTypeSerializable() {
+ SerializeMe originalValue = new SerializeMe(generateString("a lot of text ", 500));
+ checkVariableValue(originalValue);
+
+ // now check if an update still works ok
+ // updating a serialized object might fail when the blob is cached by hibernate
+ SerializeMe newValue = new SerializeMe(generateString("another text ", 500));
+ executionService.setVariable("var.one", "msg", newValue);
+ assertEquals(newValue, executionService.getVariable("var.one", "msg"));
+ }
+
+ protected String generateString(String base, int multiplier) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i=0; i<multiplier; i++) {
+ buffer.append(base);
+ }
+ String string = buffer.toString();
+ return string;
+ }
+}
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/java/org/jbpm/spring/test/variables/VariableBasicTypesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/applicationContext.xml
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/applicationContext.xml (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/applicationContext.xml 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+ <bean id="configuration" class="org.jbpm.spring.cfg.SpringConfigurationFactoryBean">
+ <property name="jbpmConfigurationLocation" value="org/jbpm/spring/test/jbpm.cfg.xml" />
+ </bean>
+
+ <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ <property name="configLocation" value="classpath:org/jbpm/spring/test/jbpm.hibernate.cfg.xml" />
+ <!-- A best practice should be to keep split the config into multiple files
+ <property name="configLocations" value="hibernate.cfg.xml, hibernate.jbpm.cfg.xml" />
+ -->
+ </bean>
+
+ <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:mem:." />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+ <!-- We need to get the commandService, since we want a transaction around it.
+ <bean id="commandService"
+ class="org.jbpm.pvm.internal.spring.SpringCommandService">
+ <property name="transactionManager" ref="transactionManager" />
+ </bean>
+ -->
+
+ <!-- Start the jobExecutor
+ <bean id="jobExecutor" class="org.jbpm.pvm.internal.jobexecutor.JobExecutor" init-method="start" destroy-method="stop">
+ <property name="commandExecutor" ref="commandService" />
+ </bean>
+ -->
+
+ <bean id="testBean" class="org.jbpm.spring.test.beans.InvokeTestBean" />
+
+
+</beans>
\ No newline at end of file
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/applicationContext.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/process.jpdl.xml
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/process.jpdl.xml (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/process.jpdl.xml 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Spring">
+
+ <start>
+ <transition to="test" />
+ </start>
+
+ <spring name="test">
+ <bean>testBean</bean>
+ <method>testMethod</method>
+ <transition to="testWithParameters" />
+ </spring>
+
+ <spring name="testWithParameters">
+ <bean>testBean</bean>
+ <method>testMethodWithParameters</method>
+ <parameters>
+ <string value="a good test" />
+ </parameters>
+ <transition to="exclusive spring test" />
+ </spring>
+
+ <exclusive name="exclusive spring test" handler-ref="testBean">
+ <transition name="no" to="wait" />
+ <transition name="yes" to="wait" />
+ </exclusive>
+
+ <state name="wait" />
+
+</process>
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/beans/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.cfg.xml (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.cfg.xml 2009-05-05 20:15:22 UTC (rev 4735)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <task-service />
+ <identity-service />
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ <spring-transaction-interceptor current="true"/>
+ <!--
+ <spring-transaction-interceptor />
+ -->
+ </command-service>
+
+ <hibernate-configuration>
+ <cfg resource="jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <deployer-manager>
+ <jpdl-deployer />
+ </deployer-manager>
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine"
+ write-context="">
+ <script-language name="juel" factory="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>
+ <repository-session />
+ <pvm-db-session />
+ <job-db-session />
+ <task-db-session />
+ <message-session />
+ <timer-session />
+ <history-session />
+ <transaction />
+ <hibernate-session />
+ <identity-session />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.hibernate.cfg.xml 2009-05-05 20:15:22 UTC (rev 4735)
@@ -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>
+
+ <mapping resource="jbpm.repository.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" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/branches/ainze/modules/test-spring/src/test/resources/org/jbpm/spring/test/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss JBPM SVN: r4734 - jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 15:34:12 -0400 (Tue, 05 May 2009)
New Revision: 4734
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/IntegrationTestHelper.java
Log:
fix to jboss version detection
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/IntegrationTestHelper.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/IntegrationTestHelper.java 2009-05-05 17:30:22 UTC (rev 4733)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/java/org/jbpm/enterprise/IntegrationTestHelper.java 2009-05-05 19:34:12 UTC (rev 4734)
@@ -133,12 +133,8 @@
if (jbossVersion.startsWith("5.0.1"))
integrationTarget = "jboss501";
- if (jbossVersion.startsWith("5.0.0"))
- integrationTarget = "jboss500";
else if (jbossVersion.startsWith("4.2.3"))
integrationTarget = "jboss423";
- else if (jbossVersion.startsWith("4.2.2"))
- integrationTarget = "jboss422";
else if (jbossVersion.startsWith("4.0.5"))
integrationTarget = "jboss405";
else
15 years, 1 month
JBoss JBPM SVN: r4733 - in jbpm3/branches/jbpm-3.2.5.SP: modules/core and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 13:30:22 -0400 (Tue, 05 May 2009)
New Revision: 4733
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml
jbpm3/branches/jbpm-3.2.5.SP/pom.xml
Log:
bump version to 3.2.5.SP6
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/db/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/examples/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/identity/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/simulation/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/userguide/src/main/docbook/en/master.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -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.SP5">
+<!ENTITY version "3.2.5.SP6">
]>
<book lang="en">
<bookinfo>
Modified: jbpm3/branches/jbpm-3.2.5.SP/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-05-05 17:16:52 UTC (rev 4732)
+++ jbpm3/branches/jbpm-3.2.5.SP/pom.xml 2009-05-05 17:30:22 UTC (rev 4733)
@@ -18,7 +18,7 @@
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>3.2.5.SP5</version>
+ <version>3.2.5.SP6</version>
<!-- Parent -->
<parent>
15 years, 1 month
JBoss JBPM SVN: r4732 - jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 13:16:52 -0400 (Tue, 05 May 2009)
New Revision: 4732
Added:
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss501-dependencies.txt
Removed:
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss422-dependencies.txt
jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss500-dependencies.txt
Log:
determine jboss 5.0.1 dependencies
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss422-dependencies.txt
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss422-dependencies.txt 2009-05-05 15:11:58 UTC (rev 4731)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss422-dependencies.txt 2009-05-05 17:16:52 UTC (rev 4732)
@@ -1,82 +0,0 @@
-# This file shows jboss-4.2.2.ga thirdparty dependencies. It was produced running the following command
-#
-# (ls -1 lib; ls -1 lib/endorsed; ls -1 server/default/lib/) | grep jar | sed s/.jar// | sort -u
-#
-activation
-antlr
-autonumber-plugin
-bcel
-bindingservice-plugin
-bsf
-bsh
-bsh-deployer
-cglib
-commons-codec
-commons-collections
-commons-httpclient
-commons-logging
-concurrent
-dom4j
-ejb3-persistence
-el-api
-getopt
-hibernate3
-hibernate-annotations
-hibernate-entitymanager
-hsqldb
-hsqldb-plugin
-javassist
-jaxen
-jboss
-jboss-cache-jdk50
-jboss-common
-jboss-common-jdbc-wrapper
-jboss-ejb3x
-jboss-hibernate
-jboss-j2ee
-jboss-jaxrpc
-jboss-jaxws
-jboss-jca
-jboss-jmx
-jboss-jsr77
-jboss-jsr88
-jbossjta
-jbossjta-integration
-jboss-management
-jboss-monitoring
-jbossmq
-jboss-remoting
-jboss-remoting-int
-jboss-saaj
-jboss-serialization
-jboss-srp
-jbosssx
-jboss-system
-jboss-transaction
-jbossts-common
-jboss-vfs
-jbossws-common
-jbossws-framework
-jbossws-jboss42
-jbossws-spi
-jboss-xml-binding
-jmx-adaptor-plugin
-jnpserver
-joesnmp
-jpl-pattern
-jpl-util
-jsp-api
-log4j
-log4j-boot
-log4j-snmp-appender
-mail
-mail-plugin
-properties-plugin
-quartz
-scheduler-plugin
-scheduler-plugin-example
-serializer
-servlet-api
-xalan
-xercesImpl
-xmlentitymgr
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss500-dependencies.txt
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss500-dependencies.txt 2009-05-05 15:11:58 UTC (rev 4731)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss500-dependencies.txt 2009-05-05 17:16:52 UTC (rev 4732)
@@ -1,151 +0,0 @@
-# This file shows jboss-5.0.0.cr2 thirdparty dependencies. It was produced running the following command
-#
-# (ls -1 lib; ls -1 lib/endorsed; ls -1 server/default/lib/) | grep jar | sed s/.jar// | sort -u
-#
-activation
-antlr
-autonumber-plugin
-bcel
-bsf
-bsh
-commons-collections
-commons-httpclient
-commons-logging
-concurrent
-dom4j
-dtdparser121
-ejb3-persistence
-el-api
-getopt
-hibernate-annotations
-hibernate-commons-annotations
-hibernate-core
-hibernate-entitymanager
-hibernate-jmx
-hibernate-validator
-hsqldb
-hsqldb-plugin
-javassist
-jaxb-api
-jaxb-impl
-jaxb-xjc
-jaxen
-jboss
-jboss-aop-deployer-jdk50
-jboss-aop-jboss4-jdk50
-jboss-aop-jboss5
-jboss-aop-jdk50
-jboss-aop-mc-int
-jbossas-remoting
-jboss-bindingservice
-jboss-bootstrap
-jboss-classloader
-jboss-classloading
-jboss-classloading-spi
-jboss-classloading-vfs
-jboss-common-core
-jboss-common-jdbc-wrapper
-jboss-current-invocation-aspects
-jboss-dependency
-jboss-deployers-client
-jboss-deployers-client-spi
-jboss-deployers-core
-jboss-deployers-core-spi
-jboss-deployers-impl
-jboss-deployers-spi
-jboss-deployers-structure-spi
-jboss-deployers-vfs
-jboss-deployers-vfs-spi
-jboss-ejb3-cache
-jboss-ejb3-common
-jboss-ejb3-core
-jboss-ejb3-ext-api
-jboss-ejb3-ext-api-impl
-jboss-ejb3-interceptors
-jboss-ejb3-metadata
-jboss-ejb3-proxy
-jboss-ejb3-proxy-clustered
-jboss-ejb3-security
-jboss-ejb3-transactions
-jbossha
-jboss-ha-client
-jboss-ha-server-api
-jboss-ha-server-cache-jbc
-jboss-ha-server-cache-spi
-jboss-hibernate
-jboss-iiop
-jboss-integration
-jboss-j2se
-jboss-jaspi-api
-jboss-javaee
-jboss-jca
-jboss-jmx
-jboss-jmx-remoting
-jboss-jpa-deployers
-jboss-jsr77
-jboss-jsr88
-jbossjta
-jbossjta-integration
-jboss-kernel
-jboss-logging-jdk
-jboss-logging-log4j
-jboss-logging-spi
-jboss-main
-jboss-managed
-jboss-management
-jboss-mbeans
-jboss-mdr
-jboss-messaging
-jboss-messaging-int
-jboss-metadata
-jboss-metatype
-jboss-monitoring
-jboss-profileservice
-jboss-reflect
-jboss-remoting
-jboss-remoting-aspects
-jboss-security-aspects
-jboss-security-spi
-jboss-serialization
-jboss-srp
-jboss-sunxacml
-jbosssx
-jbosssx-server
-jboss-system
-jboss-system-jmx
-jboss-transaction-aspects
-jbossts-common
-jboss-vfs
-jbossws-common
-jbossws-framework
-jbossws-native-jaxrpc
-jbossws-native-jaxws
-jbossws-native-jaxws-ext
-jbossws-native-saaj
-jbossws-spi
-jboss-xacml
-jboss-xml-binding
-jmx-adaptor-plugin
-jnpserver
-joesnmp
-jsp-api
-log4j
-log4j-boot
-log4j-snmp-appender
-mail
-mail-plugin
-osgi.core
-properties-plugin
-quartz
-resolver
-scheduler-plugin
-scheduler-plugin-example
-serializer
-servlet-api
-slf4j-api
-slf4j-jboss-logging
-stax-api
-trove
-wstx
-xalan
-xercesImpl
Added: jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss501-dependencies.txt
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss501-dependencies.txt (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/enterprise/src/test/resources/jboss501-dependencies.txt 2009-05-05 17:16:52 UTC (rev 4732)
@@ -0,0 +1,60 @@
+# This file shows jboss-5.0.0.cr2 thirdparty dependencies. It was produced running the following command
+#
+# (ls -1 lib; ls -1 lib/endorsed; ls -1 server/default/lib/) | grep jar | sed s/.jar// | sort -u
+#
+activation
+concurrent
+dom4j
+getopt
+javassist
+jaxb-api
+jaxb-impl
+jaxb-xjc
+jboss-aop
+jboss-aop-asintegration-core
+jboss-aop-asintegration-jmx
+jboss-aop-asintegration-mc
+jboss-aop-jboss5
+jboss-aop-mc-int
+jboss-bootstrap
+jboss-classloader
+jboss-classloading
+jboss-classloading-spi
+jboss-classloading-vfs
+jboss-common-core
+jboss-dependency
+jboss-deployers-client
+jboss-deployers-client-spi
+jboss-deployers-core
+jboss-deployers-core-spi
+jboss-deployers-impl
+jboss-deployers-spi
+jboss-deployers-structure-spi
+jboss-deployers-vfs
+jboss-deployers-vfs-spi
+jboss-j2se
+jboss-jmx
+jboss-kernel
+jboss-logging-jdk
+jboss-logging-log4j
+jboss-logging-spi
+jboss-main
+jboss-managed
+jboss-mbeans
+jboss-mdr
+jboss-metatype
+jboss-profileservice-spi
+jboss-reflect
+jboss-system
+jboss-system-jmx
+jboss-vfs
+jboss-xml-binding
+log4j-boot
+osgi.core
+resolver
+serializer
+stax-api
+trove
+wstx
+xalan
+xercesImpl
15 years, 1 month
JBoss JBPM SVN: r4731 - in jbpm3/branches/jbpm-3.2.5.SP/hudson: hudson-home and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 11:11:58 -0400 (Tue, 05 May 2009)
New Revision: 4731
Modified:
jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/hudson.tasks.Mailer.xml
Log:
[JBPM-2205] fix jboss versions in hudson build file
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml 2009-05-05 14:48:53 UTC (rev 4730)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/build.xml 2009-05-05 15:11:58 UTC (rev 4731)
@@ -81,16 +81,16 @@
<get src="https://hudson.dev.java.net/files/documents/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="true" verbose="true"/>
</target>
<target name="get-jboss405" depends="init-thirdparty" unless="jboss405.available">
- <property name="hudson.jboss422.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.0.5.GA.zip"/>
- <get src="${hudson.jboss422.zip}" dest="${thirdparty.dir}/jboss-4.0.5.GA.zip" usetimestamp="true" verbose="true"/>
+ <property name="hudson.jboss405.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.0.5.GA.zip"/>
+ <get src="${hudson.jboss405.zip}" dest="${thirdparty.dir}/jboss-4.0.5.GA.zip" usetimestamp="true" verbose="true"/>
</target>
<target name="get-jboss423" depends="init-thirdparty" unless="jboss423.available">
<property name="hudson.jboss423.zip" value="http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip"/>
<get src="${hudson.jboss423.zip}" dest="${thirdparty.dir}/jboss-4.2.3.GA.zip" usetimestamp="true" verbose="true"/>
</target>
<target name="get-jboss501" depends="init-thirdparty" unless="jboss501.available">
- <property name="hudson.jboss500.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.zip"/>
- <get src="${hudson.jboss500.zip}" dest="${thirdparty.dir}/jboss-5.0.1.GA.zip" usetimestamp="true" verbose="true"/>
+ <property name="hudson.jboss501.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.zip"/>
+ <get src="${hudson.jboss501.zip}" dest="${thirdparty.dir}/jboss-5.0.1.GA.zip" usetimestamp="true" verbose="true"/>
</target>
<!--
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/hudson.tasks.Mailer.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/hudson.tasks.Mailer.xml 2009-05-05 14:48:53 UTC (rev 4730)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/hudson.tasks.Mailer.xml 2009-05-05 15:11:58 UTC (rev 4731)
@@ -2,6 +2,6 @@
<hudson.tasks.Mailer-DescriptorImpl>
<defaultSuffix></defaultSuffix>
<hudsonUrl>http://@hudson.host@:@hudson.http.port@/hudson/</hudsonUrl>
- <adminAddress>thomas.diesler(a)jboss.com</adminAddress>
+ <adminAddress>aguizar(a)jboss.com</adminAddress>
<smtpHost>@hudson.smtp.host@</smtpHost>
</hudson.tasks.Mailer-DescriptorImpl>
15 years, 1 month
JBoss JBPM SVN: r4729 - jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 10:26:42 -0400 (Tue, 05 May 2009)
New Revision: 4729
Modified:
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
Log:
[JBPM-2205] fix command script
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-05 14:01:52 UTC (rev 4728)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-05 14:26:42 UTC (rev 4729)
@@ -25,7 +25,8 @@
java -version 2> tmp.ver
JAVA_VERSION=`grep "java version" tmp.ver | awk '{ print substr($3, 2, length($3)-2); }'`
-echo java version JAVA_VERSION
+rm tmp.ver
+echo java version $JAVA_VERSION
case $JAVA_VERSION in
1.4*)
@@ -52,6 +53,7 @@
#
# Build distro
#
+cd $JBPMDIR
export JAVA_HOME=$JAVA_BT_HOME
MVN_CMD="mvn -U $ENVIRONMENT -Pdistro,soa clean install"
echo $MVN_CMD; $MVN_CMD; MVN_STATUS=$?
15 years, 1 month
JBoss JBPM SVN: r4728 - in jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home: jobs/jBPM3-Database-Matrix and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-05 10:01:52 -0400 (Tue, 05 May 2009)
New Revision: 4728
Modified:
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml
jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml
Log:
[JBPM-2205] have command script use jdk 1.5 to build the distro when jdk14 axis runs
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-05 13:35:22 UTC (rev 4727)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/command.sh 2009-05-05 14:01:52 UTC (rev 4728)
@@ -23,18 +23,22 @@
;;
esac
-$JAVA_HOME/bin/java -version 2> tmp.ver
+java -version 2> tmp.ver
JAVA_VERSION=`grep "java version" tmp.ver | awk '{ print substr($3, 2, length($3)-2); }'`
-JAVA_VERSION=`echo $JAVA_VERSION | awk '{ print substr($1, 1, 3); }' | sed -e 's;\.;0;g'`
+echo java version JAVA_VERSION
-if [ $JAVA_VERSION -ge 1.5 ]
-then
- JDK_HOME=$JAVA_HOME
- JRE_HOME=$JAVA_HOME
-else
- JDK_HOME=(a)java.home.jdk15@
- JRE_HOME=$JAVA_HOME
-fi
+case $JAVA_VERSION in
+ 1.4*)
+ JAVA_BT_HOME=$JAVA_15_HOME
+ JAVA_RT_HOME=$JAVA_14_HOME
+ JAVA=$JAVA_BT_HOME/bin/java
+ ;;
+ *)
+ JAVA_BT_HOME=$JAVA_HOME
+ JAVA_RT_HOME=$JAVA_HOME
+ JAVA=java
+ ;;
+esac
#
# Unzip the JBoss build
@@ -48,7 +52,7 @@
#
# Build distro
#
-export JAVA_HOME=$JDK_HOME
+export JAVA_HOME=$JAVA_BT_HOME
MVN_CMD="mvn -U $ENVIRONMENT -Pdistro,soa clean install"
echo $MVN_CMD; $MVN_CMD; MVN_STATUS=$?
if [ $MVN_STATUS -ne 0 ]; then
@@ -70,7 +74,7 @@
# Deploy distro
#
AUTO_INSTALL=modules/distribution/target/resources/auto-install-template.xml; cat $AUTO_INSTALL;
-JAVA_CMD="JDK_HOME/bin/java -jar $DISTRODIR/jbpm-installer-$JBPM_VERSION.jar $AUTO_INSTALL"
+JAVA_CMD="$JAVA -jar $DISTRODIR/jbpm-installer-$JBPM_VERSION.jar $AUTO_INSTALL"
echo $JAVA_CMD; $JAVA_CMD
# FIXME: Autoinstall does not respect conditions
@@ -97,7 +101,7 @@
#
# Start JBoss AS
#
-export JAVA_HOME=$JRE_HOME
+export JAVA_HOME=$JAVA_RT_HOME
$JBPMDIR/hudson/jboss/bin/jboss.sh $JBOSS_HOME start $JBOSS_BINDADDR
# Was it successfully started?
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml 2009-05-05 13:35:22 UTC (rev 4727)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-Database-Matrix/config.xml 2009-05-05 14:01:52 UTC (rev 4728)
@@ -69,6 +69,9 @@
export JBOSS_SERVER=(a)jboss.server.instance@
export JBOSS_BINDADDR=(a)jboss.bind.address@
+export JAVA_14_HOME=(a)java.home.jdk14@
+export JAVA_15_HOME=(a)java.home.jdk15@
+
# copy the maven profile
cp @hudson.maven.profile@ $JBPMDIR/profiles.xml
Modified: jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml 2009-05-05 13:35:22 UTC (rev 4727)
+++ jbpm3/branches/jbpm-3.2.5.SP/hudson/hudson-home/jobs/jBPM3-JDK1.4.2/config.xml 2009-05-05 14:01:52 UTC (rev 4728)
@@ -52,6 +52,9 @@
export JBOSS_SERVER=(a)jboss.server.instance@
export JBOSS_BINDADDR=(a)jboss.bind.address@
+export JAVA_14_HOME=(a)java.home.jdk14@
+export JAVA_15_HOME=(a)java.home.jdk15@
+
# copy the maven profile
cp @hudson.maven.profile@ $JBPMDIR/profiles.xml
15 years, 1 month
JBoss JBPM SVN: r4727 - in jbpm4/branches/hbraun: modules/distro/src/main/resources/installer and 10 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-05 09:35:22 -0400 (Tue, 05 May 2009)
New Revision: 4727
Added:
jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDirective.java
jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/OutcomeDirective.java
jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
Modified:
jbpm4/branches/hbraun/modules/distro/src/main/resources/installer/install-definition.xml
jbpm4/branches/hbraun/modules/integration/console/integration-console.iml
jbpm4/branches/hbraun/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
jbpm4/branches/hbraun/modules/integration/form-plugin/form-plugin.iml
jbpm4/branches/hbraun/modules/integration/form-plugin/pom.xml
jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/branches/hbraun/modules/integration/integration.iml
jbpm4/branches/hbraun/modules/integration/jboss4/integration-jboss4.iml
jbpm4/branches/hbraun/modules/integration/jboss5/integration-jboss5.iml
jbpm4/branches/hbraun/modules/integration/spi/integration-spi.iml
jbpm4/branches/hbraun/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
jbpm4/branches/hbraun/modules/test-base/test-base.iml
jbpm4/branches/hbraun/pom.xml
Log:
More work on form plugin
Modified: jbpm4/branches/hbraun/modules/distro/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm4/branches/hbraun/modules/distro/src/main/resources/installer/install-definition.xml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/distro/src/main/resources/installer/install-definition.xml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -159,6 +159,7 @@
<include name="jbpm-jpdl.jar" />
<include name="jbpm-console-integration.jar" />
<include name="jbpm-console-form-plugin.jar" />
+ <include name="freemarker.jar" />
<include name="idm*.jar" />
<include name="livetribe-jsr223.jar" />
<include name="juel*.jar" />
Modified: jbpm4/branches/hbraun/modules/integration/console/integration-console.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/console/integration-console.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/console/integration-console.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -9,11 +9,12 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="gwt-parent" exported="" />
<orderEntry type="module" module-name="toplevel" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
+ <orderEntry type="module" module-name="pvm" exported="" />
+ <orderEntry type="module" module-name="test-base" exported="" />
<orderEntry type="module" module-name="gwt-rpc" exported="" />
<orderEntry type="module" module-name="server-integration" exported="" />
- <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
<CLASSES>
@@ -357,28 +358,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
@@ -392,14 +371,12 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:provided">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
Modified: jbpm4/branches/hbraun/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -28,6 +28,8 @@
import org.jboss.bpm.console.server.integration.TaskManagement;
import org.jbpm.IdentityService;
import org.jbpm.TaskService;
+import org.jbpm.env.Environment;
+import org.jbpm.env.EnvironmentFactory;
import org.jbpm.task.GroupRef;
import org.jbpm.task.Participation;
import org.jbpm.task.Task;
@@ -49,24 +51,33 @@
private List<TaskRef> internalGetTaskForIdentity(String idRef, String participationType)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- List<TaskRef> results = new ArrayList<TaskRef>();
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
- if(null==participationType || participationType.equals(Participation.CANDIDATE))
+ try
{
- // TODO: Paging
- List<Task> assignedTasks = taskService.findAssignedTasks(idRef);
- List<Task> takableTasks = taskService.findTakableTasks(idRef);
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ List<TaskRef> results = new ArrayList<TaskRef>();
- adoptTasks(assignedTasks, results);
- adoptTasks(takableTasks, results);
+ if(null==participationType || participationType.equals(Participation.CANDIDATE))
+ {
+ // TODO: Paging
+ List<Task> assignedTasks = taskService.findAssignedTasks(idRef);
+ List<Task> takableTasks = taskService.findTakableTasks(idRef);
+
+ adoptTasks(assignedTasks, results);
+ adoptTasks(takableTasks, results);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown participation type: " +participationType);
+ }
+
+ return results;
}
- else
+ finally
{
- throw new IllegalArgumentException("Unknown participation type: " +participationType);
+ env.close();
}
-
- return results;
}
private void adoptTasks(List<Task> tasks, List<TaskRef> results)
@@ -94,39 +105,87 @@
public TaskRef getTaskById(long taskId)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- Task t0 = taskService.getTask(taskId);
- return ModelAdaptor.adoptTask(t0);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ Task t0 = taskService.getTask(taskId);
+ return ModelAdaptor.adoptTask(t0);
+ }
+ finally{
+ env.close();
+ }
}
public void takeTask(long taskId, String idRef)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.takeTask(taskId, idRef);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.takeTask(taskId, idRef);
+ }
+ finally{
+ env.close();
+ }
}
public void assignTask(long taskId, String idRef)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, idRef);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.assignTask(taskId, idRef);
+ }
+ finally{
+ env.close();
+ }
}
public void releaseTask(long taskId)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(taskId, null);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.assignTask(taskId, null);
+ }
+ finally{
+ env.close();
+ }
}
public void completeTask(long taskId, String outcome)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.completeTask(taskId, outcome);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.completeTask(taskId, outcome);
+ }
+ finally{
+ env.close();
+ }
}
public void completeTask(long taskId)
{
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.completeTask(taskId);
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.completeTask(taskId);
+ }
+ finally{
+ env.close();
+ }
}
}
Modified: jbpm4/branches/hbraun/modules/integration/form-plugin/form-plugin.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/form-plugin.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/form-plugin.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -9,13 +9,14 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="integration-spi" />
- <orderEntry type="module" module-name="gwt-rpc" />
- <orderEntry type="module" module-name="integration" />
- <orderEntry type="module" module-name="server-integration" />
- <orderEntry type="module" module-name="jpdl" />
- <orderEntry type="module" module-name="api" />
- <orderEntry type="module-library">
+ <orderEntry type="module" module-name="jpdl" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
+ <orderEntry type="module" module-name="pvm" exported="" />
+ <orderEntry type="module" module-name="integration" exported="" />
+ <orderEntry type="module" module-name="test-base" exported="" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="server-integration" exported="" />
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
@@ -24,7 +25,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar!/" />
@@ -33,7 +34,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
@@ -42,7 +43,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
@@ -51,16 +52,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
@@ -69,7 +61,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar!/" />
@@ -78,7 +70,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
@@ -87,7 +79,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
@@ -96,20 +88,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/cache/jbosscache-core/3.0.2.GA/jbosscache-core-3.0.2.GA.jar!/" />
@@ -118,7 +97,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
@@ -127,7 +106,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel-engine:jar:2.1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
@@ -136,7 +115,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: antlr:antlr:jar:2.7.6:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
@@ -145,7 +124,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm:jar:1.5.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
@@ -154,7 +133,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javassist:javassist:jar:3.4.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
@@ -163,7 +142,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0.Alpha2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0.Alpha2/idm-common-1.0.0.Alpha2.jar!/" />
@@ -172,7 +151,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/" />
@@ -181,7 +160,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel:jar:2.1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
@@ -190,7 +169,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
@@ -199,7 +178,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
@@ -210,7 +189,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/jgroups/jgroups/2.6.7.GA/jgroups-2.6.7.GA.jar!/" />
@@ -221,7 +200,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.8/jaxb-impl-2.1.8.jar!/" />
@@ -230,7 +209,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
@@ -243,7 +222,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
@@ -252,7 +231,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar!/" />
@@ -261,7 +240,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel-impl:jar:2.1.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
@@ -270,7 +249,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
@@ -279,7 +258,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0.Alpha2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/identity/idm/1.0.0.Alpha2/idm-1.0.0.Alpha2.jar!/" />
@@ -288,7 +267,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: dom4j:dom4j:jar:1.6.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
@@ -299,7 +278,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: cglib:cglib:jar:2.1_3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
@@ -308,7 +287,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm-attrs:jar:1.5.3:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
@@ -317,7 +296,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0.Alpha2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/identity/idm-spi/1.0.0.Alpha2/idm-spi-1.0.0.Alpha2.jar!/" />
@@ -326,7 +305,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0.Alpha2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/identity/idm-api/1.0.0.Alpha2/idm-api-1.0.0.Alpha2.jar!/" />
@@ -335,7 +314,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
@@ -346,7 +325,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
@@ -355,7 +334,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
@@ -364,7 +343,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
@@ -375,7 +354,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: log4j:log4j:jar:1.2.14:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
@@ -386,17 +365,24 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:provided">
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.freemarker:freemarker:jar:2.3.15:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/freemarker/freemarker/2.3.15/freemarker-2.3.15.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/branches/hbraun/modules/integration/form-plugin/pom.xml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/pom.xml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/pom.xml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -40,5 +40,9 @@
<artifactId>gwt-console-server-integration</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ </dependency>
</dependencies>
</project>
Added: jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDirective.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDirective.java (rev 0)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDirective.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.console.forms;
+
+public class FormDirective
+{
+ private String action;
+ private String method = "POST";
+
+ public FormDirective()
+ {
+ }
+
+ public FormDirective(String action)
+ {
+ this.action = action;
+ }
+
+ public String getAction()
+ {
+ return action;
+ }
+
+ public void setAction(String action)
+ {
+ this.action = action;
+ }
+
+ public String getMethod()
+ {
+ return method;
+ }
+
+ public void setMethod(String method)
+ {
+ this.method = method;
+ }
+}
\ No newline at end of file
Added: jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/OutcomeDirective.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/OutcomeDirective.java (rev 0)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/OutcomeDirective.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.console.forms;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class OutcomeDirective
+{
+ private List<String> values = new ArrayList<String>();
+
+ public List<String> getValues()
+ {
+ return values;
+ }
+}
Added: jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java (rev 0)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/Runner.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.console.forms;
+
+import freemarker.template.DefaultObjectWrapper;
+import freemarker.template.Template;
+
+import java.io.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Runner
+{
+ static String template = "<html>\n" +
+ "<body>\n" +
+ "\n" +
+ "<h2>Please enter your name</h2>\n" +
+ "<form action=\"${form.action}\" method=\"POST\" enctype=\"multipart/form-data\">\n" +
+ "<input type=\"text\" name=\"name\" value=\"\"><br/>\n" +
+ "Outcomes:<br/>\n" +
+ "<ul>\n" +
+ "<#list outcome.values as transition>\n" +
+ " <li>${transition} \n" +
+ "</#list>\n" +
+ "</ul> \n" +
+ "<input type=\"submit\">\n" +
+ "</form>\n" +
+ "</body>\n" +
+ "</html>";
+
+ public static void main(String[] args)
+ {
+ Runner r = new Runner();
+
+ Map<String,Object> ctx = new HashMap<String,Object>();
+ FormDirective f = new FormDirective("http://localhost:8080/");
+ OutcomeDirective o = new OutcomeDirective();
+ o.getValues().add("transition1");
+ o.getValues().add("transition2");
+
+ ctx.put("form", f);
+ ctx.put("outcome", o);
+
+ r.execute(ctx, "testRun", new ByteArrayInputStream(template.getBytes()));
+ }
+
+ private void execute(Map<String, Object> renderContext, String name, InputStream src)
+ {
+ try
+ {
+ freemarker.template.Configuration cfg = new freemarker.template.Configuration();
+ cfg.setObjectWrapper(new DefaultObjectWrapper());
+ cfg.setTemplateUpdateDelay(0);
+
+ Template temp = new Template(name, new InputStreamReader(src), cfg);
+ temp.dump(System.out);
+
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ Writer out = new OutputStreamWriter(bout);
+ temp.process(renderContext, out);
+ out.flush();
+
+ System.out.println(new String(bout.toByteArray()));
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+
+}
Modified: jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -23,6 +23,8 @@
import org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin;
import org.jbpm.*;
+import org.jbpm.model.OpenExecution;
+import org.jbpm.model.Transition;
import org.jbpm.env.Environment;
import org.jbpm.env.EnvironmentFactory;
import org.jbpm.integration.spi.mgmt.ServerConfig;
@@ -32,13 +34,19 @@
import org.jbpm.task.Task;
import javax.activation.DataHandler;
+import javax.activation.DataSource;
import javax.naming.InitialContext;
-import java.io.InputStream;
+import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.Set;
+import java.util.HashMap;
+import java.util.List;
+import freemarker.template.DefaultObjectWrapper;
+import freemarker.template.Template;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -55,11 +63,10 @@
public URL getDispatchUrl(long taskId)
{
- ServerConfig serverConfig = getServerConfig();
StringBuffer sb = new StringBuffer();
sb.append("http://");
- sb.append(serverConfig.getWebServiceHost());
- sb.append(":").append(serverConfig.getWebServicePort());
+ sb.append(getServerConfig().getWebServiceHost());
+ sb.append(":").append(getServerConfig().getWebServicePort());
sb.append("/gwt-console-server/rs/task/");
sb.append( taskId );
sb.append("/render");
@@ -97,19 +104,19 @@
// access the processdefition
TaskImpl cast = ((TaskImpl) task);
- ExecutionImpl execution = cast.getProcessInstance();
+ ExecutionImpl processInstance = cast.getProcessInstance();
+ String processInstanceId = processInstance.getId();
+ String processId = processInstance.getProcessDefinition().getId();
- String processInstanceId = cast.getProcessInstance().getId();
- String processId = execution.getProcessInstance().getProcessDefinition().getId();
-
RepositoryService repoService = processEngine.getRepositoryService();
ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
query.id(processId);
ProcessDefinition procDef = query.uniqueResult();
// check if a template exists
+ String name = task.getName() + ".ftl";
InputStream template = repoService.getResourceAsStream(
- procDef.getDeploymentDbid(), task.getName()+".ftl"
+ procDef.getDeploymentDbid(), name
);
// merge template with process variables
@@ -120,7 +127,41 @@
Set<String> varNames = execService.getVariableNames(processInstanceId);
if(varNames!=null)
{
- Map<String, Object> variables = execService.getVariables(processInstanceId, varNames);
+ Map<String, Object> processContext = execService.getVariables(processInstanceId, varNames);
+
+ // plugin context
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("http://");
+ sb.append(getServerConfig().getWebServiceHost());
+ sb.append(":").append(getServerConfig().getWebServicePort());
+ sb.append("/gwt-console-server/rs/task/");
+ sb.append( taskId );
+ sb.append("/process");
+
+ Map<String, Object> renderContext = new HashMap<String,Object>();
+
+ // form directive
+ FormDirective formDirective = new FormDirective();
+ formDirective.setAction( sb.toString() );
+ renderContext.put("form", formDirective);
+
+ // outcome directive
+ OutcomeDirective outcomeDirective = new OutcomeDirective();
+ List<Transition> transitions =
+ ((OpenExecution) processInstance).getActivity().getOutgoingTransitions();
+ for(Transition t : transitions)
+ {
+ String outcomeName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
+ outcomeDirective.getValues().add(outcomeName);
+ }
+ renderContext.put("outcome",outcomeDirective);
+
+ // process variables
+ renderContext.putAll(processContext);
+
+
+ result = processTemplate(name, template, renderContext);
}
}
@@ -131,6 +172,63 @@
}
}
+ private DataHandler processTemplate(
+ final String name, InputStream src,
+ Map<String, Object> renderContext
+ )
+ {
+ DataHandler merged = null;
+
+ try
+ {
+ freemarker.template.Configuration cfg = new freemarker.template.Configuration();
+ cfg.setObjectWrapper(new DefaultObjectWrapper());
+ cfg.setTemplateUpdateDelay(0);
+
+ Template temp = new Template(name, new InputStreamReader(src), cfg);
+ temp.dump(System.out);
+
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ Writer out = new OutputStreamWriter(bout);
+ temp.process(renderContext, out);
+ out.flush();
+
+ merged = new DataHandler(
+
+ new DataSource()
+ {
+
+ public InputStream getInputStream() throws IOException
+ {
+ return new ByteArrayInputStream(bout.toByteArray());
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ return bout;
+ }
+
+ public String getContentType()
+ {
+ return "*/*";
+ }
+
+ public String getName()
+ {
+ return name + "_DataSource";
+ }
+ }
+ );
+
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to process task template", e);
+ }
+
+ return merged;
+ }
+
public void processCompletion(long taskId, String outcome, InputStream payload)
{
@@ -148,4 +246,5 @@
throw new RuntimeException("Failed to lookup process engine", e);
}
}
+
}
Modified: jbpm4/branches/hbraun/modules/integration/integration.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/integration.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/integration.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -22,10 +22,12 @@
<orderEntry type="module" module-name="jbpm4-test-base" exported="" />
<orderEntry type="module" module-name="jbpm4-task" exported="" />
<orderEntry type="module" module-name="jbpm4-toplevel" exported="" />
- <orderEntry type="module" module-name="gwt-rpc" exported="" />
- <orderEntry type="module" module-name="server-integration" exported="" />
<orderEntry type="module" module-name="jpdl" exported="" />
<orderEntry type="module" module-name="api" exported="" />
+ <orderEntry type="module" module-name="pvm" exported="" />
+ <orderEntry type="module" module-name="test-base" exported="" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="server-integration" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:provided">
<CLASSES>
@@ -243,15 +245,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.javaee:jboss-servlet-api:jar:2.5.0.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/javaee/jboss-servlet-api/2.5.0.GA/jboss-servlet-api-2.5.0.GA.jar!/" />
@@ -1170,60 +1163,54 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:provided">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:provided">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.9.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.9.GA/jboss-common-core-2.2.9.GA.jar!/" />
</CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <JAVADOC />
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1.1:compile">
+ <library name="M2 Dep: org.apache.ant:ant-launcher:jar:1.7.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.9.GA:compile">
+ <library name="M2 Dep: org.apache.ant:ant:jar:1.7.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.9.GA/jboss-common-core-2.2.9.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.apache.ant:ant-launcher:jar:1.7.0:provided">
+ <library name="M2 Dep: org.freemarker:freemarker:jar:2.3.15:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/freemarker/freemarker/2.3.15/freemarker-2.3.15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.apache.ant:ant:jar:1.7.0:provided">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: jbpm4/branches/hbraun/modules/integration/jboss4/integration-jboss4.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/jboss4/integration-jboss4.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/jboss4/integration-jboss4.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -11,10 +11,10 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="toplevel" exported="" />
<orderEntry type="module" module-name="jpdl" exported="" />
- <orderEntry type="module" module-name="integration-spi" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module" module-name="pvm" exported="" />
<orderEntry type="module" module-name="integration" exported="" />
- <orderEntry type="module" module-name="api" exported="" />
+ <orderEntry type="module" module-name="test-base" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile">
<CLASSES>
@@ -1108,15 +1108,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
@@ -1157,29 +1148,14 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:compile">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/branches/hbraun/modules/integration/jboss5/integration-jboss5.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/jboss5/integration-jboss5.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/jboss5/integration-jboss5.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -10,10 +10,11 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="toplevel" exported="" />
- <orderEntry type="module" module-name="integration-spi" exported="" />
- <orderEntry type="module" module-name="integration" />
- <orderEntry type="module" module-name="jpdl" />
- <orderEntry type="module" module-name="api" />
+ <orderEntry type="module" module-name="jpdl" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
+ <orderEntry type="module" module-name="pvm" exported="" />
+ <orderEntry type="module" module-name="integration" exported="" />
+ <orderEntry type="module" module-name="test-base" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile">
<CLASSES>
@@ -1115,7 +1116,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
@@ -1124,16 +1125,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
@@ -1146,35 +1138,20 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:compile">
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:compile">
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: javax.activation:activation:jar:1.1.1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/activation/activation/1.1.1/activation-1.1.1.jar!/" />
- </CLASSES>
<JAVADOC />
<SOURCES />
</library>
Modified: jbpm4/branches/hbraun/modules/integration/spi/integration-spi.iml
===================================================================
--- jbpm4/branches/hbraun/modules/integration/spi/integration-spi.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/spi/integration-spi.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -12,6 +12,8 @@
<orderEntry type="module" module-name="toplevel" exported="" />
<orderEntry type="module" module-name="jpdl" />
<orderEntry type="module" module-name="api" />
+ <orderEntry type="module" module-name="pvm" />
+ <orderEntry type="module" module-name="test-base" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
<CLASSES>
@@ -1119,7 +1121,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.jbossas:jboss-as-server:jar:client:5.0.0.CR2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jboss/jbossas/jboss-as-server/5.0.0.CR2/jboss-as-server-5.0.0.CR2-client.jar!/" />
@@ -1128,16 +1130,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
@@ -1151,29 +1144,14 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-pvm:jar:4.0.0.Beta1:compile">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-pvm/4.0.0.Beta1/jbpm-pvm-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: org.jbpm.jbpm4:jbpm-test-base:jar:4.0.0.Beta1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-javadoc.jar!/" />
- </JAVADOC>
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-test-base/4.0.0.Beta1/jbpm-test-base-4.0.0.Beta1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/branches/hbraun/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java
===================================================================
--- jbpm4/branches/hbraun/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/integration/spi/src/main/java/org/jbpm/integration/spi/DeploymentAdaptor.java 2009-05-05 13:35:22 UTC (rev 4727)
@@ -23,6 +23,7 @@
import java.io.File;
import java.util.List;
+import java.util.zip.ZipInputStream;
import javax.naming.InitialContext;
import javax.transaction.SystemException;
@@ -59,7 +60,8 @@
File deploymentFile = new File(deploymentName);
long deploymentDbid = repositoryService.createDeployment()
- .addResourceFromUrl(deploymentMetData.getProcessDescriptor())
+ .addResourcesFromZipInputStream(new ZipInputStream(deploymentMetData.getWatch().openStream()))
+ //.addResourceFromUrl(deploymentMetData.getProcessDescriptor())
.setTimestamp(deploymentFile.lastModified())
.setName(deploymentName)
.deploy();
Modified: jbpm4/branches/hbraun/modules/test-base/test-base.iml
===================================================================
--- jbpm4/branches/hbraun/modules/test-base/test-base.iml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/modules/test-base/test-base.iml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -8,12 +8,12 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="api" />
- <orderEntry type="module" module-name="toplevel" />
+ <orderEntry type="module" module-name="toplevel" exported="" />
+ <orderEntry type="module" module-name="api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -22,7 +22,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -31,7 +31,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -40,7 +40,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -49,18 +49,19 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: dom4j:dom4j:jar:1.6.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library name="M2 Dep: cglib:cglib:jar:2.1_3:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -69,7 +70,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm-attrs:jar:1.5.3:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -78,7 +79,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: antlr:antlr:jar:2.7.6:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -87,7 +88,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -96,7 +97,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm:jar:1.5.3:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -105,7 +106,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -114,7 +115,7 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -123,23 +124,37 @@
<orderEntry type="module-library" exported="">
<library name="M2 Dep: log4j:log4j:jar:1.2.14:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jbpm.jbpm4:jbpm-log:jar:4.0.0.Beta1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jbpm/jbpm4/jbpm-log/4.0.0.Beta1/jbpm-log-4.0.0.Beta1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/branches/hbraun/pom.xml
===================================================================
--- jbpm4/branches/hbraun/pom.xml 2009-05-05 13:34:39 UTC (rev 4726)
+++ jbpm4/branches/hbraun/pom.xml 2009-05-05 13:35:22 UTC (rev 4727)
@@ -47,6 +47,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<apache.ant.version>1.7.0</apache.ant.version>
<cactus.version>13-1.7.1</cactus.version>
+ <freemarker.version>2.3.15</freemarker.version>
<gwt.console.version>1.0.0-SNAPSHOT</gwt.console.version>
<hibernate.version>3.2.6.ga</hibernate.version>
<hibernate.annotations.version>3.3.1.GA</hibernate.annotations.version>
@@ -192,6 +193,11 @@
<version>${cactus.version}</version>
</dependency>
<dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>${freemarker.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
15 years, 1 month
JBoss JBPM SVN: r4726 - projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-05 09:34:39 -0400 (Tue, 05 May 2009)
New Revision: 4726
Modified:
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
Log:
todo and comments
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-05-05 13:32:14 UTC (rev 4725)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-05-05 13:34:39 UTC (rev 4726)
@@ -220,9 +220,10 @@
}
}
+ // TODO: associate task variables
+
// trigger execution
-
-
+
return Response.ok("Sucessfully processed task UI").build();
}
}
15 years, 1 month
JBoss JBPM SVN: r4725 - in projects/gwt-console/trunk: gui/war and 5 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-05 09:32:14 -0400 (Tue, 05 May 2009)
New Revision: 4725
Modified:
projects/gwt-console/trunk/gui/war/gui-war.iml
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
projects/gwt-console/trunk/gui/workspace-example/workspace-example.iml
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/server/server-core/pom.xml
projects/gwt-console/trunk/server/server-core/server-core.iml
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
Log:
More work on task forms
Modified: projects/gwt-console/trunk/gui/war/gui-war.iml
===================================================================
--- projects/gwt-console/trunk/gui/war/gui-war.iml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/war/gui-war.iml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -11,8 +11,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="workspace-api" exported="" />
<orderEntry type="module" module-name="gwt-rpc" exported="" />
- <orderEntry type="module" module-name="workspace-api" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-05-05 13:32:14 UTC (rev 4725)
@@ -66,7 +66,9 @@
{
TaskRef selection = null;
if(isInitialized() && listBox.getSelectedIndex()!=-1)
- selection = listBox.getItem( listBox.getSelectedIndex());
+ {
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ }
return selection;
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-05 13:32:14 UTC (rev 4725)
@@ -22,6 +22,7 @@
package org.jboss.bpm.console.client.task;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Frame;
@@ -32,9 +33,10 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
import org.jboss.bpm.console.client.util.WindowUtil;
-import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
import java.util.List;
@@ -46,10 +48,16 @@
public final static String ID = AssignedTasksView.class.getName();
- public AssignedTasksView()
+ private final ApplicationContext appContext;
+
+ private WindowPanel windowPanel;
+
+ public AssignedTasksView(ApplicationContext appContext)
{
super();
+ this.appContext = appContext;
setTitle("Your Tasks");
+
}
public void initialize()
@@ -93,7 +101,9 @@
int index = listBox.getSelectedIndex();
if(index!=-1)
{
- System.out.println("Selected row "+ index);
+ appContext.displayMessage(
+ "Sel1 " + listBox.getItem(index).getId(), false
+ );
}
}
});
@@ -125,12 +135,16 @@
TaskRef selection = getSelection();
+ appContext.displayMessage(
+ "Sel2 " + selection.getId(), false
+ );
+
if(selection!=null)
{
if(selection.getUrl()!=null && !selection.getUrl().equals(""))
createTaskFormWindow(selection);
else
- MessageBox.alert("Invalid operation", "The task doesn't reference a form");
+ MessageBox.alert("Invalid operation", "The task doesn't reference a form");
}
else
{
@@ -152,7 +166,7 @@
if(selection!=null)
{
TaskIdentityEvent payload = new TaskIdentityEvent(
- getAssignedIdentity(), selection
+ getAssignedIdentity(), selection
);
controller.handleEvent(
@@ -182,24 +196,43 @@
private void createTaskFormWindow(TaskRef task)
{
- WindowPanel windowPanel = new WindowPanel(task.getName());
- //windowPanel.getHeader().add( new Image("images/icons/error.png") );
+ windowPanel = new WindowPanel(task.getName());
windowPanel.setAnimationEnabled(true);
windowPanel.setSize("320px", "240px");
+ appContext.displayMessage(
+ "Sel3 " + task.getUrl(), false
+ );
+
+ windowPanel.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ windowPanel = null;
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+
// iframe
- Frame frame = new Frame();
- frame.setUrl(task.getUrl().toString());
+ Frame frame = new Frame();
+ frame.setUrl(task.getUrl());
+
+ appContext.displayMessage(
+ "Sel4 " + frame.getElement().getId(), false
+ );
+
DOM.setStyleAttribute(frame.getElement(), "border", "none");
windowPanel.setWidget(frame);
-
+
WindowUtil.addMaximizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
WindowUtil.addMinimizeButton(windowPanel, Caption.CaptionRegion.RIGHT);
// display
windowPanel.center();
+
}
public void update(String identity, List<TaskRef> tasks)
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-05 13:32:14 UTC (rev 4725)
@@ -81,7 +81,7 @@
// create and register views
registerView(OpenTasksView.ID, new OpenTasksView());
- registerView(AssignedTasksView.ID, new AssignedTasksView());
+ registerView(AssignedTasksView.ID, new AssignedTasksView(appContext));
// create and register actions
registerAction(LoadTasksAction.ID, new LoadTasksAction(appContext));
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-05-05 13:32:14 UTC (rev 4725)
@@ -34,7 +34,7 @@
<body>
<!-- OPTIONAL: include this if you want history support -->
-<iframe src="javascript:''" id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
+<!--iframe src="javascript:''" id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe-->
</body>
</html>
Modified: projects/gwt-console/trunk/gui/workspace-example/workspace-example.iml
===================================================================
--- projects/gwt-console/trunk/gui/workspace-example/workspace-example.iml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gui/workspace-example/workspace-example.iml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -12,8 +12,8 @@
<orderEntry type="module" module-name="toplevel" />
<orderEntry type="module" module-name="plugin-api" />
<orderEntry type="module" module-name="plugin" />
+ <orderEntry type="module" module-name="workspace-api" />
<orderEntry type="module" module-name="gwt-rpc" />
- <orderEntry type="module" module-name="workspace-api" />
<orderEntry type="module-library">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/gwt-parent.iml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -20,345 +20,354 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="gwt-rpc" />
<orderEntry type="module" module-name="server-integration" />
<orderEntry type="module" module-name="workspace-api" />
+ <orderEntry type="module" module-name="gwt-rpc" />
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <library name="M2 Dep: org.jboss.javaee:jboss-javaee:jar:5.0.0.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
+ </CLASSES>
+ <JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.javaee:jboss-javaee:jar:5.0.0.GA:provided">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/javaee/jboss-javaee/5.0.0.GA/jboss-javaee-5.0.0.GA-sources.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.googlecode.mvc4g:mvc4g:jar:1.0.0-jboss:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/mvc4g/mvc4g/1.0.0-jboss/mvc4g-1.0.0-jboss.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-digester:commons-digester:jar:1.8:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-configuration:commons-configuration:jar:1.6:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-beanutils:commons-beanutils-core:jar:1.8.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.resteasy:jaxrs-api:jar:1.0.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/resteasy/jaxrs-api/1.0.2.GA/jaxrs-api-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/pom.xml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -157,8 +157,12 @@
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
-
<dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
+ <dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
Modified: projects/gwt-console/trunk/server/server-core/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/server-core/pom.xml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/server/server-core/pom.xml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -96,6 +96,44 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-multipart-provider</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
Modified: projects/gwt-console/trunk/server/server-core/server-core.iml
===================================================================
--- projects/gwt-console/trunk/server/server-core/server-core.iml 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/server/server-core/server-core.iml 2009-05-05 13:32:14 UTC (rev 4725)
@@ -22,138 +22,131 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
+ <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-logging:commons-logging:jar:1.1.1:compile">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <library name="M2 Dep: commons-fileupload:commons-fileupload:jar:1.2.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <library name="M2 Dep: commons-io:commons-io:jar:1.3.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <library name="M2 Dep: org.jboss.resteasy:resteasy-multipart-provider:jar:1.0.2.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-multipart-provider/1.0.2.GA/resteasy-multipart-provider-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -166,54 +159,54 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.slf4j:slf4j-api:jar:1.5.2:compile">
+ <library name="M2 Dep: javassist:javassist:jar:3.6.0.GA:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: junit:junit:jar:3.8.1:test">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.resteasy:resteasy-jaxrs:jar:1.0.2.GA:compile">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/resteasy/resteasy-jaxrs/1.0.2.GA/resteasy-jaxrs-1.0.2.GA.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -229,23 +222,36 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-05-05 12:56:15 UTC (rev 4724)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-05-05 13:32:14 UTC (rev 4725)
@@ -25,12 +25,23 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.TaskManagement;
+import org.jboss.bpm.console.server.plugin.PluginMgr;
import org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin;
-import org.jboss.bpm.console.server.plugin.PluginMgr;
+import org.jboss.resteasy.plugins.providers.multipart.InputPart;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import javax.activation.DataHandler;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.ByteArrayInputStream;
/**
* REST server module for accessing task related data.
@@ -42,7 +53,7 @@
{
private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
- private TaskManagement taskManagement;
+ private TaskManagement taskManagement;
private TaskDispatcherPlugin formPlugin;
@@ -142,20 +153,76 @@
DataHandler dh = getTaskDispatcherPlugin().provideTaskUI(taskId);
if(null==dh)
{
- throw new RuntimeException("No UI associated with task ID" + taskId);
+ throw new RuntimeException("No UI associated with task ID " + taskId);
}
- return Response.ok(dh).build();
+ return Response.ok(dh.getDataSource()).type("text/html").build();
}
@POST
- @Path("{taskId}/close")
+ @Path("{taskId}/process")
@Produces("text/html")
+ @Consumes("multipart/form-data")
public Response closeWithUI(
@PathParam("taskId")
- long taskId
+ long taskId,
+ MultipartFormDataInput payload
)
{
- return Response.serverError().build();
+ Map<String,Object> processVars = new HashMap<String,Object>();
+
+ Map<String,InputPart> formData = payload.getFormData();
+ Iterator<String> partNames = formData.keySet().iterator();
+
+ while(partNames.hasNext())
+ {
+ final String partName = partNames.next();
+ final InputPart part = formData.get(partName);
+ final MediaType mediaType = part.getMediaType();
+
+ if(MediaType.TEXT_PLAIN_TYPE.equals(mediaType))
+ {
+ // RFC2045: Each part has an optional "Content-Type" header
+ // that defaults to "text/plain".
+ // Can go into process without conversion
+ processVars.put(partName, part.getBodyAsString());
+ }
+ else
+ {
+ // anything else turns into a DataHandler
+ final byte[] data = part.getBodyAsString().getBytes();
+ DataHandler dh = new DataHandler(
+ new DataSource()
+ {
+ public InputStream getInputStream() throws IOException
+ {
+ return new ByteArrayInputStream(data);
+ }
+
+ public OutputStream getOutputStream() throws IOException
+ {
+ throw new RuntimeException("This is a readonly DataHandler");
+ }
+
+ public String getContentType()
+ {
+ return mediaType.getType();
+ }
+
+ public String getName()
+ {
+ return partName;
+ }
+ }
+ );
+
+ processVars.put(partName, dh);
+ }
+ }
+
+ // trigger execution
+
+
+ return Response.ok("Sucessfully processed task UI").build();
}
}
15 years, 1 month