JBoss JBPM SVN: r3157 - in jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration: jboss42 and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 12:06:35 -0500 (Fri, 28 Nov 2008)
New Revision: 3157
Added:
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/deployment/
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/deployment/SimpleDeploymentTest.java
Removed:
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/
Log:
Move JBoss42 SimpleDeploymentTest
Copied: jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/deployment/SimpleDeploymentTest.java (from rev 3156, jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java)
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/deployment/SimpleDeploymentTest.java (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/jboss42/deployment/SimpleDeploymentTest.java 2008-11-28 17:06:35 UTC (rev 3157)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.integration.jboss42.deployment;
+
+// $Id$
+
+import org.jboss.bpm.api.test.IntegrationTestCase;
+
+/**
+ * Test simple jPDL process deployment
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Nov-2008
+ */
+public class SimpleDeploymentTest extends IntegrationTestCase
+{
+ String XML_DEPLOYMENT = "deployment/simple-process.xml";
+ String PAR_DEPLOYMENT = "fork-join-example.par";
+
+ public void testSimpleXMLDeploy() throws Exception
+ {
+ deploy(getResourceURL(XML_DEPLOYMENT));
+ }
+
+ public void testSimpleXMLUndeploy() throws Exception
+ {
+ undeploy(getResourceURL(XML_DEPLOYMENT));
+ }
+
+ public void testSimplePARDeploy() throws Exception
+ {
+ deploy(getTestArchiveURL(PAR_DEPLOYMENT));
+ }
+
+ public void testSimplePARUndeploy() throws Exception
+ {
+ undeploy(getTestArchiveURL(PAR_DEPLOYMENT));
+ }
+}
17 years, 4 months
JBoss JBPM SVN: r3156 - in jbpm3/trunk/modules/integration/jboss42: scripts and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 11:57:06 -0500 (Fri, 28 Nov 2008)
New Revision: 3156
Added:
jbpm3/trunk/modules/integration/jboss42/scripts/antrun-test-jars.xml
jbpm3/trunk/modules/integration/jboss42/src/test/resources/deployment/
jbpm3/trunk/modules/integration/jboss42/src/test/resources/deployment/fork-join-example/
Removed:
jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/
Modified:
jbpm3/trunk/modules/integration/jboss42/pom.xml
jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java
Log:
Enable PAR hot-deployment testing
Modified: jbpm3/trunk/modules/integration/jboss42/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/pom.xml 2008-11-28 16:42:27 UTC (rev 3155)
+++ jbpm3/trunk/modules/integration/jboss42/pom.xml 2008-11-28 16:57:06 UTC (rev 3156)
@@ -101,6 +101,25 @@
</testResources>
<plugins>
<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="tests.resources.dir" value="${basedir}/src/test/resources" />
+ <ant antfile="scripts/antrun-test-jars.xml" target="build-test-jars" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
Added: jbpm3/trunk/modules/integration/jboss42/scripts/antrun-test-jars.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/scripts/antrun-test-jars.xml (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/scripts/antrun-test-jars.xml 2008-11-28 16:57:06 UTC (rev 3156)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ============================================================ -->
+
+<!-- $Id$ -->
+
+<project>
+
+ <description>jBPM enterprise test archive builder</description>
+
+ <!-- ================================================================== -->
+ <!-- Building -->
+ <!-- ================================================================== -->
+
+ <target name="build-test-jars" description="Build the test deployments">
+
+ <mkdir dir="${tests.output.dir}/test-libs"/>
+
+ <!-- fork-join-example -->
+ <jar jarfile="${tests.output.dir}/test-libs/fork-join-example.par">
+ <fileset dir="${tests.resources.dir}/deployment/fork-join-example"/>
+ </jar>
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Property changes on: jbpm3/trunk/modules/integration/jboss42/scripts/antrun-test-jars.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml 2008-11-28 16:42:27 UTC (rev 3155)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml 2008-11-28 16:57:06 UTC (rev 3156)
@@ -4,7 +4,7 @@
$Id$
-->
<server>
- <mbean code="org.jbpm.integration.spec.jboss42.PARSubDeployer"
+ <mbean code="org.jbpm.integration.jboss42.PARSubDeployer"
name="jboss.deployer:service=PARDeployer">
</mbean>
</server>
\ No newline at end of file
Modified: jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java 2008-11-28 16:42:27 UTC (rev 3155)
+++ jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java 2008-11-28 16:57:06 UTC (rev 3156)
@@ -33,8 +33,8 @@
*/
public class SimpleDeploymentTest extends IntegrationTestCase
{
- String PAR_DEPLOYMENT = "simple/fork-join-example.par";
- String XML_DEPLOYMENT = "simple/simple-process.xml";
+ String XML_DEPLOYMENT = "deployment/simple-process.xml";
+ String PAR_DEPLOYMENT = "fork-join-example.par";
public void testSimpleXMLDeploy() throws Exception
{
@@ -46,13 +46,13 @@
undeploy(getResourceURL(XML_DEPLOYMENT));
}
- public void _testSimplePARDeploy() throws Exception
+ public void testSimplePARDeploy() throws Exception
{
- deploy(getResourceURL(PAR_DEPLOYMENT));
+ deploy(getTestArchiveURL(PAR_DEPLOYMENT));
}
- public void _testSimplePARUndeploy() throws Exception
+ public void testSimplePARUndeploy() throws Exception
{
- undeploy(getResourceURL(PAR_DEPLOYMENT));
+ undeploy(getTestArchiveURL(PAR_DEPLOYMENT));
}
}
Copied: jbpm3/trunk/modules/integration/jboss42/src/test/resources/deployment (from rev 3150, jbpm3/trunk/modules/integration/spec/src/test/resources/deployment)
Copied: jbpm3/trunk/modules/integration/jboss42/src/test/resources/deployment/fork-join-example (from rev 3154, jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example)
17 years, 4 months
JBoss JBPM SVN: r3155 - jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 11:42:27 -0500 (Fri, 28 Nov 2008)
New Revision: 3155
Added:
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ParallelGatewayImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/UserTaskImpl.java
Log:
Refactor Spec Integration
Added: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ParallelGatewayImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ParallelGatewayImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ParallelGatewayImpl.java 2008-11-28 16:42:27 UTC (rev 3155)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+// $Id$
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.incubator.model.ParallelGateway;
+import org.jbpm.graph.node.Fork;
+import org.jbpm.graph.node.Join;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class ParallelGatewayImpl extends GatewayImpl implements ParallelGateway
+{
+ private static final long serialVersionUID = 1L;
+
+ public ParallelGatewayImpl(ProcessDefinition procDef, Fork oldFork)
+ {
+ super(procDef, oldFork);
+ }
+
+ public ParallelGatewayImpl(ProcessDefinition procDef, Join oldJoin)
+ {
+ super(procDef, oldJoin);
+ }
+
+ // @Override
+ public GatewayType getGatewayType()
+ {
+ return GatewayType.Parallel;
+ }
+}
Property changes on: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ParallelGatewayImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/UserTaskImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/UserTaskImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/UserTaskImpl.java 2008-11-28 16:42:27 UTC (rev 3155)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.incubator.client.UserTaskCallback;
+import org.jboss.bpm.incubator.model.Message;
+import org.jboss.bpm.incubator.model.UserTask;
+import org.jbpm.graph.node.TaskNode;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class UserTaskImpl extends TaskImpl implements UserTask
+{
+ private static final long serialVersionUID = 1L;
+
+ public UserTaskImpl(ProcessDefinition procDef, TaskNode oldTaskNode)
+ {
+ super(procDef, oldTaskNode);
+ }
+
+ // @Override
+ public TaskType getTaskType()
+ {
+ return TaskType.User;
+ }
+
+ public Message getInMessageRef()
+ {
+ throw new NotImplementedException();
+ }
+
+ public Message getOutMessageRef()
+ {
+ throw new NotImplementedException();
+ }
+
+ public UserTaskCallback getUserTaskCallback()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void setUserTaskCallback(UserTaskCallback callback)
+ {
+ throw new NotImplementedException();
+ }
+}
Property changes on: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/UserTaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBoss JBPM SVN: r3154 - in jbpm3/trunk/modules/integration: spec and 17 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 11:41:56 -0500 (Fri, 28 Nov 2008)
New Revision: 3154
Added:
jbpm3/trunk/modules/integration/spec/scripts/antrun-test-jars.xml
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/client/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/jpdl32/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EndEventImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EventImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExpressionImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/GatewayImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/NodeImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessDefinitionImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/SequenceFlowImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/StartEventImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/TaskImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/WaitStateImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/task/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/gpd.xml
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processdefinition.xml
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processimage.jpg
Removed:
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/jpdl32/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/task/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/
Modified:
jbpm3/trunk/modules/integration/jboss42/src/main/etc/jboss-beans.xml
jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
jbpm3/trunk/modules/integration/spec/pom.xml
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/client/ProcessEngineImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/AbstractDeployment.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/PARDeployment.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/XMLDeployment.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/GatewayBuilderImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/ProcessBuilderImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/ExpressionEvaluator.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeExecuteInterceptor.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeInterceptor.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/RuntimeContext.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ExecutionServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/MutableService.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/NoopPersistenceServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessBuilderServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/TaskServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/task/TaskImpl.java
jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentXMLTest.java
Log:
Refactor Spec Integration
Modified: jbpm3/trunk/modules/integration/jboss42/src/main/etc/jboss-beans.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/jboss-beans.xml 2008-11-28 16:40:34 UTC (rev 3153)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/jboss-beans.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -10,7 +10,7 @@
</bean>
<!-- The ProcessEngine -->
- <bean name="BPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
+ <bean name="BPMProcessEngine" class="org.jbpm.integration.spec.client.ProcessEngineImpl">
<property name="services">
<set elementClass="org.jboss.bpm.api.service.Service">
<inject bean="BPMDeploymentService"/>
@@ -26,19 +26,19 @@
</bean>
<!-- The PersistenceService -->
- <bean name="BPMPersistenceService" class="org.jbpm.integration.service.NoopPersistenceServiceImpl" />
+ <bean name="BPMPersistenceService" class="org.jbpm.integration.spec.service.NoopPersistenceServiceImpl" />
<!-- The ProcessService -->
- <bean name="BPMProcessService" class="org.jbpm.integration.service.ProcessServiceImpl">
+ <bean name="BPMProcessService" class="org.jbpm.integration.spec.service.ProcessServiceImpl">
<property name="interceptors">
<list elementClass="java.lang.String">
- <value>org.jbpm.integration.runtime.NodeExecuteInterceptor</value>
+ <value>org.jbpm.integration.spec.runtime.NodeExecuteInterceptor</value>
</list>
</property>
</bean>
<!-- The DialectHandlerService -->
- <bean name="BPMDialectHandlerService" class="org.jbpm.integration.service.DialectHandlerServiceImpl">
+ <bean name="BPMDialectHandlerService" class="org.jbpm.integration.spec.service.DialectHandlerServiceImpl">
<property name="dialectHandlers">
<map keyClass="java.net.URI" valueClass="org.jboss.bpm.api.service.DialectHandler">
<entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="BPMDialectHandlerAPI10"/></value></entry>
@@ -47,14 +47,14 @@
</property>
</bean>
<bean name="BPMDialectHandlerAPI10" class="org.jboss.bpm.dialect.api10.DialectHandlerImpl" />
- <bean name="BPMDialectHandlerJPDL32" class="org.jbpm.integration.jpdl32.DialectHandlerImpl" />
+ <bean name="BPMDialectHandlerJPDL32" class="org.jbpm.integration.spec.jpdl32.DialectHandlerImpl" />
<!-- Other Services -->
- <bean name="BPMDeploymentService" class="org.jbpm.integration.service.DeploymentServiceImpl" />
- <bean name="BPMExecutionService" class="org.jbpm.integration.service.ExecutionServiceImpl" />
- <bean name="BPMIdentityService" class="org.jbpm.integration.service.IdentityServiceImpl" />
- <bean name="BPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
- <bean name="BPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
- <bean name="BPMTaskService" class="org.jbpm.integration.service.TaskServiceImpl" />
+ <bean name="BPMDeploymentService" class="org.jbpm.integration.spec.service.DeploymentServiceImpl" />
+ <bean name="BPMExecutionService" class="org.jbpm.integration.spec.service.ExecutionServiceImpl" />
+ <bean name="BPMIdentityService" class="org.jbpm.integration.spec.service.IdentityServiceImpl" />
+ <bean name="BPMProcessBuilderService" class="org.jbpm.integration.spec.service.ProcessBuilderServiceImpl" />
+ <bean name="BPMProcessDefinitionService" class="org.jbpm.integration.spec.service.ProcessDefinitionServiceImpl" />
+ <bean name="BPMTaskService" class="org.jbpm.integration.spec.service.TaskServiceImpl" />
</deployment>
Modified: jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml 2008-11-28 16:40:34 UTC (rev 3153)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -4,7 +4,7 @@
$Id$
-->
<server>
- <mbean code="org.jbpm.integration.jboss42.PARSubDeployer"
+ <mbean code="org.jbpm.integration.spec.jboss42.PARSubDeployer"
name="jboss.deployer:service=PARDeployer">
</mbean>
</server>
\ No newline at end of file
Modified: jbpm3/trunk/modules/integration/spec/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/pom.xml 2008-11-28 16:40:34 UTC (rev 3153)
+++ jbpm3/trunk/modules/integration/spec/pom.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -114,6 +114,25 @@
</executions>
</plugin>
<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="tests.resources.dir" value="${basedir}/src/test/resources" />
+ <ant antfile="scripts/antrun-test-jars.xml" target="build-test-jars" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
Added: jbpm3/trunk/modules/integration/spec/scripts/antrun-test-jars.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/scripts/antrun-test-jars.xml (rev 0)
+++ jbpm3/trunk/modules/integration/spec/scripts/antrun-test-jars.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ============================================================ -->
+
+<!-- $Id$ -->
+
+<project>
+
+ <description>jBPM enterprise test archive builder</description>
+
+ <!-- ================================================================== -->
+ <!-- Building -->
+ <!-- ================================================================== -->
+
+ <target name="build-test-jars" description="Build the test deployments">
+
+ <mkdir dir="${tests.output.dir}/test-libs"/>
+
+ <!-- fork-join-example -->
+ <jar jarfile="${tests.output.dir}/test-libs/fork-join-example.par">
+ <fileset dir="${tests.resources.dir}/deployment/fork-join-example"/>
+ </jar>
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Property changes on: jbpm3/trunk/modules/integration/spec/scripts/antrun-test-jars.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/client (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/client/ProcessEngineImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/client/ProcessEngineImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.client;
+package org.jbpm.integration.spec.client;
//$Id$
@@ -28,7 +28,7 @@
import org.jboss.bpm.api.client.ProcessEngine;
import org.jboss.bpm.api.service.Service;
import org.jbpm.JbpmConfiguration;
-import org.jbpm.integration.service.MutableService;
+import org.jbpm.integration.spec.service.MutableService;
/**
* A process engine with public access
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/AbstractDeployment.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/AbstractDeployment.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/AbstractDeployment.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.deployment;
+package org.jbpm.integration.spec.deployment;
// $Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/PARDeployment.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/PARDeployment.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/PARDeployment.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,11 +19,10 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.deployment;
+package org.jbpm.integration.spec.deployment;
// $Id$
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.zip.ZipEntry;
@@ -49,15 +48,12 @@
public String getProcessDefinitionXML() throws IOException
{
- byte[] bytes = IoUtil.readBytes(pdURL.openStream());
- System.out.println(bytes.length);
-
- ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(bytes));
+ ZipInputStream zipInputStream = new ZipInputStream(pdURL.openStream());
ZipEntry zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null)
{
String entryName = zipEntry.getName();
- bytes = IoUtil.readBytes(zipInputStream);
+ byte[] bytes = IoUtil.readBytes(zipInputStream);
if (bytes != null)
{
addAttachment(entryName, bytes);
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/XMLDeployment.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/XMLDeployment.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/deployment/XMLDeployment.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.deployment;
+package org.jbpm.integration.spec.deployment;
// $Id$
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/jpdl32 (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/jpdl32)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/jpdl32/DialectHandlerImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.jpdl32;
+package org.jbpm.integration.spec.jpdl32;
// $Id$
@@ -33,7 +33,7 @@
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.service.AbstractDialectHandler;
import org.jboss.bpm.api.service.DialectHandler;
-import org.jbpm.integration.model.ProcessDefinitionImpl;
+import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
/**
* A jPDL a {@link DialectHandler}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EndEventImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EndEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EndEventImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,67 @@
+/*
+ * 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.integration.spec.model;
+
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.model.EndEvent;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jbpm.graph.node.EndState;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class EndEventImpl extends EventImpl implements EndEvent
+{
+ private static final long serialVersionUID = 1L;
+
+ public EndEventImpl(ProcessDefinition procDef, EndState oldEnd)
+ {
+ super(procDef, oldEnd);
+ }
+
+ //@Override
+ public EventDetailType getResultType()
+ {
+ return EventDetailType.None;
+ }
+
+ //@Override
+ public EventType getEventType()
+ {
+ return EventType.End;
+ }
+
+ //@Override
+ public SequenceFlow getInFlow()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String toString()
+ {
+ return getEventType() + "Event[" + getName() + "," + getResultType() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EventImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EventImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/EventImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -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.integration.spec.model;
+
+import org.jboss.bpm.api.model.Event;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jbpm.graph.def.Node;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public abstract class EventImpl extends NodeImpl implements Event
+{
+ private static final long serialVersionUID = 1L;
+
+ public EventImpl(ProcessDefinition procDef, Node oldNode)
+ {
+ super(procDef, oldNode);
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+// $Id$
+
+import org.jboss.bpm.api.model.ExclusiveGateway;
+import org.jboss.bpm.api.model.Expression;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.SequenceFlow.ConditionType;
+import org.jboss.bpm.api.runtime.Token;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.node.Decision;
+import org.jbpm.graph.node.DecisionHandler;
+import org.jbpm.instantiation.Delegation;
+import org.jbpm.integration.spec.runtime.ExpressionEvaluator;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class ExclusiveGatewayImpl extends GatewayImpl implements ExclusiveGateway
+{
+ private static final long serialVersionUID = 1L;
+
+ public ExclusiveGatewayImpl(ProcessDefinition procDef, Decision oldDecision)
+ {
+ super(procDef, oldDecision);
+ ExclusiveGatewayDecisionHandler decisionHandler = new ExclusiveGatewayDecisionHandler();
+ oldDecision.setDecisionDelegation(new Delegation(decisionHandler));
+ }
+
+ //@Override
+ public GatewayType getGatewayType()
+ {
+ return GatewayType.Exclusive;
+ }
+
+ //@Override
+ public ExclusiveType getExclusiveType()
+ {
+ return ExclusiveType.Data;
+ }
+
+ class ExclusiveGatewayDecisionHandler implements DecisionHandler
+ {
+ private static final long serialVersionUID = 1L;
+
+ //@Override
+ public String decide(ExecutionContext executionContext) throws Exception
+ {
+ ProcessImpl procImpl = (ProcessImpl)getProcess();
+ Token token = procImpl.getRootToken();
+
+ SequenceFlow selectedGate = null;
+ for (SequenceFlow auxGate : getGates())
+ {
+ SequenceFlow seqFlow = auxGate;
+ if (seqFlow.getConditionType() == ConditionType.Expression)
+ {
+ Expression expr = seqFlow.getConditionExpression();
+ ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);
+ if ((Boolean)exprEvaluator.evaluateExpression(token))
+ {
+ selectedGate = auxGate;
+ break;
+ }
+ }
+ }
+
+ // Use to the default gate if there is one
+ if (selectedGate == null)
+ {
+ for (SequenceFlow auxGate : getGates())
+ {
+ SequenceFlow seqFlow = auxGate;
+ if (seqFlow.getConditionType() == ConditionType.Default)
+ {
+ selectedGate = auxGate;
+ break;
+ }
+ }
+ }
+
+ // Fallback to the single outgoing gate that is not conditional
+ if (selectedGate == null && getGates().size() == 1)
+ {
+ SequenceFlow auxGate = getGates().get(0);
+ SequenceFlow seqFlow = auxGate;
+ if (seqFlow.getConditionType() == ConditionType.None)
+ {
+ selectedGate = auxGate;
+ }
+ }
+
+ if (selectedGate == null)
+ throw new IllegalStateException("Cannot select applicable gate in: " + getOldNode());
+
+ return selectedGate.getTargetRef();
+ }
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExpressionImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExpressionImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExpressionImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ExpressionImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,67 @@
+/*
+ * 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.integration.spec.model;
+
+//$Id$
+
+import org.jboss.bpm.api.model.Expression;
+
+/**
+ * An Expression, which is used in the definition of attributes for @{link StartEvent},
+ *
+ * @{link IntermediateEvent}, @{link Activity}, @{link ComplexGateway}, and @{link SequenceFlow}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Nov-2008
+ */
+public class ExpressionImpl implements Expression
+{
+ // provide serial version UID
+ private static final long serialVersionUID = 1L;
+
+ private String body;
+ private ExpressionLanguage lang;
+
+ public ExpressionImpl(String body)
+ {
+ this.body = body;
+ this.lang = ExpressionLanguage.MVEL;
+ }
+
+ public ExpressionImpl(ExpressionLanguage lang, String body)
+ {
+ this.body = body;
+ this.lang = lang;
+ }
+
+ //@Override
+ public ExpressionLanguage getExpressionLanguage()
+ {
+ return lang;
+ }
+
+ //@Override
+ public String getExpressionBody()
+ {
+ return body;
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/GatewayImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/GatewayImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/GatewayImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/GatewayImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,69 @@
+/*
+ * 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.integration.spec.model;
+
+import java.util.List;
+
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.model.Gateway;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jbpm.graph.def.Node;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public abstract class GatewayImpl extends NodeImpl implements Gateway
+{
+ private static final long serialVersionUID = 1L;
+
+ public GatewayImpl(ProcessDefinition procDef, Node oldNode)
+ {
+ super(procDef, oldNode);
+ }
+
+ //@Override
+ public List<SequenceFlow> getGates()
+ {
+ return getOutFlows();
+ }
+
+ //@Override
+ public SequenceFlow getGateByName(String targetName)
+ {
+ throw new NotImplementedException();
+ }
+
+ //@Override
+ public SequenceFlow getDefaultGate()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String toString()
+ {
+ return getGatewayType() + "Gateway[" + getName() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/NodeImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/NodeImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/NodeImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/NodeImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,118 @@
+/*
+ * 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.integration.spec.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.Constants;
+import org.jboss.bpm.api.InvalidProcessException;
+import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.model.Process;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class NodeImpl implements Node
+{
+ private static final long serialVersionUID = 1L;
+
+ private ProcessDefinition procDef;
+ private Process proc;
+
+ private org.jbpm.graph.def.Node oldNode;
+ private List<SequenceFlow> outFlows = new ArrayList<SequenceFlow>();
+
+ public NodeImpl(ProcessDefinition procDef, org.jbpm.graph.def.Node oldNode)
+ {
+ this.procDef = procDef;
+ this.oldNode = oldNode;
+ }
+
+ public ObjectName getKey()
+ {
+ long id = oldNode.getId();
+ return ObjectNameFactory.create(Constants.ID_DOMAIN + ":node=" + getName() + ",id=" + id);
+ }
+
+ public org.jbpm.graph.def.Node getOldNode()
+ {
+ return oldNode;
+ }
+
+ public String getName()
+ {
+ return oldNode.getName();
+ }
+
+ public ProcessDefinition getProcessDefinition()
+ {
+ return procDef;
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public void setProcess(Process proc)
+ {
+ this.proc = proc;
+ }
+
+ public void addSequenceFlow(SequenceFlowImpl flow)
+ {
+ String targetRef = flow.getTargetRef();
+ NodeImpl targetNode = (NodeImpl)procDef.getNode(targetRef);
+ if (targetNode == null)
+ throw new InvalidProcessException("Cannot obtain target node: " + targetRef);
+
+ Transition trans = flow.getOldTransition();
+ if (oldNode.hasLeavingTransition(trans.getName()) == false)
+ {
+ oldNode.addLeavingTransition(trans);
+ targetNode.getOldNode().addArrivingTransition(trans);
+ }
+
+ outFlows.add(flow);
+ }
+
+ public List<SequenceFlow> getOutFlows()
+ {
+ return Collections.unmodifiableList(outFlows);
+ }
+
+ public String toString()
+ {
+ return oldNode.toString();
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessDefinitionImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessDefinitionImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessDefinitionImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,224 @@
+/*
+ * 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.integration.spec.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.Constants;
+import org.jboss.bpm.api.InvalidProcessException;
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.client.ProcessEngine;
+import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.model.Process;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.node.EndState;
+import org.jbpm.graph.node.Fork;
+import org.jbpm.graph.node.Join;
+import org.jbpm.graph.node.StartState;
+import org.jbpm.graph.node.State;
+import org.jbpm.graph.node.TaskNode;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class ProcessDefinitionImpl implements ProcessDefinition
+{
+ private static final long serialVersionUID = 1L;
+
+ private org.jbpm.graph.def.ProcessDefinition oldProcDef;
+ private ProcessEngine engine;
+ private Map<String, Node> nodes = new LinkedHashMap<String, Node>();
+
+ public ProcessDefinitionImpl(ProcessEngine engine, String name)
+ {
+ this(engine, new org.jbpm.graph.def.ProcessDefinition(name));
+ }
+
+ public ProcessDefinitionImpl(ProcessEngine engine, org.jbpm.graph.def.ProcessDefinition oldProcDef)
+ {
+ this.oldProcDef = oldProcDef;
+ this.engine = engine;
+
+ if (oldProcDef.getName() == null)
+ throw new InvalidProcessException("ProcessDefinition name cannot be null");
+
+ if (oldProcDef.getNodes() != null)
+ {
+ initializeNodes(oldProcDef);
+ initializeSequenceFlows(oldProcDef);
+ }
+ }
+
+ public org.jbpm.graph.def.ProcessDefinition getOldProcessDefinition()
+ {
+ return oldProcDef;
+ }
+
+ public ProcessEngine getProcessEngine()
+ {
+ return engine;
+ }
+
+ public ObjectName getKey()
+ {
+ long id = oldProcDef.getId();
+ String version = getVersion();
+
+ String keyStr = Constants.ID_DOMAIN + ":procdef=" + getName() + ",id=" + id;
+ if (version != null)
+ keyStr += ",version=" + version;
+
+ return ObjectNameFactory.create(keyStr);
+ }
+
+ public String getName()
+ {
+ return oldProcDef.getName();
+ }
+
+ public String getVersion()
+ {
+ int version = oldProcDef.getVersion();
+ return version > 0 ? String.valueOf(version) : null;
+ }
+
+ public Process newInstance()
+ {
+ ProcessImpl procImpl = new ProcessImpl(this);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.setProcess(procImpl);
+ }
+ return procImpl;
+ }
+
+ public void addNode(NodeImpl nodeImpl)
+ {
+ org.jbpm.graph.def.Node oldNode = nodeImpl.getOldNode();
+ oldProcDef.addNode(oldNode);
+ nodes.put(oldNode.getName(), nodeImpl);
+ }
+
+ public Node getNode(String name)
+ {
+ return nodes.get(name);
+ }
+
+ public List<Node> getNodes()
+ {
+ List<Node> nodeList = new ArrayList<Node>(nodes.values());
+ return Collections.unmodifiableList(nodeList);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Node> T getNode(Class<T> clazz, String name)
+ {
+ for (Node node : getNodes(clazz))
+ {
+ if (node.getName().equals(name))
+ return (T)node;
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Node> List<T> getNodes(Class<T> clazz)
+ {
+ List<T> retNodes = new ArrayList<T>();
+ for (Node node : getNodes())
+ {
+ if (clazz.isAssignableFrom(node.getClass()))
+ retNodes.add((T)node);
+ }
+ return retNodes;
+ }
+
+ private void initializeNodes(org.jbpm.graph.def.ProcessDefinition oldProcDef)
+ {
+ for(org.jbpm.graph.def.Node oldNode : oldProcDef.getNodes())
+ {
+ NodeImpl nodeImpl;
+ if (oldNode instanceof StartState)
+ {
+ nodeImpl = new StartEventImpl(this, (StartState)oldNode);
+ }
+ else if (oldNode instanceof State)
+ {
+ nodeImpl = new WaitStateImpl(this, (State)oldNode);
+ }
+ else if (oldNode instanceof Fork)
+ {
+ nodeImpl = new ParallelGatewayImpl(this, (Fork)oldNode);
+ }
+ else if (oldNode instanceof Join)
+ {
+ nodeImpl = new ParallelGatewayImpl(this, (Join)oldNode);
+ }
+ else if (oldNode instanceof TaskNode)
+ {
+ nodeImpl = new UserTaskImpl(this, (TaskNode)oldNode);
+ }
+ else if (oldNode instanceof EndState)
+ {
+ nodeImpl = new EndEventImpl(this, (EndState)oldNode);
+ }
+ else
+ {
+ throw new NotImplementedException("Unsupported node type: " + oldNode);
+ }
+ nodes.put(oldNode.getName(), nodeImpl);
+ }
+ }
+
+ private void initializeSequenceFlows(org.jbpm.graph.def.ProcessDefinition oldProcDef)
+ {
+ for(org.jbpm.graph.def.Node oldNode : oldProcDef.getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)nodes.get(oldNode.getName());
+ if (oldNode.getLeavingTransitions() != null)
+ {
+ for (Transition trans : oldNode.getLeavingTransitions())
+ {
+ SequenceFlowImpl seqFlow = new SequenceFlowImpl(trans);
+ nodeImpl.addSequenceFlow(seqFlow);
+ }
+ }
+ }
+ }
+
+ public String toString()
+ {
+ return "ProcessDefinition[" + getKey() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/ProcessImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,239 @@
+/*
+ * 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.integration.spec.model;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.Constants;
+import org.jboss.bpm.api.client.ProcessEngine;
+import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.model.Process;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Attachments.Key;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
+import org.jboss.bpm.api.service.ProcessService;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.integration.spec.runtime.TokenImpl;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class ProcessImpl implements Process
+{
+ private static final long serialVersionUID = 1L;
+
+ private ProcessDefinitionImpl procDef;
+ private ProcessInstance oldProc;
+ private ProcessStatus status = ProcessStatus.None;
+
+ public ProcessImpl(ProcessDefinitionImpl procDef)
+ {
+ this.procDef = procDef;
+ this.oldProc = new ProcessInstance(procDef.getOldProcessDefinition());
+ }
+
+ // @Override
+ public ObjectName getKey()
+ {
+ long id = oldProc.getId();
+ return ObjectNameFactory.create(Constants.ID_DOMAIN + ":proc=" + getName() + ",id=" + id);
+ }
+
+ // @Override
+ public ProcessDefinition getProcessDefinition()
+ {
+ return procDef;
+ }
+
+ // @Override
+ public ProcessEngine getProcessEngine()
+ {
+ return procDef.getProcessEngine();
+ }
+
+ public ProcessInstance getOldProcessInstance()
+ {
+ return oldProc;
+ }
+
+ // @Override
+ public ProcessStatus getProcessStatus()
+ {
+ Token rootToken = getRootToken();
+ TokenStatus tokenStatus = rootToken != null ? rootToken.getTokenStatus() : null;
+
+ if (oldProc.isSuspended())
+ status = ProcessStatus.Suspended;
+
+ if (status == ProcessStatus.Active)
+ {
+ if (oldProc.hasEnded() || tokenStatus == TokenStatus.Destroyed)
+ status = ProcessStatus.Completed;
+ }
+ return status;
+ }
+
+ public void setProcessStatus(ProcessStatus status)
+ {
+ this.status = status;
+ }
+
+ // @Override
+ public String getName()
+ {
+ return procDef.getName();
+ }
+
+ public Date getEndDate()
+ {
+ return oldProc.getEnd();
+ }
+
+ public Date getStartDate()
+ {
+ return oldProc.getStart();
+ }
+
+ // @Override
+ public <T extends Node> T getNode(Class<T> clazz, String name)
+ {
+ return procDef.getNode(clazz, name);
+ }
+
+ // @Override
+ public Node getNode(String name)
+ {
+ return procDef.getNode(name);
+ }
+
+ // @Override
+ public List<Node> getNodes()
+ {
+ return procDef.getNodes();
+ }
+
+ // @Override
+ public <T extends Node> List<T> getNodes(Class<T> clazz)
+ {
+ return procDef.getNodes(clazz);
+ }
+
+ // @Override
+ public Token startProcess()
+ {
+ return startProcess(null);
+ }
+
+ // @Override
+ public Token startProcess(Attachments contextData)
+ {
+ // Register the Process
+ ProcessService procService = getProcessEngine().getService(ProcessService.class);
+ procService.registerProcess(this);
+
+ // Create the root token
+ Token token = new TokenImpl(this, oldProc.getRootToken());
+
+ // Initialize the context data
+ if (contextData != null)
+ {
+ Attachments tokenAtt = token.getAttachments();
+ for (Key key : contextData.getAttachmentKeys())
+ {
+ Object val = contextData.getAttachment(key.getClassPart(), key.getNamePart());
+ tokenAtt.addAttachment(key.getClassPart(), key.getNamePart(), val);
+ }
+ }
+
+ // Signal the root token
+ setProcessStatus(ProcessStatus.Active);
+ token.signal();
+
+ return token;
+ }
+
+ public Token getRootToken()
+ {
+ return new TokenImpl(this, oldProc.getRootToken());
+ }
+
+ public Set<Token> getTokens()
+ {
+ return getAllTokens(getRootToken());
+ }
+
+ public void suspend()
+ {
+ if (status != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot suspend a process in state: " + status);
+
+ oldProc.suspend();
+ status = ProcessStatus.Suspended;
+ }
+
+ public void resume()
+ {
+ if (status != ProcessStatus.Suspended)
+ throw new IllegalStateException("Cannot resume a process in state: " + status);
+
+ oldProc.resume();
+ status = ProcessStatus.Active;
+ }
+
+ public void cancel()
+ {
+ if (status != ProcessStatus.Active && status != ProcessStatus.Suspended)
+ throw new IllegalStateException("Cannot cancel a process in state: " + status);
+
+ oldProc.setEnd(new Date());
+ oldProc.end();
+ status = ProcessStatus.Cancelled;
+ }
+
+ private Set<Token> getAllTokens(Token token)
+ {
+ Set<Token> tokens = new HashSet<Token>();
+ if (token != null)
+ {
+ tokens.add(token);
+ for (Token childToken : token.getChildTokens())
+ tokens.addAll(getAllTokens(childToken));
+ }
+ return tokens;
+ }
+
+ public String toString()
+ {
+ return "Process[" + getKey() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/SequenceFlowImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/SequenceFlowImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/SequenceFlowImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,96 @@
+/*
+ * 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.integration.spec.model;
+
+import org.jboss.bpm.api.model.Expression;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class SequenceFlowImpl implements SequenceFlow
+{
+ private static final long serialVersionUID = 1L;
+
+ private Transition oldTrans;
+ private ConditionType condType = ConditionType.None;
+ private Expression expr;
+
+ public SequenceFlowImpl(Transition oldTrans)
+ {
+ this.oldTrans = oldTrans;
+ }
+
+ public SequenceFlowImpl(Transition oldTrans, ExpressionLanguage exprLang, String exprBody)
+ {
+ this.oldTrans = oldTrans;
+
+ if (exprLang != null && exprBody != null)
+ {
+ this.condType = ConditionType.Expression;
+ this.expr = new ExpressionImpl(exprLang, exprBody);
+ }
+ }
+
+ public Transition getOldTransition()
+ {
+ return oldTrans;
+ }
+
+ //@Override
+ public String getName()
+ {
+ return oldTrans.getName();
+ }
+
+ //@Override
+ public Expression getConditionExpression()
+ {
+ return expr;
+ }
+
+ //@Override
+ public ConditionType getConditionType()
+ {
+ return condType;
+ }
+
+ //@Override
+ public String getSourceRef()
+ {
+ Node from = oldTrans.getFrom();
+ return from != null ? from.getName() : null;
+ }
+
+ //@Override
+ public String getTargetRef()
+ {
+ Node to = oldTrans.getTo();
+ return to != null ? to.getName() : null;
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/StartEventImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/StartEventImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/StartEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/StartEventImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+import java.util.List;
+
+import org.jboss.bpm.api.InvalidProcessException;
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.StartEvent;
+import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.node.StartState;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class StartEventImpl extends EventImpl implements StartEvent
+{
+ private static final long serialVersionUID = 1L;
+
+ private StartState oldStart;
+
+ public StartEventImpl(ProcessDefinition procDef, StartState oldStart)
+ {
+ super(procDef, oldStart);
+ this.oldStart = oldStart;
+
+ if (oldStart.getName() == null)
+ throw new InvalidProcessException("StartEvent name cannot be null");
+ }
+
+ //@Override
+ public EventDetailType getTriggerType()
+ {
+ return EventDetailType.None;
+ }
+
+ //@Override
+ public EventType getEventType()
+ {
+ return EventType.Start;
+ }
+
+ //@Override
+ public SequenceFlow getOutFlow()
+ {
+ List<Transition> leavingTransitions = oldStart.getLeavingTransitions();
+ if (leavingTransitions == null)
+ throw new IllegalStateException ("No leaving transitions on: " + oldStart);
+ if (leavingTransitions.size() > 1)
+ throw new NotImplementedException ("Multiple leaving transitions on: " + oldStart);
+
+ Transition to = leavingTransitions.get(0);
+ return new SequenceFlowImpl(to);
+ }
+
+ public String toString()
+ {
+ return getEventType() + "Event[" + getName() + "," + getTriggerType() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/TaskImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/TaskImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/TaskImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/TaskImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.Task;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class TaskImpl extends NodeImpl implements Task
+{
+ private static final long serialVersionUID = 1L;
+
+ public TaskImpl(ProcessDefinition procDef, org.jbpm.graph.def.Node oldNode)
+ {
+ super(procDef, oldNode);
+ }
+
+ //@Override
+ public TaskType getTaskType()
+ {
+ return TaskType.None;
+ }
+
+ //@Override
+ public SequenceFlow getInFlow()
+ {
+ Node oldNode = getOldNode();
+ Set<Transition> arrivingTransitions = oldNode.getArrivingTransitions();
+ if (arrivingTransitions == null)
+ throw new IllegalStateException("No leaving transitions on: " + oldNode);
+ if (arrivingTransitions.size() > 1)
+ throw new NotImplementedException("Multiple leaving transitions on: " + oldNode);
+
+ Transition from = arrivingTransitions.iterator().next();
+ return new SequenceFlowImpl(from);
+ }
+
+ //@Override
+ public SequenceFlow getOutFlow()
+ {
+ Node oldNode = getOldNode();
+ List<Transition> leavingTransitions = oldNode.getLeavingTransitions();
+ if (leavingTransitions == null)
+ throw new IllegalStateException("No leaving transitions on: " + oldNode);
+ if (leavingTransitions.size() > 1)
+ throw new NotImplementedException("Multiple leaving transitions on: " + oldNode);
+
+ Transition to = leavingTransitions.get(0);
+ return new SequenceFlowImpl(to);
+ }
+
+ public String toString()
+ {
+ return "Task[" + getTaskType() + "," + getName() + "]";
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/WaitStateImpl.java (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/WaitStateImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/WaitStateImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/WaitStateImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.model;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.WaitState;
+import org.jbpm.graph.node.State;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 15-Nov-2008
+ */
+public class WaitStateImpl extends TaskImpl implements WaitState
+{
+ private static final long serialVersionUID = 1L;
+
+ public WaitStateImpl(ProcessDefinition procDef, State oldState)
+ {
+ super(procDef, oldState);
+ }
+
+ //@Override
+ public TaskType getTaskType()
+ {
+ return TaskType.Wait;
+ }
+}
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/builder)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/GatewayBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/GatewayBuilderImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.model.builder;
+package org.jbpm.integration.spec.model.builder;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/ProcessBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/model/builder/ProcessBuilderImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.model.builder;
+package org.jbpm.integration.spec.model.builder;
//$Id$
@@ -45,14 +45,14 @@
import org.jbpm.graph.node.EndState;
import org.jbpm.graph.node.StartState;
import org.jbpm.graph.node.State;
-import org.jbpm.integration.model.EndEventImpl;
-import org.jbpm.integration.model.ExclusiveGatewayImpl;
-import org.jbpm.integration.model.NodeImpl;
-import org.jbpm.integration.model.ProcessDefinitionImpl;
-import org.jbpm.integration.model.SequenceFlowImpl;
-import org.jbpm.integration.model.StartEventImpl;
-import org.jbpm.integration.model.TaskImpl;
-import org.jbpm.integration.model.WaitStateImpl;
+import org.jbpm.integration.spec.model.EndEventImpl;
+import org.jbpm.integration.spec.model.ExclusiveGatewayImpl;
+import org.jbpm.integration.spec.model.NodeImpl;
+import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
+import org.jbpm.integration.spec.model.SequenceFlowImpl;
+import org.jbpm.integration.spec.model.StartEventImpl;
+import org.jbpm.integration.spec.model.TaskImpl;
+import org.jbpm.integration.spec.model.WaitStateImpl;
/**
* The ProcessBuilder can be used to dynamically build a {@link Process}.
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/ExpressionEvaluator.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/ExpressionEvaluator.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeExecuteInterceptor.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeExecuteInterceptor.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeInterceptor.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/NodeInterceptor.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/RuntimeContext.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/RuntimeContext.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenAttachmentDelegate.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenAttachmentDelegate.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
//$Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/runtime/TokenImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.runtime;
+package org.jbpm.integration.spec.runtime;
import java.util.Collection;
import java.util.HashSet;
@@ -39,7 +39,7 @@
import org.jboss.bpm.api.runtime.Attachments;
import org.jboss.bpm.api.runtime.Token;
import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.integration.model.ProcessImpl;
+import org.jbpm.integration.spec.model.ProcessImpl;
/**
* An integration wrapper
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DeploymentServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -33,8 +33,8 @@
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.service.DeploymentService;
import org.jboss.bpm.api.service.ProcessDefinitionService;
-import org.jbpm.integration.deployment.PARDeployment;
-import org.jbpm.integration.deployment.XMLDeployment;
+import org.jbpm.integration.spec.deployment.PARDeployment;
+import org.jbpm.integration.spec.deployment.XMLDeployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ExecutionServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ExecutionServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ExecutionServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/IdentityServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -35,7 +35,7 @@
import org.jbpm.identity.Group;
import org.jbpm.identity.User;
import org.jbpm.identity.hibernate.IdentitySession;
-import org.jbpm.integration.client.ProcessEngineImpl;
+import org.jbpm.integration.spec.client.ProcessEngineImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/MutableService.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/MutableService.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/MutableService.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/NoopPersistenceServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/NoopPersistenceServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessBuilderServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessBuilderServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -27,7 +27,7 @@
import org.jboss.bpm.api.model.Process;
import org.jboss.bpm.api.model.builder.ProcessBuilder;
import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jbpm.integration.model.builder.ProcessBuilderImpl;
+import org.jbpm.integration.spec.model.builder.ProcessBuilderImpl;
/**
* The ProcessBuilder can be used to build a {@link Process} dynamically.
*
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -36,8 +36,8 @@
import org.jboss.bpm.api.service.ProcessService;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
-import org.jbpm.integration.client.ProcessEngineImpl;
-import org.jbpm.integration.model.ProcessDefinitionImpl;
+import org.jbpm.integration.spec.client.ProcessEngineImpl;
+import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/ProcessServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -41,9 +41,9 @@
import org.jboss.bpm.api.service.ProcessService;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
-import org.jbpm.integration.client.ProcessEngineImpl;
-import org.jbpm.integration.model.ProcessImpl;
-import org.jbpm.integration.runtime.NodeInterceptor;
+import org.jbpm.integration.spec.client.ProcessEngineImpl;
+import org.jbpm.integration.spec.model.ProcessImpl;
+import org.jbpm.integration.spec.runtime.NodeInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/TaskServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/TaskServiceImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/service/TaskServiceImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.service;
+package org.jbpm.integration.spec.service;
// $Id$
@@ -33,8 +33,8 @@
import org.jboss.bpm.api.task.Task;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
-import org.jbpm.integration.client.ProcessEngineImpl;
-import org.jbpm.integration.task.TaskImpl;
+import org.jbpm.integration.spec.client.ProcessEngineImpl;
+import org.jbpm.integration.spec.task.TaskImpl;
import org.jbpm.taskmgmt.exe.TaskInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/task (from rev 3150, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/task)
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/task/TaskImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/task/TaskImpl.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/spec/task/TaskImpl.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.integration.task;
+package org.jbpm.integration.spec.task;
// $Id$
@@ -33,7 +33,7 @@
import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.service.ExecutionService;
import org.jboss.bpm.api.task.Task;
-import org.jbpm.integration.runtime.TokenImpl;
+import org.jbpm.integration.spec.runtime.TokenImpl;
import org.jbpm.taskmgmt.exe.PooledActor;
import org.jbpm.taskmgmt.exe.TaskInstance;
import org.slf4j.Logger;
Modified: jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml 2008-11-28 16:40:34 UTC (rev 3153)
+++ jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -10,7 +10,7 @@
</bean>
<!-- The ProcessEngine -->
- <bean name="BPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
+ <bean name="BPMProcessEngine" class="org.jbpm.integration.spec.client.ProcessEngineImpl">
<property name="services">
<set elementClass="org.jboss.bpm.api.service.Service">
<inject bean="BPMDeploymentService"/>
@@ -24,19 +24,19 @@
</bean>
<!-- The PersistenceService -->
- <bean name="BPMPersistenceService" class="org.jbpm.integration.service.NoopPersistenceServiceImpl" />
+ <bean name="BPMPersistenceService" class="org.jbpm.integration.spec.service.NoopPersistenceServiceImpl" />
<!-- The ProcessService -->
- <bean name="BPMProcessService" class="org.jbpm.integration.service.ProcessServiceImpl">
+ <bean name="BPMProcessService" class="org.jbpm.integration.spec.service.ProcessServiceImpl">
<property name="interceptors">
<list elementClass="java.lang.String">
- <value>org.jbpm.integration.runtime.NodeExecuteInterceptor</value>
+ <value>org.jbpm.integration.spec.runtime.NodeExecuteInterceptor</value>
</list>
</property>
</bean>
<!-- The DialectHandlerService -->
- <bean name="BPMDialectHandlerService" class="org.jbpm.integration.service.DialectHandlerServiceImpl">
+ <bean name="BPMDialectHandlerService" class="org.jbpm.integration.spec.service.DialectHandlerServiceImpl">
<property name="dialectHandlers">
<map keyClass="java.net.URI" valueClass="org.jboss.bpm.api.service.DialectHandler">
<entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="BPMDialectHandlerAPI10"/></value></entry>
@@ -45,12 +45,12 @@
</property>
</bean>
<bean name="BPMDialectHandlerAPI10" class="org.jboss.bpm.dialect.api10.DialectHandlerImpl" />
- <bean name="BPMDialectHandlerJPDL32" class="org.jbpm.integration.jpdl32.DialectHandlerImpl" />
+ <bean name="BPMDialectHandlerJPDL32" class="org.jbpm.integration.spec.jpdl32.DialectHandlerImpl" />
<!-- Other Services -->
- <bean name="BPMDeploymentService" class="org.jbpm.integration.service.DeploymentServiceImpl" />
- <bean name="BPMIdentityService" class="org.jbpm.integration.service.IdentityServiceImpl" />
- <bean name="BPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
- <bean name="BPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
+ <bean name="BPMDeploymentService" class="org.jbpm.integration.spec.service.DeploymentServiceImpl" />
+ <bean name="BPMIdentityService" class="org.jbpm.integration.spec.service.IdentityServiceImpl" />
+ <bean name="BPMProcessBuilderService" class="org.jbpm.integration.spec.service.ProcessBuilderServiceImpl" />
+ <bean name="BPMProcessDefinitionService" class="org.jbpm.integration.spec.service.ProcessDefinitionServiceImpl" />
</deployment>
Copied: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment (from rev 3150, jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment)
Added: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.integration.spec.deployment;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.bpm.api.deployment.Deployment;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.service.DeploymentService;
+import org.jboss.bpm.api.test.APITestCase;
+
+/**
+ * Test simple PAR deployment
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Nov-2008
+ */
+public class DeploymentPARTest extends APITestCase
+{
+ public void testSimplePARDeploy() throws Exception
+ {
+ URL parURL = getTestArchiveURL("fork-join-example.par");
+
+ DeploymentService depService = getProcessEngine().getService(DeploymentService.class);
+ Deployment dep = depService.createDeployment(parURL);
+
+ ProcessDefinition procDef = depService.deploy(dep);
+ assertNotNull("ProcDef not null", procDef);
+
+ // Undeploy the process
+ assertTrue("Undeploy successful", depService.undeploy(dep));
+ }
+}
Property changes on: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentXMLTest.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentXMLTest.java 2008-11-28 16:41:56 UTC (rev 3154)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.test.integration.deployment;
+package org.jbpm.test.integration.spec.deployment;
// $Id$
@@ -34,7 +34,7 @@
import org.jboss.bpm.api.test.APITestCase;
/**
- * Test simple jPDL process deployment
+ * Test simple XML deployment
*
* @author thomas.diesler(a)jboss.com
* @since 24-Nov-2008
Added: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/gpd.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/gpd.xml (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/gpd.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="ForkJoinExample3" width="658" height="421">
+ <node name="start" x="150" y="25" width="140" height="40">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="fork1" x="96" y="95" width="252" height="24">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ <edge>
+ <label x="-92" y="-11" />
+ </edge>
+ </node>
+ <node name="Review Order" x="69" y="172" width="132" height="36">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="Prepare shipping" x="293" y="171" width="132" height="36">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="join1" x="118" y="256" width="252" height="24">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="Review results" x="183" y="299" width="132" height="36">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="Wrap up" x="367" y="320" width="132" height="36">
+ <edge>
+ <label x="5" y="-10" />
+ </edge>
+ </node>
+ <node name="end" x="176" y="359" width="140" height="40" />
+</root-container>
Property changes on: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/gpd.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processdefinition.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processdefinition.xml (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processdefinition.xml 2008-11-28 16:41:56 UTC (rev 3154)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="ForkJoinExample3">
+ <start-state name="start">
+ <transition to="fork1"></transition>
+ </start-state>
+ <fork name="fork1">
+ <transition to="Prepare shipping" name="to Prepare shipping"></transition>
+ <transition to="Review Order" name="to Review Order"></transition>
+ </fork>
+
+ <task-node name="Review Order">
+ <task name="Do review order">
+ <assignment pooled-actors="sales"></assignment>
+ </task>
+ <transition to="join1" name="done with review order"></transition>
+ </task-node>
+
+ <task-node name="Prepare shipping">
+ <task name="Do prepare shipping">
+ <assignment pooled-actors="sales,hr"></assignment>
+ </task>
+ <transition to="join1" name="done with prepare shipping"></transition>
+ </task-node>
+
+ <join name="join1">
+ <transition to="Review results"></transition>
+ </join>
+
+ <task-node name="Review results">
+ <task name="Review previous steps">
+ <assignment pooled-actors="user"></assignment>
+ </task>
+ <transition to="Wrap up" name="review ok"></transition>
+ </task-node>
+
+ <task-node name="Wrap up">
+ <task name="Wrap up">
+ <assignment actor-id="fred"></assignment>
+ </task>
+ <transition to="end" name="finish this one"></transition>
+ </task-node>
+
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processdefinition.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Added: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processimage.jpg
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/fork-join-example/processimage.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
JBoss JBPM SVN: r3153 - in projects/spec/trunk: modules/api/src/main/java/org/jboss/bpm/api/test and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 11:40:34 -0500 (Fri, 28 Nov 2008)
New Revision: 3153
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestHelper.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestHelper.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestSetup.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/user/UserTaskTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/
projects/spec/trunk/pom.xml
Log:
Refactor IntegrationTestHelper
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestCase.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestCase.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -63,16 +63,6 @@
log.debug("### END " + getLongName());
}
- protected URL getResourceURL(String resource) throws MalformedURLException
- {
- return delegate.getResourceURL(resource);
- }
-
- protected File getResourceFile(String resource)
- {
- return delegate.getResourceFile(resource);
- }
-
protected String getShortName()
{
String shortName = getClass().getName();
@@ -97,4 +87,24 @@
{
return Configuration.getProcessEngine();
}
+
+ protected URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return delegate.getResourceURL(resource);
+ }
+
+ protected File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ public File getTestArchiveFile(String archive)
+ {
+ return delegate.getTestArchiveFile(archive);
+ }
+
+ public URL getTestArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getTestArchiveFile(archive).toURI().toURL();
+ }
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestHelper.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestHelper.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/APITestHelper.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -34,8 +34,10 @@
public class APITestHelper
{
private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
private static String testResourcesDir;
+ private static String testArchiveDir;
/** Try to discover the URL for the test resource */
public URL getResourceURL(String resource) throws MalformedURLException
@@ -64,4 +66,33 @@
return testResourcesDir;
}
+
+ /** Try to discover the URL for the deployment archive */
+ public URL getTestArchiveURL(String archive) throws MalformedURLException
+ {
+ return getTestArchiveFile(archive).toURI().toURL();
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public File getTestArchiveFile(String archive)
+ {
+ File file = new File(archive);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestArchiveDir() + "/" + archive);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
+ throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
+ }
+
+ public String getTestArchiveDir()
+ {
+ if (testArchiveDir == null)
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
+
+ return testArchiveDir;
+ }
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestCase.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestCase.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -23,8 +23,6 @@
// $Id$
-import java.io.File;
-import java.net.MalformedURLException;
import java.net.URL;
import javax.management.MBeanServerConnection;
@@ -43,18 +41,8 @@
// Provide logging
final Logger log = LoggerFactory.getLogger(IntegrationTestCase.class);
- private IntegrationTestHelper delegate = new IntegrationTestHelper();
+ IntegrationTestHelper delegate = new IntegrationTestHelper();
- public File getArchiveFile(String archive)
- {
- return delegate.getArchiveFile(archive);
- }
-
- public URL getArchiveURL(String archive) throws MalformedURLException
- {
- return delegate.getArchiveFile(archive).toURI().toURL();
- }
-
public boolean isTargetJBoss500()
{
return delegate.isTargetJBoss500();
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestHelper.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestHelper.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestHelper.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -21,8 +21,6 @@
*/
package org.jboss.bpm.api.test;
-import java.io.File;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.Hashtable;
@@ -41,15 +39,12 @@
*/
public class IntegrationTestHelper extends APITestHelper
{
- private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
-
private static MBeanServerConnection server;
- private static String testArchiveDir;
private String integrationTarget;
public void deploy(String archive) throws Exception
{
- URL url = getArchiveFile(archive).toURI().toURL();
+ URL url = getTestArchiveFile(archive).toURI().toURL();
deploy(url);
}
@@ -60,7 +55,7 @@
public void undeploy(String archive) throws Exception
{
- URL url = getArchiveFile(archive).toURI().toURL();
+ URL url = getTestArchiveFile(archive).toURI().toURL();
undeploy(url);
}
@@ -138,33 +133,4 @@
{
return new JBossArchiveDeployer(getServer());
}
-
- /** Try to discover the URL for the deployment archive */
- public URL getArchiveURL(String archive) throws MalformedURLException
- {
- return getArchiveFile(archive).toURI().toURL();
- }
-
- /** Try to discover the File for the deployment archive */
- public File getArchiveFile(String archive)
- {
- File file = new File(archive);
- if (file.exists())
- return file;
-
- file = new File(getTestArchiveDir() + "/" + archive);
- if (file.exists())
- return file;
-
- String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
- throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
- }
-
- public String getTestArchiveDir()
- {
- if (testArchiveDir == null)
- testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
-
- return testArchiveDir;
- }
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestSetup.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/test/IntegrationTestSetup.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -51,12 +51,12 @@
public File getArchiveFile(String archive)
{
- return delegate.getArchiveFile(archive);
+ return delegate.getTestArchiveFile(archive);
}
public URL getArchiveURL(String archive) throws MalformedURLException
{
- return delegate.getArchiveFile(archive).toURI().toURL();
+ return delegate.getTestArchiveFile(archive).toURI().toURL();
}
public boolean isTargetJBoss500()
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/user/UserTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/user/UserTaskTest.java 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/user/UserTaskTest.java 2008-11-28 16:40:34 UTC (rev 3153)
@@ -33,10 +33,8 @@
import org.jboss.bpm.api.model.Event.EventDetailType;
import org.jboss.bpm.api.model.Task.TaskType;
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
-import org.jboss.bpm.api.model.builder.ProcessBuilder;
import org.jboss.bpm.api.runtime.BasicAttachments;
import org.jboss.bpm.api.service.ProcessBuilderService;
-import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.api.test.CTSTestCase;
import org.jboss.bpm.incubator.client.MessageListener;
Property changes on: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test
___________________________________________________________________
Name: svn:ignore
- cts
pattern
incubator
Modified: projects/spec/trunk/pom.xml
===================================================================
--- projects/spec/trunk/pom.xml 2008-11-28 16:13:19 UTC (rev 3152)
+++ projects/spec/trunk/pom.xml 2008-11-28 16:40:34 UTC (rev 3153)
@@ -37,7 +37,7 @@
<module>modules/dialects</module>
<module>modules/ri</module>
<module>modules/cts</module>
- <module>modules/samples/airticket</module>
+ <!-- module>modules/samples/airticket</module -->
</modules>
<!-- Properties -->
17 years, 4 months
JBoss JBPM SVN: r3152 - in jbpm3/trunk/modules/core/src/main/java/org/jbpm: job and 1 other directory.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-11-28 11:13:19 -0500 (Fri, 28 Nov 2008)
New Revision: 3152
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteActionJob.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/Timer.java
Log:
https://jira.jboss.org/jira/browse/JBPM-1015
added "addAutoSave" to Timer, ExecuteActionJob & ExecuteNodeJob
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java 2008-11-28 16:08:06 UTC (rev 3151)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java 2008-11-28 16:13:19 UTC (rev 3152)
@@ -669,24 +669,24 @@
authenticationService.setActorId(actorId);
}
- // private methods //////////////////////////////////////////////////////////
-
- void addAutoSaveProcessInstance(ProcessInstance processInstance)
+ public void addAutoSaveProcessInstance(ProcessInstance processInstance)
{
if (autoSaveProcessInstances == null)
autoSaveProcessInstances = new ArrayList();
autoSaveProcessInstances.add(processInstance);
}
- void addAutoSaveToken(Token token)
+ public void addAutoSaveToken(Token token)
{
addAutoSaveProcessInstance(token.getProcessInstance());
}
- void addAutoSaveTaskInstance(TaskInstance taskInstance)
+ public void addAutoSaveTaskInstance(TaskInstance taskInstance)
{
addAutoSaveProcessInstance(taskInstance.getTaskMgmtInstance().getProcessInstance());
}
+
+ // private methods //////////////////////////////////////////////////////////
void autoSave()
{
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteActionJob.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteActionJob.java 2008-11-28 16:08:06 UTC (rev 3151)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteActionJob.java 2008-11-28 16:13:19 UTC (rev 3152)
@@ -23,6 +23,11 @@
public boolean execute(JbpmContext jbpmContext) throws Exception {
log.debug("job["+id+"] executes "+action);
+
+ // add processInstance to autoSave field (For details refer to
+ // https://jira.jboss.org/jira/browse/JBPM-1015)
+ jbpmContext.addAutoSaveToken(token);
+
ExecutionContext executionContext = new ExecutionContext(token);
executionContext.setAction(action);
executionContext.setEvent(action.getEvent());
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2008-11-28 16:08:06 UTC (rev 3151)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2008-11-28 16:13:19 UTC (rev 3152)
@@ -20,8 +20,13 @@
super(token);
}
- public boolean execute(JbpmContext jbpmContext) throws Exception {
+ public boolean execute(JbpmContext jbpmContext) throws Exception {
log.debug("job["+id+"] executes "+node);
+
+ // add processInstance to autoSave field (For details refer to
+ // https://jira.jboss.org/jira/browse/JBPM-1015)
+ jbpmContext.addAutoSaveToken(token);
+
token.unlock(this.toString());
ExecutionContext executionContext = new ExecutionContext(token);
node.execute(executionContext);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/Timer.java 2008-11-28 16:08:06 UTC (rev 3151)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/Timer.java 2008-11-28 16:13:19 UTC (rev 3152)
@@ -35,6 +35,10 @@
}
public boolean execute(JbpmContext jbpmContext) throws Exception {
+ // add processInstance to autoSave field (For details refer to
+ // https://jira.jboss.org/jira/browse/JBPM-1015)
+ jbpmContext.addAutoSaveToken(token);
+
ExecutionContext executionContext = new ExecutionContext(token);
executionContext.setTimer(this);
17 years, 4 months
JBoss JBPM SVN: r3151 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-11-28 11:08:06 -0500 (Fri, 28 Nov 2008)
New Revision: 3151
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
Log:
https://jira.jboss.org/jira/browse/JBPM-1888
added "getLockOwner()" and "forceUnlock" to token
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2008-11-28 15:30:25 UTC (rev 3150)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2008-11-28 16:08:06 UTC (rev 3151)
@@ -787,6 +787,33 @@
lock = null;
}
+ /**
+ * force unlocking the token, even if the owner is not known. In some
+ * use cases (e.g. in the jbpm esb integration) the lock is persistent,
+ * so a state can be reached where the client needs a possibility to force
+ * unlock of a token without knowing the owner.
+ *
+ * See https://jira.jboss.org/jira/browse/JBPM-1888
+ */
+ public void foreUnlock()
+ {
+ if (lock == null)
+ {
+ log.warn("Unlock of token '" + id + "' forced, but it is not locked");
+ }
+ log.debug("Foce unlock of token[" + id + "] which was locked by " + lock);
+ lock = null;
+ }
+
+ /**
+ * return the current lock owner of the token
+ *
+ * See https://jira.jboss.org/jira/browse/JBPM-1888
+ */
+ public String getLockOwner() {
+ return lock;
+ }
+
public boolean isLocked()
{
return lock != null;
17 years, 4 months
JBoss JBPM SVN: r3150 - in jbpm4/trunk/modules: api/src/main/resources and 6 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-11-28 10:30:25 -0500 (Fri, 28 Nov 2008)
New Revision: 3150
Added:
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
Removed:
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Condition.java
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/DecisionHandler.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.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/JpdlActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionHandlerTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java
Log:
reverted from JpdlExecution to ActivityExecution in jpdl activity base class
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Condition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Condition.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Condition.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -23,8 +23,6 @@
import java.io.Serializable;
-import org.jbpm.listener.EventListenerExecution;
-
/** user code that reflects a runtime calculation of a boolean value.
* Used for {@link Transition#getCondition() transition guard conditions} and
* {@link Transition#getWaitCondition() transition wait states}.
@@ -36,5 +34,5 @@
public interface Condition extends Serializable {
/** evaluates this condition in the context of the given execution. */
- boolean evaluate(EventListenerExecution execution);
+ boolean evaluate(OpenExecution execution);
}
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-11-28 15:30:25 UTC (rev 3150)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://jbpm.org/xsd/jpdl"
- xmlns:tns="http://jbpm.org/xsd/jpdl"
+ targetNamespace="http://jbpm.org/jpdl4"
+ xmlns:tns="http://jbpm.org/jpdl4"
elementFormDefault="qualified"
attributeFormDefault="qualified">
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/DecisionHandler.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/DecisionHandler.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/DecisionHandler.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -21,12 +21,14 @@
*/
package org.jbpm.jpdl;
+import org.jbpm.model.OpenExecution;
+
/**
* @author Tom Baeyens
*/
public interface DecisionHandler {
/** the name of the selected outgoing transition */
- String decide(JpdlExecution execution);
+ String decide(OpenExecution execution);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -21,7 +21,7 @@
*/
package org.jbpm.jpdl.activity;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.activity.ActivityExecution;
/**
@@ -33,6 +33,6 @@
- public void execute(JpdlExecution execution) {
+ public void execute(ActivityExecution execution) {
}
}
Modified: 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 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -21,7 +21,7 @@
*/
package org.jbpm.jpdl.activity;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.activity.ActivityExecution;
/**
@@ -31,7 +31,7 @@
private static final long serialVersionUID = 1L;
- public void execute(JpdlExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
execution.stop();
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.activity.ActivityExecution;
import org.jbpm.jpdl.JpdlException;
import org.jbpm.jpdl.JpdlExecution;
import org.jbpm.model.Condition;
@@ -37,7 +38,7 @@
private static final long serialVersionUID = 1L;
- public void execute(JpdlExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
Transition transition = findTransition(execution);
if (transition==null) {
throw new JpdlException("no outgoing transition condition evaluated to true for exclusive "+execution.getNode());
@@ -45,7 +46,7 @@
execution.take(transition);
}
- private Transition findTransition(JpdlExecution execution) {
+ private Transition findTransition(ActivityExecution execution) {
Node node = execution.getNode();
List<Transition> outgoingTransitions = node.getOutgoingTransitions();
for (Transition transition : outgoingTransitions) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -22,10 +22,10 @@
package org.jbpm.jpdl.activity;
import org.jbpm.JbpmException;
+import org.jbpm.activity.ActivityExecution;
import org.jbpm.env.EnvironmentHelper;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.model.Node;
import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
/**
@@ -38,8 +38,8 @@
protected String expr;
protected String lang;
- public void execute(JpdlExecution execution) throws Exception {
- NodeImpl node = execution.getNode();
+ public void execute(ActivityExecution execution) throws Exception {
+ Node node = execution.getNode();
String transitionName = null;
ScriptManager scriptManager = EnvironmentHelper.get(ScriptManager.class);
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -22,12 +22,12 @@
package org.jbpm.jpdl.activity;
import org.jbpm.JbpmException;
+import org.jbpm.activity.ActivityExecution;
import org.jbpm.env.Environment;
import org.jbpm.jpdl.DecisionHandler;
import org.jbpm.jpdl.JpdlException;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.model.Node;
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;
@@ -41,8 +41,8 @@
protected String decisionHandlerName;
protected Descriptor decisionHandlerDescriptor;
- public void execute(JpdlExecution execution) throws Exception {
- NodeImpl node = execution.getNode();
+ public void execute(ActivityExecution execution) throws Exception {
+ Node node = execution.getNode();
String transitionName = null;
Object object = null;
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-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -22,8 +22,6 @@
package org.jbpm.jpdl.activity;
import org.jbpm.activity.Activity;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.jpdl.JpdlExecution;
/**
* @author Tom Baeyens
@@ -34,9 +32,4 @@
protected long dbid;
- public void execute(ActivityExecution execution) throws Exception {
- execute((JpdlExecution) execution);
- }
-
- public abstract void execute(JpdlExecution execution) throws Exception;
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -21,22 +21,11 @@
*/
package org.jbpm.jpdl.activity;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.activity.ActivityExecution;
import org.jbpm.activity.ExternalActivity;
-import org.jbpm.jpdl.JpdlExecution;
/**
* @author Tom Baeyens
*/
public abstract class JpdlExternalActivity extends JpdlActivity implements ExternalActivity {
- public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
- signal((JpdlExecution) execution, signalName, parameters);
- }
-
- public abstract void signal(JpdlExecution execution, String signalName, Map<String, Object> parameters) throws Exception;
-
}
Modified: 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 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -21,7 +21,7 @@
*/
package org.jbpm.jpdl.activity;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.activity.ActivityExecution;
/**
@@ -31,6 +31,6 @@
private static final long serialVersionUID = 1L;
- public void execute(JpdlExecution execution) {
+ public void execute(ActivityExecution execution) {
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -23,7 +23,9 @@
import java.util.Map;
-import org.jbpm.jpdl.JpdlExecution;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.model.Node;
+import org.jbpm.model.Transition;
/**
* @author Tom Baeyens
@@ -32,14 +34,24 @@
private static final long serialVersionUID = 1L;
- public void execute(JpdlExecution execution) {
+ public void execute(ActivityExecution execution) {
execution.waitForSignal();
}
- public void signal(JpdlExecution execution, String signalName, Map<String, Object> parameters) {
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
+ Node node = execution.getNode();
+
if (parameters!=null) {
execution.setVariables(parameters);
}
- execution.take(signalName);
+
+ execution.fire(signalName, node);
+
+ Transition transition = node.findOutgoingTransition(signalName);
+ if (transition!=null) {
+ execution.take(transition);
+ } else {
+ execution.waitForSignal();
+ }
}
}
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionHandlerTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/DecisionHandlerTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -24,8 +24,8 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.jpdl.DecisionHandler;
-import org.jbpm.jpdl.JpdlExecution;
import org.jbpm.jpdl.JpdlTestCase;
+import org.jbpm.model.OpenExecution;
/**
@@ -35,7 +35,7 @@
public static class GpsDecisionHandler implements DecisionHandler {
String theWayToGo;
- public String decide(JpdlExecution execution) {
+ public String decide(OpenExecution execution) {
return theWayToGo;
}
}
Copied: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java (from rev 3147, jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -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.parsing;
+
+import java.util.List;
+
+import org.jbpm.Problem;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.jpdl.xml.JpdlParser;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class JpdlParseTestCase extends JbpmTestCase {
+
+ static JpdlParser jpdlParser = new JpdlParser();
+
+ public List<Problem> parseProblems(String xmlString) {
+ List<Problem> problems = jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .getProblems();
+ if ( (problems==null)
+ || (problems.isEmpty())
+ ) {
+ fail("expected problems during parse");
+ }
+ return problems;
+ }
+
+ public ClientProcessDefinition parse(String xmlString) {
+ JpdlParser jpdlParser = new JpdlParser();
+ return (ClientProcessDefinition) jpdlParser.createParse()
+ .setString(xmlString)
+ .execute()
+ .checkProblems("process definition xml string")
+ .getDocumentObject();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyents
*/
-public class JpdlSchemaTest extends ParsingTestCase {
+public class JpdlSchemaTest extends JpdlParseTestCase {
public void testSimplestValidProcess() {
List<Problem> problems = parseProblems(
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class NodeParsingTest extends ParsingTestCase {
+public class NodeParsingTest extends JpdlParseTestCase {
public void testInvalidNodeName() {
List<Problem> problems = parseProblems(
Deleted: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ParsingTestCase.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.parsing;
-
-import java.util.List;
-
-import org.jbpm.Problem;
-import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.jpdl.xml.JpdlParser;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class ParsingTestCase extends JbpmTestCase {
-
- public List<Problem> parseProblems(String xmlString) {
- JpdlParser jpdlParser = new JpdlParser();
- List<Problem> problems = jpdlParser.createParse()
- .setString(xmlString)
- .execute()
- .getProblems();
- if ( (problems==null)
- || (problems.isEmpty())
- ) {
- fail("expected problems during parse");
- }
- return problems;
- }
-
- public ClientProcessDefinition parse(String xmlString) {
- JpdlParser jpdlParser = new JpdlParser();
- return (ClientProcessDefinition) jpdlParser.createParse()
- .setString(xmlString)
- .execute()
- .checkProblems("process definition xml string")
- .getDocumentObject();
- }
-
-}
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class ProcessParsingTest extends ParsingTestCase {
+public class ProcessParsingTest extends JpdlParseTestCase {
public void testSimplestValidProcess() {
ClientProcessDefinition processDefinition = parse(
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -32,7 +32,7 @@
/**
* @author Tom Baeyens
*/
-public class TransitionParsingTest extends ParsingTestCase {
+public class TransitionParsingTest extends JpdlParseTestCase {
public void testTransition() {
ClientProcessDefinition processDefinition = parse(
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/basicfeatures/TransitionAsWaitStateTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -28,8 +28,8 @@
import org.jbpm.activity.ExternalActivity;
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.listener.EventListenerExecution;
import org.jbpm.model.Condition;
+import org.jbpm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.JbpmTestCase;
@@ -43,7 +43,7 @@
public static class AlwaysTrue implements Condition {
private static final long serialVersionUID = 1L;
- public boolean evaluate(EventListenerExecution execution) {
+ public boolean evaluate(OpenExecution execution) {
return true;
}
};
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -36,15 +36,6 @@
assertNotNull(processEngine);
}
- /*
- public void testResourceConfiguration() {
- ProcessEngine processEngine = new Configuration()
- .setResource("my-jbpm-configuration.xml")
- .buildProcessEngine();
- assertNotNull(processEngine);
- }
- */
-
public void testMinimalConfiguration() {
ProcessEngine processEngine = new Configuration()
.setXmlString("<jbpm-configuration />")
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java 2008-11-28 15:12:12 UTC (rev 3149)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java 2008-11-28 15:30:25 UTC (rev 3150)
@@ -114,14 +114,16 @@
}
}
- /*
public void testNamedSignalWithoutMatchingTransition() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
" <state name='a'>" +
- " <transition name='left' to='b' />" +
- " <transition name='middle' to='c' />" +
- " <transition name='right' to='d' />" +
+ " <flow name='left' to='b' />" +
+ " <flow name='middle' to='c' />" +
+ " <flow name='right' to='d' />" +
" </state>" +
" <state name='b' />" +
" <state name='c' />" +
@@ -129,27 +131,23 @@
"</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());
- }
+ executionService.startExecution("p:1", "one");
+ Execution execution = executionService.signalExecution("p:1/one", "up");
+ assertEquals("a", execution.getNodeName());
}
public void testDefaultSignalWithoutTransitions() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
" <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());
- }
+ executionService.startExecution("p:1", "one");
+ Execution execution = executionService.signalExecution("p:1/one");
+ assertEquals("a", execution.getNodeName());
}
- */
}
17 years, 4 months
JBoss JBPM SVN: r3149 - in jbpm3/trunk/modules: integration/jboss42 and 10 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 10:12:12 -0500 (Fri, 28 Nov 2008)
New Revision: 3149
Added:
jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/fork-join-example.par
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/
jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/simple-process.xml
Removed:
jbpm3/trunk/modules/integration/spec/src/test/resources/integration/
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
jbpm3/trunk/modules/integration/jboss42/pom.xml
jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/PARDeployment.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DeploymentServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml
jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java
Log:
More deployment testing
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -26,36 +26,40 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.jbpm.JbpmException;
+public class IoUtil
+{
+ private static final int BUFFERSIZE = 4096;
-public class IoUtil {
-
- private IoUtil() {
- // hide default constructor to prevent instantiation
+ // hide default constructor
+ private IoUtil()
+ {
}
- private static final int BUFFERSIZE = 4096;
-
- public static byte[] readBytes(InputStream inputStream) throws IOException {
- byte[] bytes = null;
- if (inputStream==null) {
- throw new JbpmException("inputStream is null");
- }
+ public static byte[] readBytes(InputStream inputStream) throws IOException
+ {
+ if (inputStream == null)
+ throw new IllegalArgumentException("InputStream cannot be null");
+
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
transfer(inputStream, outputStream);
- bytes = outputStream.toByteArray();
+ byte[] bytes = outputStream.toByteArray();
outputStream.close();
return bytes;
}
-
- public static int transfer(InputStream in, OutputStream out) throws IOException {
+
+ public static int transfer(InputStream in, OutputStream out) throws IOException
+ {
+ if (in == null || out == null)
+ throw new IllegalArgumentException("In/OutStream cannot be null");
+
int total = 0;
byte[] buffer = new byte[BUFFERSIZE];
- int bytesRead = in.read( buffer );
- while ( bytesRead != -1 ) {
- out.write( buffer, 0, bytesRead );
+ int bytesRead = in.read(buffer);
+ while (bytesRead != -1)
+ {
+ out.write(buffer, 0, bytesRead);
total += bytesRead;
- bytesRead = in.read( buffer );
+ bytesRead = in.read(buffer);
}
return total;
}
Modified: jbpm3/trunk/modules/integration/jboss42/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/pom.xml 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/jboss42/pom.xml 2008-11-28 15:12:12 UTC (rev 3149)
@@ -75,6 +75,12 @@
<!-- Test Dependencies -->
<dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>bpm-spec-integration-jbpm3</artifactId>
+ <version>${version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jbossall-client</artifactId>
<scope>test</scope>
Modified: jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/jboss42/src/test/java/org/jbpm/test/integration/deployment/SimpleDeploymentTest.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -33,16 +33,26 @@
*/
public class SimpleDeploymentTest extends IntegrationTestCase
{
- String PAR_ARCHIVE = "simple/simple-process.xml";
+ String PAR_DEPLOYMENT = "simple/fork-join-example.par";
+ String XML_DEPLOYMENT = "simple/simple-process.xml";
- public void testSimpleDeploy() throws Exception
+ public void testSimpleXMLDeploy() throws Exception
{
- deploy(getResourceURL(PAR_ARCHIVE));
+ deploy(getResourceURL(XML_DEPLOYMENT));
+ }
+ public void testSimpleXMLUndeploy() throws Exception
+ {
+ undeploy(getResourceURL(XML_DEPLOYMENT));
}
- public void testSimpleUndeploy() throws Exception
+ public void _testSimplePARDeploy() throws Exception
{
- undeploy(getResourceURL(PAR_ARCHIVE));
+ deploy(getResourceURL(PAR_DEPLOYMENT));
}
+
+ public void _testSimplePARUndeploy() throws Exception
+ {
+ undeploy(getResourceURL(PAR_DEPLOYMENT));
+ }
}
Added: jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/fork-join-example.par
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/fork-join-example.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/PARDeployment.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/PARDeployment.java 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/deployment/PARDeployment.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -23,14 +23,16 @@
// $Id$
-import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import org.jbpm.util.IoUtil;
+
/**
- * An in-memory persistence service.
+ * An abstraction of a process deployment
*
* @author thomas.diesler(a)jboss.com
* @since 17-Sep-2008
@@ -47,37 +49,27 @@
public String getProcessDefinitionXML() throws IOException
{
- String pdXML = null;
-
- ZipInputStream zip = new ZipInputStream(pdURL.openStream());
- ZipEntry zipEntry = zip.getNextEntry();
- String entryName = zipEntry.getName();
- if (PROCESSDEFINITION_ENTRY.equals(entryName))
+ byte[] bytes = IoUtil.readBytes(pdURL.openStream());
+ System.out.println(bytes.length);
+
+ ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(bytes));
+ ZipEntry zipEntry = zipInputStream.getNextEntry();
+ while (zipEntry != null)
{
- long size = zipEntry.getSize();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- byte[] bytes = new byte[4096];
- int len = (int)Math.min(4096, size);
- while (len > 0)
+ String entryName = zipEntry.getName();
+ bytes = IoUtil.readBytes(zipInputStream);
+ if (bytes != null)
{
- int read = zip.read(bytes, 0, len);
- baos.write(bytes, 0, read);
-
- size = size - read;
- len = (int)Math.min(4096, size);
+ addAttachment(entryName, bytes);
}
-
- pdXML = new String(baos.toByteArray());
+ zipEntry = zipInputStream.getNextEntry();
}
- else
- {
- zip.skip(zipEntry.getSize());
- }
- if (pdXML == null)
+ byte[] pdBytes = (byte[])getAttachment(PROCESSDEFINITION_ENTRY);
+ if (pdBytes == null)
throw new IllegalStateException("Cannot obtain '" + PROCESSDEFINITION_ENTRY + "' from: " + pdURL);
+ String pdXML = new String(pdBytes);
return pdXML;
}
}
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DeploymentServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DeploymentServiceImpl.java 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/DeploymentServiceImpl.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -75,7 +75,7 @@
}
@Override
- public ObjectName deploy(Deployment dep)
+ public ProcessDefinition deploy(Deployment dep)
{
try
{
@@ -89,7 +89,7 @@
ObjectName key = procDef.getKey();
dep.addAttachment(ObjectName.class, "procDefKey", key);
- return key;
+ return procDef;
}
catch (IOException ex)
{
@@ -98,10 +98,10 @@
}
@Override
- public void undeploy(Deployment dep)
+ public boolean undeploy(Deployment dep)
{
ObjectName key = dep.getAttachment(ObjectName.class, "procDefKey");
ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
- pdService.unregisterProcessDefinition(key);
+ return pdService.unregisterProcessDefinition(key);
}
}
Modified: jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/spec/src/main/resources/jbpm-cfg-beans.xml 2008-11-28 15:12:12 UTC (rev 3149)
@@ -13,8 +13,9 @@
<bean name="BPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
<property name="services">
<set elementClass="org.jboss.bpm.api.service.Service">
+ <inject bean="BPMDeploymentService"/>
+ <inject bean="BPMDialectHandlerService"/>
<inject bean="BPMIdentityService"/>
- <inject bean="BPMDialectHandlerService"/>
<inject bean="BPMProcessBuilderService"/>
<inject bean="BPMProcessDefinitionService"/>
<inject bean="BPMProcessService"/>
@@ -47,6 +48,7 @@
<bean name="BPMDialectHandlerJPDL32" class="org.jbpm.integration.jpdl32.DialectHandlerImpl" />
<!-- Other Services -->
+ <bean name="BPMDeploymentService" class="org.jbpm.integration.service.DeploymentServiceImpl" />
<bean name="BPMIdentityService" class="org.jbpm.integration.service.IdentityServiceImpl" />
<bean name="BPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
<bean name="BPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
Added: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -0,0 +1,73 @@
+/*
+ * 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.integration.deployment;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.bpm.api.deployment.Deployment;
+import org.jboss.bpm.api.model.Process;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Process.ProcessStatus;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.service.DeploymentService;
+import org.jboss.bpm.api.test.APITestCase;
+
+/**
+ * Test simple jPDL process deployment
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Nov-2008
+ */
+public class DeploymentXMLTest extends APITestCase
+{
+ public void testSimpleXMLDeploy() throws Exception
+ {
+ URL pdURL = getResourceURL("deployment/simple-process.xml");
+
+ DeploymentService depService = getProcessEngine().getService(DeploymentService.class);
+ Deployment dep = depService.createDeployment(pdURL);
+
+ ProcessDefinition procDef = depService.deploy(dep);
+ assertNotNull("ProcDef not null", procDef);
+
+ Process proc = procDef.newInstance();
+
+ Token token = proc.startProcess();
+ assertEquals("Node name", "a", token.getCurrentNode().getName());
+
+ token.signal();
+ assertEquals("Node name", "b", token.getCurrentNode().getName());
+
+ token.signal();
+ assertEquals("Node name", "c", token.getCurrentNode().getName());
+
+ token.signal();
+ assertEquals("Node name", "end", token.getCurrentNode().getName());
+
+ assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
+
+ // Undeploy the process
+ assertTrue("Undeploy successful", depService.undeploy(dep));
+ }
+}
Property changes on: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/deployment/DeploymentXMLTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java 2008-11-28 15:07:23 UTC (rev 3148)
+++ jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java 2008-11-28 15:12:12 UTC (rev 3149)
@@ -44,7 +44,7 @@
{
public void testSimple() throws Exception
{
- URL pdXML = getResourceURL("integration/jpdl/simple-process.xml");
+ URL pdXML = getResourceURL("deployment/simple-process.xml");
ProcessEngine engine = Configuration.getProcessEngine();
ProcessDefinitionService pdService = engine.getService(ProcessDefinitionService.class);
Copied: jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/simple-process.xml (from rev 3138, jbpm3/trunk/modules/integration/spec/src/test/resources/integration/jpdl/simple-process.xml)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/simple-process.xml (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/test/resources/deployment/simple-process.xml 2008-11-28 15:12:12 UTC (rev 3149)
@@ -0,0 +1,16 @@
+<process-definition name="simpleProcess" xmlns="urn:jbpm.org:jpdl-3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+ <start-state name='start'>
+ <transition to='a' />
+ </start-state>
+ <state name='a'>
+ <transition to='b' />
+ </state>
+ <state name='b'>
+ <transition to='c' />
+ </state>
+ <state name='c'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
17 years, 4 months
JBoss JBPM SVN: r3148 - projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-28 10:07:23 -0500 (Fri, 28 Nov 2008)
New Revision: 3148
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/DeploymentService.java
Log:
Modify DEploymentService
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/DeploymentService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/DeploymentService.java 2008-11-28 13:54:21 UTC (rev 3147)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/DeploymentService.java 2008-11-28 15:07:23 UTC (rev 3148)
@@ -25,9 +25,8 @@
import java.net.URL;
-import javax.management.ObjectName;
-
import org.jboss.bpm.api.deployment.Deployment;
+import org.jboss.bpm.api.model.ProcessDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,10 +55,10 @@
/**
* Deploy the Deployment to the engine.
*/
- public abstract ObjectName deploy(Deployment dep);
+ public abstract ProcessDefinition deploy(Deployment dep);
/**
* Undeploy the Deployment from the engine.
*/
- public abstract void undeploy(Deployment dep);
+ public abstract boolean undeploy(Deployment dep);
}
\ No newline at end of file
17 years, 4 months