[jbpm-commits] JBoss JBPM SVN: r3010 - in jbpm4/trunk: modules/api/src/main/java/org/jbpm and 58 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Nov 20 03:30:17 EST 2008
Author: tom.baeyens at jboss.com
Date: 2008-11-20 03:30:16 -0500 (Thu, 20 Nov 2008)
New Revision: 3010
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/JbpmException.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/deploy/ParseJpdlDeployer.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/EndBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ParseJpdlBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java
jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/hibernate.jpdl.hbm.xml
jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/
jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.hibernate.mappings.xml
jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml
jbpm4/trunk/modules/jpdl/src/test/resources/hibernate.properties
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/jpdl/src/test/resources/logging.properties
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java
jbpm4/trunk/modules/test-db/src/test/resources/log4j.xml
jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/PvmException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/pvm/
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionHandlerActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/DecisionBinding.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/StateTest.java
jbpm4/trunk/modules/jpdl/src/test/resources/log4j.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/BasicExecutionFlowDbTest.java
jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Configuration.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/cmd/CommandService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/Environment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java
jbpm4/trunk/modules/enterprise/pom.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java
jbpm4/trunk/modules/jpdl/.classpath
jbpm4/trunk/modules/jpdl/pom.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/JpdlException.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionExpressionTest.java
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Duration.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandException.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/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/Deployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveProcess.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/hibernate/ConverterType.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/job/MessageImpl.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/ExecuteJobCmd.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/JobExecutorServlet.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/lob/BlobStrategyBlob.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/ClobStrategyClob.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.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/ExceptionHandlerSynchronization.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/NodeImpl.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/script/ScriptManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.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/RetryInterceptor.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/tx/TransactionException.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/IoUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Priority.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/StringUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/TagBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/UrlEntity.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/binding/AbstractCollectionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.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/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/descriptor/SeamHibernateSessionDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.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/ScopeVariableTest.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/svc/ExecutionServiceTest.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/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/internal/jobexecutor/JobExecutorTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/test-load/pom.xml
jbpm4/trunk/modules/test-pojo/pom.xml
jbpm4/trunk/pom.xml
Log:
first jpdl 4 test in test-db
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Configuration.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Configuration.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Configuration.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -47,7 +47,7 @@
public Configuration(String type) {
String implementationClassName = getImplementationClassName(type);
if (implementationClassName==null) {
- throw new PvmException("type is null");
+ throw new JbpmException("type is null");
}
impl = instantiate(implementationClassName);
}
@@ -79,7 +79,7 @@
Class<?> implementationClass = classLoader.loadClass(className);
implementation = (Configuration) implementationClass.newInstance();
} catch (Exception e) {
- throw new PvmException("couldn't instantiate configuration of type "+className, e);
+ throw new JbpmException("couldn't instantiate configuration of type "+className, e);
}
return implementation;
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -36,21 +36,23 @@
*/
public interface Deployment extends Serializable {
- void setName(String name);
- void setLanguage(String language);
+ Deployment setName(String name);
+ Deployment setLanguage(String language);
- void addObject(String name, Object object);
- void addResource(String resource);
- void addFile(File file);
- void addUrl(URL url);
- void addInputStream(String name, InputStream inputStream);
- void addArchiveResource(String resource);
- void addArchiveFile(File file);
- void addArchiveUrl(URL url);
- void addArchive(ZipInputStream zipInputStream);
- void addDirectory(String directory);
- void addDirectoryCanonical(String directory);
- void addDirectory(File directory);
- void addDirectoryCanonical(File directory);
-
+ Deployment addObject(String name, Object object);
+ Deployment addResource(String resource);
+ Deployment addFile(File file);
+ Deployment addUrl(URL url);
+ Deployment addInputStream(String name, InputStream inputStream);
+ Deployment addString(String name, String string);
+ Deployment addArchiveResource(String resource);
+ Deployment addArchiveFile(File file);
+ Deployment addArchiveUrl(URL url);
+ Deployment addArchive(ZipInputStream zipInputStream);
+ Deployment addDirectory(String directory);
+ Deployment addDirectoryCanonical(String directory);
+ Deployment addDirectory(File directory);
+ Deployment addDirectoryCanonical(File directory);
+
+ void deploy();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -40,7 +40,7 @@
* </p>
*
* <p>If an execution is locked, methods that change the execution will throw
- * a {@link PvmException} and the message will reference the actual locking state.
+ * a {@link JbpmException} and the message will reference the actual locking state.
* {@link #fire(String, ObservableElement) Firing events},
* {@link #setVariable(String, Object) updating variables},
* {@link #setPriority(int) updating priority} and
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/JbpmException.java (from rev 2988, jbpm4/trunk/modules/api/src/main/java/org/jbpm/PvmException.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/JbpmException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/JbpmException.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm;
+
+public class JbpmException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public JbpmException() {
+ super();
+ }
+ public JbpmException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+ public JbpmException(String msg) {
+ super(msg);
+ }
+ public JbpmException(Throwable cause) {
+ super(cause);
+ }
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/PvmException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/PvmException.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/PvmException.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm;
-
-public class PvmException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public PvmException() {
- super();
- }
- public PvmException(String msg, Throwable cause) {
- super(msg, cause);
- }
- public PvmException(String msg) {
- super(msg);
- }
- public PvmException(Throwable cause) {
- super(cause);
- }
-}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.activity;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
import org.jbpm.env.Environment;
@@ -59,7 +59,7 @@
* will decide how to interpret the signal.
* </p>
*
- * @throws PvmException in case there is no default transition in the current node
+ * @throws JbpmException 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();
@@ -78,7 +78,7 @@
* @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}
+ * @throws JbpmException 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);
@@ -98,7 +98,7 @@
void take(Transition transition);
/** let's the given execution take the transition.
- * @throws PvmException if the execution is not part of this process instance. */
+ * @throws JbpmException if the execution is not part of this process instance. */
void take(Transition transition, Execution execution);
// execute a child node /////////////////////////////////////////////////////
@@ -146,7 +146,7 @@
/** 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
+ * @throws JbpmException if the given parent is not in this execution's
* process instance. */
Execution createExecution(Execution parent);
@@ -154,7 +154,7 @@
* 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
+ * @throws JbpmException if the given parent is not in this execution's
* process instance. */
Execution createExecution(String name, Execution parent);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.Activity;
import org.jbpm.activity.ExternalActivity;
import org.jbpm.model.OpenExecution;
@@ -187,10 +187,10 @@
/** 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. */
+ * @throws JbpmException if this execution is already suspended. */
void suspend();
/** resumes an execution. Inverse of {@link #suspend()}.
- * @throws PvmException if this execution is not suspended. */
+ * @throws JbpmException if this execution is not suspended. */
void resume();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/cmd/CommandService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/cmd/CommandService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/cmd/CommandService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,6 +1,6 @@
package org.jbpm.cmd;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* abstract extensible session facade. Developers can use this directly or
@@ -16,7 +16,7 @@
public interface CommandService {
/**
- * @throws PvmException if command throws an exception.
+ * @throws JbpmException if command throws an exception.
*/
<T> T execute(Command<T> command);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/Environment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/Environment.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/Environment.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.io.Serializable;
import java.util.Stack;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
@@ -192,14 +192,14 @@
Environment environment = getCurrent();
if (environment==null) {
if (required) {
- throw new PvmException("no environment to get "+type.getName());
+ throw new JbpmException("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");
+ throw new JbpmException("no "+type.getName()+" in current environment");
}
return null;
}
@@ -214,14 +214,14 @@
Environment environment = getCurrent();
if (environment==null) {
if (required) {
- throw new PvmException("no environment to get '"+name+"'");
+ throw new JbpmException("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");
+ throw new JbpmException("no '"+name+"' in current environment");
}
return null;
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
@@ -53,7 +53,7 @@
return (T) defaultObject;
}
} catch (Exception e) {
- throw new PvmException("couldn't create default "+type.getName(), e);
+ throw new JbpmException("couldn't create default "+type.getName(), e);
}
return null;
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.util.Set;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.job.Timer;
@@ -67,13 +67,13 @@
/** updates or creates a variable for the given value.
* Values are allowed to be null.
- * @throws PvmException if key is null. */
+ * @throws JbpmException 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
+ * @throws JbpmException is variables is not null and if null is present
* as a key in the provided variables map. */
void setVariables(Map<String, Object> variables);
Modified: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -65,11 +65,6 @@
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
@@ -84,20 +79,6 @@
<artifactId>livetribe-jsr223</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</dependency>
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseLocalCommandService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
@@ -48,10 +48,10 @@
commandExecutor = commandExecutorHome.create();
}
catch (NamingException e) {
- throw new PvmException("error retrieving command executor home", e);
+ throw new JbpmException("error retrieving command executor home", e);
}
catch (CreateException e) {
- throw new PvmException("error creating command executor", e);
+ throw new JbpmException("error creating command executor", e);
}
}
return commandExecutor;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EnterpriseTimerSession.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import javax.ejb.FinderException;
import javax.ejb.RemoveException;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.job.Timer;
import org.jbpm.log.Log;
@@ -56,7 +56,7 @@
timerBean.schedule();
}
catch (FinderException e) {
- throw new PvmException("could not find bean for timer: " + timer);
+ throw new JbpmException("could not find bean for timer: " + timer);
}
}
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/EnterpriseTimerSessionTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -36,10 +36,10 @@
import org.jbpm.enterprise.test.custom.HappyActivity;
import org.jbpm.env.Environment;
import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
import org.jbpm.pvm.internal.job.TimerImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.session.DbSession;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/test/TimerTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -40,12 +40,12 @@
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.cmd.DeployCmd;
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.model.ExecutionImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.session.DbSession;
Modified: jbpm4/trunk/modules/jpdl/.classpath
===================================================================
--- jbpm4/trunk/modules/jpdl/.classpath 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/.classpath 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -86,9 +86,7 @@
<configuration>
<excludes>
<!-- https://jira.jboss.org/jira/browse/JBPM-1759 -->
- <exclude>org/jbpm/jpdl/controlflow/DecisionHandlerTest.java</exclude>
- <exclude>org/jbpm/jpdl/controlflow/StateTest.java</exclude>
- <exclude>org/jbpm/jpdl/parsing/JpdlSchemaTest.java</exclude>
+ <exclude>**/*.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/JpdlException.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/JpdlException.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/JpdlException.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,12 +21,12 @@
*/
package org.jbpm.jpdl;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
*/
-public class JpdlException extends PvmException {
+public class JpdlException extends JbpmException {
private static final long serialVersionUID = 1L;
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionConditionActivity.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionConditionActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.activity;
-
-import java.util.List;
-
-import org.jbpm.jpdl.JpdlException;
-import org.jbpm.jpdl.JpdlExecution;
-import org.jbpm.model.Condition;
-import org.jbpm.model.Node;
-import org.jbpm.model.Transition;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DecisionConditionActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(JpdlExecution execution) throws Exception {
- Transition transition = findTransition(execution);
- if (transition==null) {
- throw new JpdlException("no outgoing transition condition evaluated to true for decision "+execution.getNode());
- }
- execution.take(transition);
- }
-
- private Transition findTransition(JpdlExecution execution) {
- Node node = execution.getNode();
- List<Transition> outgoingTransitions = node.getOutgoingTransitions();
- for (Transition transition : outgoingTransitions) {
- Condition condition = transition.getCondition();
- if ( (condition==null)
- || (condition.evaluate(execution))
- ) {
- return transition;
- }
- }
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionExpressionActivity.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionExpressionActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.jpdl.activity;
-
-import org.jbpm.PvmException;
-import org.jbpm.env.EnvironmentHelper;
-import org.jbpm.jpdl.JpdlExecution;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-/**
- * @author Tom Baeyens
- */
-public class DecisionExpressionActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- protected String expr;
- protected String lang;
-
- public void execute(JpdlExecution execution) throws Exception {
- NodeImpl node = execution.getNode();
- String transitionName = null;
-
- ScriptManager scriptManager = EnvironmentHelper.get(ScriptManager.class);
- Object result = scriptManager.evaluateExpression(expr, execution, lang);
- if ( (result!=null)
- && (! (result instanceof String))
- ) {
- throw new PvmException("expression '"+expr+"' in decision '"+node.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
- }
- transitionName = (String) result;
-
- Transition transition = node.getOutgoingTransition(transitionName);
- if (transition==null) {
- throw new PvmException("expression '"+expr+"' in decision '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
- }
-
- execution.take(transition);
- }
-
- public void setExpr(String expr) {
- this.expr = expr;
- }
- public void setLang(String lang) {
- this.lang = lang;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionHandlerActivity.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionHandlerActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.activity;
-
-import org.jbpm.PvmException;
-import org.jbpm.env.Environment;
-import org.jbpm.env.EnvironmentHelper;
-import org.jbpm.jpdl.DecisionHandler;
-import org.jbpm.jpdl.JpdlException;
-import org.jbpm.jpdl.JpdlExecution;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.WireContext;
-
-/**
- * @author Tom Baeyens
- */
-public class DecisionHandlerActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- protected String decisionHandlerName;
- protected Descriptor decisionHandlerDescriptor;
-
- public void execute(JpdlExecution execution) throws Exception {
- NodeImpl node = execution.getNode();
- String transitionName = null;
-
- Object object = null;
- if (decisionHandlerDescriptor!=null) {
- object = WireContext.create(decisionHandlerDescriptor);
- } else if (decisionHandlerName!=null) {
- Environment environment = Environment.getCurrent();
- object = environment.get(decisionHandlerName);
- }
-
- if (object==null) {
- throw new JpdlException("decision handler for "+node+" is null");
- }
- if (! (object instanceof DecisionHandler)) {
- throw new JpdlException("handler for decision is not a "+DecisionHandler.class.getName()+": "+object.getClass().getName());
- }
- DecisionHandler decisionHandler = (DecisionHandler) object;
- transitionName = decisionHandler.decide(execution);
-
- Transition transition = node.getOutgoingTransition(transitionName);
- if (transition==null) {
- throw new PvmException("handler in decision '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
- }
-
- execution.take(transition);
- }
-
- public void setDecisionHandlerName(String decisionHandlerName) {
- this.decisionHandlerName = decisionHandlerName;
- }
- public void setDecisionHandlerDescriptor(Descriptor decisionHandlerDescriptor) {
- this.decisionHandlerDescriptor = decisionHandlerDescriptor;
- }
-}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.activity;
+
+import org.jbpm.jpdl.JpdlExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(JpdlExecution execution) throws Exception {
+ execution.stop();
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java (from rev 2961, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionConditionActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.activity;
+
+import java.util.List;
+
+import org.jbpm.jpdl.JpdlException;
+import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.model.Condition;
+import org.jbpm.model.Node;
+import org.jbpm.model.Transition;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveConditionActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(JpdlExecution execution) throws Exception {
+ Transition transition = findTransition(execution);
+ if (transition==null) {
+ throw new JpdlException("no outgoing transition condition evaluated to true for exclusive "+execution.getNode());
+ }
+ execution.take(transition);
+ }
+
+ private Transition findTransition(JpdlExecution execution) {
+ Node node = execution.getNode();
+ List<Transition> outgoingTransitions = node.getOutgoingTransitions();
+ for (Transition transition : outgoingTransitions) {
+ Condition condition = transition.getCondition();
+ if ( (condition==null)
+ || (condition.evaluate(execution))
+ ) {
+ return transition;
+ }
+ }
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java (from rev 2961, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionExpressionActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.jpdl.activity;
+
+import org.jbpm.JbpmException;
+import org.jbpm.env.EnvironmentHelper;
+import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveExpressionActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String expr;
+ protected String lang;
+
+ public void execute(JpdlExecution execution) throws Exception {
+ NodeImpl node = execution.getNode();
+ String transitionName = null;
+
+ ScriptManager scriptManager = EnvironmentHelper.get(ScriptManager.class);
+ Object result = scriptManager.evaluateExpression(expr, execution, lang);
+ if ( (result!=null)
+ && (! (result instanceof String))
+ ) {
+ throw new JbpmException("expression '"+expr+"' in exclusive '"+node.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
+ }
+ transitionName = (String) result;
+
+ Transition transition = node.getOutgoingTransition(transitionName);
+ if (transition==null) {
+ throw new JbpmException("expression '"+expr+"' in exclusive '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+ }
+
+ execution.take(transition);
+ }
+
+ public void setExpr(String expr) {
+ this.expr = expr;
+ }
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java (from rev 2961, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/DecisionHandlerActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.jpdl.activity;
+
+import org.jbpm.JbpmException;
+import org.jbpm.env.Environment;
+import org.jbpm.jpdl.DecisionHandler;
+import org.jbpm.jpdl.JpdlException;
+import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveHandlerActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String decisionHandlerName;
+ protected Descriptor decisionHandlerDescriptor;
+
+ public void execute(JpdlExecution execution) throws Exception {
+ NodeImpl node = execution.getNode();
+ String transitionName = null;
+
+ Object object = null;
+ if (decisionHandlerDescriptor!=null) {
+ object = WireContext.create(decisionHandlerDescriptor);
+ } else if (decisionHandlerName!=null) {
+ Environment environment = Environment.getCurrent();
+ object = environment.get(decisionHandlerName);
+ }
+
+ if (object==null) {
+ throw new JpdlException("decision handler for "+node+" is null");
+ }
+ if (! (object instanceof DecisionHandler)) {
+ throw new JpdlException("handler for exclusive is not a "+DecisionHandler.class.getName()+": "+object.getClass().getName());
+ }
+ DecisionHandler decisionHandler = (DecisionHandler) object;
+ transitionName = decisionHandler.decide(execution);
+
+ Transition transition = node.getOutgoingTransition(transitionName);
+ if (transition==null) {
+ throw new JbpmException("handler in exclusive '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+ }
+
+ execution.take(transition);
+ }
+
+ public void setDecisionHandlerName(String decisionHandlerName) {
+ this.decisionHandlerName = decisionHandlerName;
+ }
+ public void setDecisionHandlerDescriptor(Descriptor decisionHandlerDescriptor) {
+ this.decisionHandlerDescriptor = decisionHandlerDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -29,7 +29,11 @@
* @author Tom Baeyens
*/
public abstract class JpdlActivity implements Activity {
+
+ private static final long serialVersionUID = 1L;
+ protected long dbid;
+
public void execute(ActivityExecution execution) throws Exception {
execute((JpdlExecution) execution);
}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.jpdl.activity;
+
+import org.jbpm.jpdl.JpdlExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(JpdlExecution execution) {
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/deploy/ParseJpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/deploy/ParseJpdlDeployer.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/deploy/ParseJpdlDeployer.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.jpdl.deploy;
+
+import org.jbpm.jpdl.xml.JpdlParser;
+import org.jbpm.pvm.internal.deploy.Deployer;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
+import org.jbpm.pvm.internal.xml.Parse;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ParseJpdlDeployer implements Deployer {
+
+ static JpdlParser jpdlParser = new JpdlParser();
+
+ public void deploy(DeploymentImpl deployment) {
+ for (String fileName: deployment.getFileNames()) {
+ // for all files ending on .jpdl.xml
+ if (fileName.endsWith(".jpdl.xml")) {
+
+ // parse them
+ Parse parse = jpdlParser.createParse();
+ parse.setInputStream(deployment.getFile(fileName));
+ parse.execute();
+
+ // add the parsed xml dom to the deployment documents
+ // so that other subsequent deployers can just use the dom
+ // instead of reparsing the whole jpdl.xml file
+ deployment.addDocument(fileName, parse.getDocument());
+ // add the parsed process definition to the objects
+ // this is where the save process deployer will find it
+ deployment.addObject(fileName, parse.getDocumentObject());
+ // add the parse for error logging
+ deployment.addParse(fileName, parse);
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/deploy/ParseJpdlDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/DecisionBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/DecisionBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/DecisionBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.xml;
-
-import java.util.List;
-
-import org.jbpm.jpdl.activity.DecisionExpressionActivity;
-import org.jbpm.jpdl.activity.DecisionHandlerActivity;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DecisionBinding extends JpdlActivityBinding {
-
- static ObjectBinding objectBinding = new ObjectBinding();
-
- public DecisionBinding() {
- super("decision");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- if (element.hasAttribute("expr")) {
- DecisionExpressionActivity decisionExpressionActivity = new DecisionExpressionActivity();
- String expr = element.getAttribute("expr");
- decisionExpressionActivity.setExpr(expr);
- return decisionExpressionActivity;
- }
-
- if (element.hasAttribute("handler-ref")) {
- String decisionHandlerName = element.getAttribute("handler-ref");
- DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
- decisionHandlerActivity.setDecisionHandlerName(decisionHandlerName);
- return decisionHandlerActivity;
- }
-
- Element handlerElement = XmlUtil.element(element, "handler");
- if (handlerElement!=null) {
- DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
- ObjectDescriptor decisionHandlerDescriptor = (ObjectDescriptor)
- objectBinding.parse(handlerElement, parse, parser);
- decisionHandlerActivity.setDecisionHandlerDescriptor(decisionHandlerDescriptor);
- return decisionHandlerActivity;
- }
-
- boolean hasConditions = false;
- List<Element> transitionElements = XmlUtil.elements(element, "transition");
- if (transitionElements!=null) {
- NodeImpl node = parse.findObject(NodeImpl.class);
- List<TransitionImpl> transitions = (List) node.getOutgoingTransitions();
-
- for (int i=0; i<transitionElements.size(); i++) {
- TransitionImpl transition = transitions.get(i);
- Element transitionElement = transitionElements.get(i);
-
- Element conditionElement = XmlUtil.element(transitionElement, "condition");
- if (conditionElement!=null) {
- hasConditions = true;
- }
-
- if (conditionElement.hasAttribute("expr")) {
- String expr = conditionElement.getAttribute("expr");
- ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr);
- transition.setConditionDescriptor(expressionDescriptor);
-
- } else if (conditionElement.hasAttribute("ref")) {
- String expr = conditionElement.getAttribute("ref");
- ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
- transition.setConditionDescriptor(refDescriptor);
-
- } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
- ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
- transition.setConditionDescriptor(conditionDescriptor);
-
- } else {
- parse.addProblem("decision must have one of {expr attribute, handler-ref attribute, handler element or transition conditions}: "+XmlUtil.toString(element));
- }
- }
- }
-
- parse.addProblem("decision '"+element.getAttribute("name")+"' must have one of: expr attribute, handler attribute, handler element or condition expressions");
-
- return null;
- }
-}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/EndBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/EndBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/EndBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.xml;
+
+import org.jbpm.jpdl.activity.EndActivity;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndBinding extends JpdlActivityBinding {
+
+ public EndBinding() {
+ super("end");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new EndActivity();
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/EndBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java (from rev 2951, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/DecisionBinding.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.xml;
+
+import java.util.List;
+
+import org.jbpm.jpdl.activity.ExclusiveExpressionActivity;
+import org.jbpm.jpdl.activity.ExclusiveHandlerActivity;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveBinding extends JpdlActivityBinding {
+
+ static ObjectBinding objectBinding = new ObjectBinding();
+
+ public ExclusiveBinding() {
+ super("decision");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ if (element.hasAttribute("expr")) {
+ ExclusiveExpressionActivity exclusiveExpressionActivity = new ExclusiveExpressionActivity();
+ String expr = element.getAttribute("expr");
+ exclusiveExpressionActivity.setExpr(expr);
+ return exclusiveExpressionActivity;
+ }
+
+ if (element.hasAttribute("handler-ref")) {
+ String decisionHandlerName = element.getAttribute("handler-ref");
+ ExclusiveHandlerActivity exclusiveHandlerActivity = new ExclusiveHandlerActivity();
+ exclusiveHandlerActivity.setDecisionHandlerName(decisionHandlerName);
+ return exclusiveHandlerActivity;
+ }
+
+ Element handlerElement = XmlUtil.element(element, "handler");
+ if (handlerElement!=null) {
+ ExclusiveHandlerActivity exclusiveHandlerActivity = new ExclusiveHandlerActivity();
+ ObjectDescriptor decisionHandlerDescriptor = (ObjectDescriptor)
+ objectBinding.parse(handlerElement, parse, parser);
+ exclusiveHandlerActivity.setDecisionHandlerDescriptor(decisionHandlerDescriptor);
+ return exclusiveHandlerActivity;
+ }
+
+ boolean hasConditions = false;
+ List<Element> transitionElements = XmlUtil.elements(element, "transition");
+ if (transitionElements!=null) {
+ NodeImpl node = parse.findObject(NodeImpl.class);
+ List<TransitionImpl> transitions = (List) node.getOutgoingTransitions();
+
+ for (int i=0; i<transitionElements.size(); i++) {
+ TransitionImpl transition = transitions.get(i);
+ Element transitionElement = transitionElements.get(i);
+
+ Element conditionElement = XmlUtil.element(transitionElement, "condition");
+ if (conditionElement!=null) {
+ hasConditions = true;
+ }
+
+ if (conditionElement.hasAttribute("expr")) {
+ String expr = conditionElement.getAttribute("expr");
+ ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr);
+ transition.setConditionDescriptor(expressionDescriptor);
+
+ } else if (conditionElement.hasAttribute("ref")) {
+ String expr = conditionElement.getAttribute("ref");
+ ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
+ transition.setConditionDescriptor(refDescriptor);
+
+ } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
+ ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
+ transition.setConditionDescriptor(conditionDescriptor);
+
+ } else {
+ parse.addProblem("decision must have one of {expr attribute, handler-ref attribute, handler element or transition conditions}: "+XmlUtil.toString(element));
+ }
+ }
+ }
+
+ parse.addProblem("decision '"+element.getAttribute("name")+"' must have one of: expr attribute, handler attribute, handler element or condition expressions");
+
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ExclusiveBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -29,6 +29,7 @@
import org.jbpm.activity.Activity;
import org.jbpm.jpdl.JpdlProcessDefinition;
import org.jbpm.log.Log;
+import org.jbpm.model.Node;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
@@ -63,56 +64,75 @@
processDefinition = new JpdlProcessDefinition();
}
- String name = XmlUtil.attribute(documentElement, "name", true, parse);
- processDefinition.setName(name);
-
- String packageName = XmlUtil.attribute(documentElement, "package");
- processDefinition.setPackageName(packageName);
+ StartEvents startEvents = new StartEvents();
+ parse.pushObject(startEvents);
+ try {
+ String name = XmlUtil.attribute(documentElement, "name", true, parse);
+ processDefinition.setName(name);
+
+ String packageName = XmlUtil.attribute(documentElement, "package");
+ processDefinition.setPackageName(packageName);
- Integer version = XmlUtil.attributeInteger(documentElement, "version", false, parse);
- if (version!=null) {
- processDefinition.setVersion(version);
- }
+ Integer version = XmlUtil.attributeInteger(documentElement, "version", false, parse);
+ if (version!=null) {
+ processDefinition.setVersion(version);
+ }
- Element descriptionElement = XmlUtil.element(documentElement, "description");
- if (descriptionElement!=null) {
- String description = XmlUtil.getContentText(descriptionElement);
- processDefinition.setDescription(description);
- }
-
- UnresolvedTransitions unresolvedTransitions = new UnresolvedTransitions();
- parse.pushObject(unresolvedTransitions);
-
- List<Element> elements = XmlUtil.elements(documentElement);
- if (elements!=null) {
- for (Element element: elements) {
- Binding activityBinding = getBinding(element, "activity");
- if (activityBinding!=null) {
- NodeImpl node = (NodeImpl) processDefinition.createNode();
- parseNodeInformation(element, node, parse);
- parse.pushObject(node);
- try {
- Activity activity = (Activity) activityBinding.parse(element, parse, this);
- node.setBehaviour(activity);
- } finally {
- parse.popObject();
+ Element descriptionElement = XmlUtil.element(documentElement, "description");
+ if (descriptionElement!=null) {
+ String description = XmlUtil.getContentText(descriptionElement);
+ processDefinition.setDescription(description);
+ }
+
+ UnresolvedTransitions unresolvedTransitions = new UnresolvedTransitions();
+ parse.pushObject(unresolvedTransitions);
+
+ List<Element> elements = XmlUtil.elements(documentElement);
+ if (elements!=null) {
+ for (Element element: elements) {
+ Binding activityBinding = getBinding(element, "activity");
+ if (activityBinding!=null) {
+ NodeImpl node = (NodeImpl) processDefinition.createNode();
+ parseNodeInformation(element, node, parse);
+ parse.pushObject(node);
+ try {
+ Activity activity = (Activity) activityBinding.parse(element, parse, this);
+ node.setBehaviour(activity);
+ } finally {
+ parse.popObject();
+ }
}
}
}
+
+ for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
+ unresolvedTransition.resolve(processDefinition, parse);
+ }
+
+ // TODO remove the initial attribute parsing
+ String initialNodeName = XmlUtil.attribute(documentElement, "initial", true, parse);
+ if (initialNodeName!=null) {
+ NodeImpl initial = processDefinition.getNode(initialNodeName);
+ if (initial==null) {
+ parse.addProblem("initial node '"+initialNodeName+"' was not found");
+ } else {
+ processDefinition.setInitial(initial);
+ }
+ }
+
+ } finally {
+ parse.popObject();
}
- for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
- unresolvedTransition.resolve(processDefinition, parse);
- }
- String initialNodeName = XmlUtil.attribute(documentElement, "initial", true, parse);
- if (initialNodeName!=null) {
- NodeImpl initial = processDefinition.getNode(initialNodeName);
- if (initial==null) {
- parse.addProblem("initial node '"+initialNodeName+"' was not found");
- } else {
- processDefinition.setInitial(initial);
- }
+ if (startEvents.size()==0) {
+ parse.addProblem("no start event in process");
+ } else if (startEvents.size()>1) {
+ parse.addProblem("multiple start events not yet supported");
+ // TODO verify that all start events have conditions
+ } else {
+ NodeImpl uniqueStartEvent = startEvents.get(0);
+ processDefinition.setInitial(uniqueStartEvent);
}
return processDefinition;
@@ -131,7 +151,7 @@
node.setName(name);
}
- List<Element> transitionElements = XmlUtil.elements(element, "transition");
+ List<Element> transitionElements = XmlUtil.elements(element, "flow");
if (transitionElements!=null) {
UnresolvedTransitions unresolvedTransitions = parse.findObject(UnresolvedTransitions.class);
for (Element transitionElement: transitionElements) {
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ParseJpdlBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ParseJpdlBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ParseJpdlBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.xml;
+
+import org.jbpm.jpdl.deploy.ParseJpdlDeployer;
+import org.jbpm.pvm.internal.wire.binding.WireDescriptorBinding;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ParseJpdlBinding extends WireDescriptorBinding {
+
+ public ParseJpdlBinding() {
+ super("parse-jpdl");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new ObjectDescriptor(ParseJpdlDeployer.class);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/ParseJpdlBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.xml;
+
+import org.jbpm.jpdl.activity.StartActivity;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartBinding extends JpdlActivityBinding {
+
+ public StartBinding() {
+ super("start");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ NodeImpl startEventNode = parse.findObject(NodeImpl.class);
+ StartEvents startEvents = parse.findObject(StartEvents.class);
+ startEvents.add(startEventNode);
+ return new StartActivity();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.model.NodeImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StartEvents {
+
+ List<NodeImpl> startEvents = new ArrayList<NodeImpl>();
+
+
+ public void add(NodeImpl startEventNode) {
+ startEvents.add(startEventNode);
+ }
+
+ public int size() {
+ return startEvents.size();
+ }
+
+ public NodeImpl get(int i) {
+ return startEvents.get(i);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartEvents.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/hibernate.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/hibernate.jpdl.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/hibernate.jpdl.hbm.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <joined-subclass name="org.jbpm.jpdl.JpdlProcessDefinition" table="JBPM_JPDL_PROCDEF" extends="org.jbpm.pvm.internal.model.ProcessDefinitionImpl">
+ <key column="DBID_"/>
+ </joined-subclass>
+
+ <joined-subclass name="org.jbpm.jpdl.JpdlExecution" table="JBPM_JPDL_EXECUTION" extends="org.jbpm.pvm.internal.model.ExecutionImpl">
+ <key column="DBID_"/>
+ </joined-subclass>
+
+ <class name="org.jbpm.jpdl.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <subclass name="org.jbpm.jpdl.activity.StartActivity" discriminator-value="start" />
+ <subclass name="org.jbpm.jpdl.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr" />
+ <subclass name="org.jbpm.jpdl.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler" />
+ <subclass name="org.jbpm.jpdl.activity.StateActivity" discriminator-value="state" />
+ <subclass name="org.jbpm.jpdl.activity.EndActivity" discriminator-value="end" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/hibernate.jpdl.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.activities.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/jpdl/jpdl.activities.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,4 +1,6 @@
<activities>
+ <activity binding="org.jbpm.jpdl.xml.StartBinding" />
<activity binding="org.jbpm.jpdl.xml.StateBinding" />
- <activity binding="org.jbpm.jpdl.xml.DecisionBinding" />
+ <activity binding="org.jbpm.jpdl.xml.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.xml.EndBinding" />
</activities>
\ No newline at end of file
Added: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.hibernate.mappings.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.hibernate.mappings.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.hibernate.mappings.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,3 @@
+<mappings>
+ <mapping resource="org/jbpm/jpdl/hibernate.jpdl.hbm.xml" />
+</mappings>
Property changes on: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.hibernate.mappings.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,3 @@
+<wire-bindings>
+ <binding class="org.jbpm.jpdl.xml.ParseJpdlBinding" />
+</wire-bindings>
Property changes on: jbpm4/trunk/modules/jpdl/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionExpressionTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionExpressionTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.jpdl.controlflow;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.jpdl.JpdlTestCase;
@@ -62,7 +62,7 @@
try {
execution.signal();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
assertTextPresent("expression '#{theWayToGo}' in decision 'b' returned unexisting outgoing transition name: null", e.getMessage());
}
@@ -71,7 +71,7 @@
try {
execution.signal();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
assertTextPresent("expression '#{theWayToGo}' in decision 'b' returned unexisting outgoing transition name: up", e.getMessage());
}
}
Deleted: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/StateTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/StateTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/StateTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.controlflow;
-
-import org.jbpm.PvmException;
-import org.jbpm.client.ClientExecution;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.jpdl.JpdlTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StateTest extends JpdlTestCase {
-
- public void testWaitStatesSequence() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a'>" +
- " <transition to='b' />" +
- " </state>" +
- " <state name='b'>" +
- " <transition to='c' />" +
- " </state>" +
- " <state name='c'>" +
- " <transition to='d' />" +
- " </state>" +
- " <state name='d' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- assertEquals("a", execution.getNode().getName());
- execution.signal();
- assertEquals("b", execution.getNode().getName());
- execution.signal();
- assertEquals("c", execution.getNode().getName());
- execution.signal();
- assertEquals("d", execution.getNode().getName());
- }
-
- public void testExternalDecision() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a'>" +
- " <transition name='left' to='b' />" +
- " <transition name='middle' to='c' />" +
- " <transition name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- execution.signal("left");
- assertEquals("b", execution.getNode().getName());
-
- execution = processDefinition.startProcessInstance();
- execution.signal("middle");
- assertEquals("c", execution.getNode().getName());
-
- execution = processDefinition.startProcessInstance();
- execution.signal("right");
- assertEquals("d", execution.getNode().getName());
- }
-
- public void testDefaultSignalWithNamedTransitions() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a'>" +
- " <transition name='left' to='b' />" +
- " <transition name='middle' to='c' />" +
- " <transition name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- try {
- execution.signal();
- } catch (PvmException e) {
- assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
- }
- }
-
- public void testNamedSignalWithoutMatchingTransition() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a'>" +
- " <transition name='left' to='b' />" +
- " <transition name='middle' to='c' />" +
- " <transition name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- try {
- execution.signal("up");
- } catch (PvmException e) {
- assertTextPresent("no matching transition or event for signal 'up' in state(a)", e.getMessage());
- }
- }
-
- public void testDefaultSignalWithoutTransitions() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- try {
- execution.signal();
- } catch (PvmException e) {
- assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
- }
- }
-}
Added: jbpm4/trunk/modules/jpdl/src/test/resources/hibernate.properties
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/hibernate.properties (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/hibernate.properties 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,11 @@
+hibernate.dialect org.hibernate.dialect.HSQLDialect
+hibernate.connection.driver_class org.hsqldb.jdbcDriver
+hibernate.connection.url jdbc:hsqldb:mem:.
+hibernate.connection.username sa
+hibernate.connection.password
+hibernate.hbm2ddl.auto create-drop
+hibernate.cache.use_second_level_cache true
+hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
+# hibernate.show_sql true
+hibernate.format_sql true
+hibernate.use_sql_comments true
Added: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<contexts xmlns="http://jbpm.org/pvm/1.0/wire">
+
+ <environment-factory>
+
+ <deployer-manager>
+ <language name="jpdl">
+ <parse-jpdl />
+ <check-version />
+ <create-id />
+ <save-process />
+ </language>
+ </deployer-manager>
+
+ <process-service />
+ <execution-service />
+ <management-service />
+
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ <standard-transaction-interceptor />
+ </command-service>
+
+ <hibernate-configuration>
+ <properties resource="hibernate.properties" />
+ <mappings resource="org/jbpm/pvm/pvm.hibernate.mappings.xml" />
+ <cache-configuration resource="org/jbpm/pvm/pvm.cache.xml"
+ usage="nonstrict-read-write" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <job-executor auto-start="false" />
+ <job-test-helper />
+
+ <id-generator />
+ <variable-types resource="org/jbpm/pvm/pvm.types.xml" />
+
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
+
+ </environment-factory>
+
+ <environment>
+ <hibernate-session />
+ <transaction />
+ <pvm-db-session />
+ <job-db-session />
+ <message-session />
+ <timer-session />
+ </environment>
+
+</contexts>
Property changes on: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/jpdl/src/test/resources/log4j.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/log4j.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/log4j.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <appender name="FILE" class="org.apache.log4j.FileAppender">
- <param name="File" value="${log4j.output.dir}/test.log"/>
- <param name="Append" value="false"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <param name="Threshold" value="INFO" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <!-- Apache HTTP Client -->
- <category name="org.apache.commons.httpclient">
- <priority value="INFO" />
- </category>
- <category name="httpclient.wire">
- <priority value="INFO" />
- </category>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <!--appender-ref ref="CONSOLE"/-->
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
\ No newline at end of file
Added: jbpm4/trunk/modules/jpdl/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/logging.properties (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/logging.properties 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,28 @@
+handlers= java.util.logging.ConsoleHandler
+# to add the error triggered file handler
+# handlers= java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler
+
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.log.LogFormatter
+
+# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
+# org.jbpm.util.ErrorTriggeredFileHandler.push = OFF
+# org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log
+
+# For example, set the com.xyz.foo logger to only log SEVERE messages:
+# com.xyz.foo.level = SEVERE
+
+org.jbpm.level=FINEST
+org.jbpm.pvm.internal.tx.level=FINE
+org.jbpm.pvm.internal.wire.level=FINE
+org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=FINEST
+org.hibernate.cfg.HbmBinder.level=SEVERE
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -48,6 +48,7 @@
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-test-base</artifactId>
</dependency>
+
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -73,25 +74,33 @@
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <scope>test</scope>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
</dependency>
<dependency>
+ <groupId>org.livetribe</groupId>
+ <artifactId>livetribe-jsr223</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
+
+<!--
<dependency>
+ <groupId>com.cenqua.clover</groupId>
+ <artifactId>clover</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <!-- Not in scope test because org.jbpm.pvm.test.base package is in main source: see JBPM-1416 -->
- <!-- <scope>test</scope> -->
</dependency>
<dependency>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<exclusions>
@@ -106,18 +115,12 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- </dependency>
- <dependency>
<groupId>cactus</groupId>
<artifactId>cactus</artifactId>
<scope>test</scope>
</dependency>
+ -->
+
</dependencies>
<!-- Plugins -->
@@ -195,6 +198,17 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/ExecutionServiceTest.java</exclude>
+ <exclude>**/AutomaticDecisionDbTest.java</exclude>
+ <exclude>**/PersistentExecutionModeTest.java</exclude>
+ <exclude>**/BasicProcessPersistenceTest.java</exclude>
+ <exclude>**/TimerIntegrationTest.java</exclude>
+ <exclude>**/ProcessServiceTest.java</exclude>
+ <exclude>**/JobExecutorTest.java</exclude>
+ </excludes>
+ </configuration>
</plugin>
</plugins>
</build>
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/DeploymentImpl.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/DeploymentImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,256 +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;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.jbpm.Deployment;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
-import org.jbpm.pvm.internal.stream.ByteArrayStreamSource;
-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.UrlStreamSource;
-import org.jbpm.pvm.internal.util.IoUtil;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Document;
-
-
-/** a deployment unit, containing all information to create a process
- * definition that will be deployed in the persistent store of the
- * Process Virtual Machine.
- *
- * @author Tom Baeyens
- */
-public class DeploymentImpl implements Deployment, Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private static final Parser parser = new Parser();
-
- protected String name;
- protected String language;
-
- protected Map<String, StreamSource> files;
- protected Map<String, Document> documents;
-
- protected ProcessDefinition processDefinition;
- protected Map<String, Object> objects;
-
- public DeploymentImpl() {
- }
-
- public DeploymentImpl(ProcessDefinition processDefinition) {
- setProcessDefinition(processDefinition);
- }
-
-
- public String getLanguage() {
- return language;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-
- public void addResource(String resource) {
- addStreamSource(resource, new ResourceStreamSource(resource));
- }
-
- public void addFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
- }
-
- public void addUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamSource(url));
- }
-
- public void addInputStream(String name, InputStream inputStream) {
- addStreamSource(name, new InputStreamSource(inputStream));
- }
-
- public void addArchiveResource(String resource) {
- this.name = resource;
- ResourceStreamSource streamSource = new ResourceStreamSource(resource);
- addStreamSource(resource, streamSource);
- }
-
- public void addArchiveFile(File file) {
- addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
- }
-
- public void addArchiveUrl(URL url) {
- addStreamSource(url.toString(), new UrlStreamSource(url));
- }
-
- public void addArchive(ZipInputStream zipInputStream) {
- try {
- ZipEntry zipEntry = zipInputStream.getNextEntry();
- while(zipEntry!=null) {
- String entryName = zipEntry.getName();
- byte[] bytes = IoUtil.readBytes(zipInputStream);
- if (bytes!=null) {
- addStreamSource(entryName, new ByteArrayStreamSource(bytes));
- }
- zipEntry = zipInputStream.getNextEntry();
- }
- } catch (Exception e) {
- throw new PvmException("couldn't read zip archive", e);
- }
- }
-
- /** recursively adds all files in a directory using the relative file names */
- public void addDirectory(String directory) {
- if (directory==null) {
- throw new PvmException("directory is null");
- }
- addDirectory(new File(directory), "", false);
- }
-
- /** recursively adds all files in a directory using the canonical file names */
- public void addDirectoryCanonical(String directory) {
- if (directory==null) {
- throw new PvmException("directory is null");
- }
- addDirectory(new File(directory), "", true);
- }
-
- /** recursively adds all files in a directory using the relative file names */
- public void addDirectory(File directory) {
- addDirectory(directory, "", false);
- }
-
- /** recursively adds all files in a directory using the canonical file names */
- public void addDirectoryCanonical(File directory) {
- addDirectory(directory, "", true);
- }
-
- protected void addDirectory(File directory, String relativeDirectoryName, boolean canonicalPathNames) {
- if (directory==null) {
- throw new PvmException("directory is null");
- }
- if (!directory.isDirectory()) {
- throw new PvmException(directory.getAbsolutePath()+" is not a directory");
- }
-
- File[] files = directory.listFiles();
- if (files!=null) {
- for (File file: files) {
- String relativeFileName = (canonicalPathNames ? null : relativeDirectoryName+"/"+file.getName());
- if (file.isFile()) {
- if (canonicalPathNames) {
- try {
- addStreamSource(file.getCanonicalPath(), new FileStreamSource(file));
- } catch (IOException e) {
- throw new PvmException("can't get canonical path name for "+file);
- }
- } else {
- addStreamSource(relativeFileName, new FileStreamSource(file));
- }
- } else if (file.isDirectory()) {
- addDirectory(file, relativeFileName, canonicalPathNames);
- }
- }
- }
- }
-
- protected void addStreamSource(String name, StreamSource streamSource) {
- if (this.name==null) {
- this.name = name;
- }
- if (files==null) {
- files = new HashMap<String, StreamSource>();
- }
- files.put(name, streamSource);
- }
-
- public InputStream getFile(String name) {
- if (files==null) {
- return null;
- }
- StreamSource streamSource = files.get(name);
- return (streamSource!=null ? streamSource.openStream() : null);
- }
-
- public Set<String> getFileNames() {
- if (files==null) {
- return Collections.EMPTY_SET;
- }
- return files.keySet();
- }
-
- public Document getDocument(String name) {
- if ( (documents!=null)
- && (documents.containsKey(name))
- ) {
- return documents.get(name);
- }
- if ( (files!=null)
- && (files.containsKey(name))
- ) {
- InputStream fileStream = getFile(name);
- return parser.createParse()
- .setInputStream(fileStream)
- .execute()
- .checkProblems("deployment file "+name)
- .getDocument();
- }
- return null;
- }
-
- public ProcessDefinition getProcessDefinition() {
- return processDefinition;
- }
-
- public void setProcessDefinition(ProcessDefinition processDefinition) {
- if (language==null) {
- language = "api";
- }
- this.processDefinition = processDefinition;
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
-
- public void addObject(String name, Object object) {
- if (objects!=null) {
- objects = new HashMap<String, Object>();
- }
- objects.put(name, object);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Duration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Duration.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cal/Duration.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* represents a time duration.
@@ -71,10 +71,10 @@
* number = (0..9)+
* unit = (y|year|years|month|months|w|week|weeks|d|day|days|h|hour|hours|min|minute|minutes|s|sec|second|seconds|milli|millis|millisecond|milliseconds)
*
- * @throws PvmException if the parsing is unsuccessful
+ * @throws JbpmException if the parsing is unsuccessful
*/
public Duration(String text) {
- if (text==null) throw new PvmException("text is null");
+ if (text==null) throw new JbpmException("text is null");
for (String part: splitInParts(text)) {
parsePart(part);
@@ -140,7 +140,7 @@
private void parsePart(String part) {
int spaceIndex = part.indexOf(' ');
if (spaceIndex==-1) {
- throw new PvmException("couldn't parse duration part "+part);
+ throw new JbpmException("couldn't parse duration part "+part);
}
String quantityText = part.substring(0, spaceIndex).trim();
spaceIndex = part.lastIndexOf(' ');
@@ -150,11 +150,11 @@
try {
quantity = Integer.parseInt(quantityText);
} catch (NumberFormatException e) {
- throw new PvmException("couldn't parse quantity "+quantityText+" in duration text", e);
+ throw new JbpmException("couldn't parse quantity "+quantityText+" in duration text", e);
}
FieldSetter fieldSetter = fieldSetters.get(unitText);
if (fieldSetter==null) {
- throw new PvmException("couldn't parse quantity "+quantityText);
+ throw new JbpmException("couldn't parse quantity "+quantityText);
}
fieldSetter.set(this, quantity);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandException.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandException.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandException.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,12 +21,12 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
*/
-public class CommandException extends PvmException {
+public class CommandException extends JbpmException {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,11 +22,11 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.deploy.DeployerManager;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
/**
* @author Tom Baeyens
@@ -35,26 +35,29 @@
private static final long serialVersionUID = 1L;
- protected DeploymentImpl deploymentImpl;
+ protected DeploymentImpl deployment;
- public DeployCmd(DeploymentImpl deploymentImpl) {
- this.deploymentImpl = deploymentImpl;
+ public DeployCmd(DeploymentImpl deployment) {
+ this.deployment = deployment;
}
public ProcessDefinition execute(Environment environment) throws Exception {
- ProcessDefinition processDefinition = deploymentImpl.getProcessDefinition();
+ DeployerManager deployerManager = environment.get(DeployerManager.class);
+ if (deployerManager==null) {
+ throw new JbpmException("no "+DeployerManager.class.getName()+" configured");
+ }
+
+ // let the process parser managemer determine the process language
+ // and handle the deployment
+ deployerManager.deploy(deployment);
- if (processDefinition!=null) {
- DeployerManager deployerManager = environment.get(DeployerManager.class);
- if (deployerManager==null) {
- throw new PvmException("no "+DeployerManager.class.getName()+" configured");
+ for (String objectName: deployment.getObjectNames()) {
+ Object object = deployment.getObject(objectName);
+ if (object instanceof ProcessDefinition) {
+ return (ProcessDefinition) object;
}
-
- // let the process parser managemer determine the process language
- // and handle the deployment
- deployerManager.deploy(deploymentImpl);
}
- return processDefinition;
+ return null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -42,18 +42,18 @@
public FindExecutionCmd(String processDefinitionName, String executionKey) {
if (processDefinitionName==null) {
- throw new PvmException("processDefinitionName is null");
+ throw new JbpmException("processDefinitionName is null");
}
this.processDefinitionName = processDefinitionName;
if (executionKey==null) {
- throw new PvmException("executionKey is null");
+ throw new JbpmException("executionKey is null");
}
this.executionKey = executionKey;
}
public FindExecutionCmd(String executionId) {
if (executionId==null) {
- throw new PvmException("executionId is null");
+ throw new JbpmException("executionId is null");
}
this.executionId = executionId;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.model.OpenProcessDefinition;
@@ -41,7 +41,7 @@
public FindProcessDefinitionCmd(String processDefinitionName, int processDefinitionVersion) {
if (processDefinitionName==null) {
- throw new PvmException("processDefinitionName is null");
+ throw new JbpmException("processDefinitionName is null");
}
this.processDefinitionName = processDefinitionName;
this.processDefinitionVersion = processDefinitionVersion;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientExecution;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
@@ -43,11 +43,11 @@
public GetVariablesCmd(String executionId, List<String> variableNames) {
if (executionId==null) {
- throw new PvmException("executionId is null");
+ throw new JbpmException("executionId is null");
}
this.executionId = executionId;
if (variableNames==null) {
- throw new PvmException("variableNames is null");
+ throw new JbpmException("variableNames is null");
}
this.variableNames = variableNames;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientExecution;
import org.jbpm.env.Environment;
@@ -38,7 +38,7 @@
public SetVariablesCmd(String executionId) {
if (executionId==null) {
- throw new PvmException("executionId is null");
+ throw new JbpmException("executionId is null");
}
this.executionId = executionId;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientExecution;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
@@ -55,10 +55,10 @@
// TODO REMOVE
public SignalCmd(String processDefinitionName, String executionKey, String signalName, Map<String, Object> parameters) {
if (processDefinitionName==null) {
- throw new PvmException("processDefinitionName is null");
+ throw new JbpmException("processDefinitionName is null");
}
if (executionKey==null) {
- throw new PvmException("executionKey is null");
+ throw new JbpmException("executionKey is null");
}
this.executionKey = executionKey;
this.signalName = signalName;
@@ -67,7 +67,7 @@
public SignalCmd(String executionKey, String signalName, Map<String, Object> parameters) {
if (executionKey==null) {
- throw new PvmException("executionKey is null");
+ throw new JbpmException("executionKey is null");
}
this.executionKey = executionKey;
this.signalName = signalName;
@@ -85,12 +85,12 @@
if (executionDbid!=null) {
execution = pvmDbSession.get(ExecutionImpl.class, executionDbid);
if (execution==null) {
- throw new PvmException("execution "+executionDbid+" does not exist");
+ throw new JbpmException("execution "+executionDbid+" does not exist");
}
} else {
execution = pvmDbSession.findExecutionById(executionKey);
if (execution==null) {
- throw new PvmException("execution "+executionKey+" does not exist");
+ throw new JbpmException("execution "+executionKey+" does not exist");
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
import org.jbpm.env.Environment;
@@ -53,7 +53,7 @@
processDefinition = pvmDbSession.findProcessDefinitionById(processDefinitionId);
if (processDefinition==null) {
- throw new PvmException("no process definition with id '"+processDefinitionId+"'");
+ throw new JbpmException("no process definition with id '"+processDefinitionId+"'");
}
ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionInLatestCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
import org.jbpm.env.Environment;
@@ -54,7 +54,7 @@
processDefinition = pvmDbSession.findLatestProcessDefinitionByName(processDefinitionName);
if (processDefinition==null) {
- throw new PvmException("no process definition with name '"+processDefinitionName+"'");
+ throw new JbpmException("no process definition with name '"+processDefinitionName+"'");
}
ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CheckVersion.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,12 +21,13 @@
*/
package org.jbpm.pvm.internal.deploy;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.session.PvmDbSession;
/**
@@ -38,29 +39,36 @@
protected boolean assign = true;
- public void deploy(DeploymentImpl deploymentImpl) {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) deploymentImpl.getProcessDefinition();
-
+ public void deploy(DeploymentImpl deployment) {
+ for (String objectName : deployment.getObjectNames()) {
+ Object object = deployment.getObject(objectName);
+ if (object instanceof ProcessDefinition) {
+ checkProcessDefinition((ProcessDefinitionImpl)object);
+ }
+ }
+ }
+
+ public void checkProcessDefinition(ProcessDefinitionImpl processDefinition) {
String name = processDefinition.getName();
if (name == null) {
- throw new PvmException("process must have a name to deploy it");
+ throw new JbpmException("process must have a name to deploy it");
}
int version = processDefinition.getVersion();
if ( (version==ProcessDefinitionImpl.UNASSIGNED_VERSION)
&& ! assign
) {
- throw new PvmException("no version specified in process definition "+name);
+ throw new JbpmException("no version specified in process definition "+name);
}
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("environment is required by deployer check-version");
+ throw new JbpmException("environment is required by deployer check-version");
}
PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
if (pvmDbSession==null) {
- throw new PvmException(PvmDbSession.class.getName()+" is required in the environment by "+getClass().getName());
+ throw new JbpmException(PvmDbSession.class.getName()+" is required in the environment by "+getClass().getName());
}
if ( (version==ProcessDefinitionImpl.UNASSIGNED_VERSION)
@@ -77,7 +85,7 @@
} else {
if (pvmDbSession.findProcessDefinitionByName(name, version) != null) {
- throw new PvmException("process '" + name + "' version " + version + " already exists");
+ throw new JbpmException("process '" + name + "' version " + version + " already exists");
}
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateId.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,10 +21,11 @@
*/
package org.jbpm.pvm.internal.deploy;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
import org.jbpm.log.Log;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
/**
@@ -34,9 +35,16 @@
private static final Log log = Log.getLog(CreateId.class.getName());
- public void deploy(DeploymentImpl deploymentImpl) {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) deploymentImpl.getProcessDefinition();
+ public void deploy(DeploymentImpl deployment) {
+ for (String objectName : deployment.getObjectNames()) {
+ Object object = deployment.getObject(objectName);
+ if (object instanceof ProcessDefinition) {
+ createId((ProcessDefinitionImpl)object);
+ }
+ }
+ }
+ private void createId(ProcessDefinitionImpl processDefinition) {
if (processDefinition.getId()==null) {
String key = processDefinition.getKey();
if (key==null) {
@@ -44,7 +52,7 @@
}
if ("".equals(key)) {
- throw new PvmException("empty string is not a valid key");
+ throw new JbpmException("empty string is not a valid key");
}
// replace any non-word character with an underscore
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/CreateProcess.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,9 +23,9 @@
import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
/**
@@ -42,7 +42,7 @@
if (processDefinition==null) {
if (processDefinitionClass==null) {
- throw new PvmException("create-process deployer improperly configured: no class specified");
+ throw new JbpmException("create-process deployer improperly configured: no class specified");
}
// instantiate
@@ -50,7 +50,7 @@
log.trace("creating new "+processDefinitionClass.getName());
processDefinition = (ProcessDefinition) processDefinitionClass.newInstance();
} catch (Exception e) {
- throw new PvmException("couldn't instantiate process definition with class "+processDefinitionClass);
+ throw new JbpmException("couldn't instantiate process definition with class "+processDefinitionClass);
}
// make the process definition available in the deployment
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/Deployer.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.deploy;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/DeployerManager.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,9 +27,9 @@
import java.util.Map;
import java.util.Map.Entry;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
@@ -59,7 +59,7 @@
public void deploy(DeploymentImpl deploymentImpl) {
if (deploymentImpl==null) {
- throw new PvmException("deployment is null");
+ throw new JbpmException("deployment is null");
}
// find the language based on the extension
@@ -68,7 +68,7 @@
String deploymentName = deploymentImpl.getName();
log.trace("no language specified in deployment, looking for extension in "+deploymentName);
if (deploymentName==null) {
- throw new PvmException("no name nor language specified in deployment");
+ throw new JbpmException("no name nor language specified in deployment");
}
Iterator<Entry<String, String>> iter = extensions.entrySet().iterator();
while ( (iter.hasNext())
@@ -81,7 +81,7 @@
}
if (language==null) {
- throw new PvmException("couldn't find process language matching extension of "+deploymentName+ " for deploying "+deploymentImpl);
+ throw new JbpmException("couldn't find process language matching extension of "+deploymentName+ " for deploying "+deploymentImpl);
}
}
@@ -89,7 +89,7 @@
log.trace("looking up process deployer sequence for language "+language);
List<Deployer> deployerSequence = deployers.get(language);
if (deployerSequence==null) {
- throw new PvmException("couldn't find deployer sequence for language "+language+ " for deploying "+deploymentImpl);
+ throw new JbpmException("couldn't find deployer sequence for language "+language+ " for deploying "+deploymentImpl);
}
log.debug("deploying deployment "+deploymentImpl+" with "+language+"-parser");
@@ -104,7 +104,7 @@
if ( (fileName==null)
|| (fileName.length()==0)
) {
- throw new PvmException("can't extract extension of deployment: no file name");
+ throw new JbpmException("can't extract extension of deployment: no file name");
}
int lastDotIndex = fileName.lastIndexOf('.');
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveProcess.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveProcess.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/deploy/SaveProcess.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,10 +21,11 @@
*/
package org.jbpm.pvm.internal.deploy;
+import org.jbpm.JbpmException;
import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.session.PvmDbSession;
@@ -33,23 +34,33 @@
*/
public class SaveProcess implements Deployer {
- public void deploy(DeploymentImpl deploymentImpl) {
+ private static Log log = Log.getLog(SaveProcess.class.getName());
+
+ public void deploy(DeploymentImpl deployment) {
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("environment is required by "+getClass().getName());
+ throw new JbpmException("environment is required by "+getClass().getName());
}
PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
if (pvmDbSession==null) {
- throw new PvmException(PvmDbSession.class.getName()+" is required in the environment by "+getClass().getName());
+ throw new JbpmException(PvmDbSession.class.getName()+" is required in the environment by "+getClass().getName());
}
+
+ boolean deployedProcess = false;
+ for (String objectName : deployment.getObjectNames()) {
+ Object object = deployment.getObject(objectName);
+ if (object instanceof ProcessDefinition) {
+ deployedProcess = true;
+ log.debug("saving process definition "+object);
+ pvmDbSession.save(object);
+ }
+ }
- ProcessDefinition processDefinition = deploymentImpl.getProcessDefinition();
- if (processDefinition==null) {
- throw new PvmException("a process definition in the deployment is required by "+getClass().getName());
+ if (!deployedProcess) {
+ log.info("no process definition in "+deployment);
}
-
- pvmDbSession.save(processDefinition);
+
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Context;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
@@ -160,7 +160,7 @@
Environment popped = Environment.popEnvironment();
if (this!=popped) {
- throw new PvmException("environment nesting problem");
+ throw new JbpmException("environment nesting problem");
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ConverterType.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -32,7 +32,7 @@
import org.hibernate.HibernateException;
import org.hibernate.type.ImmutableType;
import org.hibernate.usertype.ParameterizedType;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.util.ReflectUtil;
@@ -90,7 +90,7 @@
Converter converter = (Converter) converterClass.newInstance();
converters.put(converterName, converter);
} catch (Exception e) {
- throw new PvmException("couldn't initialize converter type "+converterClassName, e);
+ throw new JbpmException("couldn't initialize converter type "+converterClassName, e);
}
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jms/JmsMessageSession.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import javax.jms.MessageProducer;
import javax.jms.Session;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.job.Message;
import org.jbpm.session.DbSession;
import org.jbpm.session.MessageSession;
@@ -66,7 +66,7 @@
try {
messageProducer.send(jmsMessage);
} catch (Exception e) {
- throw new PvmException("couldn't send jms message: "+e.getMessage(), e);
+ throw new JbpmException("couldn't send jms message: "+e.getMessage(), e);
} finally {
messageProducer.close();
}
@@ -86,7 +86,7 @@
*/
} catch (JMSException e) {
- throw new PvmException("couldn't send jms message", e);
+ throw new JbpmException("couldn't send jms message", e);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/MessageImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/MessageImpl.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/MessageImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.job;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.job.Message;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -46,7 +46,7 @@
protected void unlockExecution() {
if (execution == null) {
- throw new PvmException("This message isn't bound to any execution");
+ throw new JbpmException("This message isn't bound to any execution");
}
execution.unlock();
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
import org.jbpm.job.Timer;
@@ -74,7 +74,7 @@
) {
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("no environment to get business calendar for calculating dueDate "+dueDateDescription);
+ throw new JbpmException("no environment to get business calendar for calculating dueDate "+dueDateDescription);
}
BusinessCalendar businessCalendar = environment.get(BusinessCalendar.class);
dueDate = businessCalendar.add(now, duration);
@@ -94,7 +94,7 @@
if (log.isDebugEnabled()) log.debug("executing " + this);
if (environment==null) {
- throw new PvmException("environment is null");
+ throw new JbpmException("environment is null");
}
JobContext jobContext = new JobContext(this);
@@ -122,7 +122,7 @@
if (log.isDebugEnabled()) log.debug("deleting " + this);
JobDbSession dbSession = environment.get(JobDbSession.class);
if (dbSession==null) {
- throw new PvmException("no "+JobDbSession.class.getName()+" in environment");
+ throw new JbpmException("no "+JobDbSession.class.getName()+" in environment");
}
dbSession.delete(this);
@@ -145,7 +145,7 @@
if (jobExecutor!=null) {
Transaction transaction = environment.get(Transaction.class);
if (transaction==null) {
- throw new PvmException("no transaction in environment");
+ throw new JbpmException("no transaction in environment");
}
JobAddedNotification jobNotificator = new JobAddedNotification(jobExecutor);
transaction.registerSynchronization(jobNotificator);
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Date;
import org.hibernate.Session;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -53,7 +53,7 @@
public Job execute(Environment environment) throws Exception {
JobDbSession session = environment.get(JobDbSession.class);
if (session==null) {
- throw new PvmException("no job session configured to get job "+jobDbid+" for execution");
+ throw new JbpmException("no job session configured to get job "+jobDbid+" for execution");
}
JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
@@ -73,7 +73,7 @@
long lockExpiration = lockExpirationDate.getTime();
long currentTime = System.currentTimeMillis();
if (currentTime>lockExpiration) {
- throw new PvmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
+ throw new JbpmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
}
}
} catch (Throwable exception) {
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import javax.transaction.Synchronization;
import org.hibernate.Session;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -71,7 +71,7 @@
// load the jobImpl from the db
JobDbSession session = environment.get(JobDbSession.class);
if (session==null) {
- throw new PvmException("no job-session configured to handle job");
+ throw new JbpmException("no job-session configured to handle job");
}
JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
// serialize the stack trace
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -30,7 +30,7 @@
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.log.Log;
@@ -75,7 +75,7 @@
/** starts the {@link DispatcherThread} and {@link JobExecutorThread}s for this jobImpl executor */
public synchronized void start() {
if (commandService==null) {
- throw new PvmException("no command executor available in jobImpl executor");
+ throw new JbpmException("no command executor available in jobImpl executor");
}
if (! isActive) {
acquireJobsCommand = new AcquireJobsCmd(this);
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.jobexecutor;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
import org.jbpm.job.Message;
@@ -57,7 +57,7 @@
log.trace("registering job executor notifier with "+transaction);
JobExecutor jobExecutor = Environment.getCurrent().get(JobExecutor.class);
if (jobExecutor==null) {
- throw new PvmException("no job executor configured to execute "+message);
+ throw new JbpmException("no job executor configured to execute "+message);
}
transaction.registerSynchronization(new JobAddedNotification(jobExecutor));
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorServlet.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -30,7 +30,7 @@
import javax.servlet.http.HttpServletResponse;
import org.jbpm.Configuration;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cfg.JbpmConfiguration;
import org.jbpm.env.EnvironmentFactory;
@@ -86,7 +86,7 @@
EnvironmentFactory environmentFactory = (EnvironmentFactory) new Configuration().setResource(configurationResource).buildProcessEngine();
jobExecutor = environmentFactory.get(JobExecutor.class);
if (jobExecutor==null) {
- throw new PvmException("no jobImpl executor configured in resource "+configurationResource);
+ throw new JbpmException("no jobImpl executor configured in resource "+configurationResource);
}
jobExecutor.start();
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -13,7 +13,7 @@
**/
package org.jbpm.pvm.internal.jobexecutor;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Transaction;
import org.jbpm.job.Timer;
import org.jbpm.log.Log;
@@ -54,18 +54,18 @@
protected void validate(Timer timer) {
if (timer == null)
- throw new PvmException("null timer scheduled");
+ throw new JbpmException("null timer scheduled");
if (timer.getExecution() == null) {
- throw new PvmException("timer has no execution specified");
+ throw new JbpmException("timer has no execution specified");
}
if ( (timer.getSignalName() == null)
&& (timer.getEventName() == null)
)
- throw new PvmException("timer has no signalName or eventName specified");
+ throw new JbpmException("timer has no signalName or eventName specified");
if (timer.getDueDate() == null)
- throw new PvmException("timer scheduled at null date");
+ throw new JbpmException("timer scheduled at null date");
if (timer.getDueDate().getTime() < 0)
- throw new PvmException("timer scheduled with a negative date");
+ throw new JbpmException("timer scheduled with a negative date");
}
public void cancel(Timer timer) {
@@ -73,7 +73,7 @@
if (timer != null) {
jobDbSession.delete(timer);
} else {
- throw new PvmException("timer is null");
+ throw new JbpmException("timer is null");
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/BlobStrategyBlob.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/BlobStrategyBlob.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/BlobStrategyBlob.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.sql.SQLException;
import org.hibernate.Hibernate;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
public class BlobStrategyBlob implements BlobStrategy {
@@ -19,7 +19,7 @@
try {
return sqlBlob.getBytes(1, (int) sqlBlob.length());
} catch (SQLException e) {
- throw new PvmException("couldn't extract bytes out of blob", e);
+ throw new JbpmException("couldn't extract bytes out of blob", e);
}
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/ClobStrategyClob.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/ClobStrategyClob.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/ClobStrategyClob.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.sql.SQLException;
import org.hibernate.Hibernate;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
public class ClobStrategyClob implements ClobStrategy {
@@ -21,7 +21,7 @@
String text = sqlClob.getSubString(1, length);
return text.toCharArray();
} catch (SQLException e) {
- throw new PvmException("couldn't extract chars out of clob", e);
+ throw new JbpmException("couldn't extract chars out of clob", e);
}
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CommentImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import java.util.Date;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.model.Comment;
import org.jbpm.pvm.internal.util.Clock;
@@ -62,7 +62,7 @@
public Comment createComment(String message) {
if (message==null) {
- throw new PvmException("message is null");
+ throw new JbpmException("message is null");
}
if (this.comments==null) {
comments = new ArrayList<CommentImpl>();
@@ -74,7 +74,7 @@
public void removeComment(Comment comment) {
if (comment==null) {
- throw new PvmException("reply is null");
+ throw new JbpmException("reply is null");
}
if (comments!=null) {
if (comments.remove(comment)) {
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
@@ -124,7 +124,7 @@
log.trace("registering exception handler to "+transaction);
CommandService commandService = environment.get(CommandService.class);
if (commandService==null) {
- throw new PvmException("environment doesn't have a command service for registering transactional exception handler", exception);
+ throw new JbpmException("environment doesn't have a command service for registering transactional exception handler", exception);
}
ExceptionHandlerSynchronization exceptionHandlerSynchronization = new ExceptionHandlerSynchronization(
this, execution,
@@ -135,9 +135,9 @@
// to avoid a dependency on class Synchronization
exceptionHandlerSynchronization.register(transaction);
log.trace("registering exception handler to "+transaction);
- throw new PvmException("transaction exception handler registered handler after transaction completed. make sure this transaction is rolled back", exception);
+ throw new JbpmException("transaction exception handler registered handler after transaction completed. make sure this transaction is rolled back", exception);
} else {
- throw new PvmException("no transaction present in the environment for transactional exception handler", exception);
+ throw new JbpmException("no transaction present in the environment for transactional exception handler", exception);
}
} else {
executeHandler(execution, exception);
@@ -156,7 +156,7 @@
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
- throw new PvmException("couldn't execute "+eventListener, e);
+ throw new JbpmException("couldn't execute "+eventListener, e);
}
}
}
@@ -222,7 +222,7 @@
if (exception instanceof RuntimeException) {
throw (RuntimeException) exception;
} else {
- throw new PvmException(prefixMessage+": "+exception.getMessage(), exception);
+ throw new JbpmException(prefixMessage+": "+exception.getMessage(), exception);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import javax.transaction.Status;
import javax.transaction.Synchronization;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -60,7 +60,7 @@
// reload the execution
DbSession dbSession = environment.get(DbSession.class);
if (dbSession==null) {
- throw new PvmException("no "+DbSession.class.getName()+" available in the environment for reloading the execution");
+ throw new JbpmException("no "+DbSession.class.getName()+" available in the environment for reloading the execution");
}
execution = dbSession.get(ExecutionImpl.class, execution.getDbid());
exceptionHandler.executeHandler(execution, exception);
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -36,7 +36,7 @@
import java.util.Set;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.ActivityExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
@@ -206,7 +206,7 @@
public void start() {
if (state!=STATE_CREATED) {
- throw new PvmException(toString()+" is already begun: "+state);
+ throw new JbpmException(toString()+" is already begun: "+state);
}
ExecutionImpl scopedExecution = initializeScopes();
this.state = STATE_ACTIVE;
@@ -302,14 +302,14 @@
public void stop(String state) {
if (state==null) {
- throw new PvmException("state is null");
+ throw new JbpmException("state is null");
}
if (state.equals(STATE_ACTIVE)
|| state.equals(STATE_CREATED)
|| state.equals(STATE_INACTIVE)
|| state.equals(STATE_SUSPENDED)
|| state.equals(STATE_ASYNC)) {
- throw new PvmException("invalid end state: "+state);
+ throw new JbpmException("invalid end state: "+state);
}
if (log.isDebugEnabled()) {
@@ -348,7 +348,7 @@
/** @see Execution#suspend() */
public void suspend() {
if (isSuspended()) {
- throw new PvmException(toString()+" is suspended");
+ throw new JbpmException(toString()+" is suspended");
}
lock(STATE_SUSPENDED);
}
@@ -356,7 +356,7 @@
/** @see Execution#resume() */
public void resume() {
if (! isSuspended()) {
- throw new PvmException(toString()+" is not suspended");
+ throw new JbpmException(toString()+" is not suspended");
}
unlock();
}
@@ -382,7 +382,7 @@
} else if (transition!=null) {
performAtomicOperation(ExecutionImpl.PROCEED_TO_DESTINATION);
} else {
- throw new PvmException("execution is not in a node or in a transition");
+ throw new JbpmException("execution is not in a node or in a transition");
}
}
@@ -408,7 +408,7 @@
public void takeDefaultTransition() {
TransitionImpl defaultTransition = node.getDefaultTransition();
if (defaultTransition==null) {
- throw new PvmException("there is no default transition in "+node);
+ throw new JbpmException("there is no default transition in "+node);
}
take(defaultTransition);
}
@@ -416,11 +416,11 @@
/** @see Execution#take(String) */
public void take(String transitionName) {
if (node==null) {
- throw new PvmException(toString()+" is not positioned in node");
+ throw new JbpmException(toString()+" is not positioned in node");
}
TransitionImpl transition = findTransition(transitionName);
if (transition==null) {
- throw new PvmException("there is no transition "+transitionName+" in "+node);
+ throw new JbpmException("there is no transition "+transitionName+" in "+node);
}
take(transition);
}
@@ -448,11 +448,11 @@
/** @see Execution#execute(String) */
public void execute(String nodeName) {
if (node==null) {
- throw new PvmException("node is null");
+ throw new JbpmException("node is null");
}
Node nestedNode = node.getNode(nodeName);
if (nestedNode==null) {
- throw new PvmException("node "+nodeName+" doesn't exist in "+node);
+ throw new JbpmException("node "+nodeName+" doesn't exist in "+node);
}
execute(nestedNode);
}
@@ -460,7 +460,7 @@
/** @see Execution#execute(Node) */
public void execute(Node node) {
if (node==null) {
- throw new PvmException("node is null");
+ throw new JbpmException("node is null");
}
checkLock();
@@ -612,7 +612,7 @@
public void createVariable(String key, Object value, String typeName, Type type) {
if (isFinished()) {
- throw new PvmException("can't create variable '"+key+"' on "+this+": "+state);
+ throw new JbpmException("can't create variable '"+key+"' on "+this+": "+state);
}
log.debug("create variable '"+key+"' in '"+this+"' with value '"+value+"'");
@@ -640,7 +640,7 @@
log.trace("creating new "+type+" variable "+key);
variable = (Variable) variableClass.newInstance();
} catch (Exception e) {
- throw new PvmException("couldn't instantiate variable instance class '"+variableClass.getName()+"'");
+ throw new JbpmException("couldn't instantiate variable instance class '"+variableClass.getName()+"'");
}
Converter converter = type.getConverter();
variable.setConverter(converter);
@@ -670,7 +670,7 @@
public void setVariable(String key, Object value) {
if (isFinished()) {
- throw new PvmException("can't update variable '"+key+"' on "+this+": "+state);
+ throw new JbpmException("can't update variable '"+key+"' on "+this+": "+state);
}
Variable variable = getVariableObject(key);
// if there is already a variable instance and it doesn't support the current type...
@@ -768,7 +768,7 @@
public boolean removeVariable(String key) {
if (isFinished()) {
- throw new PvmException("can't remove variable '"+key+"' on "+this+": "+state);
+ throw new JbpmException("can't remove variable '"+key+"' on "+this+": "+state);
}
Variable variable = null;
@@ -823,11 +823,11 @@
// get the TimerSession from the environment
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("non environment for initializing timers");
+ throw new JbpmException("non environment for initializing timers");
}
TimerSession timerSession = environment.get(TimerSession.class);
if (timerSession==null) {
- throw new PvmException("no TimerSession in environment for initializing timers");
+ throw new JbpmException("no TimerSession in environment for initializing timers");
}
for (Timer timer : timers) {
timerSession.cancel(timer);
@@ -849,7 +849,7 @@
if ( (eventName==null)
&& (signalName==null)
) {
- throw new PvmException("no event or signal specified");
+ throw new JbpmException("no event or signal specified");
}
if (log.isDebugEnabled()) {
log.debug("creating timer on "+this.toString());
@@ -890,11 +890,11 @@
// get the TimerSession from the environment
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("non environment for initializing timers");
+ throw new JbpmException("non environment for initializing timers");
}
TimerSession timerSession = environment.get(TimerSession.class);
if (timerSession==null) {
- throw new PvmException("no TimerSession in environment for initializing timers");
+ throw new JbpmException("no TimerSession in environment for initializing timers");
}
// schedule the timer with the TimerSession
@@ -924,7 +924,7 @@
/** @see Execution#lock(String) */
public void lock(String state) {
if (state==null) {
- throw new PvmException("given state is null");
+ throw new JbpmException("given state is null");
}
checkLock();
log.trace("locking "+this);
@@ -934,7 +934,7 @@
/** @see Execution#unlock() */
public void unlock() {
if (STATE_ACTIVE.equals(state)) {
- throw new PvmException("state is already active");
+ throw new JbpmException("state is already active");
}
log.trace("unlocking "+this);
this.state = STATE_ACTIVE;
@@ -970,7 +970,7 @@
protected void checkLock() {
if (!STATE_ACTIVE.equals(state)) {
- throw new PvmException(toString()+" is not active: "+state);
+ throw new JbpmException(toString()+" is not active: "+state);
}
}
@@ -980,7 +980,7 @@
Environment environment = Environment.getCurrent();
MessageSession messageSession = environment.get(MessageSession.class);
if (messageSession==null) {
- throw new PvmException("no message-session configured to send asynchronous continuation message");
+ throw new JbpmException("no message-session configured to send asynchronous continuation message");
}
MessageImpl<?> asyncMessage = operation.createAsyncMessage(this);
lock("async continuation message "+asyncMessage);
@@ -1137,7 +1137,7 @@
public Comment createComment(String message) {
if (message==null) {
- throw new PvmException("message is null");
+ throw new JbpmException("message is null");
}
CommentImpl comment = new CommentImpl(message);
addComment(comment);
@@ -1150,7 +1150,7 @@
public void addComment(CommentImpl comment) {
if (comment==null) {
- throw new PvmException("comment is null");
+ throw new JbpmException("comment is null");
}
if (comments==null) {
comments = new LinkedHashSet<CommentImpl>();
@@ -1238,7 +1238,7 @@
// invalidate the executionsMap cache
executionsMap = null;
} else {
- throw new PvmException(child+" is not a child execution of "+this);
+ throw new JbpmException(child+" is not a child execution of "+this);
}
}
}
@@ -1279,7 +1279,7 @@
public ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition, String key) {
if (subProcessInstance!=null) {
- throw new PvmException(toString()+" already has a sub process instance: "+subProcessInstance);
+ throw new JbpmException(toString()+" already has a sub process instance: "+subProcessInstance);
}
subProcessInstance = (ExecutionImpl) processDefinition.createProcessInstance(key);
subProcessInstance.setSuperProcessExecution(this);
@@ -1342,9 +1342,9 @@
public <T> T getExtension(Class<T> extensionClass) {
if (extensionClass==null) {
- throw new PvmException("extensionClass is null. and this execution doesn't support extensions");
+ throw new JbpmException("extensionClass is null. and this execution doesn't support extensions");
}
- throw new PvmException("unsuppported extension "+extensionClass.getName());
+ throw new JbpmException("unsuppported extension "+extensionClass.getName());
}
// equals ///////////////////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.Activity;
import org.jbpm.model.Node;
import org.jbpm.model.Transition;
@@ -367,7 +367,7 @@
public Activity getBehaviour() {
Activity behaviour = ( behaviourReference!=null ? behaviourReference.get() : null);
if (behaviour==null) {
- throw new PvmException("no behaviour on "+this);
+ throw new JbpmException("no behaviour on "+this);
}
return behaviour;
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.ExternalActivity;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.job.MessageImpl;
@@ -69,7 +69,7 @@
throw e;
} catch (Exception e) {
- throw new PvmException("couldn't signal "+node+": "+e.getMessage(), e);
+ throw new JbpmException("couldn't signal "+node+": "+e.getMessage(), e);
}
if (execution.getPropagation() == Propagation.UNSPECIFIED) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,7 +28,7 @@
import javax.script.ScriptException;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.env.ExecutionContext;
import org.jbpm.pvm.internal.env.ExecutionEnvironment;
@@ -95,18 +95,18 @@
/** evaluates the script with the given language.
* If script is null, then this method will return null.
- * @throws PvmException if language is null.
+ * @throws JbpmException if language is null.
*/
public Object evaluate(String script, Execution execution, String language) {
if (script==null) {
return null;
}
if (language==null) {
- throw new PvmException("no language specified");
+ throw new JbpmException("no language specified");
}
ScriptEngine scriptEngine = scriptEngineManager.getEngineByName(language);
if (scriptEngine==null) {
- throw new PvmException("no scripting engine configured for language "+language);
+ throw new JbpmException("no scripting engine configured for language "+language);
}
if (execution==null) {
@@ -139,7 +139,7 @@
try {
return scriptEngine.eval(script);
} catch (ScriptException e) {
- throw new PvmException("script evaluation error: "+e.getMessage(), e);
+ throw new JbpmException("script evaluation error: "+e.getMessage(), e);
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ByteArrayStreamSource.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
@@ -33,10 +33,10 @@
protected byte[] bytes;
- /** @throws PvmException if bytes is null */
+ /** @throws JbpmException if bytes is null */
public ByteArrayStreamSource(byte[] bytes) {
if (bytes==null) {
- throw new PvmException("bytes is null");
+ throw new JbpmException("bytes is null");
}
this.name = "byte-array";
this.bytes = bytes;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/FileStreamSource.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.io.InputStream;
import java.net.MalformedURLException;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
@@ -35,10 +35,10 @@
protected File file;
- /** @throws PvmException if file is null */
+ /** @throws JbpmException if file is null */
public FileStreamSource(File file) {
if (file==null) {
- throw new PvmException("file is null");
+ throw new JbpmException("file is null");
}
try {
@@ -55,15 +55,15 @@
try {
if (!file.exists()) {
- throw new PvmException("file "+file+" doesn't exist");
+ throw new JbpmException("file "+file+" doesn't exist");
}
if (file.isDirectory()) {
- throw new PvmException("file "+file+" is a directory");
+ throw new JbpmException("file "+file+" is a directory");
}
stream = new FileInputStream(file);
} catch (Exception e) {
- throw new PvmException("couldn't access file "+file+": "+e.getMessage(), e);
+ throw new JbpmException("couldn't access file "+file+": "+e.getMessage(), e);
}
return stream;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/InputStreamSource.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.io.InputStream;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
@@ -34,7 +34,7 @@
public InputStreamSource(InputStream inputStream) {
if (inputStream==null) {
- throw new PvmException("inputStream is null");
+ throw new JbpmException("inputStream is null");
}
this.name = "input-stream";
this.inputStream = inputStream;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/ResourceStreamSource.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.io.InputStream;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.util.ReflectUtil;
/**
@@ -34,15 +34,15 @@
protected ClassLoader classLoader;
protected String resource;
- /** @throws PvmException if resource is null */
+ /** @throws JbpmException if resource is null */
public ResourceStreamSource(String resource) {
this(resource, null);
}
- /** @throws PvmException if resource is null */
+ /** @throws JbpmException if resource is null */
public ResourceStreamSource(String resource, ClassLoader classLoader) {
if (resource==null) {
- throw new PvmException("resource is null");
+ throw new JbpmException("resource is null");
}
this.name = "resource://"+resource;
this.resource = resource;
@@ -52,7 +52,7 @@
public InputStream openStream() {
InputStream stream = ReflectUtil.getResourceAsStream(classLoader, resource);
if (stream==null) {
- throw new PvmException("resource "+resource+" does not exist");
+ throw new JbpmException("resource "+resource+" does not exist");
}
return stream;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/stream/UrlStreamSource.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.io.InputStream;
import java.net.URL;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
@@ -34,10 +34,10 @@
protected URL url;
- /** @throws PvmException if url is null */
+ /** @throws JbpmException if url is null */
public UrlStreamSource(URL url) {
if (url==null) {
- throw new PvmException("url is null");
+ throw new JbpmException("url is null");
}
this.name = url.toString();
this.url = url;
@@ -48,7 +48,7 @@
try {
stream = url.openStream();
} catch (IOException e) {
- throw new PvmException("couldn't open URL stream", e);
+ throw new JbpmException("couldn't open URL stream", e);
}
return stream;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.svc;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -38,11 +38,11 @@
public <T> T execute(Command<T> command) {
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("no environment for verifying authorization");
+ throw new JbpmException("no environment for verifying authorization");
}
MessageSession messageSession = environment.get(MessageSession.class);
if (messageSession==null) {
- throw new PvmException("no message session for executing command asynchronously");
+ throw new JbpmException("no message session for executing command asynchronously");
}
String userId = (propagateUserId ? environment.getUserId() : null);
messageSession.send(new AsyncCommandMessage(command, userId));
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.svc;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
@@ -33,11 +33,11 @@
public <T> T execute(Command<T> command) {
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("no environment for verifying authorization");
+ throw new JbpmException("no environment for verifying authorization");
}
AuthorizationSession authorizationSession = environment.get(AuthorizationSession.class);
if (authorizationSession==null) {
- throw new PvmException("no AuthorizationSession in environment for verifying authorization");
+ throw new JbpmException("no AuthorizationSession in environment for verifying authorization");
}
authorizationSession.checkPermission(command, environment);
// if the authorization check succeeded, proceed
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.svc;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.ExecutionService;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
-import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.SignalCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionInLatestCmd;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CommandExecutionService implements ExecutionService {
-
- protected CommandService commandService;
-
- public Execution startExecution(String processDefinitionId){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, null, null));
- }
-
- public Execution startExecution(String processDefinitionId, String executionKey) {
- return commandService.execute(new StartExecutionCmd(processDefinitionId, null, executionKey));
- }
-
- public Execution startExecution(String processDefinitionId, Map<String, Object> variables){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, null));
- }
-
- public Execution startExecution(String processDefinitionId, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, executionKey));
- }
-
- public Execution startExecutionInLatest(String processDefinitionName) {
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, null, null));
- }
-
- public Execution startExecutionInLatest(String processDefinitionName, Map<String, Object> variables){
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, variables, null));
- }
-
- public Execution startExecutionInLatest(String processDefinitionName, String executionKey) {
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, null, executionKey));
- }
-
- public Execution startExecutionInLatest(String processDefinitionName, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, variables, executionKey));
- }
-
-
- public Execution signalExecution(String executionId) {
- return commandService.execute(new SignalCmd(executionId, null, null));
- }
-
- public Execution signalExecution(String executionId, String signalName) {
- return commandService.execute(new SignalCmd(executionId, signalName, null));
- }
-
- public Execution signalExecution(String executionId, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionId, signalName, parameters));
- }
-
- public Execution signalExecution(String executionId, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionId, null, parameters));
- }
-
-
- public Execution signalExecution(long executionDbid) {
- return commandService.execute(new SignalCmd(executionDbid, null, null));
- }
-
- public Execution signalExecution(long executionDbid, String signalName) {
- return commandService.execute(new SignalCmd(executionDbid, signalName, null));
- }
-
- public Execution signalExecution(long executionDbid, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionDbid, signalName, parameters));
- }
-
- public Execution signalExecution(long executionDbid, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionDbid, null, parameters));
- }
-
- public Execution signalExecutionByKey(String processDefinitionName, String executionKey) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, null));
- }
-
- public Execution signalExecutionByKey(String processDefinitionName, String executionKey, String signalName) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, null));
- }
-
- public Execution signalExecutionByKey(String processDefinitionName, String executionKey, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, parameters));
- }
-
- public Execution signalExecutionByKey(String processDefinitionName, String executionKey, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, parameters));
- }
-
- public Execution findExecution(String processDefinitionName, String key) {
- return commandService.execute(new FindExecutionCmd(processDefinitionName, key));
- }
-
- public Execution findExecution(String executionId) {
- return commandService.execute(new FindExecutionCmd(executionId));
- }
-
- public Object getVariable(String executionId, String variableName) {
- List<String> variableNames = new ArrayList<String>();
- variableNames.add(variableName);
- Map<String, Object> variables = commandService.execute(new GetVariablesCmd(executionId, variableNames));
- return variables.get(variableName);
- }
-
- public Map<String, Object> getVariables(String executionId, List<String> variableNames) {
- return commandService.execute(new GetVariablesCmd(executionId, variableNames));
- }
-
- public Execution setVariable(String executionId, String name, Object value) {
- SetVariablesCmd cmd = new SetVariablesCmd(executionId);
- cmd.addVariable(name, value);
- return commandService.execute(cmd);
- }
-
- public Execution setVariables(String executionId, Map<String, Object> variables) {
- SetVariablesCmd cmd = new SetVariablesCmd(executionId);
- cmd.setVariables(variables);
- return commandService.execute(cmd);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.svc;
-
-import java.util.List;
-
-import org.jbpm.ManagementService;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.job.Job;
-import org.jbpm.job.Message;
-import org.jbpm.job.Timer;
-import org.jbpm.pvm.internal.cmd.GetMessagesCmd;
-import org.jbpm.pvm.internal.cmd.GetTimersCmd;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CommandManagementService implements ManagementService {
-
- protected CommandService commandService;
-
- public void executeJob(String jobId) {
- // TODO
- }
-
- public List<Job> getJobsWithException(int firstResult, int maxResults) {
- // TODO
- return null;
- }
-
- public List<Message> getMessages(int firstResult, int maxResults) {
- return commandService.execute(new GetMessagesCmd(firstResult, maxResults));
- }
-
- public List<Timer> getTimers(int firstResult, int maxResults) {
- return commandService.execute(new GetTimersCmd(firstResult, maxResults));
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.internal.svc;
-
-import java.util.List;
-
-import org.jbpm.Deployment;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.ProcessService;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
-import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionNamesCmd;
-import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsCmd;
-
-/** {@link ProcessService} implementation that delegates execution of the
- * methods to a {@link CommandService}.
- *
- * @author Tom Baeyens
- */
-public class CommandProcessService implements ProcessService {
-
- protected CommandService commandService;
-
- public ProcessDefinition deploy(OpenProcessDefinition processDefinition) {
- DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
- return commandService.execute(new DeployCmd(deploymentImpl));
- }
-
- public Deployment createDeployment() {
- return new DeploymentImpl();
- }
-
- public ProcessDefinition deploy(Deployment deployment) {
- return commandService.execute(new DeployCmd((DeploymentImpl)deployment));
- }
-
- public ProcessDefinition findLatestProcessDefinition(String processDefinitionName) {
- return commandService.execute(new FindLatestProcessDefinitionCmd(processDefinitionName));
- }
-
- public ProcessDefinition findProcessDefinition(String processDefinitionName, int version) {
- return commandService.execute(new FindProcessDefinitionCmd(processDefinitionName, version));
- }
-
- public List<String> findProcessDefinitionNames() {
- return commandService.execute(new FindProcessDefinitionNamesCmd());
- }
-
- public List<ProcessDefinition> findProcessDefinitions(String processDefinitionName) {
- return (List)commandService.execute(new FindProcessDefinitionsCmd(processDefinitionName));
- }
-
- public CommandService getCommandService() {
- return commandService;
- }
- public void setCommandService(CommandService commandService) {
- this.commandService = commandService;
- }
-}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.svc;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
@@ -47,7 +47,7 @@
} catch (Exception e) {
log.error("exception while executing command "+command, e);
- throw new PvmException("exception while executing command "+command, e);
+ throw new JbpmException("exception while executing command "+command, e);
}
}
}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java (from rev 2951, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/DeploymentImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,362 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.svc;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.jbpm.Deployment;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.JbpmException;
+import org.jbpm.pvm.internal.stream.ByteArrayStreamSource;
+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.util.IoUtil;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Document;
+
+
+/** a deployment unit, containing all information to create a process
+ * definition that will be deployed in the persistent store of the
+ * Process Virtual Machine.
+ *
+ * @author Tom Baeyens
+ */
+public class DeploymentImpl implements Deployment, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Parser parser = new Parser();
+
+ protected ProcessServiceImpl processServiceImpl;
+
+ protected String name;
+ protected String language;
+
+ protected Map<String, StreamSource> files;
+ protected Map<String, Document> documents;
+ protected Map<String, Object> objects;
+
+ protected List<DeploymentParse> deploymentParses;
+
+ protected ProcessDefinition processDefinition;
+
+ public DeploymentImpl(ProcessServiceImpl processServiceImpl) {
+ this.processServiceImpl = processServiceImpl;
+ }
+
+ // TODO REMOVE
+ public DeploymentImpl() {
+ }
+
+ // TODO REMOVE replace with addObject
+ public DeploymentImpl(ProcessDefinition processDefinition) {
+ setProcessDefinition(processDefinition);
+ }
+
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public Deployment setLanguage(String language) {
+ this.language = language;
+ return this;
+ }
+
+ public Deployment addResource(String resource) {
+ addStreamSource(resource, new ResourceStreamSource(resource));
+ return this;
+ }
+
+ public Deployment addFile(File file) {
+ addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
+ return this;
+ }
+
+ public Deployment addUrl(URL url) {
+ addStreamSource(url.toString(), new UrlStreamSource(url));
+ return this;
+ }
+
+ public Deployment addInputStream(String name, InputStream inputStream) {
+ addStreamSource(name, new InputStreamSource(inputStream));
+ return this;
+ }
+
+ public Deployment addString(String name, String string) {
+ addStreamSource(name, new StringStreamSource(string));
+ return this;
+ }
+
+ public Deployment addArchiveResource(String resource) {
+ this.name = resource;
+ ResourceStreamSource streamSource = new ResourceStreamSource(resource);
+ addStreamSource(resource, streamSource);
+ return this;
+ }
+
+ public Deployment addArchiveFile(File file) {
+ addStreamSource(file.getAbsolutePath(), new FileStreamSource(file));
+ return this;
+ }
+
+ public Deployment addArchiveUrl(URL url) {
+ addStreamSource(url.toString(), new UrlStreamSource(url));
+ return this;
+ }
+
+ public Deployment addArchive(ZipInputStream zipInputStream) {
+ try {
+ ZipEntry zipEntry = zipInputStream.getNextEntry();
+ while(zipEntry!=null) {
+ String entryName = zipEntry.getName();
+ byte[] bytes = IoUtil.readBytes(zipInputStream);
+ if (bytes!=null) {
+ addStreamSource(entryName, new ByteArrayStreamSource(bytes));
+ }
+ zipEntry = zipInputStream.getNextEntry();
+ }
+ } catch (Exception e) {
+ throw new JbpmException("couldn't read zip archive", e);
+ }
+ return this;
+ }
+
+ /** recursively adds all files in a directory using the relative file names */
+ public Deployment addDirectory(String directory) {
+ if (directory==null) {
+ throw new JbpmException("directory is null");
+ }
+ addDirectory(new File(directory), "", false);
+ return this;
+ }
+
+ /** recursively adds all files in a directory using the canonical file names */
+ public Deployment addDirectoryCanonical(String directory) {
+ if (directory==null) {
+ throw new JbpmException("directory is null");
+ }
+ addDirectory(new File(directory), "", true);
+ return this;
+ }
+
+ /** recursively adds all files in a directory using the relative file names */
+ public Deployment addDirectory(File directory) {
+ addDirectory(directory, "", false);
+ return this;
+ }
+
+ /** recursively adds all files in a directory using the canonical file names */
+ public Deployment addDirectoryCanonical(File directory) {
+ addDirectory(directory, "", true);
+ return this;
+ }
+
+ protected Deployment addDirectory(File directory, String relativeDirectoryName, boolean canonicalPathNames) {
+ if (directory==null) {
+ throw new JbpmException("directory is null");
+ }
+ if (!directory.isDirectory()) {
+ throw new JbpmException(directory.getAbsolutePath()+" is not a directory");
+ }
+
+ File[] files = directory.listFiles();
+ if (files!=null) {
+ for (File file: files) {
+ String relativeFileName = (canonicalPathNames ? null : relativeDirectoryName+"/"+file.getName());
+ if (file.isFile()) {
+ if (canonicalPathNames) {
+ try {
+ addStreamSource(file.getCanonicalPath(), new FileStreamSource(file));
+ } catch (IOException e) {
+ throw new JbpmException("can't get canonical path name for "+file);
+ }
+ } else {
+ addStreamSource(relativeFileName, new FileStreamSource(file));
+ }
+ } else if (file.isDirectory()) {
+ addDirectory(file, relativeFileName, canonicalPathNames);
+ }
+ }
+ }
+ return this;
+ }
+
+ protected Deployment addStreamSource(String name, StreamSource streamSource) {
+ if (this.name==null) {
+ this.name = name;
+ }
+ if (files==null) {
+ files = new HashMap<String, StreamSource>();
+ }
+ files.put(name, streamSource);
+ return this;
+ }
+
+ public InputStream getFile(String name) {
+ if (files==null) {
+ return null;
+ }
+ StreamSource streamSource = files.get(name);
+ return (streamSource!=null ? streamSource.openStream() : null);
+ }
+
+ public Set<String> getFileNames() {
+ if (files==null) {
+ return Collections.EMPTY_SET;
+ }
+ return files.keySet();
+ }
+
+ public Object getObject(String name) {
+ if (objects==null) {
+ return null;
+ }
+ return objects.get(name);
+ }
+
+ public Set<String> getObjectNames() {
+ if (objects==null) {
+ return Collections.EMPTY_SET;
+ }
+ return objects.keySet();
+ }
+
+ public Document getDocument(String name) {
+ if ( (documents!=null)
+ && (documents.containsKey(name))
+ ) {
+ return documents.get(name);
+ }
+ if ( (files!=null)
+ && (files.containsKey(name))
+ ) {
+ InputStream fileStream = getFile(name);
+ return parser.createParse()
+ .setInputStream(fileStream)
+ .execute()
+ .checkProblems("deployment file "+name)
+ .getDocument();
+ }
+ return null;
+ }
+
+ public ProcessDefinition getProcessDefinition() {
+ return processDefinition;
+ }
+
+ public void setProcessDefinition(ProcessDefinition processDefinition) {
+ if (language==null) {
+ language = "api";
+ }
+ this.processDefinition = processDefinition;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public Deployment setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Deployment addObject(String name, Object object) {
+ if (objects==null) {
+ objects = new HashMap<String, Object>();
+ }
+ objects.put(name, object);
+ return this;
+ }
+
+ public void deploy() {
+ processServiceImpl.deploy(this);
+ }
+
+ // error logging
+
+ public class DeploymentParse {
+ String name;
+ Parse parse;
+ public DeploymentParse(String name, Parse parse) {
+ this.name = name;
+ this.parse = parse;
+ }
+ }
+
+ public void addParse(String name, Parse parse) {
+ if (deploymentParses==null) {
+ deploymentParses = new ArrayList<DeploymentParse>();
+ }
+ deploymentParses.add(new DeploymentParse(name, parse));
+ }
+
+ public void checkProblems() {
+ StringBuffer errorMsg = null;
+ if (deploymentParses!=null) {
+ boolean hasProblems = false;
+ for (DeploymentParse deploymentParse: deploymentParses) {
+ if (deploymentParse.parse.hasProblems()) {
+ hasProblems = true;
+ if (errorMsg==null) {
+ errorMsg = new StringBuffer();
+ }
+ errorMsg.append("problems during parse of "+deploymentParse.name+":");
+ errorMsg.append(deploymentParse.parse.logProblems());
+ }
+ }
+ }
+ if (errorMsg!=null) {
+ throw new JbpmException("errors during parsing of "+this+": "+errorMsg);
+ }
+ }
+
+ public String toString() {
+ if (name!=null) {
+ return "deployment("+name+")";
+ }
+ return "deployment";
+ }
+
+ public void addDocument(String name, Document document) {
+ if (documents==null) {
+ documents = new HashMap<String, Document>();
+ }
+ documents.put(name, document);
+ }
+}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java (from rev 2951, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.svc;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.ExecutionService;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
+import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.SignalCmd;
+import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.cmd.StartExecutionInLatestCmd;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecutionServiceImpl implements ExecutionService {
+
+ protected CommandService commandService;
+
+ public Execution startExecution(String processDefinitionId){
+ return commandService.execute(new StartExecutionCmd(processDefinitionId, null, null));
+ }
+
+ public Execution startExecution(String processDefinitionId, String executionKey) {
+ return commandService.execute(new StartExecutionCmd(processDefinitionId, null, executionKey));
+ }
+
+ public Execution startExecution(String processDefinitionId, Map<String, Object> variables){
+ return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, null));
+ }
+
+ public Execution startExecution(String processDefinitionId, Map<String, Object> variables, String executionKey){
+ return commandService.execute(new StartExecutionCmd(processDefinitionId, variables, executionKey));
+ }
+
+ public Execution startExecutionInLatest(String processDefinitionName) {
+ return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, null, null));
+ }
+
+ public Execution startExecutionInLatest(String processDefinitionName, Map<String, Object> variables){
+ return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, variables, null));
+ }
+
+ public Execution startExecutionInLatest(String processDefinitionName, String executionKey) {
+ return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, null, executionKey));
+ }
+
+ public Execution startExecutionInLatest(String processDefinitionName, Map<String, Object> variables, String executionKey){
+ return commandService.execute(new StartExecutionInLatestCmd(processDefinitionName, variables, executionKey));
+ }
+
+
+ public Execution signalExecution(String executionId) {
+ return commandService.execute(new SignalCmd(executionId, null, null));
+ }
+
+ public Execution signalExecution(String executionId, String signalName) {
+ return commandService.execute(new SignalCmd(executionId, signalName, null));
+ }
+
+ public Execution signalExecution(String executionId, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionId, signalName, parameters));
+ }
+
+ public Execution signalExecution(String executionId, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionId, null, parameters));
+ }
+
+
+ public Execution signalExecution(long executionDbid) {
+ return commandService.execute(new SignalCmd(executionDbid, null, null));
+ }
+
+ public Execution signalExecution(long executionDbid, String signalName) {
+ return commandService.execute(new SignalCmd(executionDbid, signalName, null));
+ }
+
+ public Execution signalExecution(long executionDbid, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionDbid, signalName, parameters));
+ }
+
+ public Execution signalExecution(long executionDbid, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionDbid, null, parameters));
+ }
+
+ public Execution signalExecutionByKey(String processDefinitionName, String executionKey) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, null));
+ }
+
+ public Execution signalExecutionByKey(String processDefinitionName, String executionKey, String signalName) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, null));
+ }
+
+ public Execution signalExecutionByKey(String processDefinitionName, String executionKey, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, parameters));
+ }
+
+ public Execution signalExecutionByKey(String processDefinitionName, String executionKey, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, parameters));
+ }
+
+ public Execution findExecution(String processDefinitionName, String key) {
+ return commandService.execute(new FindExecutionCmd(processDefinitionName, key));
+ }
+
+ public Execution findExecution(String executionId) {
+ return commandService.execute(new FindExecutionCmd(executionId));
+ }
+
+ public Object getVariable(String executionId, String variableName) {
+ List<String> variableNames = new ArrayList<String>();
+ variableNames.add(variableName);
+ Map<String, Object> variables = commandService.execute(new GetVariablesCmd(executionId, variableNames));
+ return variables.get(variableName);
+ }
+
+ public Map<String, Object> getVariables(String executionId, List<String> variableNames) {
+ return commandService.execute(new GetVariablesCmd(executionId, variableNames));
+ }
+
+ public Execution setVariable(String executionId, String name, Object value) {
+ SetVariablesCmd cmd = new SetVariablesCmd(executionId);
+ cmd.addVariable(name, value);
+ return commandService.execute(cmd);
+ }
+
+ public Execution setVariables(String executionId, Map<String, Object> variables) {
+ SetVariablesCmd cmd = new SetVariablesCmd(executionId);
+ cmd.setVariables(variables);
+ return commandService.execute(cmd);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java (from rev 2951, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.internal.svc;
+
+import java.util.List;
+
+import org.jbpm.ManagementService;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.job.Job;
+import org.jbpm.job.Message;
+import org.jbpm.job.Timer;
+import org.jbpm.pvm.internal.cmd.GetMessagesCmd;
+import org.jbpm.pvm.internal.cmd.GetTimersCmd;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ManagementServiceImpl implements ManagementService {
+
+ protected CommandService commandService;
+
+ public void executeJob(String jobId) {
+ // TODO
+ }
+
+ public List<Job> getJobsWithException(int firstResult, int maxResults) {
+ // TODO
+ return null;
+ }
+
+ public List<Message> getMessages(int firstResult, int maxResults) {
+ return commandService.execute(new GetMessagesCmd(firstResult, maxResults));
+ }
+
+ public List<Timer> getTimers(int firstResult, int maxResults) {
+ return commandService.execute(new GetTimersCmd(firstResult, maxResults));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java (from rev 2961, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.svc;
+
+import java.util.List;
+
+import org.jbpm.Deployment;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.ProcessService;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.pvm.internal.cmd.DeployCmd;
+import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionCmd;
+import org.jbpm.pvm.internal.cmd.FindProcessDefinitionCmd;
+import org.jbpm.pvm.internal.cmd.FindProcessDefinitionNamesCmd;
+import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsCmd;
+
+/** {@link ProcessService} implementation that delegates execution of the
+ * methods to a {@link CommandService}.
+ *
+ * @author Tom Baeyens
+ */
+public class ProcessServiceImpl implements ProcessService {
+
+ protected CommandService commandService;
+
+ public ProcessDefinition deploy(OpenProcessDefinition processDefinition) {
+ DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
+ return commandService.execute(new DeployCmd(deploymentImpl));
+ }
+
+ public Deployment createDeployment() {
+ return new DeploymentImpl(this);
+ }
+
+ public ProcessDefinition deploy(Deployment deployment) {
+ return commandService.execute(new DeployCmd((DeploymentImpl)deployment));
+ }
+
+ public ProcessDefinition findLatestProcessDefinition(String processDefinitionName) {
+ return commandService.execute(new FindLatestProcessDefinitionCmd(processDefinitionName));
+ }
+
+ public ProcessDefinition findProcessDefinition(String processDefinitionName, int version) {
+ return commandService.execute(new FindProcessDefinitionCmd(processDefinitionName, version));
+ }
+
+ public List<String> findProcessDefinitionNames() {
+ return commandService.execute(new FindProcessDefinitionNamesCmd());
+ }
+
+ public List<ProcessDefinition> findProcessDefinitions(String processDefinitionName) {
+ return (List)commandService.execute(new FindProcessDefinitionsCmd(processDefinitionName));
+ }
+
+ public CommandService getCommandService() {
+ return commandService;
+ }
+ public void setCommandService(CommandService commandService) {
+ this.commandService = commandService;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.svc;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.log.Log;
@@ -63,7 +63,7 @@
sleepTime *= delayFactor;
}
}
- throw new PvmException("gave up after "+attempt+" attempts");
+ throw new JbpmException("gave up after "+attempt+" attempts");
}
public int getRetries() {
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.tx;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
@@ -40,12 +40,12 @@
public <T> T execute(Command<T> command) {
Environment environment = Environment.getCurrent();
if (environment==null) {
- throw new PvmException("no environment for managing hibernate transaction");
+ throw new JbpmException("no environment for managing hibernate transaction");
}
StandardTransaction standardTransaction = environment.get(StandardTransaction.class);
if (standardTransaction==null) {
- throw new PvmException("no standard-transaction in environment");
+ throw new JbpmException("no standard-transaction in environment");
}
standardTransaction.begin();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/TransactionException.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/TransactionException.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/TransactionException.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,12 +21,12 @@
*/
package org.jbpm.pvm.internal.tx;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
* @author Tom Baeyens
*/
-public class TransactionException extends PvmException {
+public class TransactionException extends JbpmException {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
@@ -71,13 +71,13 @@
public void setValue(Object value) {
if (converter!=null) {
if (! converter.supports(value)) {
- throw new PvmException("the converter '"+converter.getClass().getName()+"' in variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'. to change the type of a variable, you have to delete it first");
+ throw new JbpmException("the converter '"+converter.getClass().getName()+"' in variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'. to change the type of a variable, you have to delete it first");
}
value = converter.convert(value);
}
if ( (value!=null)
&& (! this.isStorable(value)) ) {
- throw new PvmException("variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'. to change the type of a variable, you have to delete it first");
+ throw new JbpmException("variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'. to change the type of a variable, you have to delete it first");
}
setObject(value);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.type.Converter;
/**
@@ -46,7 +46,7 @@
try {
return dateFormat.parseObject((String)o);
} catch (ParseException e) {
- throw new PvmException("invalid date format in date variable: "+o, e);
+ throw new JbpmException("invalid date format in date variable: "+o, e);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,7 +28,7 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.type.Converter;
public class SerializableToBytesConverter implements Converter {
@@ -49,7 +49,7 @@
oos.flush();
bytes = baos.toByteArray();
} catch (IOException e) {
- throw new PvmException("couldn't serialize '"+o+"'", e);
+ throw new JbpmException("couldn't serialize '"+o+"'", e);
}
return bytes;
@@ -62,7 +62,7 @@
ObjectInputStream ois = new ObjectInputStream(bais);
return ois.readObject();
} catch (Exception e) {
- throw new PvmException("couldn't deserialize object", e);
+ throw new JbpmException("couldn't deserialize object", e);
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/** default implementation of the {@link Observable} interface.
*
@@ -15,7 +15,7 @@
public void addListener(Listener listener) {
if (listener==null) {
- throw new PvmException("listener is null");
+ throw new JbpmException("listener is null");
}
if (listeners==null) {
listeners = new ArrayList<Listener>();
@@ -25,7 +25,7 @@
public void removeListener(Listener listener) {
if (listener==null) {
- throw new PvmException("listener is null");
+ throw new JbpmException("listener is null");
}
if (listeners!=null) {
listeners.remove(listener);
@@ -34,7 +34,7 @@
public Listener addListener(Listener listener, String eventName) {
if (eventName==null) {
- throw new PvmException("eventName is null");
+ throw new JbpmException("eventName is null");
}
List<String> eventNames = new ArrayList<String>();
@@ -46,10 +46,10 @@
public Listener addListener(Listener listener, List<String> eventNames) {
if (listener==null) {
- throw new PvmException("listener is null");
+ throw new JbpmException("listener is null");
}
if (eventNames==null) {
- throw new PvmException("eventNames is null");
+ throw new JbpmException("eventNames is null");
}
FilterListener filterListener = new FilterListener(listener, eventNames);
addListener(filterListener);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/** listener that only delegates events to a given listener if
* they pass the filter based on event names. */
@@ -13,17 +13,17 @@
protected List<String> eventNames;
public FilterListener(Listener listener, String eventName) {
- if (listener==null) throw new PvmException("listener is null");
+ if (listener==null) throw new JbpmException("listener is null");
this.listener = listener;
- if (eventName==null) throw new PvmException("eventName is null");
+ if (eventName==null) throw new JbpmException("eventName is null");
this.eventNames = new ArrayList<String>();
this.eventNames.add(eventName);
}
public FilterListener(Listener listener, List<String> eventNames) {
- if (listener==null) throw new PvmException("listener is null");
+ if (listener==null) throw new JbpmException("listener is null");
this.listener = listener;
- if (eventNames==null) throw new PvmException("eventNames is null");
+ if (eventNames==null) throw new JbpmException("eventNames is null");
this.eventNames = eventNames;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/IoUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/IoUtil.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/IoUtil.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -26,7 +26,7 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
public abstract class IoUtil {
@@ -35,7 +35,7 @@
public static byte[] readBytes(InputStream inputStream) {
byte[] bytes = null;
if (inputStream==null) {
- throw new PvmException("inputStream is null");
+ throw new JbpmException("inputStream is null");
}
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -44,7 +44,7 @@
outputStream.close();
return bytes;
} catch (IOException e) {
- throw new PvmException("couldn't read bytes from inputStream", e);
+ throw new JbpmException("couldn't read bytes from inputStream", e);
}
}
@@ -60,7 +60,7 @@
}
return total;
} catch (IOException e) {
- throw new PvmException("couldn't write bytes to output stream", e);
+ throw new JbpmException("couldn't write bytes to output stream", e);
}
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Priority.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Priority.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/Priority.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.util;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
public abstract class Priority {
@@ -55,7 +55,7 @@
try {
return Integer.parseInt(priorityText);
} catch (NumberFormatException e) {
- throw new PvmException("priority '"+priorityText+"' could not be parsed as a priority", e);
+ throw new JbpmException("priority '"+priorityText+"' could not be parsed as a priority", e);
}
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -9,7 +9,7 @@
import java.util.Enumeration;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
@@ -46,9 +46,9 @@
log.trace("loading class "+className);
return classLoader.loadClass(className);
} catch (NoClassDefFoundError e) {
- throw new PvmException("couldn't define class "+className, e);
+ throw new JbpmException("couldn't define class "+className, e);
} catch (ClassNotFoundException e) {
- throw new PvmException("couldn't load class "+className, e);
+ throw new JbpmException("couldn't load class "+className, e);
}
}
@@ -64,7 +64,7 @@
log.trace("getting resources "+resource);
return classLoader.getResources(resource);
} catch (Exception e) {
- throw new PvmException("couldn't get resources "+resource, e);
+ throw new JbpmException("couldn't get resources "+resource, e);
}
}
@@ -74,7 +74,7 @@
log.trace("getting resource "+resource);
return classLoader.getResource(resource);
} catch (Exception e) {
- throw new PvmException("couldn't get resources "+resource, e);
+ throw new JbpmException("couldn't get resources "+resource, e);
}
}
@@ -86,7 +86,7 @@
log.trace("instantiating "+className);
newObject = clazz.newInstance();
} catch (Exception e) {
- throw new PvmException("couldn't instantiate "+className, e);
+ throw new JbpmException("couldn't instantiate "+className, e);
}
return newObject;
}
@@ -109,9 +109,9 @@
if (log.isTraceEnabled()) log.trace("found constructor "+clazz.getName()+"("+ArrayUtil.toString(parameterTypes)+")");
} catch (SecurityException e) {
- throw new PvmException("wasn't allowed to get constructor '"+clazz.getName()+"("+getParameterTypesText(parameterTypes)+")'", e);
+ throw new JbpmException("wasn't allowed to get constructor '"+clazz.getName()+"("+getParameterTypesText(parameterTypes)+")'", e);
} catch (NoSuchMethodException e) {
- throw new PvmException("couldn't find constructor '"+clazz.getName()+"("+getParameterTypesText(parameterTypes)+")'", e);
+ throw new JbpmException("couldn't find constructor '"+clazz.getName()+"("+getParameterTypesText(parameterTypes)+")'", e);
}
return constructor;
@@ -128,12 +128,12 @@
field = clazz.getDeclaredField(fieldName);
log.trace("found field "+fieldName+" in "+clazz.getName());
} catch (SecurityException e) {
- throw new PvmException("wasn't allowed to get field '"+clazz.getName()+"."+fieldName+"'", e);
+ throw new JbpmException("wasn't allowed to get field '"+clazz.getName()+"."+fieldName+"'", e);
} catch (NoSuchFieldException e) {
if (clazz.getSuperclass()!=null) {
return getField(clazz.getSuperclass(), fieldName, original);
} else {
- throw new PvmException("couldn't find field '"+original.getName()+"."+fieldName+"'", e);
+ throw new JbpmException("couldn't find field '"+original.getName()+"."+fieldName+"'", e);
}
}
@@ -154,12 +154,12 @@
log.trace("found method "+clazz.getName()+"."+methodName+"("+ArrayUtil.toString(parameterTypes)+")");
} catch (SecurityException e) {
- throw new PvmException("wasn't allowed to get method '"+clazz.getName()+"."+methodName+"("+getParameterTypesText(parameterTypes)+")'", e);
+ throw new JbpmException("wasn't allowed to get method '"+clazz.getName()+"."+methodName+"("+getParameterTypesText(parameterTypes)+")'", e);
} catch (NoSuchMethodException e) {
if (clazz.getSuperclass()!=null) {
return getMethod(clazz.getSuperclass(), methodName, parameterTypes, original);
} else {
- throw new PvmException("couldn't find method '"+original.getName()+"."+methodName+"("+getParameterTypesText(parameterTypes)+")'", e);
+ throw new JbpmException("couldn't find method '"+original.getName()+"."+methodName+"("+getParameterTypesText(parameterTypes)+")'", e);
}
}
@@ -211,7 +211,7 @@
return constructor.newInstance(args);
} catch (Throwable t) {
- throw new PvmException("couldn't construct new '"+className+"' with args "+ArrayUtil.toString(args), t);
+ throw new JbpmException("couldn't construct new '"+className+"' with args "+ArrayUtil.toString(args), t);
}
}
@@ -224,7 +224,7 @@
log.trace("got value '"+value+"' from field '"+field.getName()+"'");
return value;
} catch (Exception e) {
- throw new PvmException("couldn't get '"+field.getName()+"'", e);
+ throw new JbpmException("couldn't get '"+field.getName()+"'", e);
}
}
@@ -240,13 +240,13 @@
}
field.set(object, value);
} catch (Exception e) {
- throw new PvmException("couldn't set '"+field.getName()+"' to '"+value+"'", e);
+ throw new JbpmException("couldn't set '"+field.getName()+"' to '"+value+"'", e);
}
}
public static Object invoke(Method method, Object target, Object[] args) {
if (method==null) {
- throw new PvmException("method is null");
+ throw new JbpmException("method is null");
}
try {
log.trace("invoking '"+method.getName()+"' on '"+target+"' with "+ArrayUtil.toString(args));
@@ -257,9 +257,9 @@
return method.invoke(target, args);
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();
- throw new PvmException("couldn't invoke '"+method.getName()+"' with "+ArrayUtil.toString(args)+" on "+target+": "+targetException.getMessage(), targetException);
+ throw new JbpmException("couldn't invoke '"+method.getName()+"' with "+ArrayUtil.toString(args)+" on "+target+": "+targetException.getMessage(), targetException);
} catch (Exception e) {
- throw new PvmException("couldn't invoke '"+method.getName()+"' with "+ArrayUtil.toString(args)+" on "+target+": "+e.getMessage(), e);
+ throw new JbpmException("couldn't invoke '"+method.getName()+"' with "+ArrayUtil.toString(args)+" on "+target+": "+e.getMessage(), e);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/StringUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/StringUtil.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/StringUtil.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.util.Collections;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
/**
@@ -35,7 +35,7 @@
public static List<String> tokenize(String text, String delimiter) {
if (delimiter==null) {
- throw new PvmException("delimiter is null");
+ throw new JbpmException("delimiter is null");
}
if (text==null) {
return Collections.EMPTY_LIST;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/TagBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/TagBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/TagBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.util;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.xml.Binding;
import org.jbpm.pvm.internal.xml.Bindings;
import org.w3c.dom.Element;
@@ -44,7 +44,7 @@
* @see Bindings */
public TagBinding(String tagName, String namespaceUri, String category) {
if (tagName==null) {
- throw new PvmException("tagName is null");
+ throw new JbpmException("tagName is null");
}
this.tagName = tagName;
this.namespaceUri = namespaceUri;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/UrlEntity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/UrlEntity.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/UrlEntity.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.io.InputStream;
import java.net.URL;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.xml.Entity;
import org.jbpm.pvm.internal.xml.Parser;
import org.xml.sax.EntityResolver;
@@ -52,7 +52,7 @@
if (url!=null) {
this.systemId = url.toString();
} else {
- throw new PvmException("couldn't create Entity from resource "+resource);
+ throw new JbpmException("couldn't create Entity from resource "+resource);
}
}
@@ -63,7 +63,7 @@
inputSource.setSystemId(systemId);
return inputSource;
} catch (IOException e) {
- throw new PvmException("couldn't open stream from url "+url, e);
+ throw new JbpmException("couldn't open stream from url "+url, e);
}
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,7 +28,7 @@
import java.util.Set;
import java.util.StringTokenizer;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.xml.Parse;
@@ -423,9 +423,9 @@
} else {
String uri = element.lookupNamespaceURI(namespaceValue.prefix);
if (uri==null) {
- throw new PvmException("unknown prefix in qname "+text);
+ throw new JbpmException("unknown prefix in qname "+text);
} else if (namespaceValue.localPart==null) {
- throw new PvmException("no local part in qname "+text);
+ throw new JbpmException("no local part in qname "+text);
} else {
qname = new QName(uri, namespaceValue.localPart, namespaceValue.prefix);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
@@ -62,7 +62,7 @@
} else {
parse.addProblem("class "+ className+" is not a "+collectionInterface.getName());
}
- } catch (PvmException e) {
+ } catch (JbpmException e) {
parse.addProblem("class "+className+" could not be found");
}
return false;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.binding;
import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.svc.CommandExecutionService;
+import org.jbpm.pvm.internal.svc.ExecutionServiceImpl;
import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
@@ -40,7 +40,7 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(CommandExecutionService.class);
+ ObjectDescriptor descriptor = new ObjectDescriptor(ExecutionServiceImpl.class);
descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
return descriptor;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.binding;
import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.svc.CommandManagementService;
+import org.jbpm.pvm.internal.svc.ManagementServiceImpl;
import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
@@ -40,7 +40,7 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(CommandManagementService.class);
+ ObjectDescriptor descriptor = new ObjectDescriptor(ManagementServiceImpl.class);
descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
return descriptor;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ProcessServiceBinding.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.binding;
import org.jbpm.cmd.CommandService;
-import org.jbpm.pvm.internal.svc.CommandProcessService;
+import org.jbpm.pvm.internal.svc.ProcessServiceImpl;
import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
@@ -40,7 +40,7 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(CommandProcessService.class);
+ ObjectDescriptor descriptor = new ObjectDescriptor(ProcessServiceImpl.class);
descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
return descriptor;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,6 +1,6 @@
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
@@ -25,7 +25,7 @@
ClassLoader classLoader = wireContext.getClassLoader();
try {
return ReflectUtil.loadClass(classLoader, text);
- } catch (PvmException e) {
+ } catch (JbpmException e) {
Throwable cause = e.getCause();
throw new WireException("couldn't load class '"+text+"': "+cause.getMessage(), cause);
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -30,7 +30,7 @@
import java.util.List;
import java.util.Properties;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -104,7 +104,7 @@
if (className!=null) {
try {
return ReflectUtil.loadClass(wireDefinition.getClassLoader(), className);
- } catch (PvmException e) {
+ } catch (JbpmException e) {
throw new WireException("couldn't create hibernate configuration '"+className+"': "+e.getMessage(), e.getCause());
}
}
@@ -168,7 +168,7 @@
Class<?> persistentClass = wireContext.getClassLoader().loadClass(className);
configuration.addClass(persistentClass);
} catch (Exception e) {
- throw new PvmException("couldn't add mapping for class "+className, e);
+ throw new JbpmException("couldn't add mapping for class "+className, e);
}
}
public String toString() {
@@ -187,7 +187,7 @@
try {
configuration.addURL(new URL(url));
} catch (Exception e) {
- throw new PvmException("couldn't add hibernate mapping from URL "+url, e);
+ throw new JbpmException("couldn't add hibernate mapping from URL "+url, e);
}
}
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -13,7 +13,7 @@
**/
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.util.Listener;
@@ -66,7 +66,7 @@
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
- throw new PvmException("exception while stopping JobExecutor");
+ throw new JbpmException("exception while stopping JobExecutor");
}
jobExecutor.stop(true);
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -7,7 +7,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.util.ArrayUtil;
@@ -229,7 +229,7 @@
if (className!=null) {
try {
return ReflectUtil.loadClass(wireDefinition.getClassLoader(), className);
- } catch (PvmException e) {
+ } catch (JbpmException e) {
throw new WireException("couldn't get type of '"+(name!=null ? name : className)+"': "+e.getMessage(), e.getCause());
}
}
@@ -299,7 +299,7 @@
try {
log.debug("auto wiring field "+fieldName+" in "+name);
ReflectUtil.set(field, object, autoWireValue);
- } catch (PvmException e) {
+ } catch (JbpmException e) {
if(e.getCause() instanceof IllegalArgumentException) {
log.info("WARNING: couldn't auto wire "+fieldName+" (of type "+field.getType().getName()+") " +
"with value "+autoWireValue + " (of type "+autoWireValue.getClass().getName()+")");
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/SeamHibernateSessionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/SeamHibernateSessionDescriptor.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/SeamHibernateSessionDescriptor.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -22,7 +22,6 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.hibernate.Session;
-import org.jboss.seam.Component;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -36,7 +35,10 @@
protected String componentName = "hibernateSession";
public Object construct(WireContext wireContext) {
+ /*
return (Session) Component.getInstance(componentName, true);
+ */
+ return null;
}
public Class< ? > getType(WireDefinition wireDefinition) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -33,6 +33,8 @@
import javax.xml.parsers.DocumentBuilder;
+import org.jbpm.JbpmException;
+import org.jbpm.log.Log;
import org.jbpm.pvm.internal.stream.FileStreamSource;
import org.jbpm.pvm.internal.stream.InputStreamSource;
import org.jbpm.pvm.internal.stream.ResourceStreamSource;
@@ -51,7 +53,9 @@
*/
public class Parse implements Serializable, ErrorHandler {
+ private static Log log = Log.getLog(Parse.class.getName());
private static final long serialVersionUID = 1L;
+ private static final String NEWLINE = System.getProperty("line.separator");
protected Parser parser;
@@ -142,12 +146,6 @@
return this;
}
- /** throws if error level problems are present and logs all problems and warnings. */
- public Parse checkProblems(String description) {
- parser.checkProblems(description, this);
- return this;
- }
-
// problems /////////////////////////////////////////////////////////////////
/** all problems encountered */
@@ -261,6 +259,46 @@
return null;
}
+ /** throws an exception with appropriate message in case the parse contains
+ * errors or fatal errors. This method also logs the problems with severity
+ * 'warning'. */
+ public Parse checkProblems(String description) {
+ if (hasProblems()) {
+ log.info("problems during parse of "+description+":");
+ String errorMsg = logProblems();
+ if (errorMsg!=null) {
+ throw new JbpmException("errors during parsing of "+description+": "+errorMsg);
+ }
+ }
+ return this;
+ }
+
+ public String logProblems() {
+ String errorMsg = null;
+ if (problems!=null) {
+ StringBuffer errorMsgBuffer = null;
+ for (Problem p : getProblems()) {
+ if (p.getSeverity().equals(Problem.SEVERITY_ERROR) || p.getSeverity().equals(Problem.SEVERITY_FATALERROR)) {
+ if (errorMsgBuffer==null) {
+ errorMsgBuffer = new StringBuffer();
+ }
+ errorMsgBuffer.append(NEWLINE);
+ errorMsgBuffer.append(" ");
+ errorMsgBuffer.append(p.toString());
+ if (p.getCause()!=null) {
+ log.error(p.toString(), p.getCause());
+ } else {
+ log.error(p.toString());
+ }
+ } else {
+ log.info("WARNING: "+p.toString());
+ }
+ }
+ errorMsg = (errorMsgBuffer!=null ? errorMsgBuffer.toString() : null);
+ }
+ return errorMsg;
+ }
+
// getters and setters //////////////////////////////////////////////////////
/** the result of this parse operation. */
@@ -275,5 +313,4 @@
public ClassLoader getClassLoader() {
return classLoader;
}
-
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.log.Log;
import org.jbpm.pvm.internal.stream.StreamSource;
import org.jbpm.pvm.internal.util.UrlEntity;
@@ -242,8 +242,6 @@
private static Log log = Log.getLog(Parser.class.getName());
- private static final String NEWLINE = System.getProperty("line.separator");
-
protected DocumentBuilderFactory documentBuilderFactory = null;
protected Map<String, Entity> entities = null;
protected Bindings bindings = null;
@@ -529,33 +527,4 @@
return object;
}
-
- /** throws an exception with appropriate message in case the parse contains
- * errors or fatal errors. This method also logs the problems with severity
- * 'warning'. */
- public void checkProblems(String description, Parse parse) {
- if (parse.hasProblems()) {
- StringBuffer errorMsg = null;
- for (Problem p : parse.getProblems()) {
- if (p.getSeverity().equals(Problem.SEVERITY_ERROR) || p.getSeverity().equals(Problem.SEVERITY_FATALERROR)) {
- if (errorMsg==null) {
- errorMsg = new StringBuffer();
- }
- errorMsg.append(NEWLINE);
- errorMsg.append(" ");
- errorMsg.append(p.toString());
- if (p.getCause()!=null) {
- log.error(p.toString(), p.getCause());
- } else {
- log.error(p.toString());
- }
- } else {
- log.info("WARNING: "+p.toString());
- }
- }
- if (errorMsg!=null) {
- throw new PvmException("errors during parsing of "+description+": "+errorMsg);
- }
- }
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import java.util.Stack;
import org.jbpm.ProcessDefinition;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.Activity;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.listener.EventListener;
@@ -147,10 +147,10 @@
/** marks the last created node as the initial node in the process. */
public ProcessFactory initial() {
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
if (processDefinition.getInitial()!=null) {
- throw new PvmException("duplicate initial node");
+ throw new JbpmException("duplicate initial node");
}
processDefinition.setInitial(node);
return this;
@@ -161,7 +161,7 @@
* or {@link #timer() adding a timer} */
public ProcessFactory scope() {
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setLocalScope(true);
scope = node;
@@ -258,10 +258,10 @@
* A current node is required. */
public ProcessFactory behaviour(Activity activity) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setBehaviour(activity);
return this;
@@ -271,10 +271,10 @@
* A current node is required. */
public ProcessFactory behaviour(Descriptor descriptor) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setBehaviour(descriptor);
return this;
@@ -290,10 +290,10 @@
* A current node is required. */
public ProcessFactory behaviour(String expression) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setBehaviour(expression);
return this;
@@ -304,10 +304,10 @@
* A current node is required. */
public ProcessFactory asyncExecute() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setExecutionAsync(true);
return this;
@@ -317,10 +317,10 @@
* A current node is required. */
public ProcessFactory asyncLeave() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setLeaveAsync(true);
return this;
@@ -330,10 +330,10 @@
* A current node is required. */
public ProcessFactory asyncSignal() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setSignalAsync(true);
return this;
@@ -343,10 +343,10 @@
* A current node is required. */
public ProcessFactory needsPrevious() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
node.setPreviousNeeded(true);
return this;
@@ -364,7 +364,7 @@
* A current node is required. */
public ProcessFactory compositeNode(String nodeName) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (compositeElementStack==null) {
@@ -383,11 +383,11 @@
* with {@link #compositeNode(String)} */
public ProcessFactory compositeEnd() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (compositeElementStack==null) {
- throw new PvmException("no composite node was started");
+ throw new JbpmException("no composite node was started");
}
compositeElement = compositeElementStack.pop();
@@ -412,7 +412,7 @@
exceptionHandler.setTransitionName(transitionName);
} else {
if (node==null) {
- throw new PvmException("no current node");
+ throw new JbpmException("no current node");
}
transition = node.createOutgoingTransition(null, transitionName);
observableElement = transition;
@@ -427,10 +427,10 @@
* This method requires a current transition. */
public ProcessFactory asyncTake() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (transition==null) {
- throw new PvmException("no current transition");
+ throw new JbpmException("no current transition");
}
transition.setTakeAsync(true);
return this;
@@ -440,10 +440,10 @@
* This method requires a current transition. */
public ProcessFactory to(String destination) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (transition==null) {
- throw new PvmException("no current transition");
+ throw new JbpmException("no current transition");
}
if (destinationReferences==null) {
destinationReferences = new ArrayList<DestinationReference>();
@@ -456,10 +456,10 @@
* This method requires a current transition. */
public ProcessFactory waitCondition(Condition condition) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (transition==null) {
- throw new PvmException("no current transition");
+ throw new JbpmException("no current transition");
}
Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
transition.setWaitConditionDescriptor(conditionDescriptor);
@@ -470,10 +470,10 @@
* This method requires a current transition. */
public ProcessFactory guardCondition(Condition condition) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (transition==null) {
- throw new PvmException("no current transition");
+ throw new JbpmException("no current transition");
}
Descriptor conditionDescriptor= new ProvidedObjectDescriptor(condition);
transition.setConditionDescriptor(conditionDescriptor);
@@ -488,13 +488,13 @@
* {@link #exceptionHandler(Class)} first. */
public ProcessFactory event(String eventName) {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (observableElement==null) {
- throw new PvmException("no current process element");
+ throw new JbpmException("no current process element");
}
if (observableElement instanceof Transition) {
- throw new PvmException("for actions on transitions, you don't need to call event");
+ throw new JbpmException("for actions on transitions, you don't need to call event");
}
event = observableElement.createEvent(eventName);
exceptionHandler = null;
@@ -509,7 +509,7 @@
* 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");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
ProcessElementImpl processElement = null;
@@ -520,7 +520,7 @@
} else if (observableElement!=null) {
processElement = observableElement;
} else {
- throw new PvmException("no current process element, event or action");
+ throw new JbpmException("no current process element, event or action");
}
exceptionHandler = processElement.createExceptionHandler();
@@ -539,7 +539,7 @@
public ProcessFactory transactional() {
if (exceptionHandler==null) {
- throw new PvmException("transactional is a property of an exception handler");
+ throw new JbpmException("transactional is a property of an exception handler");
}
exceptionHandler.setTransactional(true);
return this;
@@ -590,10 +590,10 @@
* process element to which this event relates. */
public ProcessFactory propagationDisabled() {
if (exceptionHandler!=null) {
- throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (eventListenerReference==null) {
- throw new PvmException("no current event action");
+ throw new JbpmException("no current event action");
}
eventListenerReference.setPropagationEnabled(false);
return this;
@@ -607,7 +607,7 @@
return event;
}
if (event==null) {
- throw new PvmException("no current event");
+ throw new JbpmException("no current event");
}
return event;
}
@@ -624,10 +624,10 @@
/** 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");
+ throw new JbpmException("exceptionHandler needs to be closed with exceptionHandlerEnd");
}
if (observableElement==null) {
- throw new PvmException("no current process element");
+ throw new JbpmException("no current process element");
}
if (event!=null) {
event.addProperty(descriptor);
@@ -647,7 +647,7 @@
public void resolve() {
NodeImpl destination = (NodeImpl) processDefinition.findNode(destinationName);
if (destination==null) {
- throw new PvmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
+ throw new JbpmException("couldn't find destination node '"+destinationName+"' for transition "+transition);
}
destination.addIncomingTransition(transition);
transition.setDestination(destination);
@@ -660,7 +660,7 @@
public ClientProcessDefinition done() {
resolveDestinations();
if (processDefinition.getInitial()==null) {
- throw new PvmException("no initial node");
+ throw new JbpmException("no initial node");
}
return processDefinition;
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ExecutionStateTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.Execution;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.Activity;
import org.jbpm.activity.ActivityExecution;
import org.jbpm.activity.ExternalActivity;
@@ -116,7 +116,7 @@
try {
processInstance.signal();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("process-instance is not active: inactive", e.getMessage());
}
@@ -140,7 +140,7 @@
try {
processInstance.signal();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("process-instance is not active: cancelled", e.getMessage());
}
@@ -164,7 +164,7 @@
try {
processInstance.signal();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("process-instance is not active: error", e.getMessage());
}
@@ -185,35 +185,35 @@
try {
processInstance.stop("active");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("invalid end state: active", e.getMessage());
}
try {
processInstance.stop("suspended");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("invalid end state: suspended", e.getMessage());
}
try {
processInstance.stop("created");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("invalid end state: created", e.getMessage());
}
try {
processInstance.stop("async");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("invalid end state: async", e.getMessage());
}
try {
processInstance.stop("inactive");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("invalid end state: inactive", e.getMessage());
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/ScopeVariableTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.util.Map;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.activity.ActivityExecution;
import org.jbpm.activity.ExternalActivity;
import org.jbpm.client.ClientExecution;
@@ -178,7 +178,7 @@
try {
bScope.setVariable("temp", "21C");
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("can't update variable 'temp' on execution[b]", e.getMessage());
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/basicfeatures/AutomaticDecisionDbTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -21,7 +21,7 @@
import org.jbpm.activity.ActivityExecution;
import org.jbpm.activity.ExternalActivity;
import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.OldDbTestCase;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ExecutionServiceTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -33,7 +33,7 @@
import org.jbpm.ProcessDefinition;
import org.jbpm.ProcessService;
import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.OldDbTestCase;
import org.jbpm.test.EnvironmentFactoryTestSetup;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,8 +28,8 @@
import org.jbpm.ProcessDefinition;
import org.jbpm.ProcessService;
-import org.jbpm.PvmException;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.JbpmException;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.OldDbTestCase;
import org.jbpm.test.EnvironmentFactoryTestSetup;
@@ -198,7 +198,7 @@
processService.deploy(new DeploymentImpl(processDefinition));
fail("expected exception");
}
- catch (PvmException e)
+ catch (JbpmException e)
{
assertTextPresent(e.getMessage(), "process 'nuclear fusion' version 1 already exists");
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/timer/TimerIntegrationTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,9 +28,9 @@
import org.jbpm.job.Timer;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.samples.activities.AutomaticActivity;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -28,7 +28,7 @@
import junit.framework.Test;
import org.hibernate.Session;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
@@ -127,7 +127,7 @@
});
fail("expected exception");
}
- catch (PvmException e)
+ catch (JbpmException e)
{
// OK
assertSame(MyOwnCheckedException.class, e.getCause().getClass());
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example02/PersistentExecutionModeTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,9 +27,9 @@
import org.jbpm.ProcessService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.env.EnvironmentFactory;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.example01.AutomaticActivity;
import org.jbpm.pvm.example01.WaitState;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.EnvironmentFactoryTestCase;
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -42,11 +42,11 @@
import org.jbpm.job.Job;
import org.jbpm.log.Log;
import org.jbpm.model.Comment;
-import org.jbpm.pvm.DeploymentImpl;
import org.jbpm.pvm.api.db.svc.ExecutionServiceTest;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.session.MessageSession;
import org.jbpm.session.PvmDbSession;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
import org.jbpm.pvm.internal.xml.Problem;
@@ -106,7 +106,7 @@
);
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
assertTextPresent("couldn't get type of 'o'", e.getMessage());
assertTextPresent("couldn't load class invalid-object-type", e.getMessage());
}
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-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/xml/XmlParsingTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Bindings;
@@ -165,7 +165,7 @@
.setResource("unexistingResource")
.execute();
fail("expected exception");
- } catch (PvmException e) {
+ } catch (JbpmException e) {
// OK
assertTextPresent("resource unexistingResource does not exist", e.getMessage());
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -27,7 +27,7 @@
import org.jbpm.ExecutionService;
import org.jbpm.ProcessService;
import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
+import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.samples.ExamplesConfiguration;
import org.jbpm.pvm.samples.activities.AutomaticActivity;
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -25,7 +25,7 @@
import java.util.Map;
import org.jbpm.Configuration;
-import org.jbpm.PvmException;
+import org.jbpm.JbpmException;
import org.jbpm.env.EnvironmentFactory;
@@ -68,7 +68,7 @@
environmentFactories.put(configResource, newEnvironmentFactory);
return newEnvironmentFactory;
} catch (Exception e) {
- throw new PvmException("Exception during creation of environment factory for "+configResource, e);
+ throw new JbpmException("Exception during creation of environment factory for "+configResource, e);
}
}
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-db/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -39,11 +39,19 @@
<version>${version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+
<!-- TODO remove PVM dependency for compilation (keep it for test)-->
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-pvm</artifactId>
<version>${version}</version>
+ <scope>test</scope>
</dependency>
</dependencies>
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/BasicExecutionFlowDbTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/BasicExecutionFlowDbTest.java 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/BasicExecutionFlowDbTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,112 +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.test.basicfeatures;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.activity.Activity;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.DeploymentImpl;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Guillaume Porcher
- *
- */
-public class BasicExecutionFlowDbTest extends DbTestCase {
-
- // automatic activity will log an event in a given list
- public static List<String> recordedEvents;
-
- public static class AutomaticActivity implements Activity {
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) {
- recordedEvents.add("execute["+execution.getNodeName()+"]");
- }
- }
-
- public static class WaitState implements ExternalActivity {
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) {
- recordedEvents.add("execute["+execution.getNodeName()+"]");
- execution.waitForSignal();
- }
- public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
- recordedEvents.add("signal["+execution.getNodeName()+"]");
- execution.take(signalName);
- }
- }
-
- public void testChainOfAutomaticActivitiesAndWaitStates() {
- recordedEvents = new ArrayList<String>();
-
- ClientProcessDefinition processDefinition = ProcessFactory.build("myProcess")
- .node("a").initial().behaviour(new ObjectDescriptor(AutomaticActivity.class))
- .transition().to("b")
- .node("b").behaviour(AutomaticActivity.class)
- .transition().to("c")
- .node("c").behaviour(WaitState.class)
- .transition().to("d")
- .node("d").behaviour(WaitState.class)
- .transition().to("e")
- .node("e").behaviour(AutomaticActivity.class)
- .transition().to("f")
- .node("f").behaviour(AutomaticActivity.class)
- .done();
-
- DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
- processService.deploy(deploymentImpl);
-
- Execution processInstance = executionService.startExecution("myProcess:1", "one");
-
- List<String> expectedEvents = new ArrayList<String>();
-
- expectedEvents.add("execute[a]");
- expectedEvents.add("execute[b]");
- expectedEvents.add("execute[c]");
-
- assertEquals("c", processInstance.getNodeName());
- assertFalse(processInstance.isEnded());
- assertEquals(expectedEvents, recordedEvents);
-
- processInstance = executionService.signalExecution(processInstance.getId());
-
- expectedEvents.add("signal[c]");
- expectedEvents.add("execute[d]");
-
- assertEquals("d", processInstance.getNodeName());
- assertFalse(processInstance.isEnded());
- assertEquals(expectedEvents, recordedEvents);
-
- processInstance = executionService.signalExecution(processInstance.getId());
-
- expectedEvents.add("signal[d]");
- expectedEvents.add("execute[e]");
- expectedEvents.add("execute[f]");
-
- assertEquals("f", processInstance.getNodeName());
- assertTrue(processInstance.isEnded());
- assertEquals(expectedEvents, recordedEvents);
- }
-}
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java (from rev 2961, jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/StateTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java 2008-11-20 08:30:16 UTC (rev 3010)
@@ -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.basicfeatures;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class StateTest extends DbTestCase {
+
+ public void testWaitStatesSequence() {
+ deployJpdlXmlString(
+ "<process name='ThreeStates'>" +
+ " <start name='a'>" +
+ " <flow to='b' />" +
+ " </start>" +
+ " <state name='b'>" +
+ " <flow to='c' />" +
+ " </state>" +
+ " <state name='c'>" +
+ " <flow to='d' />" +
+ " </state>" +
+ " <end name='d' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startExecution("ThreeStates:1");
+ assertEquals("b", execution.getNodeName());
+
+ String executionId = execution.getId();
+ execution = executionService.signalExecution(executionId);
+ assertEquals("c", execution.getNodeName());
+
+ execution = executionService.signalExecution(executionId);
+ assertEquals("d", execution.getNodeName());
+ assertTrue(execution.isEnded());
+ }
+
+ public void deployJpdlXmlString(String jpdlXmlString) {
+ processService.createDeployment()
+ .setLanguage("jpdl")
+ .addString("xmlstring.jpdl.xml", jpdlXmlString)
+ .deploy();
+ }
+
+ /*
+ public void testExternalDecision() {
+ ClientProcessDefinition processDefinition = parseJpdl(
+ "<process initial='a' name='p'>" +
+ " <state name='a'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal("left");
+ assertEquals("b", execution.getNode().getName());
+
+ execution = processDefinition.startProcessInstance();
+ execution.signal("middle");
+ assertEquals("c", execution.getNode().getName());
+
+ execution = processDefinition.startProcessInstance();
+ execution.signal("right");
+ assertEquals("d", execution.getNode().getName());
+ }
+
+ public void testDefaultSignalWithNamedTransitions() {
+ ClientProcessDefinition processDefinition = parseJpdl(
+ "<process initial='a' name='p'>" +
+ " <state name='a'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ try {
+ execution.signal();
+ } catch (PvmException e) {
+ assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
+ }
+ }
+
+ public void testNamedSignalWithoutMatchingTransition() {
+ ClientProcessDefinition processDefinition = parseJpdl(
+ "<process initial='a' name='p'>" +
+ " <state name='a'>" +
+ " <transition name='left' to='b' />" +
+ " <transition name='middle' to='c' />" +
+ " <transition name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ try {
+ execution.signal("up");
+ } catch (PvmException e) {
+ assertTextPresent("no matching transition or event for signal 'up' in state(a)", e.getMessage());
+ }
+ }
+
+ public void testDefaultSignalWithoutTransitions() {
+ ClientProcessDefinition processDefinition = parseJpdl(
+ "<process initial='a' name='p'>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ try {
+ execution.signal();
+ } catch (PvmException e) {
+ assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
+ }
+ }
+ */
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.cfg.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -5,7 +5,8 @@
<environment-factory>
<deployer-manager>
- <language name="api">
+ <language name="jpdl">
+ <parse-jpdl />
<check-version />
<create-id />
<save-process />
@@ -24,7 +25,13 @@
<hibernate-configuration>
<properties resource="hibernate.properties" />
- <mappings resource="org/jbpm/pvm/pvm.hibernate.mappings.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.typedefs.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.wire.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.definition.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.execution.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.variable.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/hibernate.job.hbm.xml" />
+ <mapping resource="org/jbpm/jpdl/hibernate.jpdl.hbm.xml" />
<cache-configuration resource="org/jbpm/pvm/pvm.cache.xml"
usage="nonstrict-read-write" />
</hibernate-configuration>
Added: jbpm4/trunk/modules/test-db/src/test/resources/log4j.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/log4j.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/log4j.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="TRACE" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jbpm">
+ <priority value="TRACE" />
+ </category>
+
+ <category name="org.hibernate">
+ <priority value="TRACE" />
+ </category>
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <!-- appender-ref ref="FILE"/ -->
+ </root>
+
+</log4j:configuration>
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/logging.properties 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-db/src/test/resources/logging.properties 2008-11-20 08:30:16 UTC (rev 3010)
@@ -1,28 +0,0 @@
-handlers= java.util.logging.ConsoleHandler
-# to add the error triggered file handler
-# handlers= java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler
-
-redirect.commons.logging = enabled
-
-java.util.logging.ConsoleHandler.level = FINEST
-java.util.logging.ConsoleHandler.formatter = org.jbpm.log.LogFormatter
-
-# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
-# org.jbpm.util.ErrorTriggeredFileHandler.push = OFF
-# org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log
-
-# For example, set the com.xyz.foo logger to only log SEVERE messages:
-# com.xyz.foo.level = SEVERE
-
-org.jbpm.level=FINEST
-org.jbpm.pvm.internal.tx.level=FINE
-org.jbpm.pvm.internal.wire.level=FINE
-org.jbpm.pvm.internal.util.level=FINE
-
-org.hibernate.cfg.HbmBinder.level=SEVERE
-org.hibernate.cfg.SettingsFactory.level=SEVERE
-# org.hibernate.level=FINE
-org.hibernate.SQL.level=FINEST
-# org.hibernate.type.level=FINEST
-# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
-# org.hibernate.transaction.level=FINEST
Added: jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/logging.properties (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/logging.properties 2008-11-20 08:30:16 UTC (rev 3010)
@@ -0,0 +1,28 @@
+handlers= java.util.logging.ConsoleHandler
+# to add the error triggered file handler
+# handlers= java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler
+
+redirect.commons.logging = enabled
+
+java.util.logging.ConsoleHandler.level = FINEST
+java.util.logging.ConsoleHandler.formatter = org.jbpm.log.LogFormatter
+
+# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
+# org.jbpm.util.ErrorTriggeredFileHandler.push = OFF
+# org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log
+
+# For example, set the com.xyz.foo logger to only log SEVERE messages:
+# com.xyz.foo.level = SEVERE
+
+org.jbpm.level=FINEST
+org.jbpm.pvm.internal.tx.level=FINE
+org.jbpm.pvm.internal.wire.level=FINE
+org.jbpm.pvm.internal.util.level=FINE
+
+org.hibernate.level=INFO
+org.hibernate.cfg.HbmBinder.level=SEVERE
+org.hibernate.cfg.SettingsFactory.level=SEVERE
+# org.hibernate.SQL.level=FINEST
+# org.hibernate.type.level=FINEST
+# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
+# org.hibernate.transaction.level=FINEST
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/test-load/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-load/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-load/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -40,10 +40,6 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/modules/test-pojo/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-pojo/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/modules/test-pojo/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -40,10 +40,6 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-11-20 08:21:46 UTC (rev 3009)
+++ jbpm4/trunk/pom.xml 2008-11-20 08:30:16 UTC (rev 3010)
@@ -47,18 +47,22 @@
<!-- Properties -->
<properties>
- <cactus.version>13-1.7.1</cactus.version>
- <clover.version>2.3.1</clover.version>
- <hibernate.version>3.2.5.ga</hibernate.version>
+ <hibernate.version>3.2.6.ga</hibernate.version>
<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>
<jsr233.version>2.0.3</jsr233.version>
<juel.version>2.1.0</juel.version>
<log4j.version>1.2.14</log4j.version>
+ <spring.version>2.5.4</spring.version>
<servlet-api.version>2.5</servlet-api.version>
+ <cactus.version>13-1.7.1</cactus.version>
+
+ <!--
+ <cactus.version>13-1.7.1</cactus.version>
+ <jboss.seam.version>2.0.1.GA</jboss.seam.version>
+ <clover.version>2.3.1</clover.version>
<slf4j.version>1.5.3</slf4j.version>
- <spring.version>2.5.4</spring.version>
+ -->
</properties>
<!-- DependencyManagement -->
@@ -87,14 +91,14 @@
<!-- Please sort by groupid -->
<dependency>
- <groupId>cactus</groupId>
- <artifactId>cactus</artifactId>
- <version>${cactus.version}</version>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
<dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <version>${clover.version}</version>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
@@ -102,11 +106,6 @@
<version>${hsqldb.version}</version>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${servlet-api.version}</version>
- </dependency>
- <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-j2ee</artifactId>
<version>${jboss.j2ee.version}</version>
@@ -132,26 +131,37 @@
<version>${junit.version}</version>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
+ <groupId>org.livetribe</groupId>
+ <artifactId>livetribe-jsr223</artifactId>
+ <version>${jsr233.version}</version>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>${hibernate.version}</version>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>${spring.version}</version>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${servlet-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <version>${cactus.version}</version>
+ </dependency>
+
+<!--
+ <dependency>
+ <groupId>com.cenqua.clover</groupId>
+ <artifactId>clover</artifactId>
+ <version>${clover.version}</version>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${jboss.seam.version}</version>
</dependency>
<dependency>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- <version>${jsr233.version}</version>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
@@ -161,11 +171,7 @@
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>${spring.version}</version>
- </dependency>
+ -->
</dependencies>
</dependencyManagement>
More information about the jbpm-commits
mailing list