JBoss JBPM SVN: r2701 - jbpm4/trunk/modules/log.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 06:28:46 -0400 (Fri, 31 Oct 2008)
New Revision: 2701
Removed:
jbpm4/trunk/modules/log/target/
Log:
unification api proposals
15 years, 6 months
JBoss JBPM SVN: r2700 - in jbpm4/trunk: modules/test/src/main/java/org/jbpm/test and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 06:23:57 -0400 (Fri, 31 Oct 2008)
New Revision: 2700
Removed:
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java
Modified:
jbpm4/trunk/pom.xml
Log:
unification api proposals
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.MySQLDialect;
-import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.mapping.ForeignKey;
-import org.hibernate.mapping.Table;
-import org.jbpm.pvm.env.EnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public class Db {
-
- private static final String CLEAN_SQL_KEY = "cleanSql";
-
- public static void clean(EnvironmentFactory environmentFactory) {
- SessionFactory sessionFactory = environmentFactory.get(SessionFactory.class);
- String[] cleanSql = (String[]) environmentFactory.get(CLEAN_SQL_KEY);
-
- if (cleanSql == null) {
- Configuration configuration = environmentFactory.get(Configuration.class);
-
- SessionFactoryImplementor sessionFactoryImplementor = (SessionFactoryImplementor) sessionFactory;
- Dialect dialect = sessionFactoryImplementor.getDialect();
-
- // loop over all foreign key constraints
- List<String> dropForeignKeysSql = new ArrayList<String>();
- List<String> createForeignKeysSql = new ArrayList<String>();
- Iterator<Table> iter = configuration.getTableMappings();
- while (iter.hasNext()) {
- Table table = (Table) iter.next();
- if (table.isPhysicalTable()) {
- String catalog = table.getCatalog();
- String schema = table.getSchema();
- Iterator<ForeignKey> subIter = table.getForeignKeyIterator();
- while (subIter.hasNext()) {
- ForeignKey fk = (ForeignKey) subIter.next();
- if (fk.isPhysicalConstraint()) {
- // collect the drop foreign key constraint sql
- dropForeignKeysSql.add(fk.sqlDropString(dialect, catalog, schema));
- // MySQLDialect creates an index for each foreign key.
- // see
- // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2155
- // This index should be dropped or an error will be thrown during
- // the creation phase
- if (dialect instanceof MySQLDialect) {
- dropForeignKeysSql.add("alter table " + table.getName() + " drop key " + fk.getName());
- }
- // and collect the create foreign key constraint sql
- createForeignKeysSql.add(fk.sqlCreateString(dialect, sessionFactoryImplementor, catalog, schema));
- }
- }
- }
- }
-
- List<String> deleteSql = new ArrayList<String>();
- iter = configuration.getTableMappings();
- while (iter.hasNext()) {
- Table table = (Table) iter.next();
- if (table.isPhysicalTable()) {
- deleteSql.add("delete from " + table.getName());
- }
- }
-
- // glue
- // - drop foreign key constraints
- // - delete contents of all tables
- // - create foreign key constraints
- // together to form the clean script
- List<String> cleanSqlList = new ArrayList<String>();
- cleanSqlList.addAll(dropForeignKeysSql);
- cleanSqlList.addAll(deleteSql);
- cleanSqlList.addAll(createForeignKeysSql);
-
- cleanSql = (String[]) cleanSqlList.toArray(new String[cleanSqlList.size()]);
-
- environmentFactory.set(CLEAN_SQL_KEY, cleanSql);
- }
-
- Session session = sessionFactory.openSession();
- try {
- for (String query : cleanSql) {
- session.createSQLQuery(query).executeUpdate();
- }
- } finally {
- session.close();
- }
- }
-
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import org.jbpm.ExecutionService;
-import org.jbpm.ManagementService;
-import org.jbpm.ProcessService;
-import org.jbpm.pvm.internal.cmd.CommandService;
-
-
-/** for tests that use persistence through a command service.
- *
- * The DB is cleaned inbetween tests. No environment is created.
- *
- * @author Tom Baeyens
- */
-public abstract class DbTestCase extends EnvironmentFactoryTestCase {
-
- protected CommandService commandService;
- protected ProcessService processService;
- protected ExecutionService executionService;
- protected ManagementService managementService;
-
- public DbTestCase() {
- super();
- }
-
- public DbTestCase(String configResource) {
- super(configResource);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- if (isEnvironmentFactoryCached()) {
- Db.clean(getEnvironmentFactory());
- }
-
- commandService = getEnvironmentFactory().get(CommandService.class);
- processService = getEnvironmentFactory().get(ProcessService.class);
- executionService = getEnvironmentFactory().get(ExecutionService.class);
- managementService = getEnvironmentFactory().get(ManagementService.class);
- }
-
- public void tearDown() throws Exception {
- commandService = null;
- processService = null;
- executionService = null;
- managementService = null;
- super.tearDown();
- }
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.lang.reflect.Field;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.jbpm.Execution;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.jbpm.pvm.model.OpenProcessDefinition;
-import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.session.PvmDbSession;
-
-
-/** for tests that use persistence inside environment blocks.
- *
- * An environment is opened in the setUp and closed in the tearDown.
- * DB is cleaned inbetween tests. Extra convenience methods for usage
- * inside an environment block are provided.
- *
- * @author Tom Baeyens
- */
-public class EnvironmentDbTestCase extends EnvironmentTestCase {
-
- Transaction transaction = null;
-
- public EnvironmentDbTestCase() {
- }
-
- public EnvironmentDbTestCase(String configResource) {
- super(configResource);
- }
-
- public void setUp() throws Exception {
- if (isEnvironmentFactoryCached()) {
- Db.clean(getEnvironmentFactory());
- }
- super.setUp();
- beginTransaction();
- }
-
- public void tearDown() throws Exception {
- commitTransaction();
- super.tearDown();
- }
-
- void beginTransaction() {
- Session session = environment.get(Session.class);
- transaction = session.beginTransaction();
- }
-
- void commitTransaction() {
- transaction.commit();
- transaction = null;
- }
-
- void rollbackTransaction() {
- transaction.rollback();
- transaction = null;
- }
-
- public DbSession getDbSession() {
- return environment.get(DbSession.class);
- }
-
- public void rollbackAndBeginNewTransaction() {
- rollbackTransaction();
- closeEnvironment();
- openEnvironment();
- beginTransaction();
- }
-
- public void newTransaction() {
- try {
- commitTransaction();
- closeEnvironment();
- } finally {
- openEnvironment();
- beginTransaction();
- }
- }
-
- public void beginCacheTest() {
- SessionFactory sessionFactory = environment.get(SessionFactory.class);
- if (sessionFactory != null) {
- log.debug("=================================================================");
- log.debug("Beginning of the cache test, no more sql query should be performed before the end of the test");
- log.debug("=================================================================");
-
- sessionFactory.getStatistics().clear();
- sessionFactory.getStatistics().setStatisticsEnabled(true);
- }
- }
-
- public void endCacheTest() {
- SessionFactory sessionFactory = environment.get(SessionFactory.class);
- if (sessionFactory != null) {
- assertEquals(0, sessionFactory.getStatistics().getEntityLoadCount());
- assertEquals(0, sessionFactory.getStatistics().getCollectionLoadCount());
- }
- }
-
- public ProcessDefinitionImpl reload(OpenProcessDefinition processDefinition) {
- environment.get(PvmDbSession.class).save(processDefinition);
- newTransaction();
- return environment.get(PvmDbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- }
-
- public <T> T reload(T object, Class<T> persistentClass) {
- environment.get(DbSession.class).save(object);
- newTransaction();
-
- Long dbid = null;
- try {
- Field dbidField = ReflectUtil.getField(persistentClass, "dbid");
- dbidField.setAccessible(true);
- dbid = (Long) dbidField.get(object);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return environment.get(DbSession.class).get(persistentClass, dbid);
- }
-
- public ExecutionImpl reload(Execution execution) {
- environment.get(PvmDbSession.class).save(execution);
- newTransaction();
- return environment.get(PvmDbSession.class).get(ExecutionImpl.class, execution.getDbid());
- }
-
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.PvmException;
-import org.jbpm.pvm.env.EnvironmentFactory;
-import org.jbpm.pvm.env.PvmEnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentFactoryTestCase extends JbpmTestCase {
-
- String configResource;
-
- static Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
-
- public EnvironmentFactoryTestCase() {
- this("environment.cfg.xml");
- }
-
- public EnvironmentFactoryTestCase(String configResource) {
- this.configResource = configResource;
- }
-
- public EnvironmentFactory getEnvironmentFactory() {
- if (isEnvironmentFactoryCached()) {
- return environmentFactories.get(configResource);
- }
- return createEnvironmentFactory();
- }
-
- boolean isEnvironmentFactoryCached() {
- return environmentFactories.containsKey(configResource);
- }
-
- EnvironmentFactory createEnvironmentFactory() {
- return createEnvironmentFactory(configResource);
- }
-
- static EnvironmentFactory createEnvironmentFactory(String configResource) {
- try {
- log.debug("creating environment factory for ["+configResource+"]");
- EnvironmentFactory newEnvironmentFactory = new PvmEnvironmentFactory(configResource);
- environmentFactories.put(configResource, newEnvironmentFactory);
- return newEnvironmentFactory;
- } catch (Exception e) {
- throw new PvmException("Exception during creation of environment factory for "+configResource, e);
- }
- }
-
- static void closeEnvironmentFactory(String configResource) {
- EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
- if (environmentFactory!=null) {
- log.debug("closing environment factory for ["+configResource+"]");
- environmentFactory.close();
- }
- }
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,63 +0,0 @@
-/**
- * Copyright (C) 2007 Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library is free software; you can redistribute it and/or modify it under the terms
- * of the GNU Lesser General Public License as published by the Free Software Foundation
- * version 2.1 of the License.
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301, USA.
- **/
-package org.jbpm.pvm.test.base;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Guillaume Porcher
- *
- */
-public class EnvironmentFactoryTestSetup extends TestSetup
-{
- private String configResource;
-
- public EnvironmentFactoryTestSetup(Test test)
- {
- this(test, "environment.cfg.xml");
- }
-
- public EnvironmentFactoryTestSetup(Class<?> testClass)
- {
- this(new TestSuite(testClass), "environment.cfg.xml");
- }
-
- public EnvironmentFactoryTestSetup(Test test, String configResource)
- {
- super(test);
- this.configResource = configResource;
- }
-
- public EnvironmentFactoryTestSetup(Class<?> testClass, String configResource)
- {
- super(new TestSuite(testClass));
- this.configResource = configResource;
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- EnvironmentFactoryTestCase.createEnvironmentFactory(configResource);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- EnvironmentFactoryTestCase.closeEnvironmentFactory(configResource);
- super.tearDown();
- }
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import org.jbpm.pvm.env.Environment;
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentTestCase extends EnvironmentFactoryTestCase {
-
- protected Environment environment;
-
- public EnvironmentTestCase() {
- }
-
- public EnvironmentTestCase(String configResource) {
- super(configResource);
- }
-
- public void setUp() throws Exception {
- super.setUp();
- openEnvironment();
- }
-
- public void tearDown() throws Exception {
- closeEnvironment();
- super.tearDown();
- }
-
- void closeEnvironment() {
- environment.close();
- environment = null;
- }
-
- void openEnvironment() {
- environment = getEnvironmentFactory().openEnvironment();
- }
-}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java 2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.env.EnvironmentFactory;
-import org.jbpm.pvm.env.PvmEnvironmentFactory;
-import org.jbpm.pvm.internal.log.Jdk14LogFactory;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.internal.log.LogFormatter;
-
-public abstract class JbpmTestCase extends TestCase {
-
- static {
- Jdk14LogFactory.initializeJdk14Logging();
- }
-
- public void setUp() throws Exception {
- assertNull(Environment.getCurrent());
- LogFormatter.resetIndentation();
- log.info("=== starting "+getName()+" =============================");
- }
-
- public void tearDown() throws Exception {
- log.info("=== ending "+getName()+" =============================\n");
- assertNull(Environment.getCurrent());
- }
-
- public void assertTextPresent(String expected, String value) {
- if ( (value==null)
- || (value.indexOf(expected)==-1)
- ) {
- throw new AssertionFailedError("expected presence of '"+expected+"' but was '"+value+"'");
- }
- }
-
- public static Environment openEnvironment(String xmlString) {
- EnvironmentFactory environmentFactory = PvmEnvironmentFactory.parseXmlString(xmlString);
- return environmentFactory.openEnvironment();
- }
-
- protected void runTest() throws Throwable {
- try {
- super.runTest();
- } catch (AssertionFailedError e) {
- log.error("");
- log.error("ASSERTION FAILURE: "+e.getMessage());
- log.error("");
- throw e;
- } catch (Throwable t) {
- t.printStackTrace();
- throw t;
- }
- }
-
- static protected Log log = Log.getLog(JbpmTestCase.class.getName());
-}
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/pom.xml 2008-10-31 10:23:57 UTC (rev 2700)
@@ -34,10 +34,11 @@
<!-- Modules -->
<modules>
<module>modules/api</module>
- <module>modules/pvm</module>
<module>modules/cts</module>
<module>modules/jpdl</module>
+ <module>modules/log</module>
<module>modules/manual</module>
+ <module>modules/pvm</module>
<module>modules/test</module>
</modules>
15 years, 6 months
JBoss JBPM SVN: r2699 - in jbpm4/trunk/modules: log and 42 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 06:21:24 -0400 (Fri, 31 Oct 2008)
New Revision: 2699
Added:
jbpm4/trunk/modules/log/
jbpm4/trunk/modules/log/.classpath
jbpm4/trunk/modules/log/.project
jbpm4/trunk/modules/log/pom.xml
jbpm4/trunk/modules/log/src/
jbpm4/trunk/modules/log/src/main/
jbpm4/trunk/modules/log/src/main/java/
jbpm4/trunk/modules/log/src/main/java/org/
jbpm4/trunk/modules/log/src/main/java/org/jbpm/
jbpm4/trunk/modules/log/src/main/java/org/jbpm/log/
jbpm4/trunk/modules/log/target/
jbpm4/trunk/modules/log/target/classes/
jbpm4/trunk/modules/log/target/classes/org/
jbpm4/trunk/modules/log/target/classes/org/jbpm/
jbpm4/trunk/modules/log/target/classes/org/jbpm/log/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/Db.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentTestCase.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/JbpmTestCase.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/
Modified:
jbpm4/trunk/modules/manual/.project
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/ErrorTriggeredFileHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14Log.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14LogFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLog.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLogFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFactory.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFormatter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckVersion.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateId.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateProcess.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/PvmNamingStrategy.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobAddedNotification.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThreadPool.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/Interceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/DefaultVariableTypeResolver.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CollectionDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextTypeRefDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/FieldOperation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/IncrementCounterWaitState.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/AddressActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/TestMessageCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ConcurrentWiringTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java
Log:
unification api proposals
Added: jbpm4/trunk/modules/log/.classpath
===================================================================
--- jbpm4/trunk/modules/log/.classpath (rev 0)
+++ jbpm4/trunk/modules/log/.classpath 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/log/.project
===================================================================
--- jbpm4/trunk/modules/log/.project (rev 0)
+++ jbpm4/trunk/modules/log/.project 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>log</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/trunk/modules/log/pom.xml
===================================================================
--- jbpm4/trunk/modules/log/pom.xml (rev 0)
+++ jbpm4/trunk/modules/log/pom.xml 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>jBPM 4 - Log</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-log</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>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/log/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/manual/.project
===================================================================
--- jbpm4/trunk/modules/manual/.project 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/manual/.project 2008-10-31 10:21:24 UTC (rev 2699)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>pvm-manual</name>
+ <name>manual</name>
<comment></comment>
<projects>
</projects>
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log (from rev 2690, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log)
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/ErrorTriggeredFileHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/ErrorTriggeredFileHandler.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/ErrorTriggeredFileHandler.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
import java.io.IOException;
import java.util.logging.FileHandler;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14Log.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/Jdk14Log.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14Log.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,12 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14LogFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/Jdk14LogFactory.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Jdk14LogFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
import java.io.IOException;
import java.io.InputStream;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/Log.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLog.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/Log4jLog.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLog.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLogFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/Log4jLogFactory.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/Log4jLogFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
import org.apache.log4j.LogManager;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/LogFactory.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFormatter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/log/LogFormatter.java 2008-10-31 09:09:52 UTC (rev 2690)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/log/LogFormatter.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -1,4 +1,4 @@
-package org.jbpm.pvm.internal.log;
+package org.jbpm.log;
import java.io.PrintWriter;
import java.io.StringWriter;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java (from rev 2694, jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.env;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Set;
+
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.env.PvmEnvironment;
+import org.jbpm.pvm.internal.env.PvmEnvironmentFactoryParser;
+import org.jbpm.pvm.internal.stream.FileStreamSource;
+import org.jbpm.pvm.internal.stream.InputStreamSource;
+import org.jbpm.pvm.internal.stream.ResourceStreamSource;
+import org.jbpm.pvm.internal.stream.StreamSource;
+import org.jbpm.pvm.internal.stream.StringStreamSource;
+import org.jbpm.pvm.internal.stream.UrlStreamSource;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.WireDefinition;
+
+
+/**
+ * an environment factory that also is the environment-factory context.
+ *
+ * <p>This environment factory will produce environments with 2 contexts:
+ * the environment-factory context and the block context.
+ * </p>
+ *
+ * <p>An environment-factory context is build from two wire definitions: the environment-factory
+ * wire definition and the environment wire definition.
+ * </p>
+ *
+ * <p>The environment-factory context itself is build from the environment-factory wire definition.
+ * So all objects that are created in this context remain cached for the lifetime of
+ * this environment-factory context object.
+ * </p>
+ *
+ * <p>This environment-factory context is also a environment factory. The produced environments
+ * contain 2 contexts: the environment-factory context itself and a new environment context,
+ * build from the environment wire definition. For each created environment, a new
+ * environment context will be created from the same environment wire definition.
+ * Objects in the environment context will live for as long as the environment.
+ * </p>
+ * @author Tom Baeyens
+ */
+public class PvmEnvironmentFactory extends EnvironmentFactory implements Context {
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(PvmEnvironmentFactory.class.getName());
+ protected static PvmEnvironmentFactoryParser pvmEnvironmentFactoryParser = new PvmEnvironmentFactoryParser();
+
+ protected WireContext environmentFactoryCtxWireContext = null;
+ protected WireDefinition environmentCtxWireDefinition = null;
+
+ public PvmEnvironmentFactory() {
+ }
+
+ public PvmEnvironmentFactory(String resource) {
+ this(resource, null);
+ }
+
+ public PvmEnvironmentFactory(String resource, ClassLoader classLoader) {
+ this(new ResourceStreamSource(resource, classLoader));
+ }
+
+ public PvmEnvironmentFactory(File file) {
+ this(new FileStreamSource(file));
+ }
+
+ public PvmEnvironmentFactory(URL url) {
+ this(new UrlStreamSource(url));
+ }
+
+ public PvmEnvironmentFactory(InputStream inputStream) {
+ this(new InputStreamSource(inputStream));
+ }
+
+ public static PvmEnvironmentFactory parseXmlString(String xmlString) {
+ return new PvmEnvironmentFactory(new StringStreamSource(xmlString));
+ }
+
+ PvmEnvironmentFactory(StreamSource streamSource) {
+ PvmEnvironmentFactoryParser.getInstance()
+ .createParse()
+ .setDocumentObject(this)
+ .setStreamSource(streamSource)
+ .execute()
+ .checkProblems("pvm environment configuration "+streamSource);
+ }
+
+ public Environment openEnvironment() {
+ PvmEnvironment environment = new PvmEnvironment(this);
+
+ log.debug("opening "+environment);
+
+ // set the classloader
+ ClassLoader classLoader = environmentFactoryCtxWireContext.getClassLoader();
+ if (classLoader!=null) {
+ environment.setClassLoader(classLoader);
+ }
+
+ // add the environment-factory context
+ environment.addContext(environmentFactoryCtxWireContext);
+
+ // add the environment block context
+ WireContext environmentContext = new WireContext(environmentCtxWireDefinition, Context.CONTEXTNAME_ENVIRONMENT, environment, true);
+ // add the environment block context to the environment
+ environment.addContext(environmentContext);
+
+ try {
+ // finish the creation of the environment wire context
+ environmentContext.create();
+
+ } catch (RuntimeException e) {
+ // On exception, pop environment
+ Environment.popEnvironment();
+ throw e;
+ }
+ // if all went well, return the created environment
+ return environment;
+ }
+
+ public void close() {
+ environmentFactoryCtxWireContext.fire(WireContext.EVENT_CLOSE, null);
+ }
+
+ // environment-factory context delegation methods ///////////////////////////////////
+
+ public Object get(String key) {
+ return environmentFactoryCtxWireContext.get(key);
+ }
+
+ public <T> T get(Class<T> type) {
+ return environmentFactoryCtxWireContext.get(type);
+ }
+
+ public String getName() {
+ return environmentFactoryCtxWireContext.getName();
+ }
+
+ public boolean has(String key) {
+ return environmentFactoryCtxWireContext.has(key);
+ }
+
+ public Set<String> keys() {
+ return environmentFactoryCtxWireContext.keys();
+ }
+
+ public Object set(String key, Object value) {
+ return environmentFactoryCtxWireContext.set(key, value);
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
+ public void setEnvironmentCtxWireDefinition(WireDefinition blockWireDefinition) {
+ this.environmentCtxWireDefinition = blockWireDefinition;
+ }
+ public WireContext getEnvironmentFactoryCtxWireContext() {
+ return environmentFactoryCtxWireContext;
+ }
+ public void setEnvironmentFactoryCtxWireContext(WireContext applicationWireContext) {
+ this.environmentFactoryCtxWireContext = applicationWireContext;
+ }
+ public WireDefinition getEnvironmentCtxWireDefinition() {
+ return environmentCtxWireDefinition;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java (from rev 2694, jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.env;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.pvm.internal.spring.SpringEnvironment;
+import org.jbpm.pvm.internal.util.ReflectUtil;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+/** this environment factory will see only the singleton beans.
+ *
+ * The created {@link SpringEnvironment}s will see the prototype
+ * beans and it will cache them.
+ *
+ * @author Tom Baeyens
+ */
+public class SpringEnvironmentFactory extends EnvironmentFactory implements ApplicationContextAware {
+
+ // TODO pull up the common behaviour between this class and the SpringEnvironmentContext
+
+ private static final long serialVersionUID = 1L;
+
+ ApplicationContext applicationContext;
+
+ public SpringEnvironment openEnvironment() {
+ return new SpringEnvironment(this);
+ }
+
+ public boolean has(String key) {
+ return applicationContext.isSingleton(key);
+ }
+
+ public Object get(String key) {
+ if (has(key)) {
+ return applicationContext.getBean(key);
+ }
+ return null;
+ }
+
+ public <T> T get(Class<T> type) {
+ String name = ReflectUtil.getUnqualifiedClassName(type);
+ name = name.substring(0, 1).toLowerCase() + name.substring(1);
+ return (T) get(name);
+ }
+
+ public Set<String> keys() {
+ HashSet<String> keys = new HashSet<String>();
+ for (String key : applicationContext.getBeanDefinitionNames()) {
+ if (has(key)) {
+ keys.add(key);
+ }
+ }
+ return keys;
+ }
+
+ public ApplicationContext getApplicationContext() {
+ return applicationContext;
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+
+ public void close() {
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public Object set(String key, Object value) {
+ return null;
+ }
+}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckVersion.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckVersion.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckVersion.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.deploy;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.session.PvmDbSession;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateId.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateId.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateId.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.deploy;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateProcess.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateProcess.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateProcess.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,8 +24,8 @@
import org.jbpm.ProcessDefinition;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
-import org.jbpm.pvm.internal.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -28,8 +28,8 @@
import java.util.Map.Entry;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
-import org.jbpm.pvm.internal.log.Log;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -26,9 +26,9 @@
import java.util.Map;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironment.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.env;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.Closable;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -12,7 +12,7 @@
import org.hibernate.usertype.ParameterizedType;
import org.hibernate.usertype.UserType;
import org.jbpm.Execution;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/PvmNamingStrategy.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/PvmNamingStrategy.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/PvmNamingStrategy.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -23,7 +23,7 @@
import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.util.StringHelper;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,7 +27,7 @@
import javax.jms.Session;
import org.jbpm.PvmException;
-import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.job.Message;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.MessageSession;
@@ -56,7 +56,7 @@
// Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
- public void send(MessageImpl<?> message) {
+ public void send(Message message) {
try {
dbSession.save(message);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageUtil.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageUtil.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -29,7 +29,7 @@
import javax.jms.Queue;
import javax.jms.Topic;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/** message printing and destination name extraction.
* @author Tom Baeyens, Jim Rigsbee
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -26,6 +26,7 @@
import org.jbpm.PvmException;
import org.jbpm.job.Timer;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.cal.BusinessCalendar;
@@ -34,7 +35,6 @@
import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.model.ObservableElement;
import org.jbpm.pvm.session.DbSession;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,10 +27,11 @@
import java.util.Collection;
import java.util.Date;
import java.util.List;
+
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,9 +24,9 @@
import java.util.Collection;
import java.util.Date;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
/** this thread is responsible for acquiring jobs in the jobImpl that need to be
* executed and then let the JobExecutor dispatch the acquired ids to one of the
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -26,12 +26,12 @@
import org.hibernate.Session;
import org.jbpm.PvmException;
import org.jbpm.job.Job;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,10 +22,11 @@
package org.jbpm.pvm.internal.jobexecutor;
import java.util.Date;
+
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobAddedNotification.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobAddedNotification.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobAddedNotification.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -23,7 +23,7 @@
import javax.transaction.Synchronization;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/** listener that can be registered as a listener to the transaction
* to notify the jobImpl executor of added jobs so that the dispatcher
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -28,12 +28,12 @@
import org.hibernate.Session;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -31,9 +31,9 @@
import java.util.concurrent.BlockingQueue;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
/** manager for jobImpl execution threads and their configuration.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.jobexecutor;
import org.jbpm.PvmException;
+import org.jbpm.job.Message;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.MessageSession;
@@ -45,7 +45,7 @@
boolean isNotificationAdded;
- public void send(MessageImpl<?> message) {
+ public void send(Message message) {
log.debug("sending message "+ReflectUtil.getUnqualifiedClassName(message.getClass()));
dbSession.save(message);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,8 +24,8 @@
import java.util.Collection;
import java.util.concurrent.BlockingQueue;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThreadPool.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThreadPool.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThreadPool.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,7 +24,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -15,9 +15,9 @@
import org.jbpm.PvmException;
import org.jbpm.job.Timer;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.session.TimerSession;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,10 +27,10 @@
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.op.MoveToChildNode;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.listener.EventListener;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -38,13 +38,13 @@
import org.jbpm.Execution;
import org.jbpm.PvmException;
import org.jbpm.job.Timer;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.ExecuteNode;
import org.jbpm.pvm.internal.model.op.MoveToChildNode;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -28,10 +28,10 @@
import java.util.Map;
import org.jbpm.Execution;
+import org.jbpm.log.Log;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.internal.lob.Blob;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.IoUtil;
import org.jbpm.pvm.model.OpenProcessDefinition;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,7 +27,7 @@
import java.util.List;
import java.util.Set;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.model.OpenProcessDefinition;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.model.op;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,9 +24,9 @@
import java.util.Map;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,8 +24,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ObservableElementImpl;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/Interceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/Interceptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/Interceptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.svc;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.log.Log;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.log.Log;
import org.hibernate.StaleStateException;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/HibernateSessionResource.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.tx;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,8 +27,8 @@
import javax.transaction.Synchronization;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Transaction;
-import org.jbpm.pvm.internal.log.Log;
/** simple 2 phase commit transaction.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,9 +22,9 @@
package org.jbpm.pvm.internal.tx;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.svc.Interceptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/DefaultVariableTypeResolver.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/DefaultVariableTypeResolver.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/DefaultVariableTypeResolver.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,8 +24,8 @@
import org.hibernate.SessionFactory;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.type.Type;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.type.Matcher;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -10,8 +10,8 @@
import java.util.List;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
public abstract class ReflectUtil {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -29,7 +29,7 @@
import java.util.StringTokenizer;
import org.jbpm.PvmException;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.xml.Parse;
import javax.xml.namespace.QName;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -29,12 +29,12 @@
import java.util.Map;
import java.util.Set;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ProcessElementImpl;
import org.jbpm.pvm.internal.util.Closable;
import org.jbpm.pvm.internal.util.DefaultObservable;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,7 +27,7 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/DeployerManagerBinding.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -26,8 +26,8 @@
import java.util.Enumeration;
import java.util.List;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.deploy.DeployerManager;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.stream.UrlStreamSource;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -28,7 +28,7 @@
import java.util.List;
import org.hibernate.cfg.Configuration;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.stream.FileStreamSource;
import org.jbpm.pvm.internal.stream.ResourceStreamSource;
import org.jbpm.pvm.internal.stream.StreamSource;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CollectionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CollectionDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/CollectionDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -8,7 +8,7 @@
import java.util.SortedMap;
import java.util.SortedSet;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextTypeRefDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextTypeRefDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextTypeRefDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.wire.WireContext;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.wire.descriptor;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -31,7 +31,7 @@
import java.util.Properties;
import org.jbpm.PvmException;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -25,8 +25,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.tx.HibernateSessionResource;
import org.jbpm.pvm.internal.tx.StandardTransaction;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -14,8 +14,8 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -8,8 +8,8 @@
import java.util.List;
import org.jbpm.PvmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.ArrayUtil;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -1,7 +1,7 @@
package org.jbpm.pvm.internal.wire.operation;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Transaction;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.tx.StandardResource;
import org.jbpm.pvm.internal.tx.StandardTransaction;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/FieldOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/FieldOperation.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/FieldOperation.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -2,7 +2,7 @@
import java.lang.reflect.Field;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -4,7 +4,7 @@
import java.lang.reflect.Method;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.util.ReflectUtil;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -4,9 +4,9 @@
import java.util.List;
import java.util.Set;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.FilterListener;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.util.Observable;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/BindingParser.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Binding;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -5,7 +5,7 @@
import java.util.Enumeration;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -28,7 +28,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import org.jbpm.PvmException;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.stream.StreamSource;
import org.jbpm.pvm.internal.util.UrlEntity;
import org.jbpm.pvm.internal.util.XmlUtil;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java (from rev 2694, jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,685 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Stack;
+
+import org.jbpm.ProcessDefinition;
+import org.jbpm.PvmException;
+import org.jbpm.pvm.activity.Activity;
+import org.jbpm.pvm.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.CompositeElementImpl;
+import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.EventListenerReference;
+import org.jbpm.pvm.internal.model.ExceptionHandlerImpl;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ObjectReference;
+import org.jbpm.pvm.internal.model.ObservableElementImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ProcessElementImpl;
+import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.pvm.listener.EventListener;
+
+/** factory for process definitions.
+ *
+ * <p>Use this factory as a <a href="http://martinfowler.com/bliki/FluentInterface.html">fluent interface</a>
+ * for building a process definition. To use it in this way, start with instantiating a ProcessFactory object.
+ * Then a number of methods can be invoked concatenated with dots cause all the methods return
+ * the same process factory object. When done, end that sequence with
+ * {@link #done()} to get the constructed ProcessDefinition.
+ * </p>
+ *
+ * <p>The idea is that this results into a more compact and more readable
+ * code to build process definitions as opposed to including xml inline. For example :
+ * </p>
+ * <pre>
+ * ProcessDefinition processDefinition = ProcessFactory.build()
+ * .node().initial().behaviour(new WaitState())
+ * .transition("normal").to("a")
+ * .transition("shortcut").to("c")
+ * .node("a").behaviour(new WaitState())
+ * .transition().to("b")
+ * .node("b").behaviour(new WaitState())
+ * .transition().to("c")
+ * .node("c").behaviour(new WaitState())
+ * .done();
+ * </pre>
+ *
+ * <hr />
+ *
+ * <p>If more control is needed over the creation of the process definition
+ * objects, then consider using the concrete implementation classes from
+ * package {@link org.jbpm.pvm.internal.model} directly. The implementation code
+ * of this class might be a good guide to get you on your way.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public class ProcessFactory {
+
+ // static factory methods ///////////////////////////////////////////////////
+
+ protected ProcessDefinitionImpl processDefinition;
+ protected NodeImpl node;
+ protected TransitionImpl transition;
+ protected List<DestinationReference> destinationReferences;
+ protected ObservableElementImpl observableElement;
+ protected EventImpl event;
+ protected EventListenerReference eventListenerReference;
+ protected ExceptionHandlerImpl exceptionHandler;
+ protected CompositeElementImpl compositeElement;
+ protected CompositeElementImpl scope;
+ protected Stack<CompositeElementImpl> compositeElementStack;
+
+ /** start building a process definition without a name. */
+ protected ProcessFactory() {
+ this(null);
+ }
+
+ /** start building a process definition with the given name. */
+ protected ProcessFactory(String processName) {
+ this(processName, null);
+ }
+
+ /** start building a process definition with the given name. */
+ protected ProcessFactory(String processName, ProcessDefinitionImpl processDefinition) {
+ if (processDefinition!=null) {
+ this.processDefinition = processDefinition;
+ } else {
+ this.processDefinition = instantiateProcessDefinition();
+ }
+ this.processDefinition.setName(processName);
+ this.observableElement = this.processDefinition;
+ this.compositeElement = this.processDefinition;
+ this.scope = this.processDefinition;
+ }
+
+ /** starts building a process definition */
+ public static ProcessFactory build() {
+ return new ProcessFactory();
+ }
+
+ /** starts building a process definition */
+ public static ProcessFactory build(String processName) {
+ return new ProcessFactory(processName);
+ }
+
+ /** starts populating a given process definition */
+ public static ProcessFactory build(String processName, ProcessDefinitionImpl processDefinition) {
+ return new ProcessFactory(processName, processDefinition);
+ }
+
+ /** to be overwritten by specific process language factories */
+ protected ProcessDefinitionImpl instantiateProcessDefinition() {
+ return new ProcessDefinitionImpl();
+ }
+
+ /** marks the last created node as the initial node in the process. */
+ public ProcessFactory initial() {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ if (processDefinition.getInitial()!=null) {
+ throw new PvmException("duplicate initial node");
+ }
+ processDefinition.setInitial(node);
+ return this;
+ }
+
+ /** applies on a node and makes it create a local activity instance scope.
+ * This is automatically implied when {@link #variable(String) adding a variable}
+ * or {@link #timer() adding a timer} */
+ public ProcessFactory scope() {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setLocalScope(true);
+ scope = node;
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(String key) {
+ if (node!=null) {
+ scope();
+ }
+ VariableDefinitionImpl variableDefinition = compositeElement.createVariableDefinition();
+ variableDefinition.setKey(key);
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(Descriptor sourceDescriptor) {
+ if (node!=null && scope==null) {
+ scope();
+ }
+ VariableDefinitionImpl variableDefinition = scope.createVariableDefinition();
+ variableDefinition.setKey(sourceDescriptor.getName());
+ variableDefinition.setSourceDescriptor(sourceDescriptor);
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(String key, String initialValue) {
+ return variable(new StringDescriptor(key, initialValue));
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(String dueDateDescription, String signalName) {
+ return timer(dueDateDescription, null, signalName, null);
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(String dueDateDescription, String signalName, String repeat) {
+ return timer(dueDateDescription, null, signalName, repeat);
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(Date dueDate, String signalName) {
+ return timer(null, dueDate, signalName, null);
+ }
+
+ protected ProcessFactory timer(String dueDateDescription, Date dueDate,
+ String signalName, String repeat) {
+ if (node!=null && scope==null) {
+ scope();
+ }
+ TimerDefinitionImpl timerDefinition = scope.createTimerDefinition();
+ if (dueDate!=null) {
+ timerDefinition.setDueDate(dueDate);
+ } else {
+ timerDefinition.setDueDateDescription(dueDateDescription);
+ }
+ timerDefinition.setSignalName(signalName);
+ timerDefinition.setRepeat(repeat);
+ return this;
+ }
+
+ /** creates a node in the current parent.
+ * The current parent is either the process definition or a composite node
+ * in case method {@link #compositeNode(String)} was called previously. */
+ public ProcessFactory node() {
+ return node(null);
+ }
+
+ /** creates a named node.
+ * The current parent is either the process definition or a composite node
+ * in case method {@link #compositeNode(String)} was called previously. */
+ public ProcessFactory node(String nodeName) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.setNodeName(nodeName);
+ } else {
+ node = compositeElement.createNode(nodeName);
+ scope = null;
+
+ observableElement = node;
+ event = null;
+ eventListenerReference = null;
+ transition = null;
+ exceptionHandler = null;
+ }
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Activity activity) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(activity);
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(descriptor);
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Class<? extends Activity> activityClass) {
+ return behaviour(new ObjectDescriptor(activityClass));
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(String expression) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(expression);
+ return this;
+ }
+
+
+ /** sets the asyncExecute property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncExecute() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setExecutionAsync(true);
+ return this;
+ }
+
+ /** sets the asyncLeave property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncLeave() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setLeaveAsync(true);
+ return this;
+ }
+
+ /** sets the asyncSignal property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncSignal() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setSignalAsync(true);
+ return this;
+ }
+
+ /** sets the property needsPrevious on the current node.
+ * A current node is required. */
+ public ProcessFactory needsPrevious() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setPreviousNeeded(true);
+ return this;
+ }
+
+ /** starts a block in which nested nodes can be created.
+ * This block can be ended with {@link #compositeEnd()}.
+ * A current node is required. */
+ public ProcessFactory compositeNode() {
+ return compositeNode(null);
+ }
+
+ /** starts a block in which nested nodes can be created.
+ * This block can be ended with {@link #compositeEnd()}.
+ * A current node is required. */
+ public ProcessFactory compositeNode(String nodeName) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ if (compositeElementStack==null) {
+ compositeElementStack = new Stack<CompositeElementImpl>();
+ }
+
+ compositeElementStack.push(compositeElement);
+ node(nodeName);
+ compositeElement = node;
+
+ return this;
+ }
+
+ /** ends a block in which nested nodes are created.
+ * This method requires that a nested node block was started before
+ * with {@link #compositeNode(String)} */
+ public ProcessFactory compositeEnd() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ if (compositeElementStack==null) {
+ throw new PvmException("no composite node was started");
+ }
+
+ compositeElement = compositeElementStack.pop();
+
+ if (compositeElementStack.isEmpty()) {
+ compositeElementStack = null;
+ }
+
+ return this;
+ }
+
+ /** creates a transition on the current node.
+ * This method requires a current node */
+ public ProcessFactory transition() {
+ return transition(null);
+ }
+
+ /** creates a named transition on the current node.
+ * This method requires a current node */
+ public ProcessFactory transition(String transitionName) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.setTransitionName(transitionName);
+ } else {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ transition = node.createOutgoingTransition(null, transitionName);
+ observableElement = transition;
+ event = null;
+ eventListenerReference = null;
+ exceptionHandler = null;
+ }
+ return this;
+ }
+
+ /** sets the takeAsync property on the current transition
+ * This method requires a current transition. */
+ public ProcessFactory asyncTake() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ transition.setTakeAsync(true);
+ return this;
+ }
+
+ /** sets the destination node on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory to(String destination) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ if (destinationReferences==null) {
+ destinationReferences = new ArrayList<DestinationReference>();
+ }
+ destinationReferences.add(new DestinationReference(transition, destination));
+ return this;
+ }
+
+ /** sets the wait condition on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory waitCondition(Condition condition) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
+ transition.setWaitConditionDescriptor(conditionDescriptor);
+ return this;
+ }
+
+ /** sets the guard condition on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory guardCondition(Condition condition) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
+ transition.setConditionDescriptor(conditionDescriptor);
+ return this;
+ }
+
+ /** creates the given event on the current process element.
+ * This method requires a process element. A process element is
+ * either a process definition or a node. This method doesn't need to be
+ * called for transitions. If you have exception handlers and listeners
+ * on an event, make sure that you put the invocations of
+ * {@link #exceptionHandler(Class)} first. */
+ public ProcessFactory event(String eventName) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (observableElement==null) {
+ throw new PvmException("no current process element");
+ }
+ if (observableElement instanceof Transition) {
+ throw new PvmException("for actions on transitions, you don't need to call event");
+ }
+ event = observableElement.createEvent(eventName);
+ exceptionHandler = null;
+ return this;
+ }
+
+ /** creates an exception handler for the given exception class on the current process element;
+ * until the {@link #exceptionHandlerEnd()}. Subsequent invocations of
+ * {@link #listener(Activity) listeners} or {@link #transition() transitions} will
+ * have the created exception handler as a target.
+ *
+ * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */
+ public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ ProcessElementImpl processElement = null;
+ if (eventListenerReference!=null) {
+ processElement = eventListenerReference;
+ } else if (event!=null) {
+ processElement = event;
+ } else if (observableElement!=null) {
+ processElement = observableElement;
+ } else {
+ throw new PvmException("no current process element, event or action");
+ }
+
+ exceptionHandler = processElement.createExceptionHandler();
+
+ if (exceptionClass!=null) {
+ exceptionHandler.setExceptionClassName(exceptionClass.getName());
+ }
+
+ return this;
+ }
+
+ public ProcessFactory exceptionHandlerEnd() {
+ exceptionHandler = null;
+ return this;
+ }
+
+ public ProcessFactory transactional() {
+ if (exceptionHandler==null) {
+ throw new PvmException("transactional is a property of an exception handler");
+ }
+ exceptionHandler.setTransactional(true);
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createEventListenerReference(descriptor);
+ } else {
+ getEvent().createEventListenerReference(descriptor);
+ }
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(EventListener eventListener) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createEventListenerReference(eventListener);
+ } else {
+ eventListenerReference = getEvent().createEventListenerReference(eventListener);
+ }
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(String expression) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createActivityReference(expression);
+ } else {
+ eventListenerReference = getEvent().createEventListenerReference(expression);
+ }
+ return this;
+ }
+
+ /** disables propagated events. This means that this action will only be executed
+ * if the event is fired on the actual process element of the event. The current
+ * action will not be executed if an event is fired on one of the children of the
+ * process element to which this event relates. */
+ public ProcessFactory propagationDisabled() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (eventListenerReference==null) {
+ throw new PvmException("no current event action");
+ }
+ eventListenerReference.setPropagationEnabled(false);
+ return this;
+ }
+
+ private EventImpl getEvent() {
+ if ( (event==null)
+ && (observableElement instanceof TransitionImpl)
+ ) {
+ event = ((TransitionImpl)observableElement).createEvent();
+ return event;
+ }
+ if (event==null) {
+ throw new PvmException("no current event");
+ }
+ return event;
+ }
+
+ /** adds a string-valued configuration to the current process element */
+ public ProcessFactory property(String name, String stringValue) {
+ StringDescriptor stringDescriptor = new StringDescriptor();
+ stringDescriptor.setName(name);
+ stringDescriptor.setValue(stringValue);
+ property(stringDescriptor);
+ return this;
+ }
+
+ /** adds a configuration to the current process element */
+ public ProcessFactory property(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (observableElement==null) {
+ throw new PvmException("no current process element");
+ }
+ if (event!=null) {
+ event.addProperty(descriptor);
+ } else {
+ observableElement.addProperty(descriptor);
+ }
+ return this;
+ }
+
+ public class DestinationReference {
+ TransitionImpl transition;
+ String destinationName;
+ public DestinationReference(TransitionImpl transition, String destinationName) {
+ this.transition = transition;
+ this.destinationName = destinationName;
+ }
+ public void resolve() {
+ NodeImpl destination = (NodeImpl) processDefinition.findNode(destinationName);
+ if (destination==null) {
+ throw new PvmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
+ }
+ destination.addIncomingTransition(transition);
+ transition.setDestination(destination);
+ }
+ }
+
+ /** extract the process definition from the factory. This should be
+ * the last method in the chain of subsequent invoked methods on this
+ * factory object. */
+ public ClientProcessDefinition done() {
+ resolveDestinations();
+ if (processDefinition.getInitial()==null) {
+ throw new PvmException("no initial node");
+ }
+ return processDefinition;
+ }
+
+ /** sets the {@link ProcessDefinition#getVersion() version} of the process definition explicitely */
+ public ProcessFactory version(int version) {
+ processDefinition.setVersion(version);
+ return this;
+ }
+
+ /** sets the {@link ProcessDefinition#getKey() key} of the process definition explicitely */
+ public ProcessFactory key(String key) {
+ processDefinition.setKey(key);
+ return this;
+ }
+
+ private void resolveDestinations() {
+ if (destinationReferences!=null) {
+ for (DestinationReference destinationReference : destinationReferences) {
+ destinationReference.resolve();
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test
___________________________________________________________________
Name: svn:mergeinfo
+
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/Db.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/Db.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/Db.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.MySQLDialect;
+import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.mapping.ForeignKey;
+import org.hibernate.mapping.Table;
+import org.jbpm.pvm.env.EnvironmentFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Db {
+
+ private static final String CLEAN_SQL_KEY = "cleanSql";
+
+ public static void clean(EnvironmentFactory environmentFactory) {
+ SessionFactory sessionFactory = environmentFactory.get(SessionFactory.class);
+ String[] cleanSql = (String[]) environmentFactory.get(CLEAN_SQL_KEY);
+
+ if (cleanSql == null) {
+ Configuration configuration = environmentFactory.get(Configuration.class);
+
+ SessionFactoryImplementor sessionFactoryImplementor = (SessionFactoryImplementor) sessionFactory;
+ Dialect dialect = sessionFactoryImplementor.getDialect();
+
+ // loop over all foreign key constraints
+ List<String> dropForeignKeysSql = new ArrayList<String>();
+ List<String> createForeignKeysSql = new ArrayList<String>();
+ Iterator<Table> iter = configuration.getTableMappings();
+ while (iter.hasNext()) {
+ Table table = (Table) iter.next();
+ if (table.isPhysicalTable()) {
+ String catalog = table.getCatalog();
+ String schema = table.getSchema();
+ Iterator<ForeignKey> subIter = table.getForeignKeyIterator();
+ while (subIter.hasNext()) {
+ ForeignKey fk = (ForeignKey) subIter.next();
+ if (fk.isPhysicalConstraint()) {
+ // collect the drop foreign key constraint sql
+ dropForeignKeysSql.add(fk.sqlDropString(dialect, catalog, schema));
+ // MySQLDialect creates an index for each foreign key.
+ // see
+ // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2155
+ // This index should be dropped or an error will be thrown during
+ // the creation phase
+ if (dialect instanceof MySQLDialect) {
+ dropForeignKeysSql.add("alter table " + table.getName() + " drop key " + fk.getName());
+ }
+ // and collect the create foreign key constraint sql
+ createForeignKeysSql.add(fk.sqlCreateString(dialect, sessionFactoryImplementor, catalog, schema));
+ }
+ }
+ }
+ }
+
+ List<String> deleteSql = new ArrayList<String>();
+ iter = configuration.getTableMappings();
+ while (iter.hasNext()) {
+ Table table = (Table) iter.next();
+ if (table.isPhysicalTable()) {
+ deleteSql.add("delete from " + table.getName());
+ }
+ }
+
+ // glue
+ // - drop foreign key constraints
+ // - delete contents of all tables
+ // - create foreign key constraints
+ // together to form the clean script
+ List<String> cleanSqlList = new ArrayList<String>();
+ cleanSqlList.addAll(dropForeignKeysSql);
+ cleanSqlList.addAll(deleteSql);
+ cleanSqlList.addAll(createForeignKeysSql);
+
+ cleanSql = (String[]) cleanSqlList.toArray(new String[cleanSqlList.size()]);
+
+ environmentFactory.set(CLEAN_SQL_KEY, cleanSql);
+ }
+
+ Session session = sessionFactory.openSession();
+ try {
+ for (String query : cleanSql) {
+ session.createSQLQuery(query).executeUpdate();
+ }
+ } finally {
+ session.close();
+ }
+ }
+
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/DbTestCase.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/DbTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -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.test;
+
+import org.jbpm.ExecutionService;
+import org.jbpm.ManagementService;
+import org.jbpm.ProcessService;
+import org.jbpm.pvm.internal.cmd.CommandService;
+
+
+/** for tests that use persistence through a command service.
+ *
+ * The DB is cleaned inbetween tests. No environment is created.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class DbTestCase extends EnvironmentFactoryTestCase {
+
+ protected CommandService commandService;
+ protected ProcessService processService;
+ protected ExecutionService executionService;
+ protected ManagementService managementService;
+
+ public DbTestCase() {
+ super();
+ }
+
+ public DbTestCase(String configResource) {
+ super(configResource);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ if (isEnvironmentFactoryCached()) {
+ Db.clean(getEnvironmentFactory());
+ }
+
+ commandService = getEnvironmentFactory().get(CommandService.class);
+ processService = getEnvironmentFactory().get(ProcessService.class);
+ executionService = getEnvironmentFactory().get(ExecutionService.class);
+ managementService = getEnvironmentFactory().get(ManagementService.class);
+ }
+
+ public void tearDown() throws Exception {
+ commandService = null;
+ processService = null;
+ executionService = null;
+ managementService = null;
+ super.tearDown();
+ }
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+import java.lang.reflect.Field;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.jbpm.Execution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.util.ReflectUtil;
+import org.jbpm.pvm.model.OpenProcessDefinition;
+import org.jbpm.pvm.session.DbSession;
+import org.jbpm.pvm.session.PvmDbSession;
+
+
+/** for tests that use persistence inside environment blocks.
+ *
+ * An environment is opened in the setUp and closed in the tearDown.
+ * DB is cleaned inbetween tests. Extra convenience methods for usage
+ * inside an environment block are provided.
+ *
+ * @author Tom Baeyens
+ */
+public class EnvironmentDbTestCase extends EnvironmentTestCase {
+
+ Transaction transaction = null;
+
+ public EnvironmentDbTestCase() {
+ }
+
+ public EnvironmentDbTestCase(String configResource) {
+ super(configResource);
+ }
+
+ public void setUp() throws Exception {
+ if (isEnvironmentFactoryCached()) {
+ Db.clean(getEnvironmentFactory());
+ }
+ super.setUp();
+ beginTransaction();
+ }
+
+ public void tearDown() throws Exception {
+ commitTransaction();
+ super.tearDown();
+ }
+
+ void beginTransaction() {
+ Session session = environment.get(Session.class);
+ transaction = session.beginTransaction();
+ }
+
+ void commitTransaction() {
+ transaction.commit();
+ transaction = null;
+ }
+
+ void rollbackTransaction() {
+ transaction.rollback();
+ transaction = null;
+ }
+
+ public DbSession getDbSession() {
+ return environment.get(DbSession.class);
+ }
+
+ public void rollbackAndBeginNewTransaction() {
+ rollbackTransaction();
+ closeEnvironment();
+ openEnvironment();
+ beginTransaction();
+ }
+
+ public void newTransaction() {
+ try {
+ commitTransaction();
+ closeEnvironment();
+ } finally {
+ openEnvironment();
+ beginTransaction();
+ }
+ }
+
+ public void beginCacheTest() {
+ SessionFactory sessionFactory = environment.get(SessionFactory.class);
+ if (sessionFactory != null) {
+ log.debug("=================================================================");
+ log.debug("Beginning of the cache test, no more sql query should be performed before the end of the test");
+ log.debug("=================================================================");
+
+ sessionFactory.getStatistics().clear();
+ sessionFactory.getStatistics().setStatisticsEnabled(true);
+ }
+ }
+
+ public void endCacheTest() {
+ SessionFactory sessionFactory = environment.get(SessionFactory.class);
+ if (sessionFactory != null) {
+ assertEquals(0, sessionFactory.getStatistics().getEntityLoadCount());
+ assertEquals(0, sessionFactory.getStatistics().getCollectionLoadCount());
+ }
+ }
+
+ public ProcessDefinitionImpl reload(OpenProcessDefinition processDefinition) {
+ environment.get(PvmDbSession.class).save(processDefinition);
+ newTransaction();
+ return environment.get(PvmDbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
+ }
+
+ public <T> T reload(T object, Class<T> persistentClass) {
+ environment.get(DbSession.class).save(object);
+ newTransaction();
+
+ Long dbid = null;
+ try {
+ Field dbidField = ReflectUtil.getField(persistentClass, "dbid");
+ dbidField.setAccessible(true);
+ dbid = (Long) dbidField.get(object);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return environment.get(DbSession.class).get(persistentClass, dbid);
+ }
+
+ public ExecutionImpl reload(Execution execution) {
+ environment.get(PvmDbSession.class).save(execution);
+ newTransaction();
+ return environment.get(PvmDbSession.class).get(ExecutionImpl.class, execution.getDbid());
+ }
+
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.PvmException;
+import org.jbpm.pvm.env.EnvironmentFactory;
+import org.jbpm.pvm.env.PvmEnvironmentFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class EnvironmentFactoryTestCase extends JbpmTestCase {
+
+ String configResource;
+
+ static Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
+
+ public EnvironmentFactoryTestCase() {
+ this("environment.cfg.xml");
+ }
+
+ public EnvironmentFactoryTestCase(String configResource) {
+ this.configResource = configResource;
+ }
+
+ public EnvironmentFactory getEnvironmentFactory() {
+ if (isEnvironmentFactoryCached()) {
+ return environmentFactories.get(configResource);
+ }
+ return createEnvironmentFactory();
+ }
+
+ boolean isEnvironmentFactoryCached() {
+ return environmentFactories.containsKey(configResource);
+ }
+
+ EnvironmentFactory createEnvironmentFactory() {
+ return createEnvironmentFactory(configResource);
+ }
+
+ static EnvironmentFactory createEnvironmentFactory(String configResource) {
+ try {
+ log.debug("creating environment factory for ["+configResource+"]");
+ EnvironmentFactory newEnvironmentFactory = new PvmEnvironmentFactory(configResource);
+ environmentFactories.put(configResource, newEnvironmentFactory);
+ return newEnvironmentFactory;
+ } catch (Exception e) {
+ throw new PvmException("Exception during creation of environment factory for "+configResource, e);
+ }
+ }
+
+ static void closeEnvironmentFactory(String configResource) {
+ EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
+ if (environmentFactory!=null) {
+ log.debug("closing environment factory for ["+configResource+"]");
+ environmentFactory.close();
+ }
+ }
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,63 @@
+/**
+ * Copyright (C) 2007 Bull S. A. S.
+ * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
+ * This library is free software; you can redistribute it and/or modify it under the terms
+ * of the GNU Lesser General Public License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301, USA.
+ **/
+package org.jbpm.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Guillaume Porcher
+ *
+ */
+public class EnvironmentFactoryTestSetup extends TestSetup
+{
+ private String configResource;
+
+ public EnvironmentFactoryTestSetup(Test test)
+ {
+ this(test, "environment.cfg.xml");
+ }
+
+ public EnvironmentFactoryTestSetup(Class<?> testClass)
+ {
+ this(new TestSuite(testClass), "environment.cfg.xml");
+ }
+
+ public EnvironmentFactoryTestSetup(Test test, String configResource)
+ {
+ super(test);
+ this.configResource = configResource;
+ }
+
+ public EnvironmentFactoryTestSetup(Class<?> testClass, String configResource)
+ {
+ super(new TestSuite(testClass));
+ this.configResource = configResource;
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ EnvironmentFactoryTestCase.createEnvironmentFactory(configResource);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ EnvironmentFactoryTestCase.closeEnvironmentFactory(configResource);
+ super.tearDown();
+ }
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentTestCase.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/EnvironmentTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+import org.jbpm.pvm.env.Environment;
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class EnvironmentTestCase extends EnvironmentFactoryTestCase {
+
+ protected Environment environment;
+
+ public EnvironmentTestCase() {
+ }
+
+ public EnvironmentTestCase(String configResource) {
+ super(configResource);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ openEnvironment();
+ }
+
+ public void tearDown() throws Exception {
+ closeEnvironment();
+ super.tearDown();
+ }
+
+ void closeEnvironment() {
+ environment.close();
+ environment = null;
+ }
+
+ void openEnvironment() {
+ environment = getEnvironmentFactory().openEnvironment();
+ }
+}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/JbpmTestCase.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/test/JbpmTestCase.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -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.test;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.jbpm.log.Jdk14LogFactory;
+import org.jbpm.log.Log;
+import org.jbpm.log.LogFormatter;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.env.EnvironmentFactory;
+import org.jbpm.pvm.env.PvmEnvironmentFactory;
+
+public abstract class JbpmTestCase extends TestCase {
+
+ static {
+ Jdk14LogFactory.initializeJdk14Logging();
+ }
+
+ static protected Log log = Log.getLog(JbpmTestCase.class.getName());
+
+ public void setUp() throws Exception {
+ assertNull(Environment.getCurrent());
+ LogFormatter.resetIndentation();
+ log.info("=== starting "+getName()+" =============================");
+ }
+
+ public void tearDown() throws Exception {
+ log.info("=== ending "+getName()+" =============================\n");
+ assertNull(Environment.getCurrent());
+ }
+
+ public void assertTextPresent(String expected, String value) {
+ if ( (value==null)
+ || (value.indexOf(expected)==-1)
+ ) {
+ throw new AssertionFailedError("expected presence of '"+expected+"' but was '"+value+"'");
+ }
+ }
+
+ public static Environment openEnvironment(String xmlString) {
+ EnvironmentFactory environmentFactory = PvmEnvironmentFactory.parseXmlString(xmlString);
+ return environmentFactory.openEnvironment();
+ }
+
+ protected void runTest() throws Throwable {
+ try {
+ super.runTest();
+ } catch (AssertionFailedError e) {
+ log.error("");
+ log.error("ASSERTION FAILURE: "+e.getMessage());
+ log.error("");
+ throw e;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw t;
+ }
+ }
+}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -31,6 +31,7 @@
import junit.framework.Test;
import org.hibernate.Session;
+import org.jbpm.log.Log;
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.env.Environment;
@@ -38,7 +39,6 @@
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.model.OpenProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.DbSession;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/IncrementCounterWaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/IncrementCounterWaitState.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/IncrementCounterWaitState.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -15,9 +15,9 @@
import java.util.Map;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
-import org.jbpm.pvm.internal.log.Log;
/**
* @author Pascal Verdage
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/AddressActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/AddressActivity.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/AddressActivity.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.db.langext;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -27,10 +27,10 @@
import java.util.Set;
import org.hibernate.Session;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.descriptor.LongDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -21,11 +21,11 @@
*/
package org.jbpm.pvm.internal.jobexecutor;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -17,10 +17,10 @@
import java.util.List;
import org.jbpm.job.Message;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.session.MessageSession;
import org.jbpm.pvm.session.PvmDbSession;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -34,6 +34,7 @@
import org.hibernate.Session;
import org.jbpm.ProcessService;
import org.jbpm.job.Job;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -44,7 +45,6 @@
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.model.Comment;
import org.jbpm.pvm.model.ProcessFactory;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/TestMessageCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/TestMessageCommand.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/TestMessageCommand.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,10 +24,10 @@
import java.util.List;
import java.util.Random;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.session.DbSession;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ConcurrentWiringTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ConcurrentWiringTest.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ConcurrentWiringTest.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,7 +24,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.wire.WireContext;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java 2008-10-31 10:19:49 UTC (rev 2698)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java 2008-10-31 10:21:24 UTC (rev 2699)
@@ -24,7 +24,7 @@
import java.io.InputStream;
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.DebugDomParser;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.test.JbpmTestCase;
15 years, 6 months
JBoss JBPM SVN: r2698 - in jbpm4/trunk/modules/jpdl/src: test/java/org/jbpm/jpdl and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 06:19:49 -0400 (Fri, 31 Oct 2008)
New Revision: 2698
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
Log:
unification api proposals
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java 2008-10-31 10:19:29 UTC (rev 2697)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ActivityParser.java 2008-10-31 10:19:49 UTC (rev 2698)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Binding;
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-10-31 10:19:29 UTC (rev 2697)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-10-31 10:19:49 UTC (rev 2698)
@@ -27,8 +27,8 @@
import java.util.List;
import org.jbpm.jpdl.JpdlProcessDefinition;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java 2008-10-31 10:19:29 UTC (rev 2697)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java 2008-10-31 10:19:49 UTC (rev 2698)
@@ -22,8 +22,8 @@
package org.jbpm.jpdl;
import org.jbpm.jpdl.xml.JpdlParser;
+import org.jbpm.log.Log;
import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.test.JbpmTestCase;
15 years, 6 months
JBoss JBPM SVN: r2697 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/pvm/model and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 06:19:29 -0400 (Fri, 31 Oct 2008)
New Revision: 2697
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
Modified:
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java
Log:
unification api proposals
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -1,188 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.env;
-
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Set;
-
-import org.jbpm.pvm.internal.env.PvmEnvironment;
-import org.jbpm.pvm.internal.env.PvmEnvironmentFactoryParser;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.internal.stream.FileStreamSource;
-import org.jbpm.pvm.internal.stream.InputStreamSource;
-import org.jbpm.pvm.internal.stream.ResourceStreamSource;
-import org.jbpm.pvm.internal.stream.StreamSource;
-import org.jbpm.pvm.internal.stream.StringStreamSource;
-import org.jbpm.pvm.internal.stream.UrlStreamSource;
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.WireDefinition;
-
-
-/**
- * an environment factory that also is the environment-factory context.
- *
- * <p>This environment factory will produce environments with 2 contexts:
- * the environment-factory context and the block context.
- * </p>
- *
- * <p>An environment-factory context is build from two wire definitions: the environment-factory
- * wire definition and the environment wire definition.
- * </p>
- *
- * <p>The environment-factory context itself is build from the environment-factory wire definition.
- * So all objects that are created in this context remain cached for the lifetime of
- * this environment-factory context object.
- * </p>
- *
- * <p>This environment-factory context is also a environment factory. The produced environments
- * contain 2 contexts: the environment-factory context itself and a new environment context,
- * build from the environment wire definition. For each created environment, a new
- * environment context will be created from the same environment wire definition.
- * Objects in the environment context will live for as long as the environment.
- * </p>
- * @author Tom Baeyens
- */
-public class PvmEnvironmentFactory extends EnvironmentFactory implements Context {
-
- private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(PvmEnvironmentFactory.class.getName());
- protected static PvmEnvironmentFactoryParser pvmEnvironmentFactoryParser = new PvmEnvironmentFactoryParser();
-
- protected WireContext environmentFactoryCtxWireContext = null;
- protected WireDefinition environmentCtxWireDefinition = null;
-
- public PvmEnvironmentFactory() {
- }
-
- public PvmEnvironmentFactory(String resource) {
- this(resource, null);
- }
-
- public PvmEnvironmentFactory(String resource, ClassLoader classLoader) {
- this(new ResourceStreamSource(resource, classLoader));
- }
-
- public PvmEnvironmentFactory(File file) {
- this(new FileStreamSource(file));
- }
-
- public PvmEnvironmentFactory(URL url) {
- this(new UrlStreamSource(url));
- }
-
- public PvmEnvironmentFactory(InputStream inputStream) {
- this(new InputStreamSource(inputStream));
- }
-
- public static PvmEnvironmentFactory parseXmlString(String xmlString) {
- return new PvmEnvironmentFactory(new StringStreamSource(xmlString));
- }
-
- PvmEnvironmentFactory(StreamSource streamSource) {
- PvmEnvironmentFactoryParser.getInstance()
- .createParse()
- .setDocumentObject(this)
- .setStreamSource(streamSource)
- .execute()
- .checkProblems("pvm environment configuration "+streamSource);
- }
-
- public Environment openEnvironment() {
- PvmEnvironment environment = new PvmEnvironment(this);
-
- log.debug("opening "+environment);
-
- // set the classloader
- ClassLoader classLoader = environmentFactoryCtxWireContext.getClassLoader();
- if (classLoader!=null) {
- environment.setClassLoader(classLoader);
- }
-
- // add the environment-factory context
- environment.addContext(environmentFactoryCtxWireContext);
-
- // add the environment block context
- WireContext environmentContext = new WireContext(environmentCtxWireDefinition, Context.CONTEXTNAME_ENVIRONMENT, environment, true);
- // add the environment block context to the environment
- environment.addContext(environmentContext);
-
- try {
- // finish the creation of the environment wire context
- environmentContext.create();
-
- } catch (RuntimeException e) {
- // On exception, pop environment
- Environment.popEnvironment();
- throw e;
- }
- // if all went well, return the created environment
- return environment;
- }
-
- public void close() {
- environmentFactoryCtxWireContext.fire(WireContext.EVENT_CLOSE, null);
- }
-
- // environment-factory context delegation methods ///////////////////////////////////
-
- public Object get(String key) {
- return environmentFactoryCtxWireContext.get(key);
- }
-
- public <T> T get(Class<T> type) {
- return environmentFactoryCtxWireContext.get(type);
- }
-
- public String getName() {
- return environmentFactoryCtxWireContext.getName();
- }
-
- public boolean has(String key) {
- return environmentFactoryCtxWireContext.has(key);
- }
-
- public Set<String> keys() {
- return environmentFactoryCtxWireContext.keys();
- }
-
- public Object set(String key, Object value) {
- return environmentFactoryCtxWireContext.set(key, value);
- }
-
- // getters and setters //////////////////////////////////////////////////////
-
- public void setEnvironmentCtxWireDefinition(WireDefinition blockWireDefinition) {
- this.environmentCtxWireDefinition = blockWireDefinition;
- }
- public WireContext getEnvironmentFactoryCtxWireContext() {
- return environmentFactoryCtxWireContext;
- }
- public void setEnvironmentFactoryCtxWireContext(WireContext applicationWireContext) {
- this.environmentFactoryCtxWireContext = applicationWireContext;
- }
- public WireDefinition getEnvironmentCtxWireDefinition() {
- return environmentCtxWireDefinition;
- }
-
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/SpringEnvironmentFactory.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.env;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jbpm.pvm.internal.spring.SpringEnvironment;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-/** this environment factory will see only the singleton beans.
- *
- * The created {@link SpringEnvironment}s will see the prototype
- * beans and it will cache them.
- *
- * @author Tom Baeyens
- */
-public class SpringEnvironmentFactory extends EnvironmentFactory implements ApplicationContextAware {
-
- // TODO pull up the common behaviour between this class and the SpringEnvironmentContext
-
- private static final long serialVersionUID = 1L;
-
- ApplicationContext applicationContext;
-
- public SpringEnvironment openEnvironment() {
- return new SpringEnvironment(this);
- }
-
- public boolean has(String key) {
- return applicationContext.isSingleton(key);
- }
-
- public Object get(String key) {
- if (has(key)) {
- return applicationContext.getBean(key);
- }
- return null;
- }
-
- public <T> T get(Class<T> type) {
- String name = ReflectUtil.getUnqualifiedClassName(type);
- name = name.substring(0, 1).toLowerCase() + name.substring(1);
- return (T) get(name);
- }
-
- public Set<String> keys() {
- HashSet<String> keys = new HashSet<String>();
- for (String key : applicationContext.getBeanDefinitionNames()) {
- if (has(key)) {
- keys.add(key);
- }
- }
- return keys;
- }
-
- public ApplicationContext getApplicationContext() {
- return applicationContext;
- }
-
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
-
- public void close() {
- }
-
- public String getName() {
- return null;
- }
-
- public Object set(String key, Object value) {
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -1,685 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Stack;
-
-import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
-import org.jbpm.pvm.activity.Activity;
-import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.model.CompositeElementImpl;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.EventListenerReference;
-import org.jbpm.pvm.internal.model.ExceptionHandlerImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ObjectReference;
-import org.jbpm.pvm.internal.model.ObservableElementImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.model.ProcessElementImpl;
-import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-import org.jbpm.pvm.listener.EventListener;
-
-/** factory for process definitions.
- *
- * <p>Use this factory as a <a href="http://martinfowler.com/bliki/FluentInterface.html">fluent interface</a>
- * for building a process definition. To use it in this way, start with instantiating a ProcessFactory object.
- * Then a number of methods can be invoked concatenated with dots cause all the methods return
- * the same process factory object. When done, end that sequence with
- * {@link #done()} to get the constructed ProcessDefinition.
- * </p>
- *
- * <p>The idea is that this results into a more compact and more readable
- * code to build process definitions as opposed to including xml inline. For example :
- * </p>
- * <pre>
- * ProcessDefinition processDefinition = ProcessFactory.build()
- * .node().initial().behaviour(new WaitState())
- * .transition("normal").to("a")
- * .transition("shortcut").to("c")
- * .node("a").behaviour(new WaitState())
- * .transition().to("b")
- * .node("b").behaviour(new WaitState())
- * .transition().to("c")
- * .node("c").behaviour(new WaitState())
- * .done();
- * </pre>
- *
- * <hr />
- *
- * <p>If more control is needed over the creation of the process definition
- * objects, then consider using the concrete implementation classes from
- * package {@link org.jbpm.pvm.internal.model} directly. The implementation code
- * of this class might be a good guide to get you on your way.
- * </p>
- *
- * @author Tom Baeyens
- */
-public class ProcessFactory {
-
- // static factory methods ///////////////////////////////////////////////////
-
- protected ProcessDefinitionImpl processDefinition;
- protected NodeImpl node;
- protected TransitionImpl transition;
- protected List<DestinationReference> destinationReferences;
- protected ObservableElementImpl observableElement;
- protected EventImpl event;
- protected EventListenerReference eventListenerReference;
- protected ExceptionHandlerImpl exceptionHandler;
- protected CompositeElementImpl compositeElement;
- protected CompositeElementImpl scope;
- protected Stack<CompositeElementImpl> compositeElementStack;
-
- /** start building a process definition without a name. */
- protected ProcessFactory() {
- this(null);
- }
-
- /** start building a process definition with the given name. */
- protected ProcessFactory(String processName) {
- this(processName, null);
- }
-
- /** start building a process definition with the given name. */
- protected ProcessFactory(String processName, ProcessDefinitionImpl processDefinition) {
- if (processDefinition!=null) {
- this.processDefinition = processDefinition;
- } else {
- this.processDefinition = instantiateProcessDefinition();
- }
- this.processDefinition.setName(processName);
- this.observableElement = this.processDefinition;
- this.compositeElement = this.processDefinition;
- this.scope = this.processDefinition;
- }
-
- /** starts building a process definition */
- public static ProcessFactory build() {
- return new ProcessFactory();
- }
-
- /** starts building a process definition */
- public static ProcessFactory build(String processName) {
- return new ProcessFactory(processName);
- }
-
- /** starts populating a given process definition */
- public static ProcessFactory build(String processName, ProcessDefinitionImpl processDefinition) {
- return new ProcessFactory(processName, processDefinition);
- }
-
- /** to be overwritten by specific process language factories */
- protected ProcessDefinitionImpl instantiateProcessDefinition() {
- return new ProcessDefinitionImpl();
- }
-
- /** marks the last created node as the initial node in the process. */
- public ProcessFactory initial() {
- if (node==null) {
- throw new PvmException("no current node");
- }
- if (processDefinition.getInitial()!=null) {
- throw new PvmException("duplicate initial node");
- }
- processDefinition.setInitial(node);
- return this;
- }
-
- /** applies on a node and makes it create a local activity instance scope.
- * This is automatically implied when {@link #variable(String) adding a variable}
- * or {@link #timer() adding a timer} */
- public ProcessFactory scope() {
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setLocalScope(true);
- scope = node;
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(String key) {
- if (node!=null) {
- scope();
- }
- VariableDefinitionImpl variableDefinition = compositeElement.createVariableDefinition();
- variableDefinition.setKey(key);
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(Descriptor sourceDescriptor) {
- if (node!=null && scope==null) {
- scope();
- }
- VariableDefinitionImpl variableDefinition = scope.createVariableDefinition();
- variableDefinition.setKey(sourceDescriptor.getName());
- variableDefinition.setSourceDescriptor(sourceDescriptor);
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(String key, String initialValue) {
- return variable(new StringDescriptor(key, initialValue));
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(String dueDateDescription, String signalName) {
- return timer(dueDateDescription, null, signalName, null);
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(String dueDateDescription, String signalName, String repeat) {
- return timer(dueDateDescription, null, signalName, repeat);
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(Date dueDate, String signalName) {
- return timer(null, dueDate, signalName, null);
- }
-
- protected ProcessFactory timer(String dueDateDescription, Date dueDate,
- String signalName, String repeat) {
- if (node!=null && scope==null) {
- scope();
- }
- TimerDefinitionImpl timerDefinition = scope.createTimerDefinition();
- if (dueDate!=null) {
- timerDefinition.setDueDate(dueDate);
- } else {
- timerDefinition.setDueDateDescription(dueDateDescription);
- }
- timerDefinition.setSignalName(signalName);
- timerDefinition.setRepeat(repeat);
- return this;
- }
-
- /** creates a node in the current parent.
- * The current parent is either the process definition or a composite node
- * in case method {@link #compositeNode(String)} was called previously. */
- public ProcessFactory node() {
- return node(null);
- }
-
- /** creates a named node.
- * The current parent is either the process definition or a composite node
- * in case method {@link #compositeNode(String)} was called previously. */
- public ProcessFactory node(String nodeName) {
- if (exceptionHandler!=null) {
- exceptionHandler.setNodeName(nodeName);
- } else {
- node = compositeElement.createNode(nodeName);
- scope = null;
-
- observableElement = node;
- event = null;
- eventListenerReference = null;
- transition = null;
- exceptionHandler = null;
- }
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Activity activity) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(activity);
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(descriptor);
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Class<? extends Activity> activityClass) {
- return behaviour(new ObjectDescriptor(activityClass));
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(String expression) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(expression);
- return this;
- }
-
-
- /** sets the asyncExecute property on the current node.
- * A current node is required. */
- public ProcessFactory asyncExecute() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setExecutionAsync(true);
- return this;
- }
-
- /** sets the asyncLeave property on the current node.
- * A current node is required. */
- public ProcessFactory asyncLeave() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setLeaveAsync(true);
- return this;
- }
-
- /** sets the asyncSignal property on the current node.
- * A current node is required. */
- public ProcessFactory asyncSignal() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setSignalAsync(true);
- return this;
- }
-
- /** sets the property needsPrevious on the current node.
- * A current node is required. */
- public ProcessFactory needsPrevious() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setPreviousNeeded(true);
- return this;
- }
-
- /** starts a block in which nested nodes can be created.
- * This block can be ended with {@link #compositeEnd()}.
- * A current node is required. */
- public ProcessFactory compositeNode() {
- return compositeNode(null);
- }
-
- /** starts a block in which nested nodes can be created.
- * This block can be ended with {@link #compositeEnd()}.
- * A current node is required. */
- public ProcessFactory compositeNode(String nodeName) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- if (compositeElementStack==null) {
- compositeElementStack = new Stack<CompositeElementImpl>();
- }
-
- compositeElementStack.push(compositeElement);
- node(nodeName);
- compositeElement = node;
-
- return this;
- }
-
- /** ends a block in which nested nodes are created.
- * This method requires that a nested node block was started before
- * with {@link #compositeNode(String)} */
- public ProcessFactory compositeEnd() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- if (compositeElementStack==null) {
- throw new PvmException("no composite node was started");
- }
-
- compositeElement = compositeElementStack.pop();
-
- if (compositeElementStack.isEmpty()) {
- compositeElementStack = null;
- }
-
- return this;
- }
-
- /** creates a transition on the current node.
- * This method requires a current node */
- public ProcessFactory transition() {
- return transition(null);
- }
-
- /** creates a named transition on the current node.
- * This method requires a current node */
- public ProcessFactory transition(String transitionName) {
- if (exceptionHandler!=null) {
- exceptionHandler.setTransitionName(transitionName);
- } else {
- if (node==null) {
- throw new PvmException("no current node");
- }
- transition = node.createOutgoingTransition(null, transitionName);
- observableElement = transition;
- event = null;
- eventListenerReference = null;
- exceptionHandler = null;
- }
- return this;
- }
-
- /** sets the takeAsync property on the current transition
- * This method requires a current transition. */
- public ProcessFactory asyncTake() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- transition.setTakeAsync(true);
- return this;
- }
-
- /** sets the destination node on the current transition.
- * This method requires a current transition. */
- public ProcessFactory to(String destination) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- if (destinationReferences==null) {
- destinationReferences = new ArrayList<DestinationReference>();
- }
- destinationReferences.add(new DestinationReference(transition, destination));
- return this;
- }
-
- /** sets the wait condition on the current transition.
- * This method requires a current transition. */
- public ProcessFactory waitCondition(Condition condition) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
- transition.setWaitConditionDescriptor(conditionDescriptor);
- return this;
- }
-
- /** sets the guard condition on the current transition.
- * This method requires a current transition. */
- public ProcessFactory guardCondition(Condition condition) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
- transition.setConditionDescriptor(conditionDescriptor);
- return this;
- }
-
- /** creates the given event on the current process element.
- * This method requires a process element. A process element is
- * either a process definition or a node. This method doesn't need to be
- * called for transitions. If you have exception handlers and listeners
- * on an event, make sure that you put the invocations of
- * {@link #exceptionHandler(Class)} first. */
- public ProcessFactory event(String eventName) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (observableElement==null) {
- throw new PvmException("no current process element");
- }
- if (observableElement instanceof Transition) {
- throw new PvmException("for actions on transitions, you don't need to call event");
- }
- event = observableElement.createEvent(eventName);
- exceptionHandler = null;
- return this;
- }
-
- /** creates an exception handler for the given exception class on the current process element;
- * until the {@link #exceptionHandlerEnd()}. Subsequent invocations of
- * {@link #listener(Activity) listeners} or {@link #transition() transitions} will
- * have the created exception handler as a target.
- *
- * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */
- public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- ProcessElementImpl processElement = null;
- if (eventListenerReference!=null) {
- processElement = eventListenerReference;
- } else if (event!=null) {
- processElement = event;
- } else if (observableElement!=null) {
- processElement = observableElement;
- } else {
- throw new PvmException("no current process element, event or action");
- }
-
- exceptionHandler = processElement.createExceptionHandler();
-
- if (exceptionClass!=null) {
- exceptionHandler.setExceptionClassName(exceptionClass.getName());
- }
-
- return this;
- }
-
- public ProcessFactory exceptionHandlerEnd() {
- exceptionHandler = null;
- return this;
- }
-
- public ProcessFactory transactional() {
- if (exceptionHandler==null) {
- throw new PvmException("transactional is a property of an exception handler");
- }
- exceptionHandler.setTransactional(true);
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- exceptionHandler.createEventListenerReference(descriptor);
- } else {
- getEvent().createEventListenerReference(descriptor);
- }
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(EventListener eventListener) {
- if (exceptionHandler!=null) {
- exceptionHandler.createEventListenerReference(eventListener);
- } else {
- eventListenerReference = getEvent().createEventListenerReference(eventListener);
- }
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(String expression) {
- if (exceptionHandler!=null) {
- exceptionHandler.createActivityReference(expression);
- } else {
- eventListenerReference = getEvent().createEventListenerReference(expression);
- }
- return this;
- }
-
- /** disables propagated events. This means that this action will only be executed
- * if the event is fired on the actual process element of the event. The current
- * action will not be executed if an event is fired on one of the children of the
- * process element to which this event relates. */
- public ProcessFactory propagationDisabled() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (eventListenerReference==null) {
- throw new PvmException("no current event action");
- }
- eventListenerReference.setPropagationEnabled(false);
- return this;
- }
-
- private EventImpl getEvent() {
- if ( (event==null)
- && (observableElement instanceof TransitionImpl)
- ) {
- event = ((TransitionImpl)observableElement).createEvent();
- return event;
- }
- if (event==null) {
- throw new PvmException("no current event");
- }
- return event;
- }
-
- /** adds a string-valued configuration to the current process element */
- public ProcessFactory property(String name, String stringValue) {
- StringDescriptor stringDescriptor = new StringDescriptor();
- stringDescriptor.setName(name);
- stringDescriptor.setValue(stringValue);
- property(stringDescriptor);
- return this;
- }
-
- /** adds a configuration to the current process element */
- public ProcessFactory property(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (observableElement==null) {
- throw new PvmException("no current process element");
- }
- if (event!=null) {
- event.addProperty(descriptor);
- } else {
- observableElement.addProperty(descriptor);
- }
- return this;
- }
-
- public class DestinationReference {
- TransitionImpl transition;
- String destinationName;
- public DestinationReference(TransitionImpl transition, String destinationName) {
- this.transition = transition;
- this.destinationName = destinationName;
- }
- public void resolve() {
- NodeImpl destination = (NodeImpl) processDefinition.findNode(destinationName);
- if (destination==null) {
- throw new PvmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
- }
- destination.addIncomingTransition(transition);
- transition.setDestination(destination);
- }
- }
-
- /** extract the process definition from the factory. This should be
- * the last method in the chain of subsequent invoked methods on this
- * factory object. */
- public ClientProcessDefinition done() {
- resolveDestinations();
- if (processDefinition.getInitial()==null) {
- throw new PvmException("no initial node");
- }
- return processDefinition;
- }
-
- /** sets the {@link ProcessDefinition#getVersion() version} of the process definition explicitely */
- public ProcessFactory version(int version) {
- processDefinition.setVersion(version);
- return this;
- }
-
- /** sets the {@link ProcessDefinition#getKey() key} of the process definition explicitely */
- public ProcessFactory key(String key) {
- processDefinition.setKey(key);
- return this;
- }
-
- private void resolveDestinations() {
- if (destinationReferences!=null) {
- for (DestinationReference destinationReference : destinationReferences) {
- destinationReference.resolve();
- }
- }
- }
-}
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -30,11 +30,11 @@
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.log.Log;
/**
* Stateless session command executor.
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -40,9 +40,9 @@
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCmd;
-import org.jbpm.pvm.internal.log.Log;
/**
* Message driven command receiver.
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -26,8 +26,8 @@
import org.jbpm.PvmException;
import org.jbpm.job.Timer;
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.TimerSession;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -22,10 +22,11 @@
package org.jbpm.enterprise.internal.ejb;
import java.util.Date;
+
+import org.jbpm.log.Log;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.session.DbSession;
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -36,7 +36,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/CommandExecutorTest.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -32,7 +32,7 @@
import org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome;
import org.jbpm.enterprise.test.custom.InsertPhraseCmd;
import org.jbpm.enterprise.test.custom.RemovePhraseCmd;
-import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.log.Log;
/**
* Server-side test for the {@linkplain CommandExecutorSLSB command executor}.
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -36,6 +36,7 @@
import org.jbpm.enterprise.internal.ejb.TimerEB;
import org.jbpm.enterprise.test.custom.HappyActivity;
import org.jbpm.enterprise.test.custom.NoisyActivity;
+import org.jbpm.log.Log;
import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.cmd.Command;
@@ -43,7 +44,6 @@
import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.OpenProcessDefinition;
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/HappyActivity.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -23,10 +23,10 @@
import java.util.Date;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
/**
* @author Alejandro Guizar
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java 2008-10-31 09:15:02 UTC (rev 2696)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/custom/NoisyActivity.java 2008-10-31 10:19:29 UTC (rev 2697)
@@ -24,10 +24,10 @@
import java.sql.SQLException;
import java.util.Date;
+import org.jbpm.log.Log;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
/**
* @author Alejandro Guizar
15 years, 6 months
JBoss JBPM SVN: r2696 - jbpm3/trunk/hudson.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-31 05:15:02 -0400 (Fri, 31 Oct 2008)
New Revision: 2696
Modified:
jbpm3/trunk/hudson/ant.properties.example
jbpm3/trunk/hudson/build.xml
Log:
Revert tomcat.executable. jBPM Hudson is currently supported on linux only
Modified: jbpm3/trunk/hudson/ant.properties.example
===================================================================
--- jbpm3/trunk/hudson/ant.properties.example 2008-10-31 09:14:00 UTC (rev 2695)
+++ jbpm3/trunk/hudson/ant.properties.example 2008-10-31 09:15:02 UTC (rev 2696)
@@ -20,7 +20,6 @@
hudson.maven.path=/usr/java/apache-maven-2.0.9
-tomcat.executable=catalina.sh
hudson.root=/usr/share/java/workspace
hudson.host=jbws.dyndns.org
hudson.admin.port=8150
Modified: jbpm3/trunk/hudson/build.xml
===================================================================
--- jbpm3/trunk/hudson/build.xml 2008-10-31 09:14:00 UTC (rev 2695)
+++ jbpm3/trunk/hudson/build.xml 2008-10-31 09:15:02 UTC (rev 2696)
@@ -191,7 +191,7 @@
<property environment="env"/>
<fail message="unset JBOSS_REPOSITORY=${env.JBOSS_REPOSITORY}" if="env.JBOSS_REPOSITORY"/>
- <exec executable="${hudson.tomcat}/bin/${tomcat.executable}" failonerror="true" output="${hudson.target.dir}/hudson.log">
+ <exec executable="${hudson.tomcat}/bin/catalina.sh" failonerror="true" output="${hudson.target.dir}/hudson.log">
<env key="CATALINA_OPTS" value="-Xmx512m -Djava.awt.headless=true"/>
<arg line="start"/>
</exec>
15 years, 6 months
JBoss JBPM SVN: r2695 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 05:14:00 -0400 (Fri, 31 Oct 2008)
New Revision: 2695
Modified:
jbpm4/trunk/pom.xml
Log:
unification api proposals
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-10-31 09:13:32 UTC (rev 2694)
+++ jbpm4/trunk/pom.xml 2008-10-31 09:14:00 UTC (rev 2695)
@@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM4</name>
+ <name>jBPM 4</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
@@ -38,6 +38,7 @@
<module>modules/cts</module>
<module>modules/jpdl</module>
<module>modules/manual</module>
+ <module>modules/test</module>
</modules>
<!-- Properties -->
@@ -48,7 +49,6 @@
<hsqldb.version>1.8.0.7</hsqldb.version>
<jboss.j2ee.version>4.2.1.GA</jboss.j2ee.version>
<jboss.seam.version>2.0.1.GA</jboss.seam.version>
- <jbpm.api.version>1.0.0-SNAPSHOT</jbpm.api.version>
<jsr233.version>2.0.3</jsr233.version>
<juel.version>2.1.0</juel.version>
<log4j.version>1.2.14</log4j.version>
@@ -63,8 +63,13 @@
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-api</artifactId>
- <version>${jbpm.api.version}</version>
+ <version>${version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test</artifactId>
+ <version>${version}</version>
+ </dependency>
<!-- Please sort by groupid -->
<dependency>
15 years, 6 months
JBoss JBPM SVN: r2694 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm and 13 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 05:13:32 -0400 (Fri, 31 Oct 2008)
New Revision: 2694
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java
jbpm4/trunk/modules/cts/src/test/java/org/jbpm/cts/
jbpm4/trunk/modules/cts/src/test/java/org/jbpm/cts/db/
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java
jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/MockProcessEngine.java
jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
Modified:
jbpm4/trunk/modules/api/pom.xml
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentFactory.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/MessageSession.java
jbpm4/trunk/modules/cts/pom.xml
jbpm4/trunk/modules/enterprise/pom.xml
Log:
unification api proposals
Modified: jbpm4/trunk/modules/api/pom.xml
===================================================================
--- jbpm4/trunk/modules/api/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
+++ jbpm4/trunk/modules/api/pom.xml 2008-10-31 09:13:32 UTC (rev 2694)
@@ -12,13 +12,11 @@
<!-- $Id$ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM4 - API</name>
+ <name>jBPM 4 - API</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-api</artifactId>
<packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
-
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm4</groupId>
@@ -39,6 +37,10 @@
<!-- Dependencies -->
<dependencies>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ </dependency>
</dependencies>
<!-- Plugins -->
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,272 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.activity;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.client.ClientProcessInstance;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.model.Node;
-import org.jbpm.pvm.model.ObservableElement;
-import org.jbpm.pvm.model.OpenExecution;
-import org.jbpm.pvm.model.Transition;
-import org.jbpm.pvm.processlog.ProcessLog;
-import org.jbpm.pvm.session.PvmDbSession;
-
-
-/** view upon an {@link Execution path of execution} exposed to
- * {@link Activity} implementations.
- *
- * @author Tom Baeyens
- */
-public interface ActivityExecution extends OpenExecution {
-
- // wait state behaviour /////////////////////////////////////////////////////
-
- /** makes this execution wait in the current node until an external trigger is given
- * with one of the {@link #signal()} methods. */
- void waitForSignal();
-
- // taking a transition //////////////////////////////////////////////////////
-
- /** takes the default transition.
- *
- * <p>This method can only be called from inside
- * {@link ExternalActivity} implementations and in rare occasions also from outside
- * of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal()}
- * method as in that case, it's the current node (hence the process language)that
- * will decide how to interpret the signal.
- * </p>
- *
- * @throws PvmException in case there is no default transition in the current node
- * or in case this method is called from inside an {@link Activity} */
- void takeDefaultTransition();
-
- /** takes the outgoing transition with the given name.
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivity} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current node (hence the process language)that
- * will decide how to interpret the signal.</p>
- *
- * <p>Transitions will be looked up recursively starting from the
- * {@link #getNode() current node} and then up the {@link Node#getParent() node-parent-hierarchy} </p>
- *
- * @param transitionName is the name of the transition to take. A null value will
- * match the first unnamed transition.
- *
- * @throws PvmException in case no such transition is found in {@link #getNode() the current node}
- * or in case this method is called from inside an {@link Activity}.*/
- void take(String transitionName);
-
- /** takes the given outgoing transition.
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivity} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current node (hence the process language)that
- * will decide how to interpret the signal.</p>
- *
- * <p>CAUTION: It's up to the client to make sure
- * that this transition makes sense as there is no check whether the given transition
- * is an outgoing transition of the current node. The motivation for that is
- * that in case of superstates, that check can become too 'expensive'. </p> */
- void take(Transition transition);
-
- /** let's the given execution take the transition.
- * @throws PvmException if the execution is not part of this process instance. */
- void take(Transition transition, Execution execution);
-
- // execute a child node /////////////////////////////////////////////////////
-
- /** executes the given nested node.
- *
- * <p>The nodeName is looked up in the current node's nested nodes.</p>
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivity} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current node (hence the process language)that
- * will decide how to interpret the signal.</p> */
- void execute(String nodeName);
-
- /** executes the given node.
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivity} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current node (hence the process language)that
- * will decide how to interpret the signal.</p>
- */
- void execute(Node node);
-
- // reposition the execution in another node /////////////////////////////////
-
- /** position this execution in the destination node. */
- void move(Node destination);
-
- /** position the given execution in the destination node */
- void move(Node destination, Execution execution);
-
- // managing the parent-child relation ///////////////////////////////////////
-
- /** creates a child execution. See
- * {@link #createExecution(Execution, String)} for more information. */
- Execution createExecution();
-
- /** creates a child execution with the given name. See
- * {@link #createExecution(Execution, String)} for more information. */
- Execution createExecution(String name);
-
- /** creates a new child execution under the given parent. See
- * {@link #createExecution(Execution, String)} for more information.
- * @throws PvmException if the given parent is not in this execution's
- * process instance. */
- Execution createExecution(Execution parent);
-
- /** creates a new child execution under the given parent with the given name.
- * Only leaf executions can be active. So creating the first child execution
- * will {@link Execution#STATE_INACTIVE inactivate} the parent execution
- * automatically.
- * @throws PvmException if the given parent is not in this execution's
- * process instance. */
- Execution createExecution(String name, Execution parent);
-
- /** removes the child execution from this execution. Removing the last
- * child execution of a parent will cause the parent's state to become
- * {@link Execution#STATE_ACTIVE active}. */
- void removeExecution(Execution child);
-
- /** removes the child execution from the given parent. Removing the last
- * child execution of a parent will cause the parent's state to become
- * {@link Execution#STATE_ACTIVE active}. */
- void removeExecution(Execution child, Execution parent);
-
- // create sub process execution /////////////////////////////////////////////
-
- /** creates a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition);
-
- /** creates a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition, String key);
-
- /** creates and begins a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition);
-
- /** creates and begins a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition, String key);
-
- // ending an execution //////////////////////////////////////////////////////
-
- /** ends this execution and all of its child executions.
- *
- * <p>The execution will be removed from it's parent. Potentially this can cause
- * a parent execution to start executing in case this is the last concurrent
- * execution for which the parent is waiting.</p>
- *
- * <p>This method should not be called in {@link Activity}s. It can be called from
- * outside the process execution and in {@link ExternalActivity}s. </p> */
- void stop();
-
- /** ends this execution and assigns the state {@link #STATE_CANCELLED}.
- * @see #stop(String) */
- void cancel();
-
- /** ends this execution and all it's child executions with a user defined
- * status.
- *
- * <p>It is not recommended to use any of
- * {@link #STATE_ACTIVE the defined statuses} as that may case unpredictable
- * side effects.</p>
- *
- * <p>The execution will be removed from it's parent.</p> */
- void stop(String state);
-
- // firing events ////////////////////////////////////////////////////////////
-
- /** fires the event on the given eventSource and then propagates the event
- * up to the eventSource's parent chain. All the actions will see the given
- * eventSource in {@link #getEventSource()}, event if the events are
- * registered to parent's of the given eventSource. */
- void fire(String eventName, ObservableElement eventSource);
-
- // logs /////////////////////////////////////////////////////////////////////
-
- /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
- void addLog(ProcessLog processLog);
-
- // extra state information methods //////////////////////////////////////////
-
- /** the current transition indicating the position in the process definition graph.
- * Can be null in case this execution is not taking a transition. */
- Transition getTransition();
-
- // extensions //////////////////////////////////////////////////////////////
-
- /** way to access process language extensions in the execution without
- * having to cast. Casting can be problematic for persistence. */
- <T> T getExtension(Class<T> extensionClass);
-
- /** setter for the priority. The default priority is 0, which means
- * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
- * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
- * priority integer value, but then, the UI will have to display it as
- * an integer and not the named value.*/
- void setPriority(int priority);
-
-
- // previous methods /////////////////////////////////////////////////////////
-
- // TODO evaluate the previous methods (JBPM-)
- // these methods are kind of performance optimisations. a sequence and
- // some other specific control flow implementations can be optimised if they
- // have access to the previous node or transition.
- // Those activities could also be implemented by letting the activities store
- // the contextual information in process variables or some other execution
- // context. But with the previous properties as done now, these control flow
- // nodes can be implemented without storing an extra record. It's only a property
- // that is only updated when the node configuration indicates that it's needed.
- // (see also Node.isPreviousNeeded())
-
- /** returns the previously executed node only if {@link Node#isPreviousNeeded()}
- * is set to true. */
- Node getPreviousNode();
-
- /** returns the previously taken transition only if {@link Node#isPreviousNeeded()}
- * is set to true. */
- Transition getPreviousTransition();
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ActivityExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,272 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.activity;
+
+import org.jbpm.Execution;
+import org.jbpm.PvmException;
+import org.jbpm.pvm.client.ClientProcessDefinition;
+import org.jbpm.pvm.client.ClientProcessInstance;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.model.Node;
+import org.jbpm.pvm.model.ObservableElement;
+import org.jbpm.pvm.model.OpenExecution;
+import org.jbpm.pvm.model.Transition;
+import org.jbpm.pvm.processlog.ProcessLog;
+import org.jbpm.pvm.session.PvmDbSession;
+
+
+/** view upon an {@link Execution path of execution} exposed to
+ * {@link Activity} implementations.
+ *
+ * @author Tom Baeyens
+ */
+public interface ActivityExecution extends OpenExecution {
+
+ // wait state behaviour /////////////////////////////////////////////////////
+
+ /** makes this execution wait in the current node until an external trigger is given
+ * with one of the {@link #signal()} methods. */
+ void waitForSignal();
+
+ // taking a transition //////////////////////////////////////////////////////
+
+ /** takes the default transition.
+ *
+ * <p>This method can only be called from inside
+ * {@link ExternalActivity} implementations and in rare occasions also from outside
+ * of the execution (from an external client while the process is in a wait state).
+ * For external clients, it is more normal to use the {@link #signal()}
+ * method as in that case, it's the current node (hence the process language)that
+ * will decide how to interpret the signal.
+ * </p>
+ *
+ * @throws PvmException in case there is no default transition in the current node
+ * or in case this method is called from inside an {@link Activity} */
+ void takeDefaultTransition();
+
+ /** takes the outgoing transition with the given name.
+ *
+ * <p>This method can only be called
+ * from inside {@link ExternalActivity} implementations and in rare occasions also from
+ * outside of the execution (from an external client while the process is in a wait state).
+ * For external clients, it is more normal to use the {@link #signal(String)}
+ * method as in that case, it's the current node (hence the process language)that
+ * will decide how to interpret the signal.</p>
+ *
+ * <p>Transitions will be looked up recursively starting from the
+ * {@link #getNode() current node} and then up the {@link Node#getParent() node-parent-hierarchy} </p>
+ *
+ * @param transitionName is the name of the transition to take. A null value will
+ * match the first unnamed transition.
+ *
+ * @throws PvmException in case no such transition is found in {@link #getNode() the current node}
+ * or in case this method is called from inside an {@link Activity}.*/
+ void take(String transitionName);
+
+ /** takes the given outgoing transition.
+ *
+ * <p>This method can only be called
+ * from inside {@link ExternalActivity} implementations and in rare occasions also from
+ * outside of the execution (from an external client while the process is in a wait state).
+ * For external clients, it is more normal to use the {@link #signal(String)}
+ * method as in that case, it's the current node (hence the process language)that
+ * will decide how to interpret the signal.</p>
+ *
+ * <p>CAUTION: It's up to the client to make sure
+ * that this transition makes sense as there is no check whether the given transition
+ * is an outgoing transition of the current node. The motivation for that is
+ * that in case of superstates, that check can become too 'expensive'. </p> */
+ void take(Transition transition);
+
+ /** let's the given execution take the transition.
+ * @throws PvmException if the execution is not part of this process instance. */
+ void take(Transition transition, Execution execution);
+
+ // execute a child node /////////////////////////////////////////////////////
+
+ /** executes the given nested node.
+ *
+ * <p>The nodeName is looked up in the current node's nested nodes.</p>
+ *
+ * <p>This method can only be called
+ * from inside {@link ExternalActivity} implementations and in rare occasions also from
+ * outside of the execution (from an external client while the process is in a wait state).
+ * For external clients, it is more normal to use the {@link #signal(String)}
+ * method as in that case, it's the current node (hence the process language)that
+ * will decide how to interpret the signal.</p> */
+ void execute(String nodeName);
+
+ /** executes the given node.
+ *
+ * <p>This method can only be called
+ * from inside {@link ExternalActivity} implementations and in rare occasions also from
+ * outside of the execution (from an external client while the process is in a wait state).
+ * For external clients, it is more normal to use the {@link #signal(String)}
+ * method as in that case, it's the current node (hence the process language)that
+ * will decide how to interpret the signal.</p>
+ */
+ void execute(Node node);
+
+ // reposition the execution in another node /////////////////////////////////
+
+ /** position this execution in the destination node. */
+ void move(Node destination);
+
+ /** position the given execution in the destination node */
+ void move(Node destination, Execution execution);
+
+ // managing the parent-child relation ///////////////////////////////////////
+
+ /** creates a child execution. See
+ * {@link #createExecution(Execution, String)} for more information. */
+ Execution createExecution();
+
+ /** creates a child execution with the given name. See
+ * {@link #createExecution(Execution, String)} for more information. */
+ Execution createExecution(String name);
+
+ /** creates a new child execution under the given parent. See
+ * {@link #createExecution(Execution, String)} for more information.
+ * @throws PvmException if the given parent is not in this execution's
+ * process instance. */
+ Execution createExecution(Execution parent);
+
+ /** creates a new child execution under the given parent with the given name.
+ * Only leaf executions can be active. So creating the first child execution
+ * will {@link Execution#STATE_INACTIVE inactivate} the parent execution
+ * automatically.
+ * @throws PvmException if the given parent is not in this execution's
+ * process instance. */
+ Execution createExecution(String name, Execution parent);
+
+ /** removes the child execution from this execution. Removing the last
+ * child execution of a parent will cause the parent's state to become
+ * {@link Execution#STATE_ACTIVE active}. */
+ void removeExecution(Execution child);
+
+ /** removes the child execution from the given parent. Removing the last
+ * child execution of a parent will cause the parent's state to become
+ * {@link Execution#STATE_ACTIVE active}. */
+ void removeExecution(Execution child, Execution parent);
+
+ // create sub process execution /////////////////////////////////////////////
+
+ /** creates a sub process related to this path of execution.
+ * ProcessDefinitions can be obtained from the {@link PvmDbSession}
+ * in the {@link Environment}. */
+ ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition);
+
+ /** creates a sub process related to this path of execution.
+ * ProcessDefinitions can be obtained from the {@link PvmDbSession}
+ * in the {@link Environment}. */
+ ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition, String key);
+
+ /** creates and begins a sub process related to this path of execution.
+ * ProcessDefinitions can be obtained from the {@link PvmDbSession}
+ * in the {@link Environment}. */
+ ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition);
+
+ /** creates and begins a sub process related to this path of execution.
+ * ProcessDefinitions can be obtained from the {@link PvmDbSession}
+ * in the {@link Environment}. */
+ ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition, String key);
+
+ // ending an execution //////////////////////////////////////////////////////
+
+ /** ends this execution and all of its child executions.
+ *
+ * <p>The execution will be removed from it's parent. Potentially this can cause
+ * a parent execution to start executing in case this is the last concurrent
+ * execution for which the parent is waiting.</p>
+ *
+ * <p>This method should not be called in {@link Activity}s. It can be called from
+ * outside the process execution and in {@link ExternalActivity}s. </p> */
+ void stop();
+
+ /** ends this execution and assigns the state {@link #STATE_CANCELLED}.
+ * @see #stop(String) */
+ void cancel();
+
+ /** ends this execution and all it's child executions with a user defined
+ * status.
+ *
+ * <p>It is not recommended to use any of
+ * {@link #STATE_ACTIVE the defined statuses} as that may case unpredictable
+ * side effects.</p>
+ *
+ * <p>The execution will be removed from it's parent.</p> */
+ void stop(String state);
+
+ // firing events ////////////////////////////////////////////////////////////
+
+ /** fires the event on the given eventSource and then propagates the event
+ * up to the eventSource's parent chain. All the actions will see the given
+ * eventSource in {@link #getEventSource()}, event if the events are
+ * registered to parent's of the given eventSource. */
+ void fire(String eventName, ObservableElement eventSource);
+
+ // logs /////////////////////////////////////////////////////////////////////
+
+ /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
+ void addLog(ProcessLog processLog);
+
+ // extra state information methods //////////////////////////////////////////
+
+ /** the current transition indicating the position in the process definition graph.
+ * Can be null in case this execution is not taking a transition. */
+ Transition getTransition();
+
+ // extensions //////////////////////////////////////////////////////////////
+
+ /** way to access process language extensions in the execution without
+ * having to cast. Casting can be problematic for persistence. */
+ <T> T getExtension(Class<T> extensionClass);
+
+ /** setter for the priority. The default priority is 0, which means
+ * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
+ * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
+ * priority integer value, but then, the UI will have to display it as
+ * an integer and not the named value.*/
+ void setPriority(int priority);
+
+
+ // previous methods /////////////////////////////////////////////////////////
+
+ // TODO evaluate the previous methods (JBPM-)
+ // these methods are kind of performance optimisations. a sequence and
+ // some other specific control flow implementations can be optimised if they
+ // have access to the previous node or transition.
+ // Those activities could also be implemented by letting the activities store
+ // the contextual information in process variables or some other execution
+ // context. But with the previous properties as done now, these control flow
+ // nodes can be implemented without storing an extra record. It's only a property
+ // that is only updated when the node configuration indicates that it's needed.
+ // (see also Node.isPreviousNeeded())
+
+ /** returns the previously executed node only if {@link Node#isPreviousNeeded()}
+ * is set to true. */
+ Node getPreviousNode();
+
+ /** returns the previously taken transition only if {@link Node#isPreviousNeeded()}
+ * is set to true. */
+ Transition getPreviousTransition();
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.activity;
-
-import java.util.Map;
-
-import org.jbpm.pvm.Execution;
-
-
-/** extends {@link Activity} for handling external triggers after a wait state.
- *
- * <p>Process languages will provide a set of these node implementations. But
- * languages like jPDL even allow users to provide their own node behaviour with
- * this interface.
- * </p>
- *
- * @author Tom Baeyens
- */
-public interface ExternalActivity extends Activity {
-
- /** handles an external trigger.
- *
- * <p>An external trigger that comes into an execution
- * through one of the {@link Execution#signal()} methods, will be delegated to
- * the node in which the execution is positioned when it receives the external
- * trigger.
- * </p>
- *
- * <p>The signal method implements how the
- * node will react on that signal. For example, the outgoing transition
- * could be taken that corresponds with the given signal.
- * </p>
- *
- * @param execution the {@link Execution} for which the signal is given
- *
- * @param signalName is an abstract text that can be associated with a signal. this
- * corresponds to e.g. a method name in a java class interface. The implementation
- * can decide e.g. to use the signal to identify the outgoing transition.
- *
- * @param parameters is extra information that can be provided with a signal.
- * In this way, it is somewhat similar to the parameters that can be fed into a method
- * invocation through reflection.
- *
- * @throws Exception to indicate any kind of failure. Note that exceptions are
- * considered non recoverable. After an Exception, the execution should not be
- * used any more and if this is during a transaction, the transaction should be
- * rolled back. */
- void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception;
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/activity/ExternalActivity.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -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.pvm.activity;
+
+import java.util.Map;
+
+import org.jbpm.Execution;
+
+
+/** extends {@link Activity} for handling external triggers after a wait state.
+ *
+ * <p>Process languages will provide a set of these node implementations. But
+ * languages like jPDL even allow users to provide their own node behaviour with
+ * this interface.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public interface ExternalActivity extends Activity {
+
+ /** handles an external trigger.
+ *
+ * <p>An external trigger that comes into an execution
+ * through one of the {@link Execution#signal()} methods, will be delegated to
+ * the node in which the execution is positioned when it receives the external
+ * trigger.
+ * </p>
+ *
+ * <p>The signal method implements how the
+ * node will react on that signal. For example, the outgoing transition
+ * could be taken that corresponds with the given signal.
+ * </p>
+ *
+ * @param execution the {@link Execution} for which the signal is given
+ *
+ * @param signalName is an abstract text that can be associated with a signal. this
+ * corresponds to e.g. a method name in a java class interface. The implementation
+ * can decide e.g. to use the signal to identify the outgoing transition.
+ *
+ * @param parameters is extra information that can be provided with a signal.
+ * In this way, it is somewhat similar to the parameters that can be fed into a method
+ * invocation through reflection.
+ *
+ * @throws Exception to indicate any kind of failure. Note that exceptions are
+ * considered non recoverable. After an Exception, the execution should not be
+ * used any more and if this is during a transaction, the transaction should be
+ * rolled back. */
+ void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception;
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/client)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/client/ClientExecution.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,196 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.client;
-
-import java.util.Map;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.activity.Activity;
-import org.jbpm.pvm.activity.ExternalActivity;
-import org.jbpm.pvm.model.OpenExecution;
-
-/** view upon an {@link Execution path of execution} exposed to
- * external clients.
- *
- * @author Tom Baeyens
- */
-public interface ClientExecution extends OpenExecution {
-
- // stop /////////////////////////////////////////////////////////////////////
-
- // ending an execution //////////////////////////////////////////////////////
-
- /** ends this execution and all of its child executions.
- *
- * <p>All child executions will be stopped and removed. This execution
- * will not be removed from its parent.</p>
- *
- * <p>This method should not be called in {@link Activity}s. It can be called from
- * outside the process execution and in {@link ExternalActivity}s. </p> */
- void stop();
-
- /** ends this execution and assigns the state {@link #STATE_CANCELLED}.
- * @see #stop(String) */
- void cancel();
-
- /** ends this execution and all it's child executions with a user defined
- * status.
- *
- *
- *
- * Giving states {@link */
- void stop(String state);
-
- // signal ///////////////////////////////////////////////////////////////////
-
- /** feeds a external trigger into this execution.
- *
- * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily
- * has to be the case . The {@link ExternalActivity} is responsible for interpreting
- * the signal and acting upon it.
- * </p>
- *
- * <p>A signal can optionally be given {@link #signal(String) a signal name},
- * {@link #signal(Map) a map of parameters} or {@link #signal(String, Map) both}.
- * </p>
- *
- * <p>Since it's an external trigger, this method requires that this execution is
- * waiting for an external trigger. So this method must be called as an external client
- * and can not be called while this execution is executing. In an {@link Activity} for
- * example you're not allowed to call the signal on the execution cause it is executing.
- * But you are allowed to invoke this method on any other execution (at least, if that
- * one is waiting for an external trigger).</p>
- *
- * <p>Typically a signal will cause the execution to start executing, but that is
- * not a must. What happens with this signal is defined in the
- * {@link ExternalActivity#signal(Execution, String, Map)} of
- * the {@link #getNode() current node}. </p>
- *
- * @see #signal(String) */
- void signal();
-
- /** feeds a named {@link #signal() external trigger} into the execution.
- *
- * <p>In each state, a number of things can happen. The signal parameter specifies
- * which of these things is happening. It's somewhat similar to a method name in
- * the invocation of an object.
- * </p>
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(String signalName);
-
- /** feeds {@link #signal() an external trigger} into the execution with parameters.
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(Map<String, Object> parameters);
-
- /** feeds a named {@link #signal() external trigger} into the execution with parameters.
- *
- * <p>In each state, a number of things can happen. The signal parameter specifies
- * which of these things is happening. It's somewhat similar to a method name in
- * the invocation of an object.
- * </p>
- *
- * <p>The parameters parameter provide extra information to the signal.
- * Typically, the parameters are set as variables but
- * the process language can overwrite that behaviour in the current node.
- * See {@link ExternalActivity#signal(Execution, String, Map)} for more information.
- * </p>
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(String signalName, Map<String, Object> parameters);
-
- /** feeds a external trigger into the given execution.
- *
- * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily
- * has to be the case . The {@link ExternalActivity} is responsible for interpreting
- * the signal and acting upon it.
- * </p>
- *
- * <p>A signal can optionally be given {@link #signal(String) a signal name},
- * {@link #signal(Map) a map of parameters} or {@link #signal(String, Map) both}.
- * </p>
- *
- * <p>Since it's an external trigger, this method requires that this execution is
- * waiting for an external trigger. So this method must be called as an external client
- * and can not be called while this execution is executing. In an {@link Activity} for
- * example you're not allowed to call the signal on the execution cause it is executing.
- * But you are allowed to invoke this method on any other execution (at least, if that
- * one is waiting for an external trigger).</p>
- *
- * <p>Typically a signal will cause the execution to start executing, but that is
- * not a must. What happens with this signal is defined in the
- * {@link ExternalActivity#signal(Execution, String, Map)} of
- * the {@link #getNode() current node}. </p>
- *
- * @see #signal(String) */
- void signal(Execution execution);
-
- /** feeds a named {@link #signal() external trigger} into a given execution.
- *
- * <p>In each state, a number of things can happen. The signal parameter specifies
- * which of these things is happening. It's somewhat similar to a method name in
- * the invocation of an object.
- * </p>
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(String signalName, Execution execution);
-
- /** feeds {@link #signal() an external trigger} into a given execution with parameters.
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(Map<String, Object> parameters, Execution execution);
-
- /** feeds a named {@link #signal() external trigger} into a given execution with parameters.
- *
- * <p>In each state, a number of things can happen. The signal parameter specifies
- * which of these things is happening. It's somewhat similar to a method name in
- * the invocation of an object.
- * </p>
- *
- * <p>The parameters parameter provide extra information to the signal.
- * Typically, the parameters are set as variables but
- * the process language can overwrite that behaviour in the current node.
- * See {@link ExternalActivity#signal(Execution, String, Map)} for more information.
- * </p>
- *
- * @see #signal() See the unnamed signal for more information
- */
- void signal(String signalName, Map<String, Object> parameters, Execution execution);
-
-
- /** suspends this execution and all it's child executions. Human tasks
- * of a suspended execution shouldn't show up in people's task list and
- * timers of suspended executions shouldn't fire.
- * @throws PvmException if this execution is already suspended. */
- void suspend();
-
- /** resumes an execution. Inverse of {@link #suspend()}.
- * @throws PvmException if this execution is not suspended. */
- void resume();
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/client/ClientExecution.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/client/ClientExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,196 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.client;
+
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.PvmException;
+import org.jbpm.pvm.activity.Activity;
+import org.jbpm.pvm.activity.ExternalActivity;
+import org.jbpm.pvm.model.OpenExecution;
+
+/** view upon an {@link Execution path of execution} exposed to
+ * external clients.
+ *
+ * @author Tom Baeyens
+ */
+public interface ClientExecution extends OpenExecution {
+
+ // stop /////////////////////////////////////////////////////////////////////
+
+ // ending an execution //////////////////////////////////////////////////////
+
+ /** ends this execution and all of its child executions.
+ *
+ * <p>All child executions will be stopped and removed. This execution
+ * will not be removed from its parent.</p>
+ *
+ * <p>This method should not be called in {@link Activity}s. It can be called from
+ * outside the process execution and in {@link ExternalActivity}s. </p> */
+ void stop();
+
+ /** ends this execution and assigns the state {@link #STATE_CANCELLED}.
+ * @see #stop(String) */
+ void cancel();
+
+ /** ends this execution and all it's child executions with a user defined
+ * status.
+ *
+ *
+ *
+ * Giving states {@link */
+ void stop(String state);
+
+ // signal ///////////////////////////////////////////////////////////////////
+
+ /** feeds a external trigger into this execution.
+ *
+ * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily
+ * has to be the case . The {@link ExternalActivity} is responsible for interpreting
+ * the signal and acting upon it.
+ * </p>
+ *
+ * <p>A signal can optionally be given {@link #signal(String) a signal name},
+ * {@link #signal(Map) a map of parameters} or {@link #signal(String, Map) both}.
+ * </p>
+ *
+ * <p>Since it's an external trigger, this method requires that this execution is
+ * waiting for an external trigger. So this method must be called as an external client
+ * and can not be called while this execution is executing. In an {@link Activity} for
+ * example you're not allowed to call the signal on the execution cause it is executing.
+ * But you are allowed to invoke this method on any other execution (at least, if that
+ * one is waiting for an external trigger).</p>
+ *
+ * <p>Typically a signal will cause the execution to start executing, but that is
+ * not a must. What happens with this signal is defined in the
+ * {@link ExternalActivity#signal(Execution, String, Map)} of
+ * the {@link #getNode() current node}. </p>
+ *
+ * @see #signal(String) */
+ void signal();
+
+ /** feeds a named {@link #signal() external trigger} into the execution.
+ *
+ * <p>In each state, a number of things can happen. The signal parameter specifies
+ * which of these things is happening. It's somewhat similar to a method name in
+ * the invocation of an object.
+ * </p>
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(String signalName);
+
+ /** feeds {@link #signal() an external trigger} into the execution with parameters.
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(Map<String, Object> parameters);
+
+ /** feeds a named {@link #signal() external trigger} into the execution with parameters.
+ *
+ * <p>In each state, a number of things can happen. The signal parameter specifies
+ * which of these things is happening. It's somewhat similar to a method name in
+ * the invocation of an object.
+ * </p>
+ *
+ * <p>The parameters parameter provide extra information to the signal.
+ * Typically, the parameters are set as variables but
+ * the process language can overwrite that behaviour in the current node.
+ * See {@link ExternalActivity#signal(Execution, String, Map)} for more information.
+ * </p>
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(String signalName, Map<String, Object> parameters);
+
+ /** feeds a external trigger into the given execution.
+ *
+ * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily
+ * has to be the case . The {@link ExternalActivity} is responsible for interpreting
+ * the signal and acting upon it.
+ * </p>
+ *
+ * <p>A signal can optionally be given {@link #signal(String) a signal name},
+ * {@link #signal(Map) a map of parameters} or {@link #signal(String, Map) both}.
+ * </p>
+ *
+ * <p>Since it's an external trigger, this method requires that this execution is
+ * waiting for an external trigger. So this method must be called as an external client
+ * and can not be called while this execution is executing. In an {@link Activity} for
+ * example you're not allowed to call the signal on the execution cause it is executing.
+ * But you are allowed to invoke this method on any other execution (at least, if that
+ * one is waiting for an external trigger).</p>
+ *
+ * <p>Typically a signal will cause the execution to start executing, but that is
+ * not a must. What happens with this signal is defined in the
+ * {@link ExternalActivity#signal(Execution, String, Map)} of
+ * the {@link #getNode() current node}. </p>
+ *
+ * @see #signal(String) */
+ void signal(Execution execution);
+
+ /** feeds a named {@link #signal() external trigger} into a given execution.
+ *
+ * <p>In each state, a number of things can happen. The signal parameter specifies
+ * which of these things is happening. It's somewhat similar to a method name in
+ * the invocation of an object.
+ * </p>
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(String signalName, Execution execution);
+
+ /** feeds {@link #signal() an external trigger} into a given execution with parameters.
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(Map<String, Object> parameters, Execution execution);
+
+ /** feeds a named {@link #signal() external trigger} into a given execution with parameters.
+ *
+ * <p>In each state, a number of things can happen. The signal parameter specifies
+ * which of these things is happening. It's somewhat similar to a method name in
+ * the invocation of an object.
+ * </p>
+ *
+ * <p>The parameters parameter provide extra information to the signal.
+ * Typically, the parameters are set as variables but
+ * the process language can overwrite that behaviour in the current node.
+ * See {@link ExternalActivity#signal(Execution, String, Map)} for more information.
+ * </p>
+ *
+ * @see #signal() See the unnamed signal for more information
+ */
+ void signal(String signalName, Map<String, Object> parameters, Execution execution);
+
+
+ /** suspends this execution and all it's child executions. Human tasks
+ * of a suspended execution shouldn't show up in people's task list and
+ * timers of suspended executions shouldn't fire.
+ * @throws PvmException if this execution is already suspended. */
+ void suspend();
+
+ /** resumes an execution. Inverse of {@link #suspend()}.
+ * @throws PvmException if this execution is not suspended. */
+ void resume();
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/Environment.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,268 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.env;
-
-import java.io.Serializable;
-import java.util.Stack;
-
-import org.jbpm.pvm.PvmException;
-
-
-/**
- * maintains contextual information for a thread in a set of
- * {@link Context}s.
- *
- * <h3>Introduction</h3>
- *
- * <p>Objects have different lifecycles and different context's (aka scopes). An
- * environment provides the structure to easily manage objects with different
- * contexts.
- * </p>
- *
- * <p>Examples of contexts are:
- * <ul>
- * <li><b>environment-factory</b>: The environment-factory context is used to store e.g. data sources,
- * session factories and other static resources needed by an application.
- * The environment-factory context lives for the complete duration of the {@link EnvironmentFactory}.
- * So if the {@link EnvironmentFactory} is maintained in a static member field, the
- * environment-factory context lives for the duration of the application.
- * The same environment-factory context is shared for all the Environments produced by one
- * EnvironmentFactory.</li>
- * <li><b>environment</b>: The environment context is used for e.g. a transaction
- * and transactional resources, user authentication. This results in an efficient and
- * configurable use of transactional resources that need to be lazily initialized.</li>
- * <li>The environment can accomodate other contexts as well. They can be added
- * and removed dynamically. Examples of other potential contexts are web-request, web-session,
- * web-application, business processDefinition, jobImpl, ... </li>
- * </ul>
- *
- * <center><img src="environment.gif"/></center>
- *
- * <p>An environment is typically installed like this
- * </p>
- *
- * <b><pre>static EnvironmentFactory environmentFactory = new DefaultEnvironmentFactory();
- *
- * ...
- *
- * Environment environment = environmentFactory.openEnvironment();
- * try {
- *
- * ... everything available in this block ...
- *
- * } finally {
- * environment.close();
- * }
- * </pre></b>
- *
- * <h3>Purpose</h3>
- *
- * <p>The first purpose of the environment is to separate the application from the
- * environment. Standard Java and Enterprise Java are quite different and an environment
- * abstraction like this allows for the development of applications that can run in
- * both Standard and Enterprise environments. Also test environments are easier to
- * tweak this way.
- * </p>
- *
- * <p>A second purpose of the environment is to enable specific to global searching
- * of resources. E.g. you could search for an 'adminEmailAddress' in the contexts
- * 'processDefinition-execution', 'processDefinition-definition' and 'environment-factory' in the given order.
- * That way, a global adminEmailAddress can be specified in the environment-factory context
- * and it can be refined in more specific contexts processDefinition-definition or processDefinition-execution.
- * </p>
- *
- * <h3>Search order</h3>
- *
- * <p>To find an object in the environment, a searchOrder can be specified. A
- * search order is an sequence that specifies the order in which the contexts should
- * be searched.
- * </p>
- *
- * <p>The default search order is the inverse sequence of how the contexts are
- * added to the environment. This is because in general, we can assume that the
- * more recent a context was added, the more specific it is.
- * </p>
- *
- * <h3>Transaction, username and classloader</h3>
- *
- * <p>Three objects are used so frequently in an environment that they get
- * special treatment:
- * </p>
- *
- * <ul>
- * <li><b>Transaction</b>: an abstraction for marking a transaction with
- * setRollbackOnly.</li>
- * <li><b>Classloader</b>: the current class loader.</li>
- * <li><b>Username</b>: the name of the currently authenticated user.</li>
- * </ul>
- *
- * <p>For these special properties, setters are also available. That is to support
- * programmatic injection into the environment. Alternatively, they can be configured
- * in one of the contexts.
- * </p>
- *
- *
- * @see EnvironmentFactory
- * @author Tom Baeyens
- */
-public abstract class Environment implements Serializable {
-
- /**
- * searches a named object in all the contexts in the default search order.
- * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the environment.
- */
- public abstract Object get(String name);
-
- /**
- * searches a named object in all the contexts in the given search order. The given
- * search order doesn't have to include all contexts. It can be a subset of the
- * contexts available.
- * @param searchOrder list of contexts names. The object will be searched in these contexts, in the given order.
- * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the specified searchOrder contexts.
- */
- public abstract Object get(String name, String[] searchOrder);
-
- /** searches an object based on type. The search doesn take superclasses of the context elements
- * into account.
- * @return the first object of the given type or null in case no such element was found.
- */
- public abstract <T> T get(Class<T> type);
-
-
- /** searches an object based on type. The search doesn take superclasses of the context elements
- * into account.
- * @return the first object of the given type or null in case no such element was found.
- */
- public abstract <T> T get(Class<T> type, String[] searchOrder);
-
- /** get the authenticated user id */
- public abstract String getUserId();
-
- /** set the authenticated user id */
- public abstract void setUserId(String userId);
-
- /**
- * closes the Environment by removing all its contexts.
- */
- public abstract void close();
-
- public abstract Context getContext(String contextName);
- public abstract void addContext(Context context);
- public abstract void removeContext(Context context);
-
- public abstract ClassLoader getClassLoader();
- public abstract void setClassLoader(ClassLoader classLoader);
-
- // current environment //////////////////////////////////////////////////////
- /** the current environment is maintained in the currentEnvironment thread local */
- static ThreadLocal<Environment> currentEnvironment = new ThreadLocal<Environment>();
-
- /** in case of nested environments, the current environment stack maintains the outer environments */
- static ThreadLocal<Stack<Environment>> currentEnvironmentStack = new ThreadLocal<Stack<Environment>>();
-
- /** gets the most inner open environment. */
- public static Environment getCurrent() {
- return currentEnvironment.get();
- }
-
- public static <T> T getFromCurrent(Class<T> type) {
- return getFromCurrent(type, true);
- }
-
- public static <T> T getFromCurrent(Class<T> type, boolean required) {
- Environment environment = getCurrent();
- if (environment==null) {
- if (required) {
- throw new PvmException("no environment to get "+type.getName());
- }
- return null;
- }
- T object = environment.get(type);
- if (object==null) {
- if (required) {
- throw new PvmException("no "+type.getName()+" in current environment");
- }
- return null;
- }
- return object;
- }
-
- public static Object getFromCurrent(String name) {
- return getFromCurrent(name, true);
- }
-
- public static Object getFromCurrent(String name, boolean required) {
- Environment environment = getCurrent();
- if (environment==null) {
- if (required) {
- throw new PvmException("no environment to get '"+name+"'");
- }
- return null;
- }
- Object object = environment.get(name);
- if (object==null) {
- if (required) {
- throw new PvmException("no '"+name+"' in current environment");
- }
- return null;
- }
- return object;
- }
-
- static Stack<Environment> getStack() {
- // lazy initialize the current environment stack
- Stack<Environment> stack = currentEnvironmentStack.get();
- if (stack==null) {
- stack = new Stack<Environment>();
- currentEnvironmentStack.set(stack);
- }
- return stack;
- }
-
-
- /** pops the closing context from the stack of current contexts. This
- * is the first thing that needs to be done when an environment is closed.
- * @see EnvironmentFactory#push(Environment) */
- protected static synchronized Environment popEnvironment() {
- Environment popped = currentEnvironment.get();
- currentEnvironment.set(null);
- Stack<Environment> stack = currentEnvironmentStack.get();
- if ( (stack!=null)
- && (! stack.isEmpty())
- ) {
- currentEnvironment.set(stack.pop());
- }
- return popped;
- }
-
- /** after opening of a new environment succeeded, the environment
- * must be pushed in the stack of current environments.
- *
- * @see Environment#pop() */
- protected static synchronized void pushEnvironment(Environment environment) {
- Environment current = currentEnvironment.get();
- if (current!=null) {
- getStack().push(current);
- }
- currentEnvironment.set(environment);
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/Environment.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/Environment.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,268 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.env;
+
+import java.io.Serializable;
+import java.util.Stack;
+
+import org.jbpm.PvmException;
+
+
+/**
+ * maintains contextual information for a thread in a set of
+ * {@link Context}s.
+ *
+ * <h3>Introduction</h3>
+ *
+ * <p>Objects have different lifecycles and different context's (aka scopes). An
+ * environment provides the structure to easily manage objects with different
+ * contexts.
+ * </p>
+ *
+ * <p>Examples of contexts are:
+ * <ul>
+ * <li><b>environment-factory</b>: The environment-factory context is used to store e.g. data sources,
+ * session factories and other static resources needed by an application.
+ * The environment-factory context lives for the complete duration of the {@link EnvironmentFactory}.
+ * So if the {@link EnvironmentFactory} is maintained in a static member field, the
+ * environment-factory context lives for the duration of the application.
+ * The same environment-factory context is shared for all the Environments produced by one
+ * EnvironmentFactory.</li>
+ * <li><b>environment</b>: The environment context is used for e.g. a transaction
+ * and transactional resources, user authentication. This results in an efficient and
+ * configurable use of transactional resources that need to be lazily initialized.</li>
+ * <li>The environment can accomodate other contexts as well. They can be added
+ * and removed dynamically. Examples of other potential contexts are web-request, web-session,
+ * web-application, business processDefinition, jobImpl, ... </li>
+ * </ul>
+ *
+ * <center><img src="environment.gif"/></center>
+ *
+ * <p>An environment is typically installed like this
+ * </p>
+ *
+ * <b><pre>static EnvironmentFactory environmentFactory = new DefaultEnvironmentFactory();
+ *
+ * ...
+ *
+ * Environment environment = environmentFactory.openEnvironment();
+ * try {
+ *
+ * ... everything available in this block ...
+ *
+ * } finally {
+ * environment.close();
+ * }
+ * </pre></b>
+ *
+ * <h3>Purpose</h3>
+ *
+ * <p>The first purpose of the environment is to separate the application from the
+ * environment. Standard Java and Enterprise Java are quite different and an environment
+ * abstraction like this allows for the development of applications that can run in
+ * both Standard and Enterprise environments. Also test environments are easier to
+ * tweak this way.
+ * </p>
+ *
+ * <p>A second purpose of the environment is to enable specific to global searching
+ * of resources. E.g. you could search for an 'adminEmailAddress' in the contexts
+ * 'processDefinition-execution', 'processDefinition-definition' and 'environment-factory' in the given order.
+ * That way, a global adminEmailAddress can be specified in the environment-factory context
+ * and it can be refined in more specific contexts processDefinition-definition or processDefinition-execution.
+ * </p>
+ *
+ * <h3>Search order</h3>
+ *
+ * <p>To find an object in the environment, a searchOrder can be specified. A
+ * search order is an sequence that specifies the order in which the contexts should
+ * be searched.
+ * </p>
+ *
+ * <p>The default search order is the inverse sequence of how the contexts are
+ * added to the environment. This is because in general, we can assume that the
+ * more recent a context was added, the more specific it is.
+ * </p>
+ *
+ * <h3>Transaction, username and classloader</h3>
+ *
+ * <p>Three objects are used so frequently in an environment that they get
+ * special treatment:
+ * </p>
+ *
+ * <ul>
+ * <li><b>Transaction</b>: an abstraction for marking a transaction with
+ * setRollbackOnly.</li>
+ * <li><b>Classloader</b>: the current class loader.</li>
+ * <li><b>Username</b>: the name of the currently authenticated user.</li>
+ * </ul>
+ *
+ * <p>For these special properties, setters are also available. That is to support
+ * programmatic injection into the environment. Alternatively, they can be configured
+ * in one of the contexts.
+ * </p>
+ *
+ *
+ * @see EnvironmentFactory
+ * @author Tom Baeyens
+ */
+public abstract class Environment implements Serializable {
+
+ /**
+ * searches a named object in all the contexts in the default search order.
+ * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the environment.
+ */
+ public abstract Object get(String name);
+
+ /**
+ * searches a named object in all the contexts in the given search order. The given
+ * search order doesn't have to include all contexts. It can be a subset of the
+ * contexts available.
+ * @param searchOrder list of contexts names. The object will be searched in these contexts, in the given order.
+ * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the specified searchOrder contexts.
+ */
+ public abstract Object get(String name, String[] searchOrder);
+
+ /** searches an object based on type. The search doesn take superclasses of the context elements
+ * into account.
+ * @return the first object of the given type or null in case no such element was found.
+ */
+ public abstract <T> T get(Class<T> type);
+
+
+ /** searches an object based on type. The search doesn take superclasses of the context elements
+ * into account.
+ * @return the first object of the given type or null in case no such element was found.
+ */
+ public abstract <T> T get(Class<T> type, String[] searchOrder);
+
+ /** get the authenticated user id */
+ public abstract String getUserId();
+
+ /** set the authenticated user id */
+ public abstract void setUserId(String userId);
+
+ /**
+ * closes the Environment by removing all its contexts.
+ */
+ public abstract void close();
+
+ public abstract Context getContext(String contextName);
+ public abstract void addContext(Context context);
+ public abstract void removeContext(Context context);
+
+ public abstract ClassLoader getClassLoader();
+ public abstract void setClassLoader(ClassLoader classLoader);
+
+ // current environment //////////////////////////////////////////////////////
+ /** the current environment is maintained in the currentEnvironment thread local */
+ static ThreadLocal<Environment> currentEnvironment = new ThreadLocal<Environment>();
+
+ /** in case of nested environments, the current environment stack maintains the outer environments */
+ static ThreadLocal<Stack<Environment>> currentEnvironmentStack = new ThreadLocal<Stack<Environment>>();
+
+ /** gets the most inner open environment. */
+ public static Environment getCurrent() {
+ return currentEnvironment.get();
+ }
+
+ public static <T> T getFromCurrent(Class<T> type) {
+ return getFromCurrent(type, true);
+ }
+
+ public static <T> T getFromCurrent(Class<T> type, boolean required) {
+ Environment environment = getCurrent();
+ if (environment==null) {
+ if (required) {
+ throw new PvmException("no environment to get "+type.getName());
+ }
+ return null;
+ }
+ T object = environment.get(type);
+ if (object==null) {
+ if (required) {
+ throw new PvmException("no "+type.getName()+" in current environment");
+ }
+ return null;
+ }
+ return object;
+ }
+
+ public static Object getFromCurrent(String name) {
+ return getFromCurrent(name, true);
+ }
+
+ public static Object getFromCurrent(String name, boolean required) {
+ Environment environment = getCurrent();
+ if (environment==null) {
+ if (required) {
+ throw new PvmException("no environment to get '"+name+"'");
+ }
+ return null;
+ }
+ Object object = environment.get(name);
+ if (object==null) {
+ if (required) {
+ throw new PvmException("no '"+name+"' in current environment");
+ }
+ return null;
+ }
+ return object;
+ }
+
+ static Stack<Environment> getStack() {
+ // lazy initialize the current environment stack
+ Stack<Environment> stack = currentEnvironmentStack.get();
+ if (stack==null) {
+ stack = new Stack<Environment>();
+ currentEnvironmentStack.set(stack);
+ }
+ return stack;
+ }
+
+
+ /** pops the closing context from the stack of current contexts. This
+ * is the first thing that needs to be done when an environment is closed.
+ * @see EnvironmentFactory#push(Environment) */
+ protected static synchronized Environment popEnvironment() {
+ Environment popped = currentEnvironment.get();
+ currentEnvironment.set(null);
+ Stack<Environment> stack = currentEnvironmentStack.get();
+ if ( (stack!=null)
+ && (! stack.isEmpty())
+ ) {
+ currentEnvironment.set(stack.pop());
+ }
+ return popped;
+ }
+
+ /** after opening of a new environment succeeded, the environment
+ * must be pushed in the stack of current environments.
+ *
+ * @see Environment#pop() */
+ protected static synchronized void pushEnvironment(Environment environment) {
+ Environment current = currentEnvironment.get();
+ if (current!=null) {
+ getStack().push(current);
+ }
+ currentEnvironment.set(environment);
+ }
+}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/EnvironmentFactory.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentFactory.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -23,9 +23,7 @@
import java.io.InputStream;
import java.io.Serializable;
-import java.util.Stack;
-import org.jbpm.pvm.internal.env.PvmEnvironmentFactoryParser;
import org.xml.sax.InputSource;
/**
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.env;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.pvm.PvmException;
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentHelper {
-
- static Map<Class<?>, Object> defaultObjectCache = new HashMap<Class<?>, Object>();
-
- public static <T> T get(Class<T> type) {
- if (type==null) {
- return null;
- }
- Environment environment = Environment.getCurrent();
- if (environment!=null) {
- return environment.get(type);
- }
- if (defaultObjectCache.containsKey(type)) {
- return (T) defaultObjectCache.get(type);
- }
- try {
- Method defaultFactoryMethod = type.getMethod("createDefault");
- if (defaultFactoryMethod!=null) {
- Object defaultObject = defaultFactoryMethod.invoke(null);
- defaultObjectCache.put(type, defaultObject);
- return (T) defaultObject;
- }
- } catch (Exception e) {
- throw new PvmException("couldn't create default "+type.getName(), e);
- }
- return null;
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/env/EnvironmentHelper.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.env;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.PvmException;
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class EnvironmentHelper {
+
+ static Map<Class<?>, Object> defaultObjectCache = new HashMap<Class<?>, Object>();
+
+ public static <T> T get(Class<T> type) {
+ if (type==null) {
+ return null;
+ }
+ Environment environment = Environment.getCurrent();
+ if (environment!=null) {
+ return environment.get(type);
+ }
+ if (defaultObjectCache.containsKey(type)) {
+ return (T) defaultObjectCache.get(type);
+ }
+ try {
+ Method defaultFactoryMethod = type.getMethod("createDefault");
+ if (defaultFactoryMethod!=null) {
+ Object defaultObject = defaultFactoryMethod.invoke(null);
+ defaultObjectCache.put(type, defaultObject);
+ return (T) defaultObject;
+ }
+ } catch (Exception e) {
+ throw new PvmException("couldn't create default "+type.getName(), e);
+ }
+ return null;
+ }
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/listener)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.listener;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.activity.Activity;
-import org.jbpm.pvm.model.Event;
-import org.jbpm.pvm.model.ObservableElement;
-import org.jbpm.pvm.model.OpenExecution;
-import org.jbpm.pvm.model.Transition;
-import org.jbpm.pvm.processlog.ProcessLog;
-
-
-/** view upon an {@link Execution path of execution} exposed to
- * {@link EventListener} implementations.
- *
- * @author Tom Baeyens
- */
-public interface EventListenerExecution extends OpenExecution {
-
-
- /** the original object that fired the event, part of the current position in the
- * process graph. Can be null in case no event is being fired. This is mostly the
- * object that is listened to with an {@link Activity}, but the eventSource can also
- * be a child of the object to which is listened in case of event propagation. */
- ObservableElement getEventSource();
-
- /** the event that is being fired, part of the current position in the process
- * graph. Can be null in case no event is being fired. */
- Event getEvent();
-
- // candidates to be moved to OpenExecution:
-
- // logs /////////////////////////////////////////////////////////////////////
-
- /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
- void addLog(ProcessLog processLog);
-
- // extra state information methods //////////////////////////////////////////
-
- /** the current transition indicating the position in the process definition graph.
- * Can be null in case this execution is not taking a transition. */
- Transition getTransition();
-
- /** fires the event on the given eventSource and then propagates the event
- * up to the eventSource's parent chain. All the actions will see the given
- * eventSource in {@link #getEventSource()}, event if the events are
- * registered to parent's of the given eventSource. */
- void fire(String eventName, ObservableElement eventSource);
-
- /** the exception in case an exception handler is handling an exception. */
- Exception getException();
-
- // extensions //////////////////////////////////////////////////////////////
-
- /** way to access process language extensions in the execution without
- * having to cast. Casting can be problematic for persistence. */
- <T> T getExtension(Class<T> extensionClass);
-
-
- /** setter for the priority. The default priority is 0, which means
- * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
- * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
- * priority integer value, but then, the UI will have to display it as
- * an integer and not the named value.*/
- void setPriority(int priority);
-
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/listener/EventListenerExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.listener;
+
+import org.jbpm.Execution;
+import org.jbpm.pvm.activity.Activity;
+import org.jbpm.pvm.model.Event;
+import org.jbpm.pvm.model.ObservableElement;
+import org.jbpm.pvm.model.OpenExecution;
+import org.jbpm.pvm.model.Transition;
+import org.jbpm.pvm.processlog.ProcessLog;
+
+
+/** view upon an {@link Execution path of execution} exposed to
+ * {@link EventListener} implementations.
+ *
+ * @author Tom Baeyens
+ */
+public interface EventListenerExecution extends OpenExecution {
+
+
+ /** the original object that fired the event, part of the current position in the
+ * process graph. Can be null in case no event is being fired. This is mostly the
+ * object that is listened to with an {@link Activity}, but the eventSource can also
+ * be a child of the object to which is listened in case of event propagation. */
+ ObservableElement getEventSource();
+
+ /** the event that is being fired, part of the current position in the process
+ * graph. Can be null in case no event is being fired. */
+ Event getEvent();
+
+ // candidates to be moved to OpenExecution:
+
+ // logs /////////////////////////////////////////////////////////////////////
+
+ /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
+ void addLog(ProcessLog processLog);
+
+ // extra state information methods //////////////////////////////////////////
+
+ /** the current transition indicating the position in the process definition graph.
+ * Can be null in case this execution is not taking a transition. */
+ Transition getTransition();
+
+ /** fires the event on the given eventSource and then propagates the event
+ * up to the eventSource's parent chain. All the actions will see the given
+ * eventSource in {@link #getEventSource()}, event if the events are
+ * registered to parent's of the given eventSource. */
+ void fire(String eventName, ObservableElement eventSource);
+
+ /** the exception in case an exception handler is handling an exception. */
+ Exception getException();
+
+ // extensions //////////////////////////////////////////////////////////////
+
+ /** way to access process language extensions in the execution without
+ * having to cast. Casting can be problematic for persistence. */
+ <T> T getExtension(Class<T> extensionClass);
+
+
+ /** setter for the priority. The default priority is 0, which means
+ * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
+ * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
+ * priority integer value, but then, the UI will have to display it as
+ * an integer and not the named value.*/
+ void setPriority(int priority);
+
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/Comment.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import java.util.Date;
-
-import org.jbpm.pvm.Execution;
-
-/** a free text comment that can be made to an {@link Execution}
- * or a task.
- *
- * This class also supports threaded discussions with the
- * {@link #getParent() parent}-{@link #getComments() child}
- * relation.
- *
- * @author Tom Baeyens
- */
-public interface Comment extends Discussable {
-
- /** the meaningless database primary key */
- long getDbid();
-
- /** the id of the user that made this comment. The term actorId is an abstract
- * reference to an entity in an external identity component. */
- String getUserId();
-
- /** the actual message. Both plain text as well as HTML can be stored
- * as the message. */
- String getMessage();
-
- /** time that specifies when the comment was made */
- Date getTime();
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/Comment.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Comment.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import java.util.Date;
+
+import org.jbpm.Execution;
+
+/** a free text comment that can be made to an {@link Execution}
+ * or a task.
+ *
+ * This class also supports threaded discussions with the
+ * {@link #getParent() parent}-{@link #getComments() child}
+ * relation.
+ *
+ * @author Tom Baeyens
+ */
+public interface Comment extends Discussable {
+
+ /** the meaningless database primary key */
+ long getDbid();
+
+ /** the id of the user that made this comment. The term actorId is an abstract
+ * reference to an entity in an external identity component. */
+ String getUserId();
+
+ /** the actual message. Both plain text as well as HTML can be stored
+ * as the message. */
+ String getMessage();
+
+ /** time that specifies when the comment was made */
+ Date getTime();
+}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.ProcessDefinition;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface ExecutionKeyGenerator {
-
- String createKey(ProcessDefinition processDefinition, Execution execution, String executionRef);
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ExecutionKeyGenerator.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import org.jbpm.Execution;
+import org.jbpm.ProcessDefinition;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface ExecutionKeyGenerator {
+
+ String createKey(ProcessDefinition processDefinition, Execution execution, String executionRef);
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/IdGenerator.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.ProcessDefinition;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface IdGenerator {
-
- /** generates a unique id for the given execution. */
- String createId(ProcessDefinition processDefinition, Execution parent, Execution execution);
-
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/IdGenerator.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/IdGenerator.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import org.jbpm.Execution;
+import org.jbpm.ProcessDefinition;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface IdGenerator {
+
+ /** generates a unique id for the given execution. */
+ String createId(ProcessDefinition processDefinition, Execution parent, Execution execution);
+
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/Node.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.pvm.Execution;
-
-
-/**
- * a node in a {@link OpenProcessDefinition} graph.
- *
- * <p>The node supports both graph based process models as well as
- * block structured (tree based) process models. First we describe
- * tranisions that can be used to form graph based process structures
- * and then we'll describe node composition to form block structured
- * process models. Both models can be combined as well.
- * </p>
- *
- * <p>Nodes have {@link #getIncomingTransitions() incoming}
- * and {@link #getOutgoingTransitions() outgoing transitions}.
- * These are lists of transitions.
- * </p>
- *
- * <p>Optionally, transitions can have names. In that case the
- * transition {@link #getOutgoingTransition(String) names are associated
- * to node's outgoing transitions}. The {@link #getOutgoingTransitionsMap() map
- * of outgoing transitions} provides easy access to the named transitions.
- * </p>
- *
- * <p>One of the outgoing transitions can optionally be marked as
- * {@link #getDefaultTransition() the default transition}.
- * </p>
- *
- * <p>Block structured process languages have composite nodes that can be
- * modeled with the {@link #getParent() parent}-{@link #getNodes() child}
- * relation.
- * </p>
- *
- * @author Tom Baeyens
- */
-public interface Node extends CompositeElement {
-
- /** the list of outgoing transitions.
- * Caution: the actual member is returned. No copy is made. */
- List<Transition> getOutgoingTransitions();
-
- /** the default outgoing transition. */
- Transition getDefaultTransition();
-
- /** the first leaving transition with the given name or null of no
- * such leaving transition exists. If the multiple transitions have
- * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
- * will be returned.
- *
- * @param transitionName is the name of the transition to take. A null value will
- * match the first unnamed transition. */
- Transition getOutgoingTransition(String transitionName);
-
- /** indicates if a leaving transition with the given transitionName exists.
- * A null value matches an unnamed transition. */
- boolean hasOutgoingTransition(String transitionName);
-
- /** indicates if this node has leaving transitions */
- boolean hasOutgoingTransitions();
-
- /** the leaving transitions, keyed by transition name. If a transition with
- * the same name occurs mutltiple times, the first one is returned.
- * Leaving transitions with a null value for their name are not included
- * in the map.
- * Beware: the actual member is returned. No copy is made. In fact, the
- * returned map is maintained as a cache. So updates to the map will
- * influence subsequent retrievals of outgoing transitions by name. */
- Map<String, Transition> getOutgoingTransitionsMap();
-
- /** searches for the given transitionName in this node and then up the
- * parent chain. Returns null if no such transition is found. */
- Transition findOutgoingTransition(String transitionName);
-
- /** the list of arriving transitions.
- * Beware: the actual member is returned. No copy is made. */
- List<Transition> getIncomingTransitions();
-
- /** indicates if this node has arriving transitions */
- boolean hasIncomingTransitions();
-
- /** retrieve the parent node in the composite node structure. This is
- * different from {@link ObservableElement#getParent()} in that it is restricted
- * to the parent nodes. It doesn't take into account the process definition. */
- Node getParentNode();
-
- /** indicates if this node should be executed
- * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
- boolean isExecutionAsync();
-
- /** indicates if signals should be processed
- * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
- boolean isSignalAsync();
-
- /** indicates if execution should proceed
- * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>
- * when this node is left over any of the outgoing transitions. */
- boolean isLeaveAsync();
-
- /** indicates if this node behaviour needs to know
- * {@link Execution#getPreviousNode() the previous node} or
- * {@link Execution#getPreviousTransition() previous transition}.
- * If this property is set to true, the properties {@link Execution#getPreviousNode()}
- * and {@link Execution#getPreviousTransition()} will be available to the
- * node behaviour when it is executed or signalled. */
- boolean isPreviousNeeded();
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/Node.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/Node.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -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.pvm.model;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.Execution;
+
+
+/**
+ * a node in a {@link OpenProcessDefinition} graph.
+ *
+ * <p>The node supports both graph based process models as well as
+ * block structured (tree based) process models. First we describe
+ * tranisions that can be used to form graph based process structures
+ * and then we'll describe node composition to form block structured
+ * process models. Both models can be combined as well.
+ * </p>
+ *
+ * <p>Nodes have {@link #getIncomingTransitions() incoming}
+ * and {@link #getOutgoingTransitions() outgoing transitions}.
+ * These are lists of transitions.
+ * </p>
+ *
+ * <p>Optionally, transitions can have names. In that case the
+ * transition {@link #getOutgoingTransition(String) names are associated
+ * to node's outgoing transitions}. The {@link #getOutgoingTransitionsMap() map
+ * of outgoing transitions} provides easy access to the named transitions.
+ * </p>
+ *
+ * <p>One of the outgoing transitions can optionally be marked as
+ * {@link #getDefaultTransition() the default transition}.
+ * </p>
+ *
+ * <p>Block structured process languages have composite nodes that can be
+ * modeled with the {@link #getParent() parent}-{@link #getNodes() child}
+ * relation.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public interface Node extends CompositeElement {
+
+ /** the list of outgoing transitions.
+ * Caution: the actual member is returned. No copy is made. */
+ List<Transition> getOutgoingTransitions();
+
+ /** the default outgoing transition. */
+ Transition getDefaultTransition();
+
+ /** the first leaving transition with the given name or null of no
+ * such leaving transition exists. If the multiple transitions have
+ * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
+ * will be returned.
+ *
+ * @param transitionName is the name of the transition to take. A null value will
+ * match the first unnamed transition. */
+ Transition getOutgoingTransition(String transitionName);
+
+ /** indicates if a leaving transition with the given transitionName exists.
+ * A null value matches an unnamed transition. */
+ boolean hasOutgoingTransition(String transitionName);
+
+ /** indicates if this node has leaving transitions */
+ boolean hasOutgoingTransitions();
+
+ /** the leaving transitions, keyed by transition name. If a transition with
+ * the same name occurs mutltiple times, the first one is returned.
+ * Leaving transitions with a null value for their name are not included
+ * in the map.
+ * Beware: the actual member is returned. No copy is made. In fact, the
+ * returned map is maintained as a cache. So updates to the map will
+ * influence subsequent retrievals of outgoing transitions by name. */
+ Map<String, Transition> getOutgoingTransitionsMap();
+
+ /** searches for the given transitionName in this node and then up the
+ * parent chain. Returns null if no such transition is found. */
+ Transition findOutgoingTransition(String transitionName);
+
+ /** the list of arriving transitions.
+ * Beware: the actual member is returned. No copy is made. */
+ List<Transition> getIncomingTransitions();
+
+ /** indicates if this node has arriving transitions */
+ boolean hasIncomingTransitions();
+
+ /** retrieve the parent node in the composite node structure. This is
+ * different from {@link ObservableElement#getParent()} in that it is restricted
+ * to the parent nodes. It doesn't take into account the process definition. */
+ Node getParentNode();
+
+ /** indicates if this node should be executed
+ * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
+ boolean isExecutionAsync();
+
+ /** indicates if signals should be processed
+ * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
+ boolean isSignalAsync();
+
+ /** indicates if execution should proceed
+ * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>
+ * when this node is left over any of the outgoing transitions. */
+ boolean isLeaveAsync();
+
+ /** indicates if this node behaviour needs to know
+ * {@link Execution#getPreviousNode() the previous node} or
+ * {@link Execution#getPreviousTransition() previous transition}.
+ * If this property is set to true, the properties {@link Execution#getPreviousNode()}
+ * and {@link Execution#getPreviousTransition()} will be available to the
+ * node behaviour when it is executed or signalled. */
+ boolean isPreviousNeeded();
+}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/OpenExecution.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.job.Timer;
-
-
-/** execution that opens up access to the related
- * objects in the execution and process definition
- * model.
- *
- * This execution exposes the execution hierarchy,
- * variable access and associated timers.
- *
- * This is an execution that can be used backed by
- * an open persistence session. Typically inside of
- * an environment block. Navigation over the
- * related model objects will load the related objects
- * transparantly with lazy loading.
- *
- * @author Tom Baeyens
- */
-public interface OpenExecution extends Execution, Discussable {
-
- /** the process definition for this execution.*/
- OpenProcessDefinition getProcessDefinition();
-
- /** the current node */
- Node getNode();
-
- /** the related sub process execution. */
- OpenExecution getSubProcessInstance();
-
- // variable access //////////////////////////////////////////////////////////
-
- /** retrieve the value for the given key.
- * The value can be null.
- * If there is no value for the given key, the returned
- * value will also be null. The value for key <code>null</code>
- * will always be null as null keys are not allowed. */
- Object getVariable(String key);
-
- /** updates or creates a variable for the given value.
- * Values are allowed to be null.
- * @throws PvmException if key is null. */
- void setVariable(String key, Object value);
-
- /** {@link #setVariable(String, Object) sets} all given variables.
- * Existing key-value pairs for which there is no key in the provided
- * variables will <b>not</b> be removed.
- * @throws PvmException is variables is not null and if null is present
- * as a key in the provided variables map. */
- void setVariables(Map<String, Object> variables);
-
- /** indicates presenve of the given key.
- * No exception will be thrown if key is null.
- * @return true if the key is present and false if the key doesn't exist
- * or if key is null. */
- boolean hasVariable(String key);
-
- /** remove the key-value pair for the given key from this scope.
- * No exception will be thrown when the variable is not present.
- * @returns whether a variable was actually found and removed. */
- boolean removeVariable(String key);
-
- /** removes all variables in this scope */
- void removeVariables();
-
- /** indicates if there are keys in this scope. */
- boolean hasVariables();
-
- /** a non-null set that contains all the keys present in this scope.
- * Even if there are no variable keys, an empty, non-null set will
- * be returned. */
- Set<String> getVariableKeys();
-
- /** a non-null map containing all the key-value pairs in this scope.
- * Even if there are no variable keys, an empty, non-null map will
- * be returned. */
- Map<String, Object> getVariables();
-
- /** create a new variable in this execution scope and determine
- * the type automagically. */
- void createVariable(String key, Object value);
-
- /** create a new variable in this execution scope with
- * the given type name. */
- void createVariable(String key, Object value, String typeName);
-
- // execution hierarchy access ///////////////////////////////////////////////
-
- /** the main path of execution in the <a href="package-summary.html#basicexecutionstructure">execution
- * structure</a>. Null will be returned in case this execution itself is the
- * main execution path. */
- OpenExecution getProcessInstance();
-
- /** the parent execution in the <a href="package-summary.html#basicexecutionstructure">execution
- * structure</a>. Null will be returned in case this execution itself is the
- * main execution path. */
- OpenExecution getParent();
-
- /** the child executions in the <a href="package-summary.html#basicexecutionstructure">execution
- * structure</a>. Can be null and can be an empty collection. */
- Collection<OpenExecution> getExecutions();
-
- /** maps child execution names to execution objects. In case multiple executions
- * have the same name, the first one is taken. Can be null or can be an empty
- * map. The first execution without a name is also included with null as the key.
- */
- Map<String, OpenExecution> getExecutionsMap();
-
- /** the child execution for the given name or null in case such execution doesn't exist. */
- OpenExecution getExecution(String name);
-
- /** indicates if this execution has a child execution with the given executionName */
- boolean hasExecution(String executionName);
-
- // timer access /////////////////////////////////////////////////////////////
-
- /** indicates if this execution scope has timers */
- boolean hasTimers();
-
- /** timers for this execution scope */
- Set<Timer> getTimers();
-
- // priority /////////////////////////////////////////////////////////////////
-
- /** setter for the priority. The default priority is 0, which means
- * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
- * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
- * priority integer value, but then, the UI will have to display it as
- * an integer and not the named value.*/
- void setPriority(int priority);
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java (from rev 2685, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/OpenExecution.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenExecution.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -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.pvm.model;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.Execution;
+import org.jbpm.PvmException;
+import org.jbpm.job.Timer;
+
+
+/** execution that opens up access to the related
+ * objects in the execution and process definition
+ * model.
+ *
+ * This execution exposes the execution hierarchy,
+ * variable access and associated timers.
+ *
+ * This is an execution that can be used backed by
+ * an open persistence session. Typically inside of
+ * an environment block. Navigation over the
+ * related model objects will load the related objects
+ * transparantly with lazy loading.
+ *
+ * @author Tom Baeyens
+ */
+public interface OpenExecution extends Execution, Discussable {
+
+ /** the process definition for this execution.*/
+ OpenProcessDefinition getProcessDefinition();
+
+ /** the current node */
+ Node getNode();
+
+ /** the related sub process execution. */
+ OpenExecution getSubProcessInstance();
+
+ // variable access //////////////////////////////////////////////////////////
+
+ /** retrieve the value for the given key.
+ * The value can be null.
+ * If there is no value for the given key, the returned
+ * value will also be null. The value for key <code>null</code>
+ * will always be null as null keys are not allowed. */
+ Object getVariable(String key);
+
+ /** updates or creates a variable for the given value.
+ * Values are allowed to be null.
+ * @throws PvmException if key is null. */
+ void setVariable(String key, Object value);
+
+ /** {@link #setVariable(String, Object) sets} all given variables.
+ * Existing key-value pairs for which there is no key in the provided
+ * variables will <b>not</b> be removed.
+ * @throws PvmException is variables is not null and if null is present
+ * as a key in the provided variables map. */
+ void setVariables(Map<String, Object> variables);
+
+ /** indicates presenve of the given key.
+ * No exception will be thrown if key is null.
+ * @return true if the key is present and false if the key doesn't exist
+ * or if key is null. */
+ boolean hasVariable(String key);
+
+ /** remove the key-value pair for the given key from this scope.
+ * No exception will be thrown when the variable is not present.
+ * @returns whether a variable was actually found and removed. */
+ boolean removeVariable(String key);
+
+ /** removes all variables in this scope */
+ void removeVariables();
+
+ /** indicates if there are keys in this scope. */
+ boolean hasVariables();
+
+ /** a non-null set that contains all the keys present in this scope.
+ * Even if there are no variable keys, an empty, non-null set will
+ * be returned. */
+ Set<String> getVariableKeys();
+
+ /** a non-null map containing all the key-value pairs in this scope.
+ * Even if there are no variable keys, an empty, non-null map will
+ * be returned. */
+ Map<String, Object> getVariables();
+
+ /** create a new variable in this execution scope and determine
+ * the type automagically. */
+ void createVariable(String key, Object value);
+
+ /** create a new variable in this execution scope with
+ * the given type name. */
+ void createVariable(String key, Object value, String typeName);
+
+ // execution hierarchy access ///////////////////////////////////////////////
+
+ /** the main path of execution in the <a href="package-summary.html#basicexecutionstructure">execution
+ * structure</a>. Null will be returned in case this execution itself is the
+ * main execution path. */
+ OpenExecution getProcessInstance();
+
+ /** the parent execution in the <a href="package-summary.html#basicexecutionstructure">execution
+ * structure</a>. Null will be returned in case this execution itself is the
+ * main execution path. */
+ OpenExecution getParent();
+
+ /** the child executions in the <a href="package-summary.html#basicexecutionstructure">execution
+ * structure</a>. Can be null and can be an empty collection. */
+ Collection<OpenExecution> getExecutions();
+
+ /** maps child execution names to execution objects. In case multiple executions
+ * have the same name, the first one is taken. Can be null or can be an empty
+ * map. The first execution without a name is also included with null as the key.
+ */
+ Map<String, OpenExecution> getExecutionsMap();
+
+ /** the child execution for the given name or null in case such execution doesn't exist. */
+ OpenExecution getExecution(String name);
+
+ /** indicates if this execution has a child execution with the given executionName */
+ boolean hasExecution(String executionName);
+
+ // timer access /////////////////////////////////////////////////////////////
+
+ /** indicates if this execution scope has timers */
+ boolean hasTimers();
+
+ /** timers for this execution scope */
+ Set<Timer> getTimers();
+
+ // priority /////////////////////////////////////////////////////////////////
+
+ /** setter for the priority. The default priority is 0, which means
+ * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
+ * LOW (-1) and LOWEST (-2). For the rest, the user can set any other
+ * priority integer value, but then, the UI will have to display it as
+ * an integer and not the named value.*/
+ void setPriority(int priority);
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import org.jbpm.pvm.ProcessDefinition;
-
-
-
-/**
- * a graph (or tree) structure that can be executed.
- *
- * <h2>Purpose</h2>
- * <p>ProcessDefinition is a base implementation that can be leveraged to build
- * graph based execution languages. While the ProcessDefinition class is concrete and
- * can be used as-is (e.g. by aggregation), most likely processDefinition languages
- * will inherit from this ProcessDefinition and create more specialized implementations.
- * </p>
- *
- * <p>The specialized processDefinition language classes can extend this ProcessDefinition
- * with new datastructures relevant for that perticular processDefinition language.
- * </p>
- *
- * <h2>Structure</h2>
- * <p>A processDefinition contains a set of nodes. Nodes can be connected with
- * transitions or nodes can have nested nodes. But the transitions and
- * nested nodes can be combined.
- * </p>
- *
- * <h2>Execution</h2>
- * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
- * </p>
- *
- * @author Tom Baeyens
- */
-public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
-
- /** the initial node of this process definition */
- Node getInitial();
-
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/OpenProcessDefinition.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import org.jbpm.ProcessDefinition;
+
+
+
+/**
+ * a graph (or tree) structure that can be executed.
+ *
+ * <h2>Purpose</h2>
+ * <p>ProcessDefinition is a base implementation that can be leveraged to build
+ * graph based execution languages. While the ProcessDefinition class is concrete and
+ * can be used as-is (e.g. by aggregation), most likely processDefinition languages
+ * will inherit from this ProcessDefinition and create more specialized implementations.
+ * </p>
+ *
+ * <p>The specialized processDefinition language classes can extend this ProcessDefinition
+ * with new datastructures relevant for that perticular processDefinition language.
+ * </p>
+ *
+ * <h2>Structure</h2>
+ * <p>A processDefinition contains a set of nodes. Nodes can be connected with
+ * transitions or nodes can have nested nodes. But the transitions and
+ * nested nodes can be combined.
+ * </p>
+ *
+ * <h2>Execution</h2>
+ * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
+
+ /** the initial node of this process definition */
+ Node getInitial();
+
+}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,685 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.model;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Stack;
-
-import org.jbpm.pvm.ProcessDefinition;
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.activity.Activity;
-import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.model.CompositeElementImpl;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.EventListenerReference;
-import org.jbpm.pvm.internal.model.ExceptionHandlerImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ObjectReference;
-import org.jbpm.pvm.internal.model.ObservableElementImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.model.ProcessElementImpl;
-import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-import org.jbpm.pvm.listener.EventListener;
-
-/** factory for process definitions.
- *
- * <p>Use this factory as a <a href="http://martinfowler.com/bliki/FluentInterface.html">fluent interface</a>
- * for building a process definition. To use it in this way, start with instantiating a ProcessFactory object.
- * Then a number of methods can be invoked concatenated with dots cause all the methods return
- * the same process factory object. When done, end that sequence with
- * {@link #done()} to get the constructed ProcessDefinition.
- * </p>
- *
- * <p>The idea is that this results into a more compact and more readable
- * code to build process definitions as opposed to including xml inline. For example :
- * </p>
- * <pre>
- * ProcessDefinition processDefinition = ProcessFactory.build()
- * .node().initial().behaviour(new WaitState())
- * .transition("normal").to("a")
- * .transition("shortcut").to("c")
- * .node("a").behaviour(new WaitState())
- * .transition().to("b")
- * .node("b").behaviour(new WaitState())
- * .transition().to("c")
- * .node("c").behaviour(new WaitState())
- * .done();
- * </pre>
- *
- * <hr />
- *
- * <p>If more control is needed over the creation of the process definition
- * objects, then consider using the concrete implementation classes from
- * package {@link org.jbpm.pvm.internal.model} directly. The implementation code
- * of this class might be a good guide to get you on your way.
- * </p>
- *
- * @author Tom Baeyens
- */
-public class ProcessFactory {
-
- // static factory methods ///////////////////////////////////////////////////
-
- protected ProcessDefinitionImpl processDefinition;
- protected NodeImpl node;
- protected TransitionImpl transition;
- protected List<DestinationReference> destinationReferences;
- protected ObservableElementImpl observableElement;
- protected EventImpl event;
- protected EventListenerReference eventListenerReference;
- protected ExceptionHandlerImpl exceptionHandler;
- protected CompositeElementImpl compositeElement;
- protected CompositeElementImpl scope;
- protected Stack<CompositeElementImpl> compositeElementStack;
-
- /** start building a process definition without a name. */
- protected ProcessFactory() {
- this(null);
- }
-
- /** start building a process definition with the given name. */
- protected ProcessFactory(String processName) {
- this(processName, null);
- }
-
- /** start building a process definition with the given name. */
- protected ProcessFactory(String processName, ProcessDefinitionImpl processDefinition) {
- if (processDefinition!=null) {
- this.processDefinition = processDefinition;
- } else {
- this.processDefinition = instantiateProcessDefinition();
- }
- this.processDefinition.setName(processName);
- this.observableElement = this.processDefinition;
- this.compositeElement = this.processDefinition;
- this.scope = this.processDefinition;
- }
-
- /** starts building a process definition */
- public static ProcessFactory build() {
- return new ProcessFactory();
- }
-
- /** starts building a process definition */
- public static ProcessFactory build(String processName) {
- return new ProcessFactory(processName);
- }
-
- /** starts populating a given process definition */
- public static ProcessFactory build(String processName, ProcessDefinitionImpl processDefinition) {
- return new ProcessFactory(processName, processDefinition);
- }
-
- /** to be overwritten by specific process language factories */
- protected ProcessDefinitionImpl instantiateProcessDefinition() {
- return new ProcessDefinitionImpl();
- }
-
- /** marks the last created node as the initial node in the process. */
- public ProcessFactory initial() {
- if (node==null) {
- throw new PvmException("no current node");
- }
- if (processDefinition.getInitial()!=null) {
- throw new PvmException("duplicate initial node");
- }
- processDefinition.setInitial(node);
- return this;
- }
-
- /** applies on a node and makes it create a local activity instance scope.
- * This is automatically implied when {@link #variable(String) adding a variable}
- * or {@link #timer() adding a timer} */
- public ProcessFactory scope() {
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setLocalScope(true);
- scope = node;
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(String key) {
- if (node!=null) {
- scope();
- }
- VariableDefinitionImpl variableDefinition = compositeElement.createVariableDefinition();
- variableDefinition.setKey(key);
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(Descriptor sourceDescriptor) {
- if (node!=null && scope==null) {
- scope();
- }
- VariableDefinitionImpl variableDefinition = scope.createVariableDefinition();
- variableDefinition.setKey(sourceDescriptor.getName());
- variableDefinition.setSourceDescriptor(sourceDescriptor);
- return this;
- }
-
- /** declares a local variable. {@link #scope()} is automatically implied. */
- public ProcessFactory variable(String key, String initialValue) {
- return variable(new StringDescriptor(key, initialValue));
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(String dueDateDescription, String signalName) {
- return timer(dueDateDescription, null, signalName, null);
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(String dueDateDescription, String signalName, String repeat) {
- return timer(dueDateDescription, null, signalName, repeat);
- }
-
- /** declares a timer on the current node or process. {@link #scope()} is
- * automatically implied. */
- public ProcessFactory timer(Date dueDate, String signalName) {
- return timer(null, dueDate, signalName, null);
- }
-
- protected ProcessFactory timer(String dueDateDescription, Date dueDate,
- String signalName, String repeat) {
- if (node!=null && scope==null) {
- scope();
- }
- TimerDefinitionImpl timerDefinition = scope.createTimerDefinition();
- if (dueDate!=null) {
- timerDefinition.setDueDate(dueDate);
- } else {
- timerDefinition.setDueDateDescription(dueDateDescription);
- }
- timerDefinition.setSignalName(signalName);
- timerDefinition.setRepeat(repeat);
- return this;
- }
-
- /** creates a node in the current parent.
- * The current parent is either the process definition or a composite node
- * in case method {@link #compositeNode(String)} was called previously. */
- public ProcessFactory node() {
- return node(null);
- }
-
- /** creates a named node.
- * The current parent is either the process definition or a composite node
- * in case method {@link #compositeNode(String)} was called previously. */
- public ProcessFactory node(String nodeName) {
- if (exceptionHandler!=null) {
- exceptionHandler.setNodeName(nodeName);
- } else {
- node = compositeElement.createNode(nodeName);
- scope = null;
-
- observableElement = node;
- event = null;
- eventListenerReference = null;
- transition = null;
- exceptionHandler = null;
- }
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Activity activity) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(activity);
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(descriptor);
- return this;
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(Class<? extends Activity> activityClass) {
- return behaviour(new ObjectDescriptor(activityClass));
- }
-
- /** sets the behaviour on the current node.
- * A current node is required. */
- public ProcessFactory behaviour(String expression) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setBehaviour(expression);
- return this;
- }
-
-
- /** sets the asyncExecute property on the current node.
- * A current node is required. */
- public ProcessFactory asyncExecute() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setExecutionAsync(true);
- return this;
- }
-
- /** sets the asyncLeave property on the current node.
- * A current node is required. */
- public ProcessFactory asyncLeave() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setLeaveAsync(true);
- return this;
- }
-
- /** sets the asyncSignal property on the current node.
- * A current node is required. */
- public ProcessFactory asyncSignal() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setSignalAsync(true);
- return this;
- }
-
- /** sets the property needsPrevious on the current node.
- * A current node is required. */
- public ProcessFactory needsPrevious() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (node==null) {
- throw new PvmException("no current node");
- }
- node.setPreviousNeeded(true);
- return this;
- }
-
- /** starts a block in which nested nodes can be created.
- * This block can be ended with {@link #compositeEnd()}.
- * A current node is required. */
- public ProcessFactory compositeNode() {
- return compositeNode(null);
- }
-
- /** starts a block in which nested nodes can be created.
- * This block can be ended with {@link #compositeEnd()}.
- * A current node is required. */
- public ProcessFactory compositeNode(String nodeName) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- if (compositeElementStack==null) {
- compositeElementStack = new Stack<CompositeElementImpl>();
- }
-
- compositeElementStack.push(compositeElement);
- node(nodeName);
- compositeElement = node;
-
- return this;
- }
-
- /** ends a block in which nested nodes are created.
- * This method requires that a nested node block was started before
- * with {@link #compositeNode(String)} */
- public ProcessFactory compositeEnd() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- if (compositeElementStack==null) {
- throw new PvmException("no composite node was started");
- }
-
- compositeElement = compositeElementStack.pop();
-
- if (compositeElementStack.isEmpty()) {
- compositeElementStack = null;
- }
-
- return this;
- }
-
- /** creates a transition on the current node.
- * This method requires a current node */
- public ProcessFactory transition() {
- return transition(null);
- }
-
- /** creates a named transition on the current node.
- * This method requires a current node */
- public ProcessFactory transition(String transitionName) {
- if (exceptionHandler!=null) {
- exceptionHandler.setTransitionName(transitionName);
- } else {
- if (node==null) {
- throw new PvmException("no current node");
- }
- transition = node.createOutgoingTransition(null, transitionName);
- observableElement = transition;
- event = null;
- eventListenerReference = null;
- exceptionHandler = null;
- }
- return this;
- }
-
- /** sets the takeAsync property on the current transition
- * This method requires a current transition. */
- public ProcessFactory asyncTake() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- transition.setTakeAsync(true);
- return this;
- }
-
- /** sets the destination node on the current transition.
- * This method requires a current transition. */
- public ProcessFactory to(String destination) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- if (destinationReferences==null) {
- destinationReferences = new ArrayList<DestinationReference>();
- }
- destinationReferences.add(new DestinationReference(transition, destination));
- return this;
- }
-
- /** sets the wait condition on the current transition.
- * This method requires a current transition. */
- public ProcessFactory waitCondition(Condition condition) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
- transition.setWaitConditionDescriptor(conditionDescriptor);
- return this;
- }
-
- /** sets the guard condition on the current transition.
- * This method requires a current transition. */
- public ProcessFactory guardCondition(Condition condition) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (transition==null) {
- throw new PvmException("no current transition");
- }
- Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
- transition.setConditionDescriptor(conditionDescriptor);
- return this;
- }
-
- /** creates the given event on the current process element.
- * This method requires a process element. A process element is
- * either a process definition or a node. This method doesn't need to be
- * called for transitions. If you have exception handlers and listeners
- * on an event, make sure that you put the invocations of
- * {@link #exceptionHandler(Class)} first. */
- public ProcessFactory event(String eventName) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (observableElement==null) {
- throw new PvmException("no current process element");
- }
- if (observableElement instanceof Transition) {
- throw new PvmException("for actions on transitions, you don't need to call event");
- }
- event = observableElement.createEvent(eventName);
- exceptionHandler = null;
- return this;
- }
-
- /** creates an exception handler for the given exception class on the current process element;
- * until the {@link #exceptionHandlerEnd()}. Subsequent invocations of
- * {@link #listener(Activity) listeners} or {@link #transition() transitions} will
- * have the created exception handler as a target.
- *
- * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */
- public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
-
- ProcessElementImpl processElement = null;
- if (eventListenerReference!=null) {
- processElement = eventListenerReference;
- } else if (event!=null) {
- processElement = event;
- } else if (observableElement!=null) {
- processElement = observableElement;
- } else {
- throw new PvmException("no current process element, event or action");
- }
-
- exceptionHandler = processElement.createExceptionHandler();
-
- if (exceptionClass!=null) {
- exceptionHandler.setExceptionClassName(exceptionClass.getName());
- }
-
- return this;
- }
-
- public ProcessFactory exceptionHandlerEnd() {
- exceptionHandler = null;
- return this;
- }
-
- public ProcessFactory transactional() {
- if (exceptionHandler==null) {
- throw new PvmException("transactional is a property of an exception handler");
- }
- exceptionHandler.setTransactional(true);
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- exceptionHandler.createEventListenerReference(descriptor);
- } else {
- getEvent().createEventListenerReference(descriptor);
- }
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(EventListener eventListener) {
- if (exceptionHandler!=null) {
- exceptionHandler.createEventListenerReference(eventListener);
- } else {
- eventListenerReference = getEvent().createEventListenerReference(eventListener);
- }
- return this;
- }
-
- /** adds an action to the current event. The current event was either
- * created by {@link #event(String)} or by a {@link #transition()}.
- * Subsequent invocations of {@link #exceptionHandler(Class)} will
- * be associated to this event listener. */
- public ProcessFactory listener(String expression) {
- if (exceptionHandler!=null) {
- exceptionHandler.createActivityReference(expression);
- } else {
- eventListenerReference = getEvent().createEventListenerReference(expression);
- }
- return this;
- }
-
- /** disables propagated events. This means that this action will only be executed
- * if the event is fired on the actual process element of the event. The current
- * action will not be executed if an event is fired on one of the children of the
- * process element to which this event relates. */
- public ProcessFactory propagationDisabled() {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (eventListenerReference==null) {
- throw new PvmException("no current event action");
- }
- eventListenerReference.setPropagationEnabled(false);
- return this;
- }
-
- private EventImpl getEvent() {
- if ( (event==null)
- && (observableElement instanceof TransitionImpl)
- ) {
- event = ((TransitionImpl)observableElement).createEvent();
- return event;
- }
- if (event==null) {
- throw new PvmException("no current event");
- }
- return event;
- }
-
- /** adds a string-valued configuration to the current process element */
- public ProcessFactory property(String name, String stringValue) {
- StringDescriptor stringDescriptor = new StringDescriptor();
- stringDescriptor.setName(name);
- stringDescriptor.setValue(stringValue);
- property(stringDescriptor);
- return this;
- }
-
- /** adds a configuration to the current process element */
- public ProcessFactory property(Descriptor descriptor) {
- if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
- }
- if (observableElement==null) {
- throw new PvmException("no current process element");
- }
- if (event!=null) {
- event.addProperty(descriptor);
- } else {
- observableElement.addProperty(descriptor);
- }
- return this;
- }
-
- public class DestinationReference {
- TransitionImpl transition;
- String destinationName;
- public DestinationReference(TransitionImpl transition, String destinationName) {
- this.transition = transition;
- this.destinationName = destinationName;
- }
- public void resolve() {
- NodeImpl destination = (NodeImpl) processDefinition.findNode(destinationName);
- if (destination==null) {
- throw new PvmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
- }
- destination.addIncomingTransition(transition);
- transition.setDestination(destination);
- }
- }
-
- /** extract the process definition from the factory. This should be
- * the last method in the chain of subsequent invoked methods on this
- * factory object. */
- public ClientProcessDefinition done() {
- resolveDestinations();
- if (processDefinition.getInitial()==null) {
- throw new PvmException("no initial node");
- }
- return processDefinition;
- }
-
- /** sets the {@link ProcessDefinition#getVersion() version} of the process definition explicitely */
- public ProcessFactory version(int version) {
- processDefinition.setVersion(version);
- return this;
- }
-
- /** sets the {@link ProcessDefinition#getKey() key} of the process definition explicitely */
- public ProcessFactory key(String key) {
- processDefinition.setKey(key);
- return this;
- }
-
- private void resolveDestinations() {
- if (destinationReferences!=null) {
- for (DestinationReference destinationReference : destinationReferences) {
- destinationReference.resolve();
- }
- }
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,685 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Stack;
+
+import org.jbpm.ProcessDefinition;
+import org.jbpm.PvmException;
+import org.jbpm.pvm.activity.Activity;
+import org.jbpm.pvm.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.CompositeElementImpl;
+import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.EventListenerReference;
+import org.jbpm.pvm.internal.model.ExceptionHandlerImpl;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ObjectReference;
+import org.jbpm.pvm.internal.model.ObservableElementImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ProcessElementImpl;
+import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.pvm.listener.EventListener;
+
+/** factory for process definitions.
+ *
+ * <p>Use this factory as a <a href="http://martinfowler.com/bliki/FluentInterface.html">fluent interface</a>
+ * for building a process definition. To use it in this way, start with instantiating a ProcessFactory object.
+ * Then a number of methods can be invoked concatenated with dots cause all the methods return
+ * the same process factory object. When done, end that sequence with
+ * {@link #done()} to get the constructed ProcessDefinition.
+ * </p>
+ *
+ * <p>The idea is that this results into a more compact and more readable
+ * code to build process definitions as opposed to including xml inline. For example :
+ * </p>
+ * <pre>
+ * ProcessDefinition processDefinition = ProcessFactory.build()
+ * .node().initial().behaviour(new WaitState())
+ * .transition("normal").to("a")
+ * .transition("shortcut").to("c")
+ * .node("a").behaviour(new WaitState())
+ * .transition().to("b")
+ * .node("b").behaviour(new WaitState())
+ * .transition().to("c")
+ * .node("c").behaviour(new WaitState())
+ * .done();
+ * </pre>
+ *
+ * <hr />
+ *
+ * <p>If more control is needed over the creation of the process definition
+ * objects, then consider using the concrete implementation classes from
+ * package {@link org.jbpm.pvm.internal.model} directly. The implementation code
+ * of this class might be a good guide to get you on your way.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public class ProcessFactory {
+
+ // static factory methods ///////////////////////////////////////////////////
+
+ protected ProcessDefinitionImpl processDefinition;
+ protected NodeImpl node;
+ protected TransitionImpl transition;
+ protected List<DestinationReference> destinationReferences;
+ protected ObservableElementImpl observableElement;
+ protected EventImpl event;
+ protected EventListenerReference eventListenerReference;
+ protected ExceptionHandlerImpl exceptionHandler;
+ protected CompositeElementImpl compositeElement;
+ protected CompositeElementImpl scope;
+ protected Stack<CompositeElementImpl> compositeElementStack;
+
+ /** start building a process definition without a name. */
+ protected ProcessFactory() {
+ this(null);
+ }
+
+ /** start building a process definition with the given name. */
+ protected ProcessFactory(String processName) {
+ this(processName, null);
+ }
+
+ /** start building a process definition with the given name. */
+ protected ProcessFactory(String processName, ProcessDefinitionImpl processDefinition) {
+ if (processDefinition!=null) {
+ this.processDefinition = processDefinition;
+ } else {
+ this.processDefinition = instantiateProcessDefinition();
+ }
+ this.processDefinition.setName(processName);
+ this.observableElement = this.processDefinition;
+ this.compositeElement = this.processDefinition;
+ this.scope = this.processDefinition;
+ }
+
+ /** starts building a process definition */
+ public static ProcessFactory build() {
+ return new ProcessFactory();
+ }
+
+ /** starts building a process definition */
+ public static ProcessFactory build(String processName) {
+ return new ProcessFactory(processName);
+ }
+
+ /** starts populating a given process definition */
+ public static ProcessFactory build(String processName, ProcessDefinitionImpl processDefinition) {
+ return new ProcessFactory(processName, processDefinition);
+ }
+
+ /** to be overwritten by specific process language factories */
+ protected ProcessDefinitionImpl instantiateProcessDefinition() {
+ return new ProcessDefinitionImpl();
+ }
+
+ /** marks the last created node as the initial node in the process. */
+ public ProcessFactory initial() {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ if (processDefinition.getInitial()!=null) {
+ throw new PvmException("duplicate initial node");
+ }
+ processDefinition.setInitial(node);
+ return this;
+ }
+
+ /** applies on a node and makes it create a local activity instance scope.
+ * This is automatically implied when {@link #variable(String) adding a variable}
+ * or {@link #timer() adding a timer} */
+ public ProcessFactory scope() {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setLocalScope(true);
+ scope = node;
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(String key) {
+ if (node!=null) {
+ scope();
+ }
+ VariableDefinitionImpl variableDefinition = compositeElement.createVariableDefinition();
+ variableDefinition.setKey(key);
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(Descriptor sourceDescriptor) {
+ if (node!=null && scope==null) {
+ scope();
+ }
+ VariableDefinitionImpl variableDefinition = scope.createVariableDefinition();
+ variableDefinition.setKey(sourceDescriptor.getName());
+ variableDefinition.setSourceDescriptor(sourceDescriptor);
+ return this;
+ }
+
+ /** declares a local variable. {@link #scope()} is automatically implied. */
+ public ProcessFactory variable(String key, String initialValue) {
+ return variable(new StringDescriptor(key, initialValue));
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(String dueDateDescription, String signalName) {
+ return timer(dueDateDescription, null, signalName, null);
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(String dueDateDescription, String signalName, String repeat) {
+ return timer(dueDateDescription, null, signalName, repeat);
+ }
+
+ /** declares a timer on the current node or process. {@link #scope()} is
+ * automatically implied. */
+ public ProcessFactory timer(Date dueDate, String signalName) {
+ return timer(null, dueDate, signalName, null);
+ }
+
+ protected ProcessFactory timer(String dueDateDescription, Date dueDate,
+ String signalName, String repeat) {
+ if (node!=null && scope==null) {
+ scope();
+ }
+ TimerDefinitionImpl timerDefinition = scope.createTimerDefinition();
+ if (dueDate!=null) {
+ timerDefinition.setDueDate(dueDate);
+ } else {
+ timerDefinition.setDueDateDescription(dueDateDescription);
+ }
+ timerDefinition.setSignalName(signalName);
+ timerDefinition.setRepeat(repeat);
+ return this;
+ }
+
+ /** creates a node in the current parent.
+ * The current parent is either the process definition or a composite node
+ * in case method {@link #compositeNode(String)} was called previously. */
+ public ProcessFactory node() {
+ return node(null);
+ }
+
+ /** creates a named node.
+ * The current parent is either the process definition or a composite node
+ * in case method {@link #compositeNode(String)} was called previously. */
+ public ProcessFactory node(String nodeName) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.setNodeName(nodeName);
+ } else {
+ node = compositeElement.createNode(nodeName);
+ scope = null;
+
+ observableElement = node;
+ event = null;
+ eventListenerReference = null;
+ transition = null;
+ exceptionHandler = null;
+ }
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Activity activity) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(activity);
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(descriptor);
+ return this;
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(Class<? extends Activity> activityClass) {
+ return behaviour(new ObjectDescriptor(activityClass));
+ }
+
+ /** sets the behaviour on the current node.
+ * A current node is required. */
+ public ProcessFactory behaviour(String expression) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setBehaviour(expression);
+ return this;
+ }
+
+
+ /** sets the asyncExecute property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncExecute() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setExecutionAsync(true);
+ return this;
+ }
+
+ /** sets the asyncLeave property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncLeave() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setLeaveAsync(true);
+ return this;
+ }
+
+ /** sets the asyncSignal property on the current node.
+ * A current node is required. */
+ public ProcessFactory asyncSignal() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setSignalAsync(true);
+ return this;
+ }
+
+ /** sets the property needsPrevious on the current node.
+ * A current node is required. */
+ public ProcessFactory needsPrevious() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ node.setPreviousNeeded(true);
+ return this;
+ }
+
+ /** starts a block in which nested nodes can be created.
+ * This block can be ended with {@link #compositeEnd()}.
+ * A current node is required. */
+ public ProcessFactory compositeNode() {
+ return compositeNode(null);
+ }
+
+ /** starts a block in which nested nodes can be created.
+ * This block can be ended with {@link #compositeEnd()}.
+ * A current node is required. */
+ public ProcessFactory compositeNode(String nodeName) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ if (compositeElementStack==null) {
+ compositeElementStack = new Stack<CompositeElementImpl>();
+ }
+
+ compositeElementStack.push(compositeElement);
+ node(nodeName);
+ compositeElement = node;
+
+ return this;
+ }
+
+ /** ends a block in which nested nodes are created.
+ * This method requires that a nested node block was started before
+ * with {@link #compositeNode(String)} */
+ public ProcessFactory compositeEnd() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ if (compositeElementStack==null) {
+ throw new PvmException("no composite node was started");
+ }
+
+ compositeElement = compositeElementStack.pop();
+
+ if (compositeElementStack.isEmpty()) {
+ compositeElementStack = null;
+ }
+
+ return this;
+ }
+
+ /** creates a transition on the current node.
+ * This method requires a current node */
+ public ProcessFactory transition() {
+ return transition(null);
+ }
+
+ /** creates a named transition on the current node.
+ * This method requires a current node */
+ public ProcessFactory transition(String transitionName) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.setTransitionName(transitionName);
+ } else {
+ if (node==null) {
+ throw new PvmException("no current node");
+ }
+ transition = node.createOutgoingTransition(null, transitionName);
+ observableElement = transition;
+ event = null;
+ eventListenerReference = null;
+ exceptionHandler = null;
+ }
+ return this;
+ }
+
+ /** sets the takeAsync property on the current transition
+ * This method requires a current transition. */
+ public ProcessFactory asyncTake() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ transition.setTakeAsync(true);
+ return this;
+ }
+
+ /** sets the destination node on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory to(String destination) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ if (destinationReferences==null) {
+ destinationReferences = new ArrayList<DestinationReference>();
+ }
+ destinationReferences.add(new DestinationReference(transition, destination));
+ return this;
+ }
+
+ /** sets the wait condition on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory waitCondition(Condition condition) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
+ transition.setWaitConditionDescriptor(conditionDescriptor);
+ return this;
+ }
+
+ /** sets the guard condition on the current transition.
+ * This method requires a current transition. */
+ public ProcessFactory guardCondition(Condition condition) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (transition==null) {
+ throw new PvmException("no current transition");
+ }
+ Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
+ transition.setConditionDescriptor(conditionDescriptor);
+ return this;
+ }
+
+ /** creates the given event on the current process element.
+ * This method requires a process element. A process element is
+ * either a process definition or a node. This method doesn't need to be
+ * called for transitions. If you have exception handlers and listeners
+ * on an event, make sure that you put the invocations of
+ * {@link #exceptionHandler(Class)} first. */
+ public ProcessFactory event(String eventName) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (observableElement==null) {
+ throw new PvmException("no current process element");
+ }
+ if (observableElement instanceof Transition) {
+ throw new PvmException("for actions on transitions, you don't need to call event");
+ }
+ event = observableElement.createEvent(eventName);
+ exceptionHandler = null;
+ return this;
+ }
+
+ /** creates an exception handler for the given exception class on the current process element;
+ * until the {@link #exceptionHandlerEnd()}. Subsequent invocations of
+ * {@link #listener(Activity) listeners} or {@link #transition() transitions} will
+ * have the created exception handler as a target.
+ *
+ * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */
+ public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+
+ ProcessElementImpl processElement = null;
+ if (eventListenerReference!=null) {
+ processElement = eventListenerReference;
+ } else if (event!=null) {
+ processElement = event;
+ } else if (observableElement!=null) {
+ processElement = observableElement;
+ } else {
+ throw new PvmException("no current process element, event or action");
+ }
+
+ exceptionHandler = processElement.createExceptionHandler();
+
+ if (exceptionClass!=null) {
+ exceptionHandler.setExceptionClassName(exceptionClass.getName());
+ }
+
+ return this;
+ }
+
+ public ProcessFactory exceptionHandlerEnd() {
+ exceptionHandler = null;
+ return this;
+ }
+
+ public ProcessFactory transactional() {
+ if (exceptionHandler==null) {
+ throw new PvmException("transactional is a property of an exception handler");
+ }
+ exceptionHandler.setTransactional(true);
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createEventListenerReference(descriptor);
+ } else {
+ getEvent().createEventListenerReference(descriptor);
+ }
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(EventListener eventListener) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createEventListenerReference(eventListener);
+ } else {
+ eventListenerReference = getEvent().createEventListenerReference(eventListener);
+ }
+ return this;
+ }
+
+ /** adds an action to the current event. The current event was either
+ * created by {@link #event(String)} or by a {@link #transition()}.
+ * Subsequent invocations of {@link #exceptionHandler(Class)} will
+ * be associated to this event listener. */
+ public ProcessFactory listener(String expression) {
+ if (exceptionHandler!=null) {
+ exceptionHandler.createActivityReference(expression);
+ } else {
+ eventListenerReference = getEvent().createEventListenerReference(expression);
+ }
+ return this;
+ }
+
+ /** disables propagated events. This means that this action will only be executed
+ * if the event is fired on the actual process element of the event. The current
+ * action will not be executed if an event is fired on one of the children of the
+ * process element to which this event relates. */
+ public ProcessFactory propagationDisabled() {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (eventListenerReference==null) {
+ throw new PvmException("no current event action");
+ }
+ eventListenerReference.setPropagationEnabled(false);
+ return this;
+ }
+
+ private EventImpl getEvent() {
+ if ( (event==null)
+ && (observableElement instanceof TransitionImpl)
+ ) {
+ event = ((TransitionImpl)observableElement).createEvent();
+ return event;
+ }
+ if (event==null) {
+ throw new PvmException("no current event");
+ }
+ return event;
+ }
+
+ /** adds a string-valued configuration to the current process element */
+ public ProcessFactory property(String name, String stringValue) {
+ StringDescriptor stringDescriptor = new StringDescriptor();
+ stringDescriptor.setName(name);
+ stringDescriptor.setValue(stringValue);
+ property(stringDescriptor);
+ return this;
+ }
+
+ /** adds a configuration to the current process element */
+ public ProcessFactory property(Descriptor descriptor) {
+ if (exceptionHandler!=null) {
+ throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ }
+ if (observableElement==null) {
+ throw new PvmException("no current process element");
+ }
+ if (event!=null) {
+ event.addProperty(descriptor);
+ } else {
+ observableElement.addProperty(descriptor);
+ }
+ return this;
+ }
+
+ public class DestinationReference {
+ TransitionImpl transition;
+ String destinationName;
+ public DestinationReference(TransitionImpl transition, String destinationName) {
+ this.transition = transition;
+ this.destinationName = destinationName;
+ }
+ public void resolve() {
+ NodeImpl destination = (NodeImpl) processDefinition.findNode(destinationName);
+ if (destination==null) {
+ throw new PvmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
+ }
+ destination.addIncomingTransition(transition);
+ transition.setDestination(destination);
+ }
+ }
+
+ /** extract the process definition from the factory. This should be
+ * the last method in the chain of subsequent invoked methods on this
+ * factory object. */
+ public ClientProcessDefinition done() {
+ resolveDestinations();
+ if (processDefinition.getInitial()==null) {
+ throw new PvmException("no initial node");
+ }
+ return processDefinition;
+ }
+
+ /** sets the {@link ProcessDefinition#getVersion() version} of the process definition explicitely */
+ public ProcessFactory version(int version) {
+ processDefinition.setVersion(version);
+ return this;
+ }
+
+ /** sets the {@link ProcessDefinition#getKey() key} of the process definition explicitely */
+ public ProcessFactory key(String key) {
+ processDefinition.setKey(key);
+ return this;
+ }
+
+ private void resolveDestinations() {
+ if (destinationReferences!=null) {
+ for (DestinationReference destinationReference : destinationReferences) {
+ destinationReference.resolve();
+ }
+ }
+ }
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.processlog;
-
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.pvm.Execution;
-
-/**
- * @author Tom Baeyens
- */
-public interface ProcessLog {
-
- long getDbid();
-
- Execution getExecution();
-
- Execution getProcessInstance();
-
- /** text id of the type of this process log used for
- * XML serialization. */
- String getType();
-
- /** xml representation of the process log properties
- * used for XML serialization. Properties time, execution
- * and processInstance should not be included. This method
- * is made abstract to remind and encourage
- * implementors to provide XML serialization capabilities to
- * the fixed process log XML schema. But it is allowed to
- * return null if XML serialisation if you're sure that
- * XML serialization will never be necessary. */
- List<ProcessLogProperty> getProperties();
-
- /** provides a text description for this update
- * which can be used e.g. in the admin web console.
- * This texts hould not contain time, execution
- * nor processInstance.
- * The default implementation will include the
- * {@link #getType() type} and then append all the top
- * level properties. */
- String toString();
-
- Date getTime();
-
- void setExecution(Execution execution);
-
- void setTime(Date currentTime);
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLog.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -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.pvm.processlog;
+
+import java.util.Date;
+import java.util.List;
+
+import org.jbpm.Execution;
+
+/**
+ * @author Tom Baeyens
+ */
+public interface ProcessLog {
+
+ long getDbid();
+
+ Execution getExecution();
+
+ Execution getProcessInstance();
+
+ /** text id of the type of this process log used for
+ * XML serialization. */
+ String getType();
+
+ /** xml representation of the process log properties
+ * used for XML serialization. Properties time, execution
+ * and processInstance should not be included. This method
+ * is made abstract to remind and encourage
+ * implementors to provide XML serialization capabilities to
+ * the fixed process log XML schema. But it is allowed to
+ * return null if XML serialisation if you're sure that
+ * XML serialization will never be necessary. */
+ List<ProcessLogProperty> getProperties();
+
+ /** provides a text description for this update
+ * which can be used e.g. in the admin web console.
+ * This texts hould not contain time, execution
+ * nor processInstance.
+ * The default implementation will include the
+ * {@link #getType() type} and then append all the top
+ * level properties. */
+ String toString();
+
+ Date getTime();
+
+ void setExecution(Execution execution);
+
+ void setTime(Date currentTime);
+}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.processlog;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.session.LogSession;
-
-/** base class for process logs. Process logs are dispatched to the
- * {@link LogSession} that is configured in the environment.
- *
- * <p>ProcessLogs that are send to a LogSession is the probe mechanism
- * provided to listen into the process execution progress and details.
- * It is the mechanism to collect process history and process statistics.
- * </p>
- *
- * @author Tom Baeyens
- */
-public abstract class ProcessLogImpl implements Serializable, ProcessLog {
-
- private static final long serialVersionUID = 1L;
-
- protected long dbid;
- protected int index = -1;
- protected Date time;
- protected Execution execution;
- protected Execution processInstance;
-
- public ProcessLogImpl() {
- }
-
- public void setExecution(ExecutionImpl execution) {
- this.execution = execution;
- this.processInstance = (execution!=null ? execution.getProcessInstance() : null);
- }
-
- /** text id of the type of this process log used for
- * XML serialization. */
- public abstract String getType();
-
- /** xml representation of the process log properties
- * used for XML serialization. Properties time, execution
- * and processInstance should not be included. This method
- * is made abstract to remind and encourage
- * implementors to provide XML serialization capabilities to
- * the fixed process log XML schema. But it is allowed to
- * return null if XML serialisation if you're sure that
- * XML serialization will never be necessary. */
- public abstract List<ProcessLogProperty> getProperties();
-
- /** provides a text description for this update
- * which can be used e.g. in the admin web console.
- * This texts hould not contain time, execution
- * nor processInstance.
- * The default implementation will include the
- * {@link #getType() type} and then append all the top
- * level properties. */
- public String toString() {
- StringBuffer text = new StringBuffer();
- text.append(getType());
- text.append('[');
- List<ProcessLogProperty> properties = getProperties();
- if (properties!=null) {
- for (int i=0; i<properties.size(); i++) {
- ProcessLogProperty property = properties.get(i);
- text.append(property.name);
- if (property.value!=null) {
- text.append('=');
- text.append(property.value);
- }
- if (i < (properties.size()-1)) {
- text.append('|');
- }
- }
- }
- text.append(']');
- return text.toString();
- }
-
- public long getDbid() {
- return dbid;
- }
- public Date getTime() {
- return time;
- }
- public void setTime(Date date) {
- this.time = date;
- }
- public Execution getExecution() {
- return execution;
- }
- public int getIndex() {
- return index;
- }
- public Execution getProcessInstance() {
- return processInstance;
- }
- public void setIndex(int index) {
- this.index = index;
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogImpl.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.processlog;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.pvm.model.OpenExecution;
+import org.jbpm.pvm.session.LogSession;
+
+/** base class for process logs. Process logs are dispatched to the
+ * {@link LogSession} that is configured in the environment.
+ *
+ * <p>ProcessLogs that are send to a LogSession is the probe mechanism
+ * provided to listen into the process execution progress and details.
+ * It is the mechanism to collect process history and process statistics.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public abstract class ProcessLogImpl implements Serializable, ProcessLog {
+
+ private static final long serialVersionUID = 1L;
+
+ protected long dbid;
+ protected int index = -1;
+ protected Date time;
+ protected Execution execution;
+ protected Execution processInstance;
+
+ public ProcessLogImpl() {
+ }
+
+ public void setExecution(OpenExecution execution) {
+ this.execution = execution;
+ this.processInstance = (execution!=null ? execution.getProcessInstance() : null);
+ }
+
+ /** text id of the type of this process log used for
+ * XML serialization. */
+ public abstract String getType();
+
+ /** xml representation of the process log properties
+ * used for XML serialization. Properties time, execution
+ * and processInstance should not be included. This method
+ * is made abstract to remind and encourage
+ * implementors to provide XML serialization capabilities to
+ * the fixed process log XML schema. But it is allowed to
+ * return null if XML serialisation if you're sure that
+ * XML serialization will never be necessary. */
+ public abstract List<ProcessLogProperty> getProperties();
+
+ /** provides a text description for this update
+ * which can be used e.g. in the admin web console.
+ * This texts hould not contain time, execution
+ * nor processInstance.
+ * The default implementation will include the
+ * {@link #getType() type} and then append all the top
+ * level properties. */
+ public String toString() {
+ StringBuffer text = new StringBuffer();
+ text.append(getType());
+ text.append('[');
+ List<ProcessLogProperty> properties = getProperties();
+ if (properties!=null) {
+ for (int i=0; i<properties.size(); i++) {
+ ProcessLogProperty property = properties.get(i);
+ text.append(property.name);
+ if (property.value!=null) {
+ text.append('=');
+ text.append(property.value);
+ }
+ if (i < (properties.size()-1)) {
+ text.append('|');
+ }
+ }
+ }
+ text.append(']');
+ return text.toString();
+ }
+
+ public long getDbid() {
+ return dbid;
+ }
+ public Date getTime() {
+ return time;
+ }
+ public void setTime(Date date) {
+ this.time = date;
+ }
+ public Execution getExecution() {
+ return execution;
+ }
+ public int getIndex() {
+ return index;
+ }
+ public Execution getProcessInstance() {
+ return processInstance;
+ }
+ public void setIndex(int index) {
+ this.index = index;
+ }
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.processlog;
-
-import java.text.SimpleDateFormat;
-import java.util.List;
-
-import org.jbpm.pvm.Execution;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessLogXmlSerializer {
-
- public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss,SSS");
-
- protected List<ProcessLogProperty> properties;
-
- public void appendLog(Document document, Element parent, ProcessLog processLog) {
- String logType = getEventType(processLog);
- String time = getTime(processLog);
- String executionDbid = getExecutionDbid(processLog);
- String processInstanceDbid = getProcessInstanceDbid(processLog);
- String processInstanceKey = getProcessInstanceKey(processLog);
-
- Element logElement = document.createElement("log");
- parent.appendChild(logElement);
-
- logElement.setAttribute("type", logType);
- logElement.setAttribute("time", time);
- if (executionDbid!=null) {
- logElement.setAttribute("execution", executionDbid);
- }
- if (processInstanceDbid!=null) {
- logElement.setAttribute("instance", processInstanceDbid);
- }
- if (processInstanceKey!=null) {
- logElement.setAttribute("key", processInstanceKey);
- }
-
- appendProperties(document, logElement, processLog.getProperties());
- }
-
- protected void appendProperties(Document document, Element parent, List<ProcessLogProperty> properties) {
- if (properties!=null) {
- for (ProcessLogProperty property: properties) {
- Element propertyElement = document.createElement("property");
- parent.appendChild(propertyElement);
-
- if (property.name!=null) {
- propertyElement.setAttribute("name", property.name);
- }
- if (property.value!=null) {
- propertyElement.setAttribute("value", property.value);
- }
- appendProperties(document, propertyElement, property.getProperties());
- }
- }
- }
-
- protected String getEventType(ProcessLog processLog) {
- return processLog.getType();
- }
-
- protected String getTime(ProcessLog processLog) {
- return dateFormatter.format(processLog.getTime());
- }
-
- protected String getExecutionDbid(ProcessLog processLog) {
- Execution execution = processLog.getExecution();
- return (execution!=null ? Long.toString(execution.getDbid()) : null);
- }
-
- protected String getProcessInstanceDbid(ProcessLog processLog) {
- Execution processInstance = processLog.getProcessInstance();
- return (processInstance!=null ? Long.toString(processInstance.getDbid()) : null);
- }
-
- protected String getProcessInstanceKey(ProcessLog processLog) {
- Execution processInstance = processLog.getProcessInstance();
- return (processInstance!=null ? processInstance.getKey() : null);
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/processlog/ProcessLogXmlSerializer.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.processlog;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessLogXmlSerializer {
+
+ public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss,SSS");
+
+ protected List<ProcessLogProperty> properties;
+
+ public void appendLog(Document document, Element parent, ProcessLog processLog) {
+ String logType = getEventType(processLog);
+ String time = getTime(processLog);
+ String executionDbid = getExecutionDbid(processLog);
+ String processInstanceDbid = getProcessInstanceDbid(processLog);
+ String processInstanceKey = getProcessInstanceKey(processLog);
+
+ Element logElement = document.createElement("log");
+ parent.appendChild(logElement);
+
+ logElement.setAttribute("type", logType);
+ logElement.setAttribute("time", time);
+ if (executionDbid!=null) {
+ logElement.setAttribute("execution", executionDbid);
+ }
+ if (processInstanceDbid!=null) {
+ logElement.setAttribute("instance", processInstanceDbid);
+ }
+ if (processInstanceKey!=null) {
+ logElement.setAttribute("key", processInstanceKey);
+ }
+
+ appendProperties(document, logElement, processLog.getProperties());
+ }
+
+ protected void appendProperties(Document document, Element parent, List<ProcessLogProperty> properties) {
+ if (properties!=null) {
+ for (ProcessLogProperty property: properties) {
+ Element propertyElement = document.createElement("property");
+ parent.appendChild(propertyElement);
+
+ if (property.name!=null) {
+ propertyElement.setAttribute("name", property.name);
+ }
+ if (property.value!=null) {
+ propertyElement.setAttribute("value", property.value);
+ }
+ appendProperties(document, propertyElement, property.getProperties());
+ }
+ }
+ }
+
+ protected String getEventType(ProcessLog processLog) {
+ return processLog.getType();
+ }
+
+ protected String getTime(ProcessLog processLog) {
+ return dateFormatter.format(processLog.getTime());
+ }
+
+ protected String getExecutionDbid(ProcessLog processLog) {
+ Execution execution = processLog.getExecution();
+ return (execution!=null ? Long.toString(execution.getDbid()) : null);
+ }
+
+ protected String getProcessInstanceDbid(ProcessLog processLog) {
+ Execution processInstance = processLog.getProcessInstance();
+ return (processInstance!=null ? Long.toString(processInstance.getDbid()) : null);
+ }
+
+ protected String getProcessInstanceKey(ProcessLog processLog) {
+ Execution processInstance = processLog.getProcessInstance();
+ return (processInstance!=null ? processInstance.getKey() : null);
+ }
+}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session)
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/MessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/MessageSession.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/MessageSession.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.session;
-import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.job.Message;
/**
@@ -29,5 +29,5 @@
*/
public interface MessageSession {
- void send(MessageImpl<?> message);
+ void send(Message message);
}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/PvmDbSession.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.session;
-
-import java.util.List;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.client.ClientExecution;
-import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.job.Job;
-import org.jbpm.pvm.job.Message;
-import org.jbpm.pvm.job.Timer;
-
-/**
- * @author Tom Baeyens, Pascal Verdage
- */
-public interface PvmDbSession extends DbSession {
-
- /** all deployed process names. */
- List<String> findProcessDefinitionNames();
-
- /** all versions of the given process. */
- List<ClientProcessDefinition> findProcessDefinitionsByName(String name);
-
- /** specific version of a named processDefinition. */
- ClientProcessDefinition findProcessDefinitionByName(String name, int version);
-
- /** latest version of the processDefinition with the given name. */
- ClientProcessDefinition findLatestProcessDefinitionByName(String name);
-
- /** the process definition uniquely identified by the given
- * processDefinition id. */
- ClientProcessDefinition findProcessDefinitionById(String processDefinitionId);
-
- /** the execution uniquely identified by the given executionKey. */
- ClientExecution findExecutionById(String executionId);
-
- /** the execution uniquely identified by the given processDefinition name
- * and the execution key. */
- Execution findExecutionByKey(String processDefinitionName, String executionKey);
-
- /** timers */
- List<Timer> findTimers(int firstResult, int maxResults);
-
- /** timers */
- List<Message> findMessages(int firstResult, int maxResults);
-
- /** the jobs for which all the retries have failed and which will not be
- * picked up any more by the jobImpl executor */
- public List<Job> findJobsWithException(int firstResult, int maxResults);
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java (from rev 2685, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/PvmDbSession.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/PvmDbSession.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.session;
+
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.job.Job;
+import org.jbpm.job.Message;
+import org.jbpm.job.Timer;
+import org.jbpm.pvm.client.ClientExecution;
+import org.jbpm.pvm.client.ClientProcessDefinition;
+
+/**
+ * @author Tom Baeyens, Pascal Verdage
+ */
+public interface PvmDbSession extends DbSession {
+
+ /** all deployed process names. */
+ List<String> findProcessDefinitionNames();
+
+ /** all versions of the given process. */
+ List<ClientProcessDefinition> findProcessDefinitionsByName(String name);
+
+ /** specific version of a named processDefinition. */
+ ClientProcessDefinition findProcessDefinitionByName(String name, int version);
+
+ /** latest version of the processDefinition with the given name. */
+ ClientProcessDefinition findLatestProcessDefinitionByName(String name);
+
+ /** the process definition uniquely identified by the given
+ * processDefinition id. */
+ ClientProcessDefinition findProcessDefinitionById(String processDefinitionId);
+
+ /** the execution uniquely identified by the given executionKey. */
+ ClientExecution findExecutionById(String executionId);
+
+ /** the execution uniquely identified by the given processDefinition name
+ * and the execution key. */
+ Execution findExecutionByKey(String processDefinitionName, String executionKey);
+
+ /** timers */
+ List<Timer> findTimers(int firstResult, int maxResults);
+
+ /** timers */
+ List<Message> findMessages(int firstResult, int maxResults);
+
+ /** the jobs for which all the retries have failed and which will not be
+ * picked up any more by the jobImpl executor */
+ public List<Job> findJobsWithException(int firstResult, int maxResults);
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/TimerSession.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.session;
-
-import org.jbpm.pvm.job.Timer;
-
-/**
- * @author Tom Baeyens, Pascal Verdage
- */
-public interface TimerSession {
-
- /**
- * Schedule the execution of a timer.
- * @param timerImpl the timer to be executed.
- * @throws IllegalArgumentException if the timer is null
- * or if its activity is null or if its dueDate is null
- * or if its dueDate is negative or if its dueDate is past
- * or if its dueDate is equals to Long.MAX_VALUE
- */
- public void schedule(Timer timer);
-
- /**
- * Cancels a timer.
- * <br />
- * If a transaction is in progress, the cancellation will be effective
- * at the end of the transaction.
- * If the timer has been created in the same transaction or
- * if there is no transaction, the cancellation is immediately effective.
- * <br />
- * If the timer is executing when the cancellation becomes effective,
- * the execution in progress will not be stopped.
- * @param timerImpl the timer to be cancelled.
- */
- public void cancel(Timer timer);
-
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java (from rev 2685, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/TimerSession.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/session/TimerSession.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.session;
+
+import org.jbpm.job.Timer;
+
+/**
+ * @author Tom Baeyens, Pascal Verdage
+ */
+public interface TimerSession {
+
+ /**
+ * Schedule the execution of a timer.
+ * @param timerImpl the timer to be executed.
+ * @throws IllegalArgumentException if the timer is null
+ * or if its activity is null or if its dueDate is null
+ * or if its dueDate is negative or if its dueDate is past
+ * or if its dueDate is equals to Long.MAX_VALUE
+ */
+ public void schedule(Timer timer);
+
+ /**
+ * Cancels a timer.
+ * <br />
+ * If a transaction is in progress, the cancellation will be effective
+ * at the end of the transaction.
+ * If the timer has been created in the same transaction or
+ * if there is no transaction, the cancellation is immediately effective.
+ * <br />
+ * If the timer is executing when the cancellation becomes effective,
+ * the execution in progress will not be stopped.
+ * @param timerImpl the timer to be cancelled.
+ */
+ public void cancel(Timer timer);
+
+}
Modified: jbpm4/trunk/modules/cts/pom.xml
===================================================================
--- jbpm4/trunk/modules/cts/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
+++ jbpm4/trunk/modules/cts/pom.xml 2008-10-31 09:13:32 UTC (rev 2694)
@@ -12,7 +12,7 @@
<!-- $Id$ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM4 - CTS</name>
+ <name>jBPM 4 - CTS DB</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-cts</artifactId>
<packaging>jar</packaging>
Deleted: jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/MockProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/MockProcessEngine.java 2008-10-31 09:12:32 UTC (rev 2693)
+++ jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/MockProcessEngine.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.processengine;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-
-/**
- * A mock ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public class MockProcessEngine extends ProcessEngine
-{
- @Override
- public void setName(String name)
- {
- super.setName(name);
- }
-}
Deleted: jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-10-31 09:12:32 UTC (rev 2693)
+++ jbpm4/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-10-31 09:13:32 UTC (rev 2694)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.processengine;
-
-// $Id$
-
-import java.net.URL;
-
-import org.jbpm.api.client.MicrocontainerConfiguration;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public class ProcessEngineTest extends CTSTestCase
-{
- public void testDefaultProcessEngine() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- assertNotNull("ProcessEngine not null", engine);
- }
-
- public void testUnregisteredProcessEngine() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine("bogus");
- assertNull("ProcessEngine null", engine);
- }
-
- public void testMicrocontainerConfiguration() throws Exception
- {
- URL cfgURL = getResourceURL("cts/processengine/test-cfg-beans.xml");
- ProcessEngine engineOne = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
- assertNotNull("ProcessEngine not null", engineOne);
-
- ProcessEngine engineTwo = ProcessEngine.getProcessEngine("mock engine");
- assertNotNull("ProcessEngine not null", engineTwo);
-
- assertSame("ProcessEngine same", engineOne, engineTwo);
- }
-}
Modified: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2008-10-31 09:13:32 UTC (rev 2694)
@@ -15,7 +15,7 @@
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>JBoss jBPM4 - Enterprise</name>
+ <name>jBPM 4 - Enterprise</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-enterprise</artifactId>
<packaging>jar</packaging>
15 years, 6 months
JBoss JBPM SVN: r2693 - in jbpm4/trunk/modules: jpdl and 38 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-10-31 05:12:32 -0400 (Fri, 31 Oct 2008)
New Revision: 2693
Added:
jbpm4/trunk/modules/test/
jbpm4/trunk/modules/test/.classpath
jbpm4/trunk/modules/test/.project
jbpm4/trunk/modules/test/pom.xml
jbpm4/trunk/modules/test/src/
jbpm4/trunk/modules/test/src/main/
jbpm4/trunk/modules/test/src/main/java/
jbpm4/trunk/modules/test/src/main/java/org/
jbpm4/trunk/modules/test/src/main/java/org/jbpm/
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/activity/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/client/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/env/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/listener/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/processlog/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/session/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
Modified:
jbpm4/trunk/modules/jpdl/pom.xml
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java
jbpm4/trunk/modules/manual/pom.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/AutomaticDecisionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/BasicExecutionFlowTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventPropagationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExceptionHandlerTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExecutionStateTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/FunctionalActivityTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/LoopingTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeStateTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableDeclarationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/SubProcessTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionBasedConcurrencyTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionEventsTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/VariableTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/AutomaticDecisionDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ExecutionServiceTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ManagementServiceTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/BasicEnvironmentTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentClassLoaderTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentSearchOrderTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentTypeLookupTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/NestedEnvironmentTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/spring/SpringTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerIntegrationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/PersistentExecutionModeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example04/DisplayActivityTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/examples/ExamplesTests.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/LanguageExtensionsDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/CommentDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessExecutionDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/VariableCustomTypeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java
Log:
unification api proposals
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
@@ -16,7 +16,7 @@
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM4 - jPDL Core</name>
+ <name>jBPM 4 - jPDL</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-jpdl</artifactId>
<packaging>jar</packaging>
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/JpdlTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,7 @@
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -26,7 +26,7 @@
import org.jbpm.jpdl.xml.JpdlParser;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.xml.Problem;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/manual/pom.xml
===================================================================
--- jbpm4/trunk/modules/manual/pom.xml 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/manual/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
@@ -16,7 +16,7 @@
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM4 - PVM Manual</name>
+ <name>jBPM 4 - Manual</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-manual</artifactId>
<packaging>pom</packaging>
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
@@ -15,7 +15,7 @@
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>JBoss jBPM4 - PVM Core</name>
+ <name>jBPM 4 - PVM</name>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-pvm</artifactId>
<packaging>jar</packaging>
@@ -41,6 +41,10 @@
<artifactId>jbpm-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test</artifactId>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/AutomaticDecisionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/AutomaticDecisionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/AutomaticDecisionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,13 +23,13 @@
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/** shows an automatic decision.
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/BasicExecutionFlowTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/BasicExecutionFlowTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/BasicExecutionFlowTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -34,7 +34,7 @@
import org.jbpm.pvm.example03.AutomaticActivity;
import org.jbpm.pvm.example03.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/** shows wait states and automatic activities in a simple
* sequence based on transitions.
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventPropagationTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventPropagationTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -37,6 +36,7 @@
import org.jbpm.pvm.model.Node;
import org.jbpm.pvm.model.ObservableElement;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/EventTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -39,6 +38,7 @@
import org.jbpm.pvm.model.Node;
import org.jbpm.pvm.model.ObservableElement;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/** shows how actions are listeners to following processDefinition events:
* <ul>
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExceptionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExceptionHandlerTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExceptionHandlerTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,7 +23,6 @@
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
@@ -32,6 +31,7 @@
import org.jbpm.pvm.listener.EventListenerExecution;
import org.jbpm.pvm.model.Event;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExecutionStateTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExecutionStateTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExecutionStateTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,13 +25,13 @@
import org.jbpm.Execution;
import org.jbpm.PvmException;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/** shows the basics of the state property on the execution.
*
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/FunctionalActivityTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/FunctionalActivityTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/FunctionalActivityTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -36,6 +35,7 @@
import org.jbpm.pvm.model.Node;
import org.jbpm.pvm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/** shows how functional nodes (nodes that have a specific function
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/LoopingTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/LoopingTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/LoopingTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -4,13 +4,13 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
public class LoopingTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeStateTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeStateTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeStateTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -30,7 +30,7 @@
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableDeclarationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableDeclarationTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableDeclarationTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,7 +24,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
@@ -32,6 +31,7 @@
import org.jbpm.pvm.model.Node;
import org.jbpm.pvm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,13 +24,13 @@
import java.util.Map;
import org.jbpm.PvmException;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
*
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/SubProcessTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/SubProcessTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,13 +23,13 @@
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,7 +23,6 @@
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -32,6 +31,7 @@
import org.jbpm.pvm.listener.EventListenerExecution;
import org.jbpm.pvm.model.Condition;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/** this test shows how to implement a transition that behaves as a
* wait state.
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionBasedConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionBasedConcurrencyTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionBasedConcurrencyTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -6,7 +6,6 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.Activity;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
@@ -16,6 +15,7 @@
import org.jbpm.pvm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.model.Transition;
+import org.jbpm.test.JbpmTestCase;
/**
* concurrent execution where synchronization is done by checking if the
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionEventsTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionEventsTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionEventsTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.activity.ActivityExecution;
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
@@ -34,6 +33,7 @@
import org.jbpm.pvm.listener.EventListenerExecution;
import org.jbpm.pvm.model.Event;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/VariableTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/VariableTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/VariableTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -32,7 +32,7 @@
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/AutomaticDecisionDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/AutomaticDecisionDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/AutomaticDecisionDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,7 +23,7 @@
import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.DbTestCase;
+import org.jbpm.test.DbTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,7 @@
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.DbTestCase;
+import org.jbpm.test.DbTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/continuation/ContinuationTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -43,8 +43,8 @@
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ExecutionServiceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ExecutionServiceTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ExecutionServiceTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -35,8 +35,8 @@
import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ManagementServiceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ManagementServiceTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ManagementServiceTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,8 +24,8 @@
import junit.framework.Test;
import org.jbpm.ManagementService;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -31,8 +31,8 @@
import org.jbpm.PvmException;
import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/BasicEnvironmentTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/BasicEnvironmentTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/BasicEnvironmentTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,11 +21,11 @@
*/
package org.jbpm.pvm.api.env;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentClassLoaderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentClassLoaderTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentClassLoaderTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,10 +21,10 @@
*/
package org.jbpm.pvm.api.env;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentSearchOrderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentSearchOrderTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentSearchOrderTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,13 +21,13 @@
*/
package org.jbpm.pvm.api.env;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentTypeLookupTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentTypeLookupTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/EnvironmentTypeLookupTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,10 +21,10 @@
*/
package org.jbpm.pvm.api.env;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/NestedEnvironmentTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/NestedEnvironmentTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/env/NestedEnvironmentTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,10 +21,10 @@
*/
package org.jbpm.pvm.api.env;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/spring/SpringTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/spring/SpringTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/spring/SpringTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -22,11 +22,11 @@
package org.jbpm.pvm.api.spring;
import org.hibernate.Session;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.test.JbpmTestCase;
import org.springframework.context.support.ClassPathXmlApplicationContext;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerIntegrationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerIntegrationTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerIntegrationTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -36,7 +36,7 @@
import org.jbpm.pvm.samples.activities.AutomaticActivity;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentDbTestCase;
/**
* @author Pascal Verdage
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -34,8 +34,8 @@
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.type.variable.StringVariable;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/PersistentExecutionModeTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/PersistentExecutionModeTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/PersistentExecutionModeTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -31,7 +31,7 @@
import org.jbpm.pvm.example01.AutomaticActivity;
import org.jbpm.pvm.example01.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestCase;
+import org.jbpm.test.EnvironmentFactoryTestCase;
public class PersistentExecutionModeTest extends EnvironmentFactoryTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example04/DisplayActivityTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example04/DisplayActivityTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example04/DisplayActivityTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,7 +24,7 @@
import org.jbpm.Execution;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
public class DisplayActivityTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,7 +24,7 @@
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
public class ExternalActivityExampleTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -26,7 +26,7 @@
import org.jbpm.pvm.example04.Display;
import org.jbpm.pvm.example05.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
public class BasicProcessExecutionTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -31,7 +31,7 @@
import org.jbpm.pvm.example04.TestConsole;
import org.jbpm.pvm.model.Event;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
public class EventListenerTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -30,7 +30,7 @@
import org.jbpm.pvm.example04.TestConsole;
import org.jbpm.pvm.model.Event;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
public class EventPropagationTest extends JbpmTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/examples/ExamplesTests.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/examples/ExamplesTests.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/examples/ExamplesTests.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -11,7 +11,7 @@
import org.jbpm.pvm.example06.BasicProcessExecutionTest;
import org.jbpm.pvm.example07.EventListenerTest;
import org.jbpm.pvm.example08.EventPropagationTest;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
public class ExamplesTests {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/LanguageExtensionsDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/LanguageExtensionsDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/LanguageExtensionsDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -33,8 +33,8 @@
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/CommentDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/CommentDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/CommentDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -29,8 +29,8 @@
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.model.Comment;
import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -27,8 +27,8 @@
import org.jbpm.pvm.model.Transition;
import org.jbpm.pvm.session.DbSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Guillaume Porcher
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -28,8 +28,8 @@
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.model.Transition;
import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Charles Souillard
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessExecutionDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessExecutionDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessExecutionDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -18,8 +18,8 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.model.OpenProcessDefinition;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Guillaume Porcher
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/SessionFactoryDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,8 +24,8 @@
import junit.framework.Test;
import org.hibernate.SessionFactory;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -53,8 +53,8 @@
import org.jbpm.pvm.model.OpenProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Guillaume Porcher
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/WireTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -28,8 +28,8 @@
import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/VariableCustomTypeTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/VariableCustomTypeTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/VariableCustomTypeTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -35,8 +35,8 @@
import org.jbpm.pvm.internal.type.Variable;
import org.jbpm.pvm.internal.type.variable.DateVariable;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.EnvironmentDbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Guillaume Porcher
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -28,7 +28,7 @@
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.samples.activities.WaitState;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -28,7 +28,7 @@
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.samples.activities.WaitState;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorIsolationDbTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,7 +24,7 @@
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.session.MessageSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.DbTestCase;
+import org.jbpm.test.DbTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -50,8 +50,8 @@
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.MessageSession;
import org.jbpm.pvm.session.PvmDbSession;
-import org.jbpm.pvm.test.base.DbTestCase;
-import org.jbpm.pvm.test.base.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.tx;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.tx;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,10 +21,10 @@
*/
package org.jbpm.pvm.internal.tx;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.Transaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -40,7 +40,7 @@
import org.jbpm.pvm.internal.type.variable.LongVariable;
import org.jbpm.pvm.internal.type.variable.StringVariable;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.test.base.EnvironmentTestCase;
+import org.jbpm.test.EnvironmentTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -25,7 +25,7 @@
import java.util.List;
import org.jbpm.pvm.internal.util.Listener;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,13 +23,13 @@
import java.util.List;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -23,11 +23,11 @@
import java.util.List;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/DebugDomBuilderTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -24,10 +24,10 @@
import java.io.InputStream;
import java.util.List;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.DebugDomParser;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.test.JbpmTestCase;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/WireParserTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.xml;
-import org.jbpm.pvm.test.base.JbpmTestCase;
+import org.jbpm.test.JbpmTestCase;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java 2008-10-31 09:11:30 UTC (rev 2692)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -4,13 +4,13 @@
import java.util.List;
import org.jbpm.PvmException;
-import org.jbpm.pvm.test.base.JbpmTestCase;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Bindings;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
import org.w3c.dom.Element;
public class XmlParsingTest extends JbpmTestCase {
Added: jbpm4/trunk/modules/test/.classpath
===================================================================
--- jbpm4/trunk/modules/test/.classpath (rev 0)
+++ jbpm4/trunk/modules/test/.classpath 2008-10-31 09:12:32 UTC (rev 2693)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/test/.project
===================================================================
--- jbpm4/trunk/modules/test/.project (rev 0)
+++ jbpm4/trunk/modules/test/.project 2008-10-31 09:12:32 UTC (rev 2693)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/trunk/modules/test/pom.xml
===================================================================
--- jbpm4/trunk/modules/test/pom.xml (rev 0)
+++ jbpm4/trunk/modules/test/pom.xml 2008-10-31 09:12:32 UTC (rev 2693)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>jBPM 4 - Test</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test</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>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test (from rev 2677, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base)
Property changes on: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/DbTestCase.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import org.jbpm.pvm.ExecutionService;
-import org.jbpm.pvm.ManagementService;
-import org.jbpm.pvm.ProcessService;
-import org.jbpm.pvm.internal.cmd.CommandService;
-
-
-/** for tests that use persistence through a command service.
- *
- * The DB is cleaned inbetween tests. No environment is created.
- *
- * @author Tom Baeyens
- */
-public abstract class DbTestCase extends EnvironmentFactoryTestCase {
-
- protected CommandService commandService;
- protected ProcessService processService;
- protected ExecutionService executionService;
- protected ManagementService managementService;
-
- public DbTestCase() {
- super();
- }
-
- public DbTestCase(String configResource) {
- super(configResource);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- if (isEnvironmentFactoryCached()) {
- Db.clean(getEnvironmentFactory());
- }
-
- commandService = getEnvironmentFactory().get(CommandService.class);
- processService = getEnvironmentFactory().get(ProcessService.class);
- executionService = getEnvironmentFactory().get(ExecutionService.class);
- managementService = getEnvironmentFactory().get(ManagementService.class);
- }
-
- public void tearDown() throws Exception {
- commandService = null;
- processService = null;
- executionService = null;
- managementService = null;
- super.tearDown();
- }
-}
Copied: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/DbTestCase.java)
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java (rev 0)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -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.pvm.test.base;
+
+import org.jbpm.ExecutionService;
+import org.jbpm.ManagementService;
+import org.jbpm.ProcessService;
+import org.jbpm.pvm.internal.cmd.CommandService;
+
+
+/** for tests that use persistence through a command service.
+ *
+ * The DB is cleaned inbetween tests. No environment is created.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class DbTestCase extends EnvironmentFactoryTestCase {
+
+ protected CommandService commandService;
+ protected ProcessService processService;
+ protected ExecutionService executionService;
+ protected ManagementService managementService;
+
+ public DbTestCase() {
+ super();
+ }
+
+ public DbTestCase(String configResource) {
+ super(configResource);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ if (isEnvironmentFactoryCached()) {
+ Db.clean(getEnvironmentFactory());
+ }
+
+ commandService = getEnvironmentFactory().get(CommandService.class);
+ processService = getEnvironmentFactory().get(ProcessService.class);
+ executionService = getEnvironmentFactory().get(ExecutionService.class);
+ managementService = getEnvironmentFactory().get(ManagementService.class);
+ }
+
+ public void tearDown() throws Exception {
+ commandService = null;
+ processService = null;
+ executionService = null;
+ managementService = null;
+ super.tearDown();
+ }
+}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/EnvironmentDbTestCase.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.lang.reflect.Field;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.jbpm.pvm.model.OpenProcessDefinition;
-import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.session.PvmDbSession;
-
-
-/** for tests that use persistence inside environment blocks.
- *
- * An environment is opened in the setUp and closed in the tearDown.
- * DB is cleaned inbetween tests. Extra convenience methods for usage
- * inside an environment block are provided.
- *
- * @author Tom Baeyens
- */
-public class EnvironmentDbTestCase extends EnvironmentTestCase {
-
- Transaction transaction = null;
-
- public EnvironmentDbTestCase() {
- }
-
- public EnvironmentDbTestCase(String configResource) {
- super(configResource);
- }
-
- public void setUp() throws Exception {
- if (isEnvironmentFactoryCached()) {
- Db.clean(getEnvironmentFactory());
- }
- super.setUp();
- beginTransaction();
- }
-
- public void tearDown() throws Exception {
- commitTransaction();
- super.tearDown();
- }
-
- void beginTransaction() {
- Session session = environment.get(Session.class);
- transaction = session.beginTransaction();
- }
-
- void commitTransaction() {
- transaction.commit();
- transaction = null;
- }
-
- void rollbackTransaction() {
- transaction.rollback();
- transaction = null;
- }
-
- public DbSession getDbSession() {
- return environment.get(DbSession.class);
- }
-
- public void rollbackAndBeginNewTransaction() {
- rollbackTransaction();
- closeEnvironment();
- openEnvironment();
- beginTransaction();
- }
-
- public void newTransaction() {
- try {
- commitTransaction();
- closeEnvironment();
- } finally {
- openEnvironment();
- beginTransaction();
- }
- }
-
- public void beginCacheTest() {
- SessionFactory sessionFactory = environment.get(SessionFactory.class);
- if (sessionFactory != null) {
- log.debug("=================================================================");
- log.debug("Beginning of the cache test, no more sql query should be performed before the end of the test");
- log.debug("=================================================================");
-
- sessionFactory.getStatistics().clear();
- sessionFactory.getStatistics().setStatisticsEnabled(true);
- }
- }
-
- public void endCacheTest() {
- SessionFactory sessionFactory = environment.get(SessionFactory.class);
- if (sessionFactory != null) {
- assertEquals(0, sessionFactory.getStatistics().getEntityLoadCount());
- assertEquals(0, sessionFactory.getStatistics().getCollectionLoadCount());
- }
- }
-
- public ProcessDefinitionImpl reload(OpenProcessDefinition processDefinition) {
- environment.get(PvmDbSession.class).save(processDefinition);
- newTransaction();
- return environment.get(PvmDbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
- }
-
- public <T> T reload(T object, Class<T> persistentClass) {
- environment.get(DbSession.class).save(object);
- newTransaction();
-
- Long dbid = null;
- try {
- Field dbidField = ReflectUtil.getField(persistentClass, "dbid");
- dbidField.setAccessible(true);
- dbid = (Long) dbidField.get(object);
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return environment.get(DbSession.class).get(persistentClass, dbid);
- }
-
- public ExecutionImpl reload(Execution execution) {
- environment.get(PvmDbSession.class).save(execution);
- newTransaction();
- return environment.get(PvmDbSession.class).get(ExecutionImpl.class, execution.getDbid());
- }
-
-}
Copied: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/EnvironmentDbTestCase.java)
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java (rev 0)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.test.base;
+
+import java.lang.reflect.Field;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.jbpm.Execution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.util.ReflectUtil;
+import org.jbpm.pvm.model.OpenProcessDefinition;
+import org.jbpm.pvm.session.DbSession;
+import org.jbpm.pvm.session.PvmDbSession;
+
+
+/** for tests that use persistence inside environment blocks.
+ *
+ * An environment is opened in the setUp and closed in the tearDown.
+ * DB is cleaned inbetween tests. Extra convenience methods for usage
+ * inside an environment block are provided.
+ *
+ * @author Tom Baeyens
+ */
+public class EnvironmentDbTestCase extends EnvironmentTestCase {
+
+ Transaction transaction = null;
+
+ public EnvironmentDbTestCase() {
+ }
+
+ public EnvironmentDbTestCase(String configResource) {
+ super(configResource);
+ }
+
+ public void setUp() throws Exception {
+ if (isEnvironmentFactoryCached()) {
+ Db.clean(getEnvironmentFactory());
+ }
+ super.setUp();
+ beginTransaction();
+ }
+
+ public void tearDown() throws Exception {
+ commitTransaction();
+ super.tearDown();
+ }
+
+ void beginTransaction() {
+ Session session = environment.get(Session.class);
+ transaction = session.beginTransaction();
+ }
+
+ void commitTransaction() {
+ transaction.commit();
+ transaction = null;
+ }
+
+ void rollbackTransaction() {
+ transaction.rollback();
+ transaction = null;
+ }
+
+ public DbSession getDbSession() {
+ return environment.get(DbSession.class);
+ }
+
+ public void rollbackAndBeginNewTransaction() {
+ rollbackTransaction();
+ closeEnvironment();
+ openEnvironment();
+ beginTransaction();
+ }
+
+ public void newTransaction() {
+ try {
+ commitTransaction();
+ closeEnvironment();
+ } finally {
+ openEnvironment();
+ beginTransaction();
+ }
+ }
+
+ public void beginCacheTest() {
+ SessionFactory sessionFactory = environment.get(SessionFactory.class);
+ if (sessionFactory != null) {
+ log.debug("=================================================================");
+ log.debug("Beginning of the cache test, no more sql query should be performed before the end of the test");
+ log.debug("=================================================================");
+
+ sessionFactory.getStatistics().clear();
+ sessionFactory.getStatistics().setStatisticsEnabled(true);
+ }
+ }
+
+ public void endCacheTest() {
+ SessionFactory sessionFactory = environment.get(SessionFactory.class);
+ if (sessionFactory != null) {
+ assertEquals(0, sessionFactory.getStatistics().getEntityLoadCount());
+ assertEquals(0, sessionFactory.getStatistics().getCollectionLoadCount());
+ }
+ }
+
+ public ProcessDefinitionImpl reload(OpenProcessDefinition processDefinition) {
+ environment.get(PvmDbSession.class).save(processDefinition);
+ newTransaction();
+ return environment.get(PvmDbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
+ }
+
+ public <T> T reload(T object, Class<T> persistentClass) {
+ environment.get(DbSession.class).save(object);
+ newTransaction();
+
+ Long dbid = null;
+ try {
+ Field dbidField = ReflectUtil.getField(persistentClass, "dbid");
+ dbidField.setAccessible(true);
+ dbid = (Long) dbidField.get(object);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return environment.get(DbSession.class).get(persistentClass, dbid);
+ }
+
+ public ExecutionImpl reload(Execution execution) {
+ environment.get(PvmDbSession.class).save(execution);
+ newTransaction();
+ return environment.get(PvmDbSession.class).get(ExecutionImpl.class, execution.getDbid());
+ }
+
+}
Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/EnvironmentFactoryTestCase.java 2008-10-30 13:20:37 UTC (rev 2677)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.env.EnvironmentFactory;
-import org.jbpm.pvm.env.PvmEnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentFactoryTestCase extends JbpmTestCase {
-
- String configResource;
-
- static Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
-
- public EnvironmentFactoryTestCase() {
- this("environment.cfg.xml");
- }
-
- public EnvironmentFactoryTestCase(String configResource) {
- this.configResource = configResource;
- }
-
- public EnvironmentFactory getEnvironmentFactory() {
- if (isEnvironmentFactoryCached()) {
- return environmentFactories.get(configResource);
- }
- return createEnvironmentFactory();
- }
-
- boolean isEnvironmentFactoryCached() {
- return environmentFactories.containsKey(configResource);
- }
-
- EnvironmentFactory createEnvironmentFactory() {
- return createEnvironmentFactory(configResource);
- }
-
- static EnvironmentFactory createEnvironmentFactory(String configResource) {
- try {
- log.debug("creating environment factory for ["+configResource+"]");
- EnvironmentFactory newEnvironmentFactory = new PvmEnvironmentFactory(configResource);
- environmentFactories.put(configResource, newEnvironmentFactory);
- return newEnvironmentFactory;
- } catch (Exception e) {
- throw new PvmException("Exception during creation of environment factory for "+configResource, e);
- }
- }
-
- static void closeEnvironmentFactory(String configResource) {
- EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
- if (environmentFactory!=null) {
- log.debug("closing environment factory for ["+configResource+"]");
- environmentFactory.close();
- }
- }
-}
Copied: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java (from rev 2682, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/test/base/EnvironmentFactoryTestCase.java)
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java (rev 0)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-10-31 09:12:32 UTC (rev 2693)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.test.base;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.PvmException;
+import org.jbpm.pvm.env.EnvironmentFactory;
+import org.jbpm.pvm.env.PvmEnvironmentFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class EnvironmentFactoryTestCase extends JbpmTestCase {
+
+ String configResource;
+
+ static Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
+
+ public EnvironmentFactoryTestCase() {
+ this("environment.cfg.xml");
+ }
+
+ public EnvironmentFactoryTestCase(String configResource) {
+ this.configResource = configResource;
+ }
+
+ public EnvironmentFactory getEnvironmentFactory() {
+ if (isEnvironmentFactoryCached()) {
+ return environmentFactories.get(configResource);
+ }
+ return createEnvironmentFactory();
+ }
+
+ boolean isEnvironmentFactoryCached() {
+ return environmentFactories.containsKey(configResource);
+ }
+
+ EnvironmentFactory createEnvironmentFactory() {
+ return createEnvironmentFactory(configResource);
+ }
+
+ static EnvironmentFactory createEnvironmentFactory(String configResource) {
+ try {
+ log.debug("creating environment factory for ["+configResource+"]");
+ EnvironmentFactory newEnvironmentFactory = new PvmEnvironmentFactory(configResource);
+ environmentFactories.put(configResource, newEnvironmentFactory);
+ return newEnvironmentFactory;
+ } catch (Exception e) {
+ throw new PvmException("Exception during creation of environment factory for "+configResource, e);
+ }
+ }
+
+ static void closeEnvironmentFactory(String configResource) {
+ EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
+ if (environmentFactory!=null) {
+ log.debug("closing environment factory for ["+configResource+"]");
+ environmentFactory.close();
+ }
+ }
+}
15 years, 6 months
JBoss JBPM SVN: r2692 - in projects/gwt-console/trunk: rpc/src/main/java/org/jboss/bpm/console/client/model/util and 5 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-31 05:11:30 -0400 (Fri, 31 Oct 2008)
New Revision: 2692
Added:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapReplacement.java
Modified:
projects/gwt-console/trunk/gwt-console.iml
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/server/pom.xml
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskManagement.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/DiagramDAO.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/TaskDAO.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3CommandDelegate.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3TaskDAO.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
Log:
Added TaskFormList and TaskForm resources that give access to the jbpm3 JSF forms
Modified: projects/gwt-console/trunk/gwt-console.iml
===================================================================
--- projects/gwt-console/trunk/gwt-console.iml 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/gwt-console.iml 2008-10-31 09:11:30 UTC (rev 2692)
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/server/target/classes" />
<exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../../../../../IdeaProjects/jBPM3/classes/test/gwt-console" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/rpc/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/server/src/main/java" isTestSource="false" />
@@ -14,90 +16,153 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="jbpm3-enterprise" />
<orderEntry type="module" module-name="jbpm3-core" />
- <orderEntry type="module" module-name="jbpm3-enterprise" />
<orderEntry type="module-library">
- <library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<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/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: nekohtml:nekohtml:jar:0.9.4:provided">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/nekohtml/nekohtml/0.9.4/nekohtml-0.9.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: org.apache.derby:derby:jar:10.2.1.6:provided">
+ <library name="M2 Dep: com.google.gwt:gchart:jar:2.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/derby/derby/10.2.1.6/derby-10.2.1.6.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gchart/2.2/gchart-2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
<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-user/1.5.2/gwt-user-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: poi:poi:jar:2.5.1-final-20040804:provided">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.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">
- <library name="M2 Dep: asm:asm:jar:1.5.3:provided">
+ <library name="M2 Dep: junit:junit:jar:3.8.1:test">
<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/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-httpclient:commons-httpclient:jar:3.1:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.2:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-mac.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.google.gwt:gchart:jar:2.2:compile">
+ <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gchart/2.2/gchart-2.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<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/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: nekohtml:nekohtml:jar:0.9.4:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/nekohtml/nekohtml/0.9.4/nekohtml-0.9.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.apache.derby:derby:jar:10.2.1.6:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/derby/derby/10.2.1.6/derby-10.2.1.6.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: poi:poi:jar:2.5.1-final-20040804:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: asm:asm:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-httpclient:commons-httpclient:jar:3.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <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/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">
<library name="M2 Dep: xml-apis:xml-apis:jar:1.3.03:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar!/" />
@@ -161,18 +226,18 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: org.apache.jackrabbit:jackrabbit-api:jar:1.4:provided">
+ <library name="M2 Dep: javax.mail:mail:jar:1.4:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/jackrabbit/jackrabbit-api/1.4/jackrabbit-api-1.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/mail/mail/1.4/mail-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: javax.mail:mail:jar:1.4:compile">
+ <library name="M2 Dep: org.apache.jackrabbit:jackrabbit-api:jar:1.4:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/mail/mail/1.4/mail-1.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/jackrabbit/jackrabbit-api/1.4/jackrabbit-api-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -215,27 +280,27 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
+ <library name="M2 Dep: org.apache.jackrabbit:jackrabbit-spi-commons:jar:1.4:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/jackrabbit/jackrabbit-spi-commons/1.4/jackrabbit-spi-commons-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: org.apache.jackrabbit:jackrabbit-spi-commons:jar:1.4:provided">
+ <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/jackrabbit/jackrabbit-spi-commons/1.4/jackrabbit-spi-commons-1.4.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.2/jaxb-impl-2.1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile">
+ <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/sun/xml/bind/jaxb-impl/2.1.2/jaxb-impl-2.1.2.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 />
@@ -260,15 +325,6 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <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!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
<library name="M2 Dep: concurrent:concurrent:jar:1.3.4:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar!/" />
@@ -296,15 +352,6 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: junit:junit:jar:3.8.1:test">
- <CLASSES>
- <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">
<library name="M2 Dep: org.apache.ant:ant:jar:1.7.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar!/" />
@@ -332,15 +379,6 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-mac.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
<library name="M2 Dep: bsh:bsh:jar:1.3.0:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/bsh/bsh/1.3.0/bsh-1.3.0.jar!/" />
@@ -413,15 +451,6 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <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 />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
<library name="M2 Dep: com.sun.xml.fastinfoset:FastInfoset:jar:1.2.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.2/FastInfoset-1.2.2.jar!/" />
@@ -520,15 +549,6 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/pom.xml 2008-10-31 09:11:30 UTC (rev 2692)
@@ -1,156 +1,163 @@
<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>JBoss jBPM3 - GWT Console</name>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss jBPM3 - GWT Console</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm</groupId>
- <artifactId>jbpm-parent</artifactId>
- <version>1.0.0.GA</version>
- </parent>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-parent</artifactId>
+ <version>1.0.0.GA</version>
+ </parent>
- <properties>
- <gwt.version>1.5.2</gwt.version>
- <gchart.version>2.2</gchart.version>
- <gwtext.version>2.0.5</gwtext.version>
- <stax-api.version>1.0-2</stax-api.version>
- <jaf.version>1.1</jaf.version>
- <resteasy.version>1.0-beta-8</resteasy.version>
- <gson.version>1.2.2</gson.version>
- <commons.fileupload.version>1.2.1</commons.fileupload.version>
- <commons.io.version>1.3.2</commons.io.version>
- <jbpm.version>3.3.0-SNAPSHOT</jbpm.version>
- <javax.jaxb.version>2.1</javax.jaxb.version>
- <javax.ejb.version>3.0</javax.ejb.version>
- <junit.version>3.8.1</junit.version>
- </properties>
+ <properties>
+ <gwt.version>1.5.2</gwt.version>
+ <gchart.version>2.2</gchart.version>
+ <gwtext.version>2.0.5</gwtext.version>
+ <stax-api.version>1.0-2</stax-api.version>
+ <jaf.version>1.1</jaf.version>
+ <resteasy.version>1.0-beta-8</resteasy.version>
+ <gson.version>1.2.2</gson.version>
+ <commons.fileupload.version>1.2.1</commons.fileupload.version>
+ <commons.io.version>1.3.2</commons.io.version>
+ <jbpm.version>3.3.0-SNAPSHOT</jbpm.version>
+ <javax.jaxb.version>2.1</javax.jaxb.version>
+ <javax.ejb.version>3.0</javax.ejb.version>
+ <jboss.common.version>2.2.7.GA</jboss.common.version>
+ <junit.version>3.8.1</junit.version>
+ </properties>
- <modules>
- <module>rpc</module>
- <module>server</module>
- <module>war</module>
- </modules>
+ <modules>
+ <module>rpc</module>
+ <module>server</module>
+ <module>war</module>
+ </modules>
- <dependencyManagement>
- <dependencies>
+ <dependencyManagement>
+ <dependencies>
- <!-- JBPM -->
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-core</artifactId>
- <scope>provided</scope>
- <version>${jbpm.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-enterprise-beans</artifactId>
- <scope>provided</scope>
- <version>${jbpm.version}</version>
- </dependency>
+ <!-- JBPM -->
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-core</artifactId>
+ <scope>provided</scope>
+ <version>${jbpm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-enterprise-beans</artifactId>
+ <scope>provided</scope>
+ <version>${jbpm.version}</version>
+ </dependency>
- <!-- GET related -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwt.version}</version>
- </dependency>
+ <!-- GET related -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
- <dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- <version>${gwtext.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gchart</artifactId>
- <version>${gchart.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
+ <dependency>
+ <groupId>com.gwtext</groupId>
+ <artifactId>gwtext</artifactId>
+ <version>${gwtext.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gchart</artifactId>
+ <version>${gchart.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
- <!-- Other -->
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>${stax-api.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>${jaf.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>${javax.jaxb.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- <version>${javax.ejb.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- </dependency>
+ <!-- Other -->
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>${jaf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${javax.jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>${javax.ejb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>${jboss.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${commons.fileupload.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
- </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${commons.fileupload.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
- </dependencies>
- </dependencyManagement>
+ </dependencies>
+ </dependencyManagement>
- <!-- Repositories -->
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
- </pluginRepository>
- </pluginRepositories>
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
+ </pluginRepository>
+ </pluginRepositories>
</project>
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapEntry.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -0,0 +1,47 @@
+/*
+ * 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.jboss.bpm.console.client.model.util;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MapEntry
+{
+ String name;
+ Object value;
+
+ public MapEntry(String name, Object value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+}
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapReplacement.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapReplacement.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/MapReplacement.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -0,0 +1,52 @@
+/*
+ * 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.jboss.bpm.console.client.model.util;
+
+import java.util.List;
+
+/**
+ * Json Map serialization is a problem, hence the map replacement.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MapReplacement
+{
+ String name;
+
+ List<MapEntry> entries;
+
+ public MapReplacement(String name, List<MapEntry> entries)
+ {
+ this.name = name;
+ this.entries = entries;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public List<MapEntry> getEntries()
+ {
+ return entries;
+ }
+}
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/pom.xml 2008-10-31 09:11:30 UTC (rev 2692)
@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3 - GWT Console (Server)</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>gwt-console-server</artifactId>
+ <artifactId>gwt-console-server</artifactId>
<packaging>war</packaging>
<!-- Parent -->
@@ -30,12 +30,12 @@
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-enterprise-beans</artifactId>
- <scope>provided</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-core</artifactId>
- <scope>provided</scope>
+ <scope>provided</scope>
</dependency>
<!-- GWT related -->
@@ -46,7 +46,7 @@
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
+ <artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
@@ -70,8 +70,13 @@
</dependency>
<dependency>
<groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <artifactId>commons-io</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskManagement.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskManagement.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskManagement.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -23,19 +23,19 @@
import com.google.gson.Gson;
import org.jboss.bpm.console.client.model.TaskReferenceWrapper;
+import org.jboss.bpm.console.client.model.util.MapEntry;
+import org.jboss.bpm.console.client.model.util.MapReplacement;
import org.jboss.bpm.console.server.dao.DAOFactory;
import org.jboss.bpm.console.server.dao.TaskDAO;
import org.jboss.bpm.console.server.gson.GsonFactory;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
+import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.StringTokenizer;
/**
@@ -66,10 +66,10 @@
@Path("actor")
@Produces("application/json")
public Response getTasksForActor(
- @Context
- HttpServletRequest request,
- @QueryParam("actors")
- String actors
+ @Context
+ HttpServletRequest request,
+ @QueryParam("actors")
+ String actors
)
{
List<String> actorList = new ArrayList<String>();
@@ -81,10 +81,49 @@
}
TaskReferenceWrapper wrapper =
- new TaskReferenceWrapper(getTaskDAO(request).getTasksByActors(actorList));
+ new TaskReferenceWrapper(getTaskDAO(request).getTasksByActors(actorList));
return createJsonResponse(wrapper);
}
+ @GET
+ @Path("forms/{processId}")
+ @Produces("application/json")
+ public Response getTasksForms(
+ @Context
+ HttpServletRequest request,
+ @PathParam("processId")
+ long processId
+ )
+ {
+ Map<String,String> formMapping =
+ getTaskDAO(request).getAvailableTaskForms(processId);
+
+ List<MapEntry> entries = new ArrayList<MapEntry>();
+ for(String s : formMapping.keySet())
+ {
+ entries.add( new MapEntry(s, formMapping.get(s)) );
+ }
+
+ return createJsonResponse( new MapReplacement("formMapping", entries));
+ }
+
+ @GET
+ @Path("forms/{processId}/{taskId}")
+ @Produces("text/html")
+ public Response getTasksFormByTaskName(
+ @Context
+ HttpServletRequest request,
+ @PathParam("processId")
+ long processId,
+ @PathParam("taskId")
+ long taskId
+
+ )
+ {
+ byte[] form = getTaskDAO(request).getTaskFormByTaskName(processId, taskId);
+ return Response.ok(form).build();
+ }
+
private Response createJsonResponse(Object wrapper)
{
Gson gson = GsonFactory.createInstance();
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/DiagramDAO.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/DiagramDAO.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/DiagramDAO.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -26,6 +26,8 @@
import org.jboss.bpm.console.server.dao.ProcessDAO;
/**
+ * Proprietary to jBPM3, no sure if it will stay.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public interface DiagramDAO
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/TaskDAO.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/TaskDAO.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/TaskDAO.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -24,6 +24,7 @@
import org.jboss.bpm.console.client.model.TaskReference;
import java.util.List;
+import java.util.Map;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -32,4 +33,6 @@
{
List<TaskReference> getTasksByActors(List<String> actorList);
List<TaskReference> getTasksByInstanceId(long instanceId);
+ Map<String, String> getAvailableTaskForms(long processId);
+ byte[] getTaskFormByTaskName(long processId, long taskId);
}
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3CommandDelegate.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3CommandDelegate.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3CommandDelegate.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -152,4 +152,11 @@
facade.execute( new GetTaskListCommand(actorList.toArray(new String[]{})));
return tasks;
}
+
+ public TaskInstance getTaskById(long taskId)
+ {
+
+ // include variables, but no logs
+ return (TaskInstance) facade.execute( new GetTaskInstanceCommand(taskId, true, false));
+ }
}
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3TaskDAO.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3TaskDAO.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/JBPM3TaskDAO.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -21,11 +21,17 @@
*/
package org.jboss.bpm.console.server.dao.internal;
+import org.jboss.bpm.console.client.model.TaskReference;
import org.jboss.bpm.console.server.dao.TaskDAO;
-import org.jboss.bpm.console.client.model.TaskReference;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.file.def.FileDefinition;
+import org.jbpm.util.XmlUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
-import java.util.List;
-import java.util.ArrayList;
+import java.util.*;
+import java.io.InputStream;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -35,7 +41,6 @@
private JBPM3CommandDelegate delegate;
-
public JBPM3TaskDAO()
{
this.delegate = new JBPM3CommandDelegate();
@@ -55,8 +60,67 @@
return taskRefs;
}
+ // TODO: If not requred please remove
public List<TaskReference> getTasksByInstanceId(long instanceId)
{
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ throw new RuntimeException("Not implemented");
}
+
+ public Map<String, String> getAvailableTaskForms(long processId)
+ {
+ org.jbpm.graph.def.ProcessDefinition processDefinition =
+ delegate.getActualDefinition(processId);
+
+ return getTask2FileMapping(processDefinition);
+ }
+
+ private Map<String, String> getTask2FileMapping(ProcessDefinition processDefinition)
+ {
+ Map<String, String> result = new HashMap<String, String>();
+
+ final FileDefinition fileDefinition = processDefinition.getFileDefinition();
+ if (! fileDefinition.hasFile("forms.xml"))
+ {
+ // exit with empty list
+ // TODO: maybe an exception is better?
+ return result;
+ }
+
+ final InputStream inputStream = fileDefinition.getInputStream("forms.xml");
+ if (inputStream == null)
+ {
+ throw new RuntimeException("Failed to open stream on forms.xml");
+ }
+
+ final Document document = XmlUtil.parseXmlInputStream(inputStream);
+ final Element documentElement = document.getDocumentElement();
+ final NodeList nodeList = documentElement.getElementsByTagName("form");
+ final int length = nodeList.getLength();
+ for (int i = 0; i < length; i ++)
+ {
+ final Element element = (Element) nodeList.item(i);
+ final String itemTaskName = element.getAttribute("task");
+ final String itemFormName = element.getAttribute("form");
+ if (itemTaskName == null || itemFormName == null) {
+ continue;
+ }
+ result.put(itemTaskName, itemFormName);
+ }
+ return result;
+ }
+
+ public byte[] getTaskFormByTaskName(long processId, long taskId)
+ {
+ org.jbpm.graph.def.ProcessDefinition processDefinition =
+ delegate.getActualDefinition(processId);
+ org.jbpm.taskmgmt.exe.TaskInstance t0 = delegate.getTaskById(taskId);
+
+ Map<String,String> fileMapping = getTask2FileMapping(processDefinition);
+ String fileName = fileMapping.get(t0.getName());
+ if(fileName !=null)
+ return processDefinition.getFileDefinition().getBytes(fileName);
+ else
+ throw new RuntimeException("No form definition for taskId '"+taskId+"'");
+
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-31 09:10:33 UTC (rev 2691)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-10-31 09:11:30 UTC (rev 2692)
@@ -25,6 +25,8 @@
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
import org.jboss.bpm.console.client.util.JSONWalk;
@@ -107,4 +109,13 @@
return ref;
}
+
+ public static Map<String,String> parseFormMapping(String json)
+ {
+ //{"Wait for money":"form.money.xhtml","Fix web order data":"form.fix.xhtml"}
+ Map<String,String> result = new HashMap<String,String>();
+
+
+ return result;
+ }
}
15 years, 6 months