[jbpm-commits] JBoss JBPM SVN: r2954 - in jbpm3/trunk: modules and 15 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Nov 17 08:08:15 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-11-17 08:08:14 -0500 (Mon, 17 Nov 2008)
New Revision: 2954
Added:
jbpm3/trunk/modules/integration/
jbpm3/trunk/modules/integration/.classpath
jbpm3/trunk/modules/integration/.project
jbpm3/trunk/modules/integration/pom.xml
jbpm3/trunk/modules/integration/src/
jbpm3/trunk/modules/integration/src/main/
jbpm3/trunk/modules/integration/src/main/java/
jbpm3/trunk/modules/integration/src/main/java/org/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
jbpm3/trunk/modules/integration/src/main/resources/
jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml
jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider
Removed:
jbpm3/trunk/modules/integration/.classpath
jbpm3/trunk/modules/integration/.project
jbpm3/trunk/modules/integration/pom.xml
jbpm3/trunk/modules/integration/src/
jbpm3/trunk/modules/integration/src/main/
jbpm3/trunk/modules/integration/src/main/java/
jbpm3/trunk/modules/integration/src/main/java/org/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
jbpm3/trunk/modules/integration/src/main/resources/
jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml
jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
jbpm3/trunk/modules/simulation/.classpath
jbpm3/trunk/pom.xml
Log:
Add API integration
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-11-17 12:57:48 UTC (rev 2953)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -81,7 +81,10 @@
try {
if (decisionDelegation != null) {
- DecisionHandler decisionHandler = (DecisionHandler) decisionDelegation.instantiate();
+ DecisionHandler decisionHandler = (DecisionHandler)decisionDelegation.getInstance();
+ if (decisionHandler == null)
+ decisionHandler = (DecisionHandler) decisionDelegation.instantiate();
+
String transitionName = decisionHandler.decide(executionContext);
transition = getLeavingTransition(transitionName);
if (transition == null) {
Copied: jbpm3/trunk/modules/integration (from rev 2952, jbpm3/branches/tdiesler/modules/integration)
Property changes on: jbpm3/trunk/modules/integration
___________________________________________________________________
Name: svn:ignore
+ target
.settings
Deleted: jbpm3/trunk/modules/integration/.classpath
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/.classpath 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/.classpath 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Copied: jbpm3/trunk/modules/integration/.classpath (from rev 2952, jbpm3/branches/tdiesler/modules/integration/.classpath)
===================================================================
--- jbpm3/trunk/modules/integration/.classpath (rev 0)
+++ jbpm3/trunk/modules/integration/.classpath 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Deleted: jbpm3/trunk/modules/integration/.project
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/.project 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/.project 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jbpm-integration</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
Copied: jbpm3/trunk/modules/integration/.project (from rev 2952, jbpm3/branches/tdiesler/modules/integration/.project)
===================================================================
--- jbpm3/trunk/modules/integration/.project (rev 0)
+++ jbpm3/trunk/modules/integration/.project 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-integration</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Deleted: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/pom.xml 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id$ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <name>JBoss jBPM3 - Integration</name>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-integration</artifactId>
- <packaging>jar</packaging>
-
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <!-- Properties -->
- <properties>
- <mvel.version>1.3.7-java1.5</mvel.version>
- </properties>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <classifier>config</classifier>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.mvel</groupId>
- <artifactId>mvel</artifactId>
- <version>${mvel.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-dialect-api10</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-cts</artifactId>
- <scope>test</scope>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-cts</artifactId>
- <type>zip</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>src/test</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/jbpm/test/preview/**/*Test.java</exclude>
- <exclude>org/jbpm/test/pattern/**/*Test.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
Copied: jbpm3/trunk/modules/integration/pom.xml (from rev 2952, jbpm3/branches/tdiesler/modules/integration/pom.xml)
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml (rev 0)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBoss jBPM3 - Integration</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <mvel.version>1.3.7-java1.5</mvel.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <classifier>config</classifier>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ <version>${mvel.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-api10</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <scope>test</scope>
+ <type>zip</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>src/test</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jbpm/test/preview/**/*Test.java</exclude>
+ <exclude>org/jbpm/test/pattern/**/*Test.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Copied: jbpm3/trunk/modules/integration/src (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src)
Property changes on: jbpm3/trunk/modules/integration/src
___________________________________________________________________
Name: svn:ignore
+ test
Copied: jbpm3/trunk/modules/integration/src/main (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main)
Copied: jbpm3/trunk/modules/integration/src/main/java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java)
Copied: jbpm3/trunk/modules/integration/src/main/java/org (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org)
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm)
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration)
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client)
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,54 +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.integration.client;
-
-//$Id$
-
-import java.util.Set;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.service.Service;
-import org.jbpm.integration.service.MutableService;
-
-/**
- * A process engine with public access
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessEngineImpl extends ProcessEngine
-{
- public void setServices(Set<Service> services)
- {
- this.services = services;
-
- // Set this engine on every mutable service
- for (Service service : services)
- {
- if (service instanceof MutableService)
- {
- MutableService mutService = (MutableService)service;
- mutService.setProcessEngine(this);
- }
- }
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -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.integration.client;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.Service;
+import org.jbpm.integration.service.MutableService;
+
+/**
+ * A process engine with public access
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessEngineImpl extends ProcessEngine
+{
+ public void setServices(Set<Service> services)
+ {
+ this.services = services;
+
+ // Set this engine on every mutable service
+ for (Service service : services)
+ {
+ if (service instanceof MutableService)
+ {
+ MutableService mutService = (MutableService)service;
+ mutService.setProcessEngine(this);
+ }
+ }
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,137 +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.integration.client;
-
-import java.util.Set;
-
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.Token;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.integration.model.ProcessImpl;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class TokenImpl implements Token
-{
- private static final long serialVersionUID = 1L;
-
- private org.jbpm.graph.exe.Token oldToken;
- private ProcessImpl procImpl;
- private Attachments att = new BasicAttachments();
-
- public TokenImpl(ProcessImpl proc, org.jbpm.graph.exe.Token oldToken, Attachments att)
- {
- this.oldToken = oldToken;
- this.procImpl = proc;
- this.att = att;
- }
-
- @Override
- public String getTokenID()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Process getProcess()
- {
- return procImpl;
- }
-
- @Override
- public ProcessEngine getProcessEngine()
- {
- return procImpl.getProcessEngine();
- }
-
- @Override
- public Attachments getAttachments()
- {
- return att;
- }
-
- @Override
- public TokenStatus getTokenStatus()
- {
- TokenStatus status = TokenStatus.Suspended;
- if (oldToken.hasEnded())
- {
- status = TokenStatus.Destroyed;
- }
- return status;
- }
-
- @Override
- public Set<Token> getChildTokens()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Node getCurrentNode()
- {
- String nodeName = oldToken.getNode().getName();
- return procImpl.getNode(nodeName);
- }
-
- @Override
- public SequenceFlow getLastFlow()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Token getParentToken()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public Token getRootToken()
- {
- throw new NotImplementedException();
- }
-
- @Override
- public void signal()
- {
- try
- {
- oldToken.signal();
- }
- catch (RuntimeException rte)
- {
- procImpl.setProcessStatus(ProcessStatus.Aborted);
- throw rte;
- }
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/client/TokenImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,137 @@
+/*
+ * 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.client;
+
+import java.util.Set;
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.integration.model.ProcessImpl;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class TokenImpl implements Token
+{
+ private static final long serialVersionUID = 1L;
+
+ private org.jbpm.graph.exe.Token oldToken;
+ private ProcessImpl procImpl;
+ private Attachments att = new BasicAttachments();
+
+ public TokenImpl(ProcessImpl proc, org.jbpm.graph.exe.Token oldToken, Attachments att)
+ {
+ this.oldToken = oldToken;
+ this.procImpl = proc;
+ this.att = att;
+ }
+
+ @Override
+ public String getTokenID()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public Process getProcess()
+ {
+ return procImpl;
+ }
+
+ @Override
+ public ProcessEngine getProcessEngine()
+ {
+ return procImpl.getProcessEngine();
+ }
+
+ @Override
+ public Attachments getAttachments()
+ {
+ return att;
+ }
+
+ @Override
+ public TokenStatus getTokenStatus()
+ {
+ TokenStatus status = TokenStatus.Suspended;
+ if (oldToken.hasEnded())
+ {
+ status = TokenStatus.Destroyed;
+ }
+ return status;
+ }
+
+ @Override
+ public Set<Token> getChildTokens()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public Node getCurrentNode()
+ {
+ String nodeName = oldToken.getNode().getName();
+ return procImpl.getNode(nodeName);
+ }
+
+ @Override
+ public SequenceFlow getLastFlow()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public Token getParentToken()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public Token getRootToken()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void signal()
+ {
+ try
+ {
+ oldToken.signal();
+ }
+ catch (RuntimeException rte)
+ {
+ procImpl.setProcessStatus(ProcessStatus.Aborted);
+ throw rte;
+ }
+ }
+}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model)
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.model;
-
-import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.graph.node.EndState;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class EndEventImpl extends NodeImpl implements EndEvent
-{
- private static final long serialVersionUID = 1L;
-
- private EndState oldEnd;
-
- public EndEventImpl(ProcessDefinition procDef, EndState oldEnd)
- {
- super(procDef, oldEnd);
- this.oldEnd = oldEnd;
- }
-
- @Override
- public EventDetailType getResultType()
- {
- return EventDetailType.None;
- }
-
- @Override
- public EventType getEventType()
- {
- return EventType.End;
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.graph.node.EndState;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class EndEventImpl extends NodeImpl implements EndEvent
+{
+ private static final long serialVersionUID = 1L;
+
+ private EndState oldEnd;
+
+ public EndEventImpl(ProcessDefinition procDef, EndState oldEnd)
+ {
+ super(procDef, oldEnd);
+ this.oldEnd = oldEnd;
+ }
+
+ @Override
+ public EventDetailType getResultType()
+ {
+ return EventDetailType.None;
+ }
+
+ @Override
+ public EventType getEventType()
+ {
+ return EventType.End;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.model;
-
-// $Id$
-
-import org.jbpm.api.client.Token;
-import org.jbpm.api.model.ExclusiveGateway;
-import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.SequenceFlow.ConditionType;
-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.runtime.ExpressionEvaluator;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -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.model;
+
+// $Id$
+
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.ExclusiveGateway;
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.SequenceFlow.ConditionType;
+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.runtime.ExpressionEvaluator;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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();
+ }
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,67 +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.integration.model;
-
-//$Id$
-
-import org.jbpm.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 at 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/src/main/java/org/jbpm/integration/model/ExpressionImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ExpressionImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -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.model;
+
+//$Id$
+
+import org.jbpm.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 at 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;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,64 +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.integration.model;
-
-import java.util.List;
-
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.graph.node.Decision;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public abstract class GatewayImpl extends NodeImpl implements Gateway
-{
- private static final long serialVersionUID = 1L;
-
- public GatewayImpl(ProcessDefinition procDef, Decision oldDecision)
- {
- super(procDef, oldDecision);
- }
-
- @Override
- public List<SequenceFlow> getGates()
- {
- return getOutFlows();
- }
-
- @Override
- public SequenceFlow getGateByName(String targetName)
- {
- throw new NotImplementedException();
- }
-
- @Override
- public SequenceFlow getDefaultGate()
- {
- throw new NotImplementedException();
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/GatewayImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,64 @@
+/*
+ * 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.model;
+
+import java.util.List;
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.graph.node.Decision;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public abstract class GatewayImpl extends NodeImpl implements Gateway
+{
+ private static final long serialVersionUID = 1L;
+
+ public GatewayImpl(ProcessDefinition procDef, Decision oldDecision)
+ {
+ super(procDef, oldDecision);
+ }
+
+ @Override
+ public List<SequenceFlow> getGates()
+ {
+ return getOutFlows();
+ }
+
+ @Override
+ public SequenceFlow getGateByName(String targetName)
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public SequenceFlow getDefaultGate()
+ {
+ throw new NotImplementedException();
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.Constants;
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.graph.def.Transition;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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;
- }
-
- @Override
- 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;
- }
-
- @Override
- public String getName()
- {
- return oldNode.getName();
- }
-
- @Override
- public ProcessDefinition getProcessDefinition()
- {
- return procDef;
- }
-
- @Override
- 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();
- oldNode.addLeavingTransition(trans);
- targetNode.getOldNode().addArrivingTransition(trans);
-
- outFlows.add(flow);
- }
-
- public List<SequenceFlow> getOutFlows()
- {
- return Collections.unmodifiableList(outFlows);
- }
-
- @Override
- public String toString()
- {
- return oldNode.toString();
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/NodeImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.Constants;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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;
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public String getName()
+ {
+ return oldNode.getName();
+ }
+
+ @Override
+ public ProcessDefinition getProcessDefinition()
+ {
+ return procDef;
+ }
+
+ @Override
+ 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();
+ oldNode.addLeavingTransition(trans);
+ targetNode.getOldNode().addArrivingTransition(trans);
+
+ outFlows.add(flow);
+ }
+
+ public List<SequenceFlow> getOutFlows()
+ {
+ return Collections.unmodifiableList(outFlows);
+ }
+
+ @Override
+ public String toString()
+ {
+ return oldNode.toString();
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,145 +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.integration.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.jbpm.api.Constants;
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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.oldProcDef = new org.jbpm.graph.def.ProcessDefinition(name);
- this.engine = engine;
-
- if (name == null)
- throw new InvalidProcessException("ProcessDefinition name cannot be null");
- }
-
-
- public org.jbpm.graph.def.ProcessDefinition getOldProcessDefinition()
- {
- return oldProcDef;
- }
-
-
- @Override
- public ProcessEngine getProcessEngine()
- {
- return engine;
- }
-
- @Override
- public ObjectName getKey()
- {
- long id = oldProcDef.getId();
- return ObjectNameFactory.create(Constants.ID_DOMAIN + ":procdef=" + getName() + ",id=" + id);
- }
-
- @Override
- public String getName()
- {
- return oldProcDef.getName();
- }
-
- @Override
- 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);
- }
-
- @Override
- public Node getNode(String name)
- {
- return nodes.get(name);
- }
-
- @Override
- public List<Node> getNodes()
- {
- List<Node> nodeList = new ArrayList<Node>(nodes.values());
- return Collections.unmodifiableList(nodeList);
- }
-
- @Override
- @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;
- }
-
- @Override
- @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;
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,145 @@
+/*
+ * 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.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.jbpm.api.Constants;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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.oldProcDef = new org.jbpm.graph.def.ProcessDefinition(name);
+ this.engine = engine;
+
+ if (name == null)
+ throw new InvalidProcessException("ProcessDefinition name cannot be null");
+ }
+
+
+ public org.jbpm.graph.def.ProcessDefinition getOldProcessDefinition()
+ {
+ return oldProcDef;
+ }
+
+
+ @Override
+ public ProcessEngine getProcessEngine()
+ {
+ return engine;
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ long id = oldProcDef.getId();
+ return ObjectNameFactory.create(Constants.ID_DOMAIN + ":procdef=" + getName() + ",id=" + id);
+ }
+
+ @Override
+ public String getName()
+ {
+ return oldProcDef.getName();
+ }
+
+ @Override
+ 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);
+ }
+
+ @Override
+ public Node getNode(String name)
+ {
+ return nodes.get(name);
+ }
+
+ @Override
+ public List<Node> getNodes()
+ {
+ List<Node> nodeList = new ArrayList<Node>(nodes.values());
+ return Collections.unmodifiableList(nodeList);
+ }
+
+ @Override
+ @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;
+ }
+
+ @Override
+ @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;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,145 +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.integration.model;
-
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.Constants;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.Token;
-import org.jbpm.api.client.Token.TokenStatus;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.integration.client.TokenImpl;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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 procStatus = ProcessStatus.None;
- private Token rootToken;
-
- public ProcessImpl(ProcessDefinitionImpl procDef)
- {
- this.procDef = procDef;
- }
-
- @Override
- public ObjectName getKey()
- {
- long id = oldProc != null ? oldProc.getId() : 0;
- return ObjectNameFactory.create(Constants.ID_DOMAIN + ":proc=" + getName() + ",id=" + id);
- }
-
- @Override
- public ProcessDefinition getProcessDefinition()
- {
- return procDef;
- }
-
- @Override
- public ProcessEngine getProcessEngine()
- {
- return procDef.getProcessEngine();
- }
-
- @Override
- public ProcessStatus getProcessStatus()
- {
- if (rootToken != null && procStatus == ProcessStatus.Active)
- {
- if (rootToken.getTokenStatus() == TokenStatus.Destroyed)
- procStatus = ProcessStatus.Completed;
- }
- return procStatus;
- }
-
- public void setProcessStatus(ProcessStatus procStatus)
- {
- this.procStatus = procStatus;
- }
-
- @Override
- public String getName()
- {
- return procDef.getName();
- }
-
- @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 att)
- {
- setProcessStatus(ProcessStatus.Active);
- oldProc = new ProcessInstance(procDef.getOldProcessDefinition());
- rootToken = new TokenImpl(this, oldProc.getRootToken(), att);
- rootToken.signal();
- return rootToken;
- }
-
- public Token getRootToken()
- {
- return rootToken;
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,145 @@
+/*
+ * 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.model;
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.Constants;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.client.Token.TokenStatus;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.integration.client.TokenImpl;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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 procStatus = ProcessStatus.None;
+ private Token rootToken;
+
+ public ProcessImpl(ProcessDefinitionImpl procDef)
+ {
+ this.procDef = procDef;
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ long id = oldProc != null ? oldProc.getId() : 0;
+ return ObjectNameFactory.create(Constants.ID_DOMAIN + ":proc=" + getName() + ",id=" + id);
+ }
+
+ @Override
+ public ProcessDefinition getProcessDefinition()
+ {
+ return procDef;
+ }
+
+ @Override
+ public ProcessEngine getProcessEngine()
+ {
+ return procDef.getProcessEngine();
+ }
+
+ @Override
+ public ProcessStatus getProcessStatus()
+ {
+ if (rootToken != null && procStatus == ProcessStatus.Active)
+ {
+ if (rootToken.getTokenStatus() == TokenStatus.Destroyed)
+ procStatus = ProcessStatus.Completed;
+ }
+ return procStatus;
+ }
+
+ public void setProcessStatus(ProcessStatus procStatus)
+ {
+ this.procStatus = procStatus;
+ }
+
+ @Override
+ public String getName()
+ {
+ return procDef.getName();
+ }
+
+ @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 att)
+ {
+ setProcessStatus(ProcessStatus.Active);
+ oldProc = new ProcessInstance(procDef.getOldProcessDefinition());
+ rootToken = new TokenImpl(this, oldProc.getRootToken(), att);
+ rootToken.signal();
+ return rootToken;
+ }
+
+ public Token getRootToken()
+ {
+ return rootToken;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,90 +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.integration.model;
-
-import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.Transition;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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 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/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,90 @@
+/*
+ * 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.model;
+
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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 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;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,80 +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.integration.model;
-
-import java.util.List;
-
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.graph.def.Transition;
-import org.jbpm.graph.node.StartState;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class StartEventImpl extends NodeImpl 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
- @SuppressWarnings("unchecked")
- 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);
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+import java.util.List;
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.node.StartState;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class StartEventImpl extends NodeImpl 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
+ @SuppressWarnings("unchecked")
+ 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);
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.model;
-
-import java.util.List;
-import java.util.Set;
-
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Task;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.Transition;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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);
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Task;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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);
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,48 +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.integration.model;
-
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.WaitState;
-import org.jbpm.graph.node.State;
-
-/**
- * An integration wrapper
- *
- * @author thomas.diesler at 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/src/main/java/org/jbpm/integration/model/WaitStateImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/WaitStateImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -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.model;
+
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.WaitState;
+import org.jbpm.graph.node.State;
+
+/**
+ * An integration wrapper
+ *
+ * @author thomas.diesler at 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/src/main/java/org/jbpm/integration/model/builder (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/builder)
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,62 +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.integration.model.builder;
-
-//$Id$
-
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.GatewayBuilder;
-
-/**
- * The GatewayBuilder can be used to build a Gateway dynamically.
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class GatewayBuilderImpl extends ProcessBuilderImpl implements GatewayBuilder
-{
- protected GatewayBuilderImpl(ProcessBuilderImpl procBuilder)
- {
- super(procBuilder);
- }
-
- @Override
- public GatewayBuilder addGate(String targetName)
- {
- addSequenceFlow(targetName);
- return this;
- }
-
- @Override
- public GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody)
- {
- addSequenceFlow(targetName, exprLang, exprBody);
- return this;
- }
-
- @Override
- public GatewayBuilder addDefaultGate(String targetName)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/GatewayBuilderImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,62 @@
+/*
+ * 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.model.builder;
+
+//$Id$
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.GatewayBuilder;
+
+/**
+ * The GatewayBuilder can be used to build a Gateway dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class GatewayBuilderImpl extends ProcessBuilderImpl implements GatewayBuilder
+{
+ protected GatewayBuilderImpl(ProcessBuilderImpl procBuilder)
+ {
+ super(procBuilder);
+ }
+
+ @Override
+ public GatewayBuilder addGate(String targetName)
+ {
+ addSequenceFlow(targetName);
+ return this;
+ }
+
+ @Override
+ public GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody)
+ {
+ addSequenceFlow(targetName, exprLang, exprBody);
+ return this;
+ }
+
+ @Override
+ public GatewayBuilder addDefaultGate(String targetName)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,232 +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.integration.model.builder;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.GatewayBuilder;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.graph.def.Transition;
-import org.jbpm.graph.node.Decision;
-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;
-
-/**
- * The ProcessBuilder can be used to dynamically build a {@link Process}.
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class ProcessBuilderImpl implements ProcessBuilder
-{
- protected ProcessEngine engine;
- protected ProcessDefinitionImpl procDefImpl;
- protected NodeImpl nodeImpl;
-
- private List<FlowSpec> flows = new ArrayList<FlowSpec>();
-
- public ProcessBuilderImpl(ProcessEngine engine)
- {
- this.engine = engine;
- }
-
- protected ProcessBuilderImpl(ProcessBuilderImpl procBuilder)
- {
- this.engine = procBuilder.engine;
- this.procDefImpl = procBuilder.procDefImpl;
- this.nodeImpl = procBuilder.nodeImpl;
- this.flows = procBuilder.flows;
- }
-
- @Override
- public ProcessBuilder addProcess(String name)
- {
- procDefImpl = new ProcessDefinitionImpl(engine, name);
- return this;
- }
-
- @Override
- public ProcessDefinition getProcessDefinition()
- {
- initProcessDefinition();
- return procDefImpl;
- }
-
- @Override
- public ProcessBuilder addStartEvent(String name)
- {
- nodeImpl = new StartEventImpl(procDefImpl, new StartState(name));
- procDefImpl.addNode(nodeImpl);
- return this;
- }
-
- @Override
- public GatewayBuilder addGateway(String name, GatewayType type)
- {
- if (type == GatewayType.Exclusive)
- {
- nodeImpl = new ExclusiveGatewayImpl(procDefImpl, new Decision(name));
- procDefImpl.addNode(nodeImpl);
- }
- else
- {
- throw new NotImplementedException("Unsupported gateway type: " + type);
- }
- return new GatewayBuilderImpl(this);
- }
-
- @Override
- public ProcessBuilder addTask(String name)
- {
- return addTask(name, TaskType.None);
- }
-
- @Override
- public ProcessBuilder addTask(String name, TaskType type)
- {
- if (type == TaskType.None)
- {
- nodeImpl = new TaskImpl(procDefImpl, new org.jbpm.graph.def.Node(name));
- procDefImpl.addNode(nodeImpl);
- }
- else if (type == TaskType.Wait)
- {
- nodeImpl = new WaitStateImpl(procDefImpl, new State(name));
- procDefImpl.addNode(nodeImpl);
- }
- else
- {
- throw new NotImplementedException("Unsupported task type: " + type);
- }
- return this;
- }
-
- @Override
- public ProcessBuilder addEndEvent(String name)
- {
- nodeImpl = new EndEventImpl(procDefImpl, new EndState(name));
- procDefImpl.addNode(nodeImpl);
- return this;
- }
-
- @Override
- public ProcessBuilder addSequenceFlow(String targetName)
- {
- return addSequenceFlow(targetName, null, null);
- }
-
- public ProcessBuilder addSequenceFlow(String targetName, ExpressionLanguage exprLang, String exprBody)
- {
- flows.add(new FlowSpec(nodeImpl.getName(), targetName, exprLang, exprBody));
- return this;
- }
-
- class FlowSpec
- {
- String source;
- String target;
- ExpressionLanguage exprLang;
- String exprBody;
-
- public FlowSpec(String source, String target, ExpressionLanguage exprLang, String exprBody)
- {
- this.source = source;
- this.target = target;
- this.exprLang = exprLang;
- this.exprBody = exprBody;
- }
- }
-
- private void initProcessDefinition()
- {
- // Initialize the flows
- for (FlowSpec flow : flows)
- {
- NodeImpl srcNode = (NodeImpl)procDefImpl.getNode(flow.source);
- if (srcNode == null)
- throw new InvalidProcessException("Cannot obtain source node: " + flow.source);
-
- NodeImpl targetNode = (NodeImpl)procDefImpl.getNode(flow.target);
- if (targetNode == null)
- throw new InvalidProcessException("Cannot obtain target node: " + flow.target);
-
- Transition trans = new Transition(flow.target);
- trans.setFrom(srcNode.getOldNode());
- trans.setTo(targetNode.getOldNode());
-
- SequenceFlowImpl seqFlow = new SequenceFlowImpl(trans, flow.exprLang, flow.exprBody);
- srcNode.addSequenceFlow(seqFlow);
- }
-
- // Verify that there is a start event
- List<StartEvent> startEvents = procDefImpl.getNodes(StartEvent.class);
- if (startEvents.size() == 0)
- throw new InvalidProcessException("Cannot obtain a start event");
-
- // Verify that there is an end event
- List<EndEvent> endEvents = procDefImpl.getNodes(EndEvent.class);
- if (endEvents.size() == 0)
- throw new InvalidProcessException("Cannot obtain an end event");
-
- // Detect unreachable nodes
- for (Node node : procDefImpl.getNodes())
- {
- NodeImpl nodeImpl = (NodeImpl)node;
- Set arriving = nodeImpl.getOldNode().getArrivingTransitions();
- if (!(node instanceof StartEvent) && arriving == null)
- throw new InvalidProcessException("Unreachable node: " + node);
- }
-
- // Detect dead end nodes
- for (Node node : procDefImpl.getNodes())
- {
- NodeImpl nodeImpl = (NodeImpl)node;
- List leaving = nodeImpl.getOldNode().getLeavingTransitions();
- if (!(node instanceof EndEvent) && leaving == null)
- throw new InvalidProcessException("Dead end node: " + node);
- }
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/model/builder/ProcessBuilderImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,232 @@
+/*
+ * 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.model.builder;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.node.Decision;
+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;
+
+/**
+ * The ProcessBuilder can be used to dynamically build a {@link Process}.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class ProcessBuilderImpl implements ProcessBuilder
+{
+ protected ProcessEngine engine;
+ protected ProcessDefinitionImpl procDefImpl;
+ protected NodeImpl nodeImpl;
+
+ private List<FlowSpec> flows = new ArrayList<FlowSpec>();
+
+ public ProcessBuilderImpl(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ protected ProcessBuilderImpl(ProcessBuilderImpl procBuilder)
+ {
+ this.engine = procBuilder.engine;
+ this.procDefImpl = procBuilder.procDefImpl;
+ this.nodeImpl = procBuilder.nodeImpl;
+ this.flows = procBuilder.flows;
+ }
+
+ @Override
+ public ProcessBuilder addProcess(String name)
+ {
+ procDefImpl = new ProcessDefinitionImpl(engine, name);
+ return this;
+ }
+
+ @Override
+ public ProcessDefinition getProcessDefinition()
+ {
+ initProcessDefinition();
+ return procDefImpl;
+ }
+
+ @Override
+ public ProcessBuilder addStartEvent(String name)
+ {
+ nodeImpl = new StartEventImpl(procDefImpl, new StartState(name));
+ procDefImpl.addNode(nodeImpl);
+ return this;
+ }
+
+ @Override
+ public GatewayBuilder addGateway(String name, GatewayType type)
+ {
+ if (type == GatewayType.Exclusive)
+ {
+ nodeImpl = new ExclusiveGatewayImpl(procDefImpl, new Decision(name));
+ procDefImpl.addNode(nodeImpl);
+ }
+ else
+ {
+ throw new NotImplementedException("Unsupported gateway type: " + type);
+ }
+ return new GatewayBuilderImpl(this);
+ }
+
+ @Override
+ public ProcessBuilder addTask(String name)
+ {
+ return addTask(name, TaskType.None);
+ }
+
+ @Override
+ public ProcessBuilder addTask(String name, TaskType type)
+ {
+ if (type == TaskType.None)
+ {
+ nodeImpl = new TaskImpl(procDefImpl, new org.jbpm.graph.def.Node(name));
+ procDefImpl.addNode(nodeImpl);
+ }
+ else if (type == TaskType.Wait)
+ {
+ nodeImpl = new WaitStateImpl(procDefImpl, new State(name));
+ procDefImpl.addNode(nodeImpl);
+ }
+ else
+ {
+ throw new NotImplementedException("Unsupported task type: " + type);
+ }
+ return this;
+ }
+
+ @Override
+ public ProcessBuilder addEndEvent(String name)
+ {
+ nodeImpl = new EndEventImpl(procDefImpl, new EndState(name));
+ procDefImpl.addNode(nodeImpl);
+ return this;
+ }
+
+ @Override
+ public ProcessBuilder addSequenceFlow(String targetName)
+ {
+ return addSequenceFlow(targetName, null, null);
+ }
+
+ public ProcessBuilder addSequenceFlow(String targetName, ExpressionLanguage exprLang, String exprBody)
+ {
+ flows.add(new FlowSpec(nodeImpl.getName(), targetName, exprLang, exprBody));
+ return this;
+ }
+
+ class FlowSpec
+ {
+ String source;
+ String target;
+ ExpressionLanguage exprLang;
+ String exprBody;
+
+ public FlowSpec(String source, String target, ExpressionLanguage exprLang, String exprBody)
+ {
+ this.source = source;
+ this.target = target;
+ this.exprLang = exprLang;
+ this.exprBody = exprBody;
+ }
+ }
+
+ private void initProcessDefinition()
+ {
+ // Initialize the flows
+ for (FlowSpec flow : flows)
+ {
+ NodeImpl srcNode = (NodeImpl)procDefImpl.getNode(flow.source);
+ if (srcNode == null)
+ throw new InvalidProcessException("Cannot obtain source node: " + flow.source);
+
+ NodeImpl targetNode = (NodeImpl)procDefImpl.getNode(flow.target);
+ if (targetNode == null)
+ throw new InvalidProcessException("Cannot obtain target node: " + flow.target);
+
+ Transition trans = new Transition(flow.target);
+ trans.setFrom(srcNode.getOldNode());
+ trans.setTo(targetNode.getOldNode());
+
+ SequenceFlowImpl seqFlow = new SequenceFlowImpl(trans, flow.exprLang, flow.exprBody);
+ srcNode.addSequenceFlow(seqFlow);
+ }
+
+ // Verify that there is a start event
+ List<StartEvent> startEvents = procDefImpl.getNodes(StartEvent.class);
+ if (startEvents.size() == 0)
+ throw new InvalidProcessException("Cannot obtain a start event");
+
+ // Verify that there is an end event
+ List<EndEvent> endEvents = procDefImpl.getNodes(EndEvent.class);
+ if (endEvents.size() == 0)
+ throw new InvalidProcessException("Cannot obtain an end event");
+
+ // Detect unreachable nodes
+ for (Node node : procDefImpl.getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ Set arriving = nodeImpl.getOldNode().getArrivingTransitions();
+ if (!(node instanceof StartEvent) && arriving == null)
+ throw new InvalidProcessException("Unreachable node: " + node);
+ }
+
+ // Detect dead end nodes
+ for (Node node : procDefImpl.getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ List leaving = nodeImpl.getOldNode().getLeavingTransitions();
+ if (!(node instanceof EndEvent) && leaving == null)
+ throw new InvalidProcessException("Dead end node: " + node);
+ }
+ }
+}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime)
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,76 +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.integration.runtime;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.api.client.Token;
-import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.Attachments.Key;
-import org.mvel.MVEL;
-
-/**
- * Evaluates an expression for a given token
- *
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public class ExpressionEvaluator
-{
- private Expression expr;
-
- public ExpressionEvaluator(Expression expr)
- {
- this.expr = expr;
- }
-
- /**
- * Evaluate an expression for a given token. <p/> Note that <code>propName.replace(".", "_")</code> applies to
- * property names for MVEL expressions, because the dot notation has special meaning in MVEL.
- */
- public Object evaluateExpression(Token token)
- {
- ExpressionLanguage exprLang = expr.getExpressionLanguage();
- if (exprLang == ExpressionLanguage.MVEL)
- {
- String mvel = expr.getExpressionBody();
- Attachments atts = token.getAttachments();
- Map<String, Object> vars = new HashMap<String, Object>();
- for (Key key : atts.getAttachmentKeys())
- {
- String name = key.getNamePart();
- Object value = atts.getAttachment(name);
- vars.put(name.replace(".", "_"), value);
- }
- return MVEL.eval(mvel, vars);
- }
- else
- {
- throw new IllegalStateException("Unsupported expression language: " + exprLang);
- }
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,76 @@
+/*
+ * 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.runtime;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.Attachments.Key;
+import org.mvel.MVEL;
+
+/**
+ * Evaluates an expression for a given token
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public class ExpressionEvaluator
+{
+ private Expression expr;
+
+ public ExpressionEvaluator(Expression expr)
+ {
+ this.expr = expr;
+ }
+
+ /**
+ * Evaluate an expression for a given token. <p/> Note that <code>propName.replace(".", "_")</code> applies to
+ * property names for MVEL expressions, because the dot notation has special meaning in MVEL.
+ */
+ public Object evaluateExpression(Token token)
+ {
+ ExpressionLanguage exprLang = expr.getExpressionLanguage();
+ if (exprLang == ExpressionLanguage.MVEL)
+ {
+ String mvel = expr.getExpressionBody();
+ Attachments atts = token.getAttachments();
+ Map<String, Object> vars = new HashMap<String, Object>();
+ for (Key key : atts.getAttachmentKeys())
+ {
+ String name = key.getNamePart();
+ Object value = atts.getAttachment(name);
+ vars.put(name.replace(".", "_"), value);
+ }
+ return MVEL.eval(mvel, vars);
+ }
+ else
+ {
+ throw new IllegalStateException("Unsupported expression language: " + exprLang);
+ }
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.runtime;
-
-//$Id$
-
-import org.jbpm.api.client.Token;
-
-/**
- * An interceptor that invokes the Node.execute
- *
- * @author thomas.diesler at jboss.com
- * @since 07-Oct-2008
- */
-public class NodeExecuteInterceptor implements NodeInterceptor
-{
- @Override
- public void execute(RuntimeContext rtContext)
- {
- Token token = rtContext.getToken();
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+//$Id$
+
+import org.jbpm.api.client.Token;
+
+/**
+ * An interceptor that invokes the Node.execute
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public class NodeExecuteInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Token token = rtContext.getToken();
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,35 +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.integration.runtime;
-
-//$Id$
-
-/**
- * A node interceptor
- *
- * @author thomas.diesler at jboss.com
- * @since 07-Oct-2008
- */
-public interface NodeInterceptor
-{
- void execute (RuntimeContext rtContext);
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,35 @@
+/*
+ * 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.runtime;
+
+//$Id$
+
+/**
+ * A node interceptor
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public interface NodeInterceptor
+{
+ void execute (RuntimeContext rtContext);
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.runtime;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.api.client.Token;
-
-/**
- * A runtime context that passes through a chain of interceptors.
- *
- * @author thomas.diesler at jboss.com
- * @since 07-Oct-2008
- */
-public class RuntimeContext
-{
- private List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
- private int itorIndex;
-
- private Token token;
-
- public Token getToken()
- {
- return token;
- }
-
- public void setToken(Token token)
- {
- this.token = token;
- this.itorIndex = 0;
- }
-
- void addInterceptor(NodeInterceptor itor)
- {
- interceptors.add(itor);
- }
-
- protected void next()
- {
- if (itorIndex < interceptors.size())
- {
- NodeInterceptor itor = interceptors.get(itorIndex++);
- itor.execute(this);
- }
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.client.Token;
+
+/**
+ * A runtime context that passes through a chain of interceptors.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public class RuntimeContext
+{
+ private List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
+ private int itorIndex;
+
+ private Token token;
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ public void setToken(Token token)
+ {
+ this.token = token;
+ this.itorIndex = 0;
+ }
+
+ void addInterceptor(NodeInterceptor itor)
+ {
+ interceptors.add(itor);
+ }
+
+ protected void next()
+ {
+ if (itorIndex < interceptors.size())
+ {
+ NodeInterceptor itor = interceptors.get(itorIndex++);
+ itor.execute(this);
+ }
+ }
+}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service)
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.service;
-
-// $Id$
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.service.DialectHandler;
-import org.jbpm.api.service.DialectHandlerService;
-
-/**
- * A registry that maps namespaceURI to a {@link DialectHandler}
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class DialectHandlerServiceImpl extends DialectHandlerService implements MutableService
-{
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- public void setDialectHandlers(Map<URI, DialectHandler> dialectHandlers)
- {
- this.dialectHandlers = dialectHandlers;
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.DialectHandler;
+import org.jbpm.api.service.DialectHandlerService;
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class DialectHandlerServiceImpl extends DialectHandlerService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setDialectHandlers(Map<URI, DialectHandler> dialectHandlers)
+ {
+ this.dialectHandlers = dialectHandlers;
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,38 +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.integration.service;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.service.Service;
-
-/**
- * A mutable service
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public interface MutableService extends Service
-{
- void setProcessEngine(ProcessEngine engine);
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.Service;
+
+/**
+ * A mutable service
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public interface MutableService extends Service
+{
+ void setProcessEngine(ProcessEngine engine);
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,137 +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.integration.service;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
-import org.hibernate.Session;
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.PersistenceService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * An in-memory persistence service.
- *
- * @author thomas.diesler at jboss.com
- * @since 17-Sep-2008
- */
-public class NoopPersistenceServiceImpl extends PersistenceService implements MutableService
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(NoopPersistenceServiceImpl.class);
-
- private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
- private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
-
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- @Override
- public Session createSession()
- {
- return null;
- }
-
- @Override
- public ObjectName saveProcessDefinition(ProcessDefinition procDef)
- {
- procDefs.put(procDef.getKey(), procDef);
- return procDef.getKey();
- }
-
- @Override
- public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
- {
- ProcessDefinition procDef = procDefs.get(procDefID);
- if (procDef == null)
- throw new ProcessNotFoundException("Cannot find process: " + procDefID);
-
- return procDef;
- }
-
- @Override
- public void deleteProcessDefinition(ProcessDefinition procDef)
- {
- procDefs.remove(procDef.getKey());
- }
-
- @Override
- public ObjectName saveProcess(Process proc)
- {
- procs.put(proc.getKey(), proc);
-
- for (Node node : proc.getNodes())
- nodes.put(node.getKey(), node);
-
- return proc.getKey();
- }
-
- @Override
- public Process loadProcess(ObjectName procID)
- {
- Process proc = procs.get(procID);
- if (proc == null)
- throw new ProcessNotFoundException("Cannot find process: " + procID);
-
- return proc;
- }
-
- @Override
- public void deleteProcess(Process proc)
- {
- procs.remove(proc.getKey());
-
- for (Node node : proc.getNodes())
- nodes.remove(node.getKey());
- }
-
- @Override
- public ObjectName saveNode(Session session, Node node)
- {
- return node.getKey();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T extends Node> T loadNode(Session session, Class<T> nodeImpl, ObjectName nodeID)
- {
- T node = (T)nodes.get(nodeID);
- if (node == null)
- throw new ProcessNotFoundException("Cannot find node: " + nodeID);
-
- return node;
- }
-}
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,137 @@
+/*
+ * 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.service;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.hibernate.Session;
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.PersistenceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An in-memory persistence service.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 17-Sep-2008
+ */
+public class NoopPersistenceServiceImpl extends PersistenceService implements MutableService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(NoopPersistenceServiceImpl.class);
+
+ private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+ private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public Session createSession()
+ {
+ return null;
+ }
+
+ @Override
+ public ObjectName saveProcessDefinition(ProcessDefinition procDef)
+ {
+ procDefs.put(procDef.getKey(), procDef);
+ return procDef.getKey();
+ }
+
+ @Override
+ public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
+ {
+ ProcessDefinition procDef = procDefs.get(procDefID);
+ if (procDef == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procDefID);
+
+ return procDef;
+ }
+
+ @Override
+ public void deleteProcessDefinition(ProcessDefinition procDef)
+ {
+ procDefs.remove(procDef.getKey());
+ }
+
+ @Override
+ public ObjectName saveProcess(Process proc)
+ {
+ procs.put(proc.getKey(), proc);
+
+ for (Node node : proc.getNodes())
+ nodes.put(node.getKey(), node);
+
+ return proc.getKey();
+ }
+
+ @Override
+ public Process loadProcess(ObjectName procID)
+ {
+ Process proc = procs.get(procID);
+ if (proc == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procID);
+
+ return proc;
+ }
+
+ @Override
+ public void deleteProcess(Process proc)
+ {
+ procs.remove(proc.getKey());
+
+ for (Node node : proc.getNodes())
+ nodes.remove(node.getKey());
+ }
+
+ @Override
+ public ObjectName saveNode(Session session, Node node)
+ {
+ return node.getKey();
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <T extends Node> T loadNode(Session session, Class<T> nodeImpl, ObjectName nodeID)
+ {
+ T node = (T)nodes.get(nodeID);
+ if (node == null)
+ throw new ProcessNotFoundException("Cannot find node: " + nodeID);
+
+ return node;
+ }
+}
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,50 +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.integration.service;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.integration.model.builder.ProcessBuilderImpl;
-/**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessBuilderServiceImpl extends ProcessBuilderService implements MutableService
-{
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- @Override
- public ProcessBuilder getProcessBuilder()
- {
- return new ProcessBuilderImpl(getProcessEngine());
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.integration.model.builder.ProcessBuilderImpl;
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessBuilderServiceImpl extends ProcessBuilderService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public ProcessBuilder getProcessBuilder()
+ {
+ return new ProcessBuilderImpl(getProcessEngine());
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,108 +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.integration.service;
-
-// $Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessDefinitionServiceImpl extends ProcessDefinitionService implements MutableService
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessDefinitionServiceImpl.class);
-
- // The set of registered ProcessDefinitions
- private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
-
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- @Override
- public ProcessDefinition getProcessDefinition(ObjectName procDefID)
- {
- return procDefs.get(procDefID);
- }
-
- @Override
- public Set<ObjectName> getProcessDefinitions()
- {
- return Collections.unmodifiableSet(procDefs.keySet());
- }
-
- @Override
- public ObjectName registerProcessDefinition(ProcessDefinition procDef)
- {
- if (getProcessDefinition(procDef.getKey()) != null)
- throw new IllegalStateException("Process definition already registered: " + procDef);
-
- log.debug("registerProcessDefinition: " + procDef);
-
- // Save the ProcessDefinition through the PersistenceService
- ObjectName procDefID = procDef.getKey();
- procDefs.put(procDefID, procDef);
-
- return procDefID;
- }
-
- @Override
- public boolean unregisterProcessDefinition(ObjectName procDefID)
- {
- boolean removed = false;
- ProcessDefinition procDef = procDefs.get(procDefID);
- if (procDef != null)
- {
- log.debug("unregisterProcessDefinition: " + procDef);
-
- ProcessEngine engine = getProcessEngine();
-
- // Unregister the associated process instances
- ProcessService procService = engine.getService(ProcessService.class);
- for (ObjectName procID : procService.getProcesses(procDef.getName(), null))
- procService.unregisterProcess(procID);
-
- procDefs.remove(procDefID);
- removed = true;
- }
- return removed;
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,108 @@
+/*
+ * 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.service;
+
+// $Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessDefinitionServiceImpl extends ProcessDefinitionService implements MutableService
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessDefinitionServiceImpl.class);
+
+ // The set of registered ProcessDefinitions
+ private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public ProcessDefinition getProcessDefinition(ObjectName procDefID)
+ {
+ return procDefs.get(procDefID);
+ }
+
+ @Override
+ public Set<ObjectName> getProcessDefinitions()
+ {
+ return Collections.unmodifiableSet(procDefs.keySet());
+ }
+
+ @Override
+ public ObjectName registerProcessDefinition(ProcessDefinition procDef)
+ {
+ if (getProcessDefinition(procDef.getKey()) != null)
+ throw new IllegalStateException("Process definition already registered: " + procDef);
+
+ log.debug("registerProcessDefinition: " + procDef);
+
+ // Save the ProcessDefinition through the PersistenceService
+ ObjectName procDefID = procDef.getKey();
+ procDefs.put(procDefID, procDef);
+
+ return procDefID;
+ }
+
+ @Override
+ public boolean unregisterProcessDefinition(ObjectName procDefID)
+ {
+ boolean removed = false;
+ ProcessDefinition procDef = procDefs.get(procDefID);
+ if (procDef != null)
+ {
+ log.debug("unregisterProcessDefinition: " + procDef);
+
+ ProcessEngine engine = getProcessEngine();
+
+ // Unregister the associated process instances
+ ProcessService procService = engine.getService(ProcessService.class);
+ for (ObjectName procID : procService.getProcesses(procDef.getName(), null))
+ procService.unregisterProcess(procID);
+
+ procDefs.remove(procDefID);
+ removed = true;
+ }
+ return removed;
+ }
+}
\ No newline at end of file
Deleted: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,188 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.service;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.integration.model.ProcessImpl;
-import org.jbpm.integration.runtime.NodeInterceptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The ProcessService is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessServiceImpl extends ProcessService implements MutableService
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class);
-
- private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
- private List<NodeInterceptor> nodeInterceptors = new ArrayList<NodeInterceptor>();
-
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- public void setInterceptors(List<String> itorClassNames)
- {
- for (String itorClass : itorClassNames)
- {
- NodeInterceptor itor = loadNodeInterceptor(itorClass);
- nodeInterceptors.add(itor);
- }
- }
-
- public List<NodeInterceptor> getNodeInterceptors()
- {
- return Collections.unmodifiableList(nodeInterceptors);
- }
-
- /**
- * Get a Process for a given id
- */
- @Override
- public Process getProcess(ObjectName procID)
- {
- Process proc = registeredProcs.get(procID);
- return proc;
- }
-
- /**
- * Get the set of registered Processes
- */
- @Override
- public Set<ObjectName> getProcesses()
- {
- return Collections.unmodifiableSet(registeredProcs.keySet());
- }
-
- /**
- * Find the set of Processes for a given name
- *
- * @param name The process name
- * @param status The optional process status
- * @return An empty set if the process cannot be found
- */
- @Override
- public Set<ObjectName> getProcesses(String name, ProcessStatus status)
- {
- Set<ObjectName> procSet = new HashSet<ObjectName>();
- for (Process auxProc : registeredProcs.values())
- {
- if (auxProc.getName().equals(name))
- {
- if (status == null || auxProc.getProcessStatus() == status)
- procSet.add(auxProc.getKey());
- }
- }
- return procSet;
- }
-
- /**
- * Register a Process.
- */
- public ObjectName registerProcess(Process proc)
- {
- log.debug("registerProcess: " + proc);
-
- ObjectName procID = proc.getKey();
- if (getProcess(procID) != null)
- throw new IllegalStateException("Process already registered: " + proc);
-
- ProcessStatus procStatus = proc.getProcessStatus();
- ProcessDefinition procDef = proc.getProcessDefinition();
- ProcessEngine engine = getProcessEngine();
-
- if (procStatus != ProcessStatus.None)
- throw new IllegalStateException("Cannot register process in state: " + procStatus);
-
- // Register the process definition if needed
- ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
- if (procDefService.getProcessDefinition(procDef.getKey()) == null)
- procDefService.registerProcessDefinition(procDef);
-
- // Register the process
- registeredProcs.put(procID, proc);
-
- ProcessImpl procImpl = (ProcessImpl)proc;
- procImpl.setProcessStatus(ProcessStatus.Ready);
-
- return procID;
- }
-
- /**
- * Unregister a Process.
- */
- public boolean unregisterProcess(ObjectName procID)
- {
- boolean removed = false;
- Process proc = registeredProcs.get(procID);
- if (proc != null)
- {
- log.debug("unregisterProcess: " + proc);
-
- registeredProcs.remove(procID);
- removed = true;
- }
- return removed;
- }
-
- private NodeInterceptor loadNodeInterceptor(String className)
- {
- NodeInterceptor itor = null;
- if (className != null)
- {
- try
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- itor = (NodeInterceptor)ctxLoader.loadClass(className).newInstance();
- }
- catch (Exception ex)
- {
- log.error("Cannot load interceptor: " + className, ex);
- }
- }
- return itor;
- }
-}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.integration.model.ProcessImpl;
+import org.jbpm.integration.runtime.NodeInterceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessService is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessServiceImpl extends ProcessService implements MutableService
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class);
+
+ private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
+ private List<NodeInterceptor> nodeInterceptors = new ArrayList<NodeInterceptor>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setInterceptors(List<String> itorClassNames)
+ {
+ for (String itorClass : itorClassNames)
+ {
+ NodeInterceptor itor = loadNodeInterceptor(itorClass);
+ nodeInterceptors.add(itor);
+ }
+ }
+
+ public List<NodeInterceptor> getNodeInterceptors()
+ {
+ return Collections.unmodifiableList(nodeInterceptors);
+ }
+
+ /**
+ * Get a Process for a given id
+ */
+ @Override
+ public Process getProcess(ObjectName procID)
+ {
+ Process proc = registeredProcs.get(procID);
+ return proc;
+ }
+
+ /**
+ * Get the set of registered Processes
+ */
+ @Override
+ public Set<ObjectName> getProcesses()
+ {
+ return Collections.unmodifiableSet(registeredProcs.keySet());
+ }
+
+ /**
+ * Find the set of Processes for a given name
+ *
+ * @param name The process name
+ * @param status The optional process status
+ * @return An empty set if the process cannot be found
+ */
+ @Override
+ public Set<ObjectName> getProcesses(String name, ProcessStatus status)
+ {
+ Set<ObjectName> procSet = new HashSet<ObjectName>();
+ for (Process auxProc : registeredProcs.values())
+ {
+ if (auxProc.getName().equals(name))
+ {
+ if (status == null || auxProc.getProcessStatus() == status)
+ procSet.add(auxProc.getKey());
+ }
+ }
+ return procSet;
+ }
+
+ /**
+ * Register a Process.
+ */
+ public ObjectName registerProcess(Process proc)
+ {
+ log.debug("registerProcess: " + proc);
+
+ ObjectName procID = proc.getKey();
+ if (getProcess(procID) != null)
+ throw new IllegalStateException("Process already registered: " + proc);
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ ProcessDefinition procDef = proc.getProcessDefinition();
+ ProcessEngine engine = getProcessEngine();
+
+ if (procStatus != ProcessStatus.None)
+ throw new IllegalStateException("Cannot register process in state: " + procStatus);
+
+ // Register the process definition if needed
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ if (procDefService.getProcessDefinition(procDef.getKey()) == null)
+ procDefService.registerProcessDefinition(procDef);
+
+ // Register the process
+ registeredProcs.put(procID, proc);
+
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ procImpl.setProcessStatus(ProcessStatus.Ready);
+
+ return procID;
+ }
+
+ /**
+ * Unregister a Process.
+ */
+ public boolean unregisterProcess(ObjectName procID)
+ {
+ boolean removed = false;
+ Process proc = registeredProcs.get(procID);
+ if (proc != null)
+ {
+ log.debug("unregisterProcess: " + proc);
+
+ registeredProcs.remove(procID);
+ removed = true;
+ }
+ return removed;
+ }
+
+ private NodeInterceptor loadNodeInterceptor(String className)
+ {
+ NodeInterceptor itor = null;
+ if (className != null)
+ {
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ itor = (NodeInterceptor)ctxLoader.loadClass(className).newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load interceptor: " + className, ex);
+ }
+ }
+ return itor;
+ }
+}
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/resources (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/resources)
Deleted: jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,45 +0,0 @@
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- The KernelLocator -->
- <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator" />
-
- <!-- The ProcessEngine -->
- <bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
- <property name="services">
- <set elementClass="org.jbpm.api.service.Service">
- <inject bean="jBPMDialectHandlerService" />
- <inject bean="jBPMProcessBuilderService" />
- <inject bean="jBPMProcessDefinitionService" />
- <inject bean="jBPMProcessService" />
- </set>
- </property>
- </bean>
-
- <!-- The PersistenceService -->
- <bean name="jBPMPersistenceService" class="org.jbpm.integration.service.NoopPersistenceServiceImpl"/>
-
- <!-- The ProcessService -->
- <bean name="jBPMProcessService" class="org.jbpm.integration.service.ProcessServiceImpl" >
- <property name="interceptors">
- <list elementClass="java.lang.String">
- <value>org.jbpm.integration.runtime.NodeExecuteInterceptor</value>
- </list>
- </property>
- </bean>
-
- <!-- The DialectHandlerService -->
- <bean name="jBPMDialectHandlerService" class="org.jbpm.integration.service.DialectHandlerServiceImpl" >
- <property name="dialectHandlers">
- <map keyClass="java.net.URI" valueClass="org.jbpm.api.service.DialectHandler">
- <entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="jBPMDialectHandlerAPI10"/></value></entry>
- </map>
- </property>
- </bean>
- <bean name="jBPMDialectHandlerAPI10" class="org.jbpm.dialect.api10.DialectHandlerImpl"/>
-
- <!-- Other Services -->
- <bean name="jBPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
- <bean name="jBPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
-
- </deployment>
Copied: jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/resources/jbpm-cfg-beans.xml 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1,45 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The KernelLocator -->
+ <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator" />
+
+ <!-- The ProcessEngine -->
+ <bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
+ <property name="services">
+ <set elementClass="org.jbpm.api.service.Service">
+ <inject bean="jBPMDialectHandlerService" />
+ <inject bean="jBPMProcessBuilderService" />
+ <inject bean="jBPMProcessDefinitionService" />
+ <inject bean="jBPMProcessService" />
+ </set>
+ </property>
+ </bean>
+
+ <!-- The PersistenceService -->
+ <bean name="jBPMPersistenceService" class="org.jbpm.integration.service.NoopPersistenceServiceImpl"/>
+
+ <!-- The ProcessService -->
+ <bean name="jBPMProcessService" class="org.jbpm.integration.service.ProcessServiceImpl" >
+ <property name="interceptors">
+ <list elementClass="java.lang.String">
+ <value>org.jbpm.integration.runtime.NodeExecuteInterceptor</value>
+ </list>
+ </property>
+ </bean>
+
+ <!-- The DialectHandlerService -->
+ <bean name="jBPMDialectHandlerService" class="org.jbpm.integration.service.DialectHandlerServiceImpl" >
+ <property name="dialectHandlers">
+ <map keyClass="java.net.URI" valueClass="org.jbpm.api.service.DialectHandler">
+ <entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="jBPMDialectHandlerAPI10"/></value></entry>
+ </map>
+ </property>
+ </bean>
+ <bean name="jBPMDialectHandlerAPI10" class="org.jbpm.dialect.api10.DialectHandlerImpl"/>
+
+ <!-- Other Services -->
+ <bean name="jBPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
+ <bean name="jBPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
+
+ </deployment>
Deleted: jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider 2008-11-17 11:41:14 UTC (rev 2952)
+++ jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1 +0,0 @@
-org.jbpm.api.client.internal.MicrocontainerConfigurationProvider
\ No newline at end of file
Copied: jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider (from rev 2952, jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider)
===================================================================
--- jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider 2008-11-17 13:08:14 UTC (rev 2954)
@@ -0,0 +1 @@
+org.jbpm.api.client.internal.MicrocontainerConfigurationProvider
\ No newline at end of file
Modified: jbpm3/trunk/modules/simulation/.classpath
===================================================================
--- jbpm3/trunk/modules/simulation/.classpath 2008-11-17 12:57:48 UTC (rev 2953)
+++ jbpm3/trunk/modules/simulation/.classpath 2008-11-17 13:08:14 UTC (rev 2954)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-11-17 12:57:48 UTC (rev 2953)
+++ jbpm3/trunk/pom.xml 2008-11-17 13:08:14 UTC (rev 2954)
@@ -33,6 +33,7 @@
<module>modules/enterprise</module>
<module>modules/examples</module>
<module>modules/simulation</module>
+ <module>modules/integration</module>
</modules>
<!-- Properties -->
@@ -64,7 +65,7 @@
<javax.persistence.version>1.0</javax.persistence.version>
<javax.jaxb.version>2.1</javax.jaxb.version>
<jaxen.version>1.1.1</jaxen.version>
- <jbpm.api.version>1.0.0-Alpha2</jbpm.api.version>
+ <jbpm.api.version>1.0.0-SNAPSHOT</jbpm.api.version>
<jbpm.designer.version>3.1.5</jbpm.designer.version>
<jbpm.gwt-console.version>1.0.0-Beta1</jbpm.gwt-console.version>
<jbpm.jsf-console.version>3.3.0.GA</jbpm.jsf-console.version>
@@ -94,6 +95,17 @@
<version>${jbpm.api.version}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-api10</artifactId>
+ <version>${jbpm.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <version>${jbpm.api.version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jsf-console</artifactId>
<version>${jbpm.jsf-console.version}</version>
More information about the jbpm-commits
mailing list