[jbpm-commits] JBoss JBPM SVN: r2403 - in jbpm4/branches/tdiesler: modules/api/src/main/java/org/jbpm/api and 14 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Sep 26 13:41:47 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-09-26 13:41:47 -0400 (Fri, 26 Sep 2008)
New Revision: 2403
Added:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/pattern/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/pattern/control/
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration
Removed:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
Modified:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
jbpm4/branches/tdiesler/modules/cts/pom.xml
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
jbpm4/branches/tdiesler/pom.xml
Log:
Add basic model
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,46 +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.api.client;
-
-// $Id$
-
-/**
- * The Configuration provides a ProcessEngine through a given
- * configuration method
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public interface Configuration
-{
- /**
- * Create a new instance of ProcessEngine for this configuration
- * @return The configured instance of a process engine
- */
- ProcessEngine getProcessEngine();
-
- /**
- * Get a ProcessEngine with a given name from this configuration
- * @return The configured instance of a process engine
- */
- ProcessEngine getProcessEngine(String engineName);
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,102 +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.api.client;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
- *
- * @author Tom Baeyens
- * @author thomas.diesler at jboss.com
- * @since 25-Sep-2008
- */
-public class Deployment implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private String procXML;
-
- public Deployment(String procXML)
- {
- if (procXML == null)
- throw new IllegalArgumentException("Null process definition");
-
- this.procXML = procXML;
- }
-
- public Deployment(URL procURL) throws IOException
- {
- if (procURL == null)
- throw new IllegalArgumentException("Null process definition");
-
- StringBuilder strBuilder = new StringBuilder();
- BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
- String line = br.readLine();
- while (line != null)
- {
- strBuilder.append(line);
- line = br.readLine();
- }
- procXML = strBuilder.toString();
- }
-
- public String getProcessXML()
- {
- return procXML;
- }
-
- public URI getNamespaceURI()
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot parse process descriptor", ex);
- }
-
- Element root = doc.getDocumentElement();
- String nsURI = root.getNamespaceURI();
- if (nsURI == null)
- throw new IllegalStateException("Cannot get namespace URI from root element");
-
- return URI.create(nsURI);
- }
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,49 +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.api.client;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The marker interface for all Services
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Sep-2008
- */
-public abstract class DeploymentService implements Service
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
-
- /**
- * Deploy a new process to the process service.
- */
- ObjectName deploy(Deployment deployment)
- {
- return null;
- }
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.client;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-
-/**
- * The DialectHandler converts a supported dialect to the Process model.
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public interface DialectHandler
-{
- URI DEFAULT_NAMESPACE_URI = URI.create("urn:bpm.jboss:pdl-0.1");
-
- /**
- * Get the the supported namespace from this dialect.
- */
- URI getNamespaceURI();
-
- /**
- * Create a {@link Process} from a descriptor.
- * @param isInclude TODO
- */
- Process createProcess(String pXML);
-
- /**
- * Create a {@link Process} from a descriptor URL.
- * @param isInclude TODO
- */
- Process createProcess(URL pURL) throws IOException;
-
- /**
- * Marshall the process to the given writer
- */
- void marshallProcess(Process proc, Writer out) throws IOException;
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-/**
- * A registry that maps namespaceURI to a {@link DialectHandler}
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jul-2008
- */
-public abstract class DialectRegistry
-{
- // Maps namespaceURI to a DialectHandler
- protected Map<URI, DialectHandler> dialectHandlers;
-
- /**
- * Get the handler for the dialect with the given namespace URI
- */
- public DialectHandler getDialectHandler(URI nsURI)
- {
- DialectHandler dialectHandler = dialectHandlers.get(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + nsURI);
-
- return dialectHandler;
- }
-
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,106 +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.api.client;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.util.KernelLocator;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jbpm.api.client.internal.EmbeddedBeansDeployer;
-
-/**
- * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class MicrocontainerConfiguration implements Configuration
-{
- /** The process engine bean name - jBPMEngine */
- public static final String BEAN_NAME = "jBPMProcessEngine";
- /** The default bean config: jbpm-cfg-beans.xml */
- public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
-
- // Everything gets deployed through one deployer
- private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
-
- public void deployDefaultConfig()
- {
- URL cfgURL = getDefaultConfigURL();
- beansDeployer.deploy(cfgURL);
- }
-
- public void undeployDefaultConfig()
- {
- URL cfgURL = getDefaultConfigURL();
- beansDeployer.undeploy(cfgURL);
- }
-
- public void deployBeansConfig(URL cfgURL)
- {
- beansDeployer.deploy(cfgURL);
- }
-
- public void undeployBeansConfig(URL cfgURL)
- {
- beansDeployer.undeploy(cfgURL);
- }
-
- /**
- * Get the default ProcessEngine from this configuration
- * @return The configured instance of a process engine
- */
- public ProcessEngine getProcessEngine()
- {
- return getProcessEngine(BEAN_NAME);
- }
-
- /**
- * Get a ProcessEngine with a given name from this configuration
- * @return The configured instance of a process engine
- */
- @SuppressWarnings("deprecation")
- public ProcessEngine getProcessEngine(String beanName)
- {
- Kernel kernel = KernelLocator.getKernel();
- if (kernel == null)
- {
- deployDefaultConfig();
- kernel = KernelLocator.getKernel();
- }
-
- KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
- ProcessEngine engine = (ProcessEngine)entry.getTarget();
- return engine;
- }
-
- private URL getDefaultConfigURL()
- {
- URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
- if (cfgURL == null)
- throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
- return cfgURL;
- }
-}
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -28,20 +28,27 @@
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
+import org.jbpm.api.config.Configuration;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
+import org.jbpm.api.service.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * The process engine is an agregator of various service objects used by the BPM engine. <p/> A ProcessEngine is always
- * created via one of the available {@link Configuration} objects. Every implementation of the API has one default
- * {@link Configuration} which is configured via a resource file with the fully qualified class name of
- * {@link Configuration}. <p/> The API natively supports {@link MicrocontainerConfiguration}. To create and register a
- * ProcessEngine explicitly, you would do
+ * The process engine is an agregator of various service objects used by the BPM engine.
+ * <p/>
+ * A ProcessEngine is always created via one of the available {@link Configuration} objects. Every implementation of the API has one default
+ * {@link Configuration} which is configured via a resource file with the fully qualified class name of {@link Configuration}.
+ * <p/>
+ * The API natively supports {@link MicrocontainerConfiguration}. To create and register a ProcessEngine explicitly, you would do
*
* <pre>
- * ProcessEngine engine = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
- * ProcessEngineRegistry.registerProcessEngine(engine);
+ * MicrocontainerConfiguration config = new MicrocontainerConfiguration();
+ * ProcessEngine engine = config.deployBeansConfig(cfgURL).getProcessEngine("EngineBeanName");
+ * ProcessEngineRegistry.registerProcessEngine(engine);
* </pre>
*
* @author thomas.diesler at jboss.com
@@ -89,23 +96,21 @@
*
* @return null, if there is no ProcessEngine registered by this name
*/
- public static ProcessEngine getProcessEngine(String name)
+ public static ProcessEngine getProcessEngine(String engineName)
{
- Map<String, ProcessEngine> engineRegistry = ProcessEngineRegistry.engineRegistry;
+ Set<String> registeredEngines = ProcessEngineRegistry.getEngineNames();
+ if (registeredEngines.size() == 0)
+ {
+ ProcessEngine engine = loadDefaultEngine();
+ ProcessEngineRegistry.registerEngine(engine);
+ return engine;
+ }
- if (engineRegistry.size() == 0)
- loadDefaultEngine();
+ if (engineName == null && registeredEngines.size() == 1)
+ engineName = registeredEngines.iterator().next();
- ProcessEngine pe = null;
- if (name == null && engineRegistry.size() == 1)
- {
- pe = engineRegistry.values().iterator().next();
- }
- else
- {
- pe = engineRegistry.get(name);
- }
- return pe;
+ ProcessEngine engine = ProcessEngineRegistry.getEngine(engineName);
+ return engine;
}
/**
@@ -129,7 +134,7 @@
{
}
- private static void loadDefaultEngine()
+ private static ProcessEngine loadDefaultEngine()
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
InputStream instream = ctxLoader.getResourceAsStream(Configuration.class.getName());
@@ -153,7 +158,7 @@
if (engine == null)
throw new IllegalStateException("Cannot obtain engine from configuration: " + config);
- ProcessEngineRegistry.registerProcessEngine(engine);
+ return engine;
}
@Override
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,84 +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.api.client;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A registry of ProcessEngine instances per VM
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Sep-2008
- */
-public final class ProcessEngineRegistry
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
-
- // The process engine registry
- static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
-
- // Hide constructor
- private ProcessEngineRegistry()
- {
- }
-
- /**
- * Get the set of registered engine names
- */
- public static Set<String> getRegisteredProcessEngines()
- {
- return engineRegistry.keySet();
- }
-
- /**
- * Register a ProcessEngine
- * @throws IllegalStateException If a ProcessEngine with that name is already registered
- */
- public static void registerProcessEngine(ProcessEngine engine)
- {
- if (engineRegistry.get(engine.getName()) != null)
- throw new IllegalStateException("Process engine already registered: " + engine.getName());
-
- log.debug("Register: " + engine);
- engineRegistry.put(engine.getName(), engine);
- }
-
- /**
- * Unregister a ProcessEngine for a given name
- */
- public static ProcessEngine unregisterProcessEngine(String name)
- {
- ProcessEngine pe = engineRegistry.remove(name);
- log.debug("Unregister: " + name + "=" + pe);
- return pe;
- }
-
-
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,73 +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.api.client;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The marker interface for all Services
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Sep-2008
- */
-public abstract class ProcessService implements Service
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessService.class);
-
- // The set of registered processes
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
-
- // Hide public constructor
- protected ProcessService()
- {
- }
-
- /**
- * Deploy a new process to the process service.
- */
- ObjectName deploy(Deployment deployment)
- {
-
- return null;
- }
-
- /**
- * Get the set of registered Processes
- */
- public Set<Process> getProcesses()
- {
- Set<Process> procSet = new HashSet<Process>(procs.values());
- return Collections.unmodifiableSet(procSet);
- }
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.client;
-
-//$Id$
-
-/**
- * The base interface for all Services
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Sep-2008
- */
-public interface Service
-{
- /**
- * Get the associated ProcessEngine
- */
- ProcessEngine getProcessEngine();
-}
\ No newline at end of file
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.config;
+
+import org.jbpm.api.client.ProcessEngine;
+
+// $Id$
+
+/**
+ * The Configuration provides a ProcessEngine through a given
+ * configuration method
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public interface Configuration
+{
+ /**
+ * Create a new instance of ProcessEngine for this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine();
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine(String engineName);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,109 @@
+/*
+ * 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.api.config;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.config.internal.EmbeddedBeansDeployer;
+
+/**
+ * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class MicrocontainerConfiguration implements Configuration
+{
+ /** The process engine bean name - jBPMEngine */
+ public static final String BEAN_NAME = "jBPMProcessEngine";
+ /** The default bean config: jbpm-cfg-beans.xml */
+ public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
+
+ // Everything gets deployed through one deployer
+ private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
+
+ public Configuration deployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ public Configuration deployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ /**
+ * Get the default ProcessEngine from this configuration
+ * @return The configured instance of a process engine
+ */
+ public ProcessEngine getProcessEngine()
+ {
+ return getProcessEngine(BEAN_NAME);
+ }
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ @SuppressWarnings("deprecation")
+ public ProcessEngine getProcessEngine(String beanName)
+ {
+ Kernel kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ deployDefaultConfig();
+ kernel = KernelLocator.getKernel();
+ }
+
+ KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
+ ProcessEngine engine = (ProcessEngine)entry.getTarget();
+ return engine;
+ }
+
+ private URL getDefaultConfigURL()
+ {
+ URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
+ if (cfgURL == null)
+ throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+ return cfgURL;
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,107 @@
+/*
+ * 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.api.config.internal;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jbpm.api.test.CTSTestSetup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Boostrap the Microcontainer
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 27-Jun-2008
+ */
+public class EmbeddedBeansDeployer extends BasicBootstrap
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(CTSTestSetup.class);
+
+ private Kernel kernel;
+ private BasicXMLDeployer deployer;
+
+ public EmbeddedBeansDeployer()
+ {
+ // Get or bootstrap the kernel
+ kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ try
+ {
+ super.bootstrap();
+ kernel = super.getKernel();
+ log.debug("bootstrap kernel: " + kernel);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot bootstrap kernel", e);
+ }
+ }
+ deployer = new BasicXMLDeployer(kernel);
+ }
+
+ /**
+ * Deploy MC beans from URL
+ */
+ public void deploy(URL url)
+ {
+ log.debug("deploy: " + url);
+ try
+ {
+ deployer.deploy(url);
+ deployer.validate();
+
+ // The KernelLocator is expected to get deployed as a bean
+ if (KernelLocator.getKernel() == null)
+ throw new IllegalStateException("KernelLocator not deployed as MC bean");
+
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot deploy beans from: " + url, e);
+ }
+ }
+
+ /**
+ * Undeploy MC beans from URL
+ */
+ public void undeploy(URL url)
+ {
+ log.debug("undeploy: " + url);
+ try
+ {
+ deployer.undeploy(url);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot undeploy beans from: " + url, e);
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+/**
+ * The parrent of all Elements
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface AbstractElement extends Serializable
+{
+ /**
+ * Get the ID of this element
+ */
+ ObjectName getID();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * The base of all builders.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Builder
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * There are two ways of Connecting Objects in BPMN: a Flow, either sequence or message, and an Association. Sequence
+ * Flow and Message Flow, to a certain extent, represent orthogonal aspects of the business processes depicted in a model,
+ * although they both affect the performance of activities within a Process.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ConnectingObject
+{
+ /**
+ * Name is an optional attribute that is text description of the Connecting Object.
+ */
+ String getName();
+
+ /**
+ * SourceRef is an attribute that identifies which Graphical Element the Connecting
+ * Object is connected from. Note: there are restrictions as to what objects Sequence
+ * Flow and Message Flow can connect.
+ */
+ Node getSourceRef();
+
+ /**
+ * TargetRef is an attribute that identifies which Graphical Element the Connecting
+ * Object is connected to. Note: there are restrictions as to what objects Sequence
+ * Flow and Message Flow can connect.
+ */
+ Node getTargetRef();
+
+ /**
+ * Get the required target name
+ */
+ String getTargetName();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+//$Id$
+
+/**
+ * As the name implies, the End Event indicates where a Process will end.
+ *
+ * In terms of Sequence Flow, the End Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flow.
+ * An End Event can have a specific Result that will appear as a marker within the center of the End Event shape.
+ * End Event Results are Message, Error, Compensation, Link, and Multiple.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface EndEvent extends Event
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+//$Id$
+
+/**
+ * An Event is something that “happens” during the course of a business process.
+ * <p/>
+ * These Events affect the flow of the Process and usually have a cause or an impact.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Event extends Node
+{
+ /**
+ * Defines the type of an {@link Event}
+ */
+ enum EventType
+ {
+ Start, End, Intermediate
+ };
+
+ /**
+ * Get the type of this event
+ */
+ EventType getEventType();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,53 @@
+/*
+ * 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.api.model;
+
+//$Id$
+
+/**
+ * An Expression, which is used in the definition of attributes for StartEvent,
+ * IntermediateEvent, Activity, ComplexGateway, and SequenceFlow
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Expression
+{
+ public enum ExpressionLanguage
+ {
+ MVEL
+ }
+
+ /**
+ * An ExpressionBody MUST be entered to provide the text of the expression, which
+ * will be written in the language defined by the ExpressionLanguage attribute.
+ */
+ String getExpressionBody();
+
+ /**
+ * A Language MUST be provided to identify the language of the ExpressionBody.
+ * The value of the ExpressionLanguage should follow the naming conventions for the
+ * version of the specified language.
+ */
+ ExpressionLanguage getExpressionLanguage();
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+//$Id$
+
+
+/**
+ * There MAY be zero or more Gates (except where noted below). Zero Gates are
+ * allowed if the Gateway is last object in a Process flow and there are no Start or
+ * End Events for the Process. If there are zero or only one incoming Sequence
+ * Flow, then there MUST be at least two Gates.
+ *
+ * For Exclusive Data-Based Gateways
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * For Exclusive Event-Based Gateways
+ * There MUST be two or more Gates. (Note that this type of Gateway does not act
+ * only as a Merge--it is always a Decision, at least.)
+ *
+ * For Inclusive Gateways
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Gate
+{
+ /**
+ * Each Gate MUST have an associated (outgoing) Sequence Flow.
+ *
+ * For Exclusive Event-Based, Complex, and Parallel Gateways:
+ * The Sequence Flow MUST have its Condition attribute set to None (there is not an
+ * evaluation of a condition expression).
+ *
+ * For Exclusive Data-Based, and Inclusive Gateways:
+ * The Sequence Flow MUST have its Condition attribute set to Expression and
+ * MUST have a valid ConditionExpression. The ConditionExpression MUST be
+ * unique for all the Gates within the Gateway. If there is only one Gate (i.e., the
+ * Gateway is acting only as a Merge), then Sequence Flow MUST have its Condition
+ * set to None.
+ *
+ * For DefaultGates:
+ * The Sequence Flow MUST have its Condition attribute set to Otherwise
+ */
+ SequenceFlow getOutgoingSequenceFlow();
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+//$Id:$
+
+import java.util.List;
+
+/**
+ * Gateways are modeling elements that are used to control how Sequence Flow interact as they converge and diverge within
+ * a Process. If the flow does not need to be controlled, then a Gateway is not needed. The term “Gateway” implies that
+ * there is a gating mechanism that either allows or disallows passage through the Gateway--that is, as Tokens arrive at a
+ * Gateway, they can be merged together on input and/or split apart on output as the Gateway mechanisms are invoked. To
+ * be more descriptive, a Gateway is actually a collection of “Gates.”
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Gateway extends Node
+{
+ /**
+ * The GatewayType
+ *
+ */
+ public enum GatewayType
+ {
+ Exclusive, Inclusive, Complex, Parallel
+ }
+
+ /**
+ * GatewayType is by default Exclusive. The GatewayType MAY be set to Inclusive, Complex, or Parallel. The GatewayType will determine the behavior of the Gateway,
+ * both for incoming and outgoing Sequence Flow
+ */
+ GatewayType getGatewayType();
+
+ /**
+ * There MAY be zero or more Gates (except where noted below). Zero Gates are allowed if the Gateway is last object in a Process flow and there are no Start or End
+ * Events for the Process. If there are zero or only one incoming Sequence Flow, then there MUST be at least two Gates.
+ *
+ * For Exclusive Data-Based Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * For Exclusive Event-Based Gateways.
+ * There MUST be two or more Gates. (Note that this type of Gateway does not act only as a Merge--it is always a Decision, at
+ * least.)
+ *
+ * For Inclusive Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ */
+ List<Gate> getGates();
+
+ /**
+ * Get the optional default gate
+ * @return null if there is none
+ */
+ Gate getDefaultGate();
+
+ /**
+ * Get the gate for the given target name
+ * @return null if there is none
+ */
+ Gate getGateByTargetName(String targetName);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+
+//$Id$
+
+/**
+ * A Message, which is used in the definition of attributes for a StartEvent,
+ * EndEvent, IntermediateEvent, Task, and MessageFlow
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Message extends PropertySupport
+{
+ /**
+ * Name is an attribute that is text description of the Message.
+ */
+ String getName();
+
+ /**
+ * This defines the source of the Message.
+ */
+ Participant getFromRef();
+
+ /**
+ * This defines the target of the Message.
+ */
+ Participant getToRef();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,66 @@
+/*
+ * 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.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+
+/**
+ * A MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageBuilder extends Builder
+{
+ /**
+ * Create a {@link Message} with a given name
+ */
+ MessageBuilder newMessage(String msgName);
+
+ /**
+ * Add a message destination
+ */
+ MessageBuilder addToRef(ObjectName toRef);
+
+ /**
+ * Add a message source
+ */
+ MessageBuilder addFromRef(ObjectName fromRef);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value, boolean isCorrelation);
+
+ /**
+ * Get the Message
+ */
+ Message getMessage();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Message Flow is a dashed line that is used to show the flow of messages between two entities that are prepared to
+ * send and receive them. In BPMN, two separate Pools in the Diagram will represent the two entities.
+ *
+ * Message Flow MUST connect two Pools, either to the Pools themselves or to Flow Objects within the Pools. They cannot
+ * connect two objects within the same Pool.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageFlow extends ConnectingObject
+{
+ /**
+ * MessageRef is an optional attribute that identifies the Message that is being sent.
+ */
+ Message getMessageRef();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,43 @@
+/*
+ * 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.api.model;
+
+// $Id$
+
+/**
+ * A Node is an abstract element with a name and an associated process
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Node extends AbstractElement
+{
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the associated Process
+ */
+ Process getProcess();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+/**
+ * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Participant
+{
+ /**
+ * The name of this participant
+ */
+ ObjectName getName();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,101 @@
+/*
+ * 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.api.model;
+
+//$Id$
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Process extends AbstractElement
+{
+ /**
+ * Defines the status a {@link Process} can be in
+ */
+ public enum ProcessStatus
+ {
+ None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
+ }
+
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the process state
+ */
+ ProcessStatus getProcessStatus();
+
+ /**
+ * Get the list of flow objects
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of flow objects of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a flow object by name.
+ * @return null if not found
+ */
+ Node getNode(String name);
+
+ // Runtime Aspects ====================================================================================================
+
+ /**
+ * Start the process
+ */
+ ObjectName startProcess();
+
+ /**
+ * Start the process, with a given execution context
+ */
+ ObjectName startProcess(Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends without timeout.
+ */
+ ProcessStatus waitForEnd();
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends with a given timeout.
+ */
+ ProcessStatus waitForEnd(long timeout);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,119 @@
+/*
+ * 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.api.model;
+
+// $Id$
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessBuilder extends Builder
+{
+ /**
+ * Add a {@link Process} with a given name
+ */
+ ProcessBuilder addProcess(String name);
+
+ /**
+ * Get the {@link Process}.
+ * <p/>
+ * This is the final call to the ProcessBuilder after all elements have been added.
+ * The {@link Process} is initialized and put in state READY
+ */
+ Process getProcess();
+
+ /**
+ * Get the {@link Process} for inclusion in another.
+ * <p/>
+ * This is the final call to the ProcessBuilder after all elements have been added.
+ * The {@link Process} is not initialized and stays in state CREATED
+ */
+ Process getProcessForInclude();
+
+ /**
+ * Add a SequenceFlow with a given name
+ */
+ ProcessBuilder addSequenceFlow(String targetName);
+
+ /**
+ * Add a MessageFlow with a given name
+ */
+ ProcessBuilder addMessageFlow(String targetName);
+
+ /**
+ * Add a SartEvent with a given name
+ */
+ ProcessBuilder addStartEvent(String name);
+
+ /**
+ * Add an IntermediateEvent with a given name
+ */
+ ProcessBuilder addEvent(String name);
+
+ /**
+ * Add an EndEvent with a given name
+ */
+ ProcessBuilder addEndEvent(String name);
+
+ /**
+ * Add a Task of {@link Task.TaskType} NONE with a given name
+ */
+ ProcessBuilder addTask(String name);
+
+ /**
+ * Add a Task with a given name and type
+ */
+ ProcessBuilder addTask(String name, Task.TaskType type);
+
+ /**
+ * Add a Gateway with a given name
+ */
+ ProcessBuilder addGateway(String name, Gateway.GatewayType type);
+
+ /**
+ * Add a {@link Message} with a given name.
+ */
+ MessageBuilder addMessage(String name);
+
+ /**
+ * Add a process property
+ */
+ ProcessBuilder addProperty(String name, String value);
+
+ /**
+ * Add an {@link ExecutionHandler} with a given Class
+ */
+ ProcessBuilder addExecutionHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link FlowHandler} with a given Class
+ */
+ ProcessBuilder addFlowHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link SignalHandler} with a given Class
+ */
+ ProcessBuilder addSignalHandler(Class<?> clazz);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,49 @@
+/*
+ * 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.api.model;
+
+// $Id$
+
+/**
+ * A Property, which is used in the definition of attributes for a Process and common activity attributes
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Property
+{
+ /**
+ * Each Property has a Name (e.g., name=”Customer Name”).
+ */
+ String getName();
+
+ /**
+ * Get the body of the expression value.
+ */
+ Object getValue();
+
+ /**
+ * If the Correlation attribute is set to True, then the Property is marked to be used for
+ * correlation (e.g., for incoming Messages).
+ */
+ boolean isCorrelation();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * Property support
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 21-Jul-2008
+ */
+public interface PropertySupport
+{
+ /**
+ * Get a Property with a given name.
+ */
+ Property getProperty(String name);
+
+ /**
+ * Get the list of property names
+ */
+ List<String> getPropertyNames();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Sequence Flow is used to show the order that activities will be performed in a Process. Each Flow has only one
+ * source and only one target. The source and target must be from the set of the following Flow Objects: Events (Start,
+ * Intermediate, and End), Activities (Task and Sub-Process), and Gateways. During performance (or simulation) of the
+ * process, a Token will leave the source Flow Object, traverse down the Sequence Flow, and enter the target Flow
+ * Object.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SequenceFlow extends ConnectingObject
+{
+ /**
+ * The ConditionType
+ */
+ public enum ConditionType
+ {
+ None, Expression, Default
+ }
+
+ /**
+ * By default, the ConditionType of a Sequence Flow is None. This means that there is no evaluation at runtime to
+ * determine whether or not the Sequence Flow will be used. Once a Token is ready to traverse the Sequence Flow (i.e.,
+ * the Source is an activity that has completed), then the Token will do so. The normal, uncontrolled use of Sequence
+ * Flow, in a sequence of activities, will have a None ConditionType. A None ConditionType MUST NOT be used if the
+ * Source of the Sequence Flow is an Exclusive Data-Based or Inclusive Gateway. The ConditionType attribute MAY be set
+ * to Expression if the Source of the Sequence Flow is a Task, a Sub-Process, or a Gateway of type Exclusive-Data-
+ * Based or Inclusive. If the ConditionType attribute is set to Expression, then a condition marker SHALL be added to
+ * the line if the Sequence Flow is outgoing from an activity. However, a condition indicator MUST NOT be added to the
+ * line if the Sequence Flow is outgoing from a Gateway. An Expression ConditionType MUST NOT be used if the Source of
+ * the Sequence Flow is an Event-Based Exclusive Gateway, a Complex Gateway, a Parallel Gateway, a Start Event, or an
+ * Intermediate Event. In addition, an Expression ConditionType MUST NOT be used if the Sequence Flow is associated
+ * with the Default Gate of a Gateway. The ConditionType attribute MAY be set to Default only if the Source of the
+ * Sequence Flow is an activity or an Exclusive Data-Based Gateway.
+ */
+ ConditionType getConditionType();
+
+ /**
+ * If the ConditionType attribute is set to Expression, then the ConditionExpression attribute MUST be defined as a
+ * valid expression. The expression will be evaluated at runtime. If the result of the evaluation is TRUE, then a
+ * Token will be generated and will traverse the Sequence--Subject to any constraints imposed by a Source that is a
+ * Gateway.
+ */
+ Expression getConditionExpression();
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+// $Id$
+
+/**
+ * A Signal thrown by the ProcessEngine
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public final class Signal implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Defines the types of supported Signals
+ */
+ public enum SignalType
+ {
+ SYSTEM_START_EVENT_ENTER, SYSTEM_START_EVENT_EXIT, SYSTEM_START_TRIGGER,
+ SYSTEM_EVENT_ENTER, SYSTEM_EVENT_EXIT, SYSTEM_EVENT_TRIGGER,
+ SYSTEM_END_EVENT_ENTER, SYSTEM_END_EVENT_EXIT, SYSTEM_END_TRIGGER,
+ SYSTEM_GATEWAY_ENTER, SYSTEM_GATEWAY_EXIT,
+ SYSTEM_PROCESS_ENTER, SYSTEM_PROCESS_EXIT,
+ SYSTEM_TASK_ENTER, SYSTEM_TASK_EXIT, SYSTEM_TASK_TRIGGER,
+ USER_SIGNAL
+ }
+
+ private SignalType type;
+ private String message;
+ private ObjectName fromRef;
+
+ /**
+ * Create the signal for a given source and type
+ */
+ public Signal(ObjectName fromRef, SignalType type)
+ {
+ this.fromRef = fromRef;
+ this.type = type;
+ if (fromRef == null)
+ throw new IllegalArgumentException("Signal fromRef cannot be null");
+ if (type == null)
+ throw new IllegalArgumentException("SignalType cannot be null");
+ }
+
+ /**
+ * Create the signal for a given source, type and message
+ */
+ public Signal(ObjectName fromRef, SignalType type, String message)
+ {
+ this(fromRef, type);
+ this.message = message;
+ }
+
+ public ObjectName getFromRef()
+ {
+ return fromRef;
+ }
+
+ public SignalType getSignalType()
+ {
+ return type;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ StringBuilder string = new StringBuilder(type + "[" + fromRef);
+ if (message != null)
+ {
+ string.append(":" + message);
+ }
+ string.append("]");
+ return string.toString();
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * A Start Event indicates where a particular Process will start. <p/> In terms of Sequence Flow, the Start Event starts
+ * the Flow of the Process, and thus, will not have any incoming Sequence Flow. A Start Event can have a Trigger that
+ * indicates how the Process starts: Message, Timer, Rule, Link, or Multiple.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface StartEvent extends Event
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.model;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface StructuralProcess extends Process
+{
+ /**
+ * Get the list of flow objects
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of flow objects of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a flow object by name.
+ * @return null if not found
+ */
+ Node getNode(String name);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Task is an Atomic Activity that is included within a Process.
+ *
+ * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
+ * perform the Task when it is executed.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Task extends Node
+{
+ /**
+ * The TaskType
+ */
+ public enum TaskType
+ {
+ Service, Receive, Send, User, Script, Manual, Reference, None
+ }
+
+ /**
+ * TaskType is an attribute that has a default of None, but MAY be set to Send,
+ * Receive, User, Script, Manual, Reference, or Service. The TaskType will be
+ * impacted by the Message Flow to and/or from the Task, if Message Flow are
+ * used. A TaskType of Receive MUST NOT have an outgoing Message Flow. A
+ * TaskType of Send MUST NOT have an incoming Message Flow. A TaskType of
+ * Script or Manual MUST NOT have an incoming or an outgoing Message Flow.
+ * The TaskType list MAY be extended to include new types.
+ */
+ TaskType getTaskType();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,142 @@
+/*
+ * 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.api.runtime;
+
+// $Id$
+
+import java.util.Collection;
+
+/**
+ * An interface for general Attachments
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Attachments
+{
+ /** Get attachment keys */
+ Collection<Key> getAttachmentKeys();
+
+ /** Add arbitrary attachment */
+ <T> T addAttachment(Class<T> clazz, Object value);
+
+ /** Add arbitrary attachment with name */
+ <T> T addAttachment(Class<T> clazz, String name, Object value);
+
+ /** Add arbitrary attachment with name */
+ Object addAttachment(String name, Object value);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz, String name);
+
+ /** Get an arbitrary attachment */
+ Object getAttachment(String name);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz, String name);
+
+ /** Remove arbitrary attachments */
+ Object removeAttachment(String name);
+
+ /**
+ * A key for attachements
+ */
+ public static class Key
+ {
+ private Class<?> clazz;
+ private String name;
+
+ /**
+ * Construct the key with optional class and name
+ */
+ public Key(Class<?> clazz, String name)
+ {
+ this.clazz = clazz;
+ this.name = name;
+ }
+
+ /**
+ * Get the class part for this key
+ *
+ * @return maybe null
+ */
+ public Class<?> getClassPart()
+ {
+ return clazz;
+ }
+
+ /**
+ * Get the name part for this key
+ *
+ * @return maybe null
+ */
+ public String getNamePart()
+ {
+ return name;
+ }
+
+ /**
+ * Two keys are equal if their {@link #toString()} is equal
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Key))
+ return false;
+ if (obj == this)
+ return true;
+ return obj.toString().equals(toString());
+ }
+
+ /**
+ * Two keys have the same hashCode if their {@link #toString()} is equal
+ */
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ /**
+ * Returns the String repesentation of this Key. <p/>
+ * <pre>
+ * "[" + clazz + "," + name + "]"
+ * </pre>
+ */
+ public String toString()
+ {
+ StringBuilder str = new StringBuilder("[");
+ if (clazz != null)
+ str.append(clazz.getName());
+ if (clazz != null && name != null)
+ str.append(",");
+ if (name != null)
+ str.append(name);
+ str.append("]");
+ return str.toString();
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.runtime;
+
+// $Id$
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Basic attachments.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicAttachments implements Attachments
+{
+ private Map<Key, Object> attachments = new HashMap<Key, Object>();
+
+ /** Construct the execution context with no attachments */
+ public BasicAttachments()
+ {
+
+ }
+
+ /** Construct the execution context with given attachments */
+ public BasicAttachments(Attachments att)
+ {
+ if (att != null)
+ {
+ for (Key key : att.getAttachmentKeys())
+ {
+ Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
+ this.attachments.put(key, value);
+ }
+ }
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ return attachments.keySet();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return (T)attachments.get(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.get(new Key(clazz, name));
+ }
+
+ public Object getAttachment(String name)
+ {
+ return attachments.get(new Key(null, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, null), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, String name, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, name), obj);
+ }
+
+ public Object addAttachment(String name, Object obj)
+ {
+ return attachments.put(new Key(null, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return (T)attachments.remove(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.remove(new Key(clazz, name));
+ }
+
+ public Object removeAttachment(String name)
+ {
+ return attachments.remove(new Key(null, name));
+ }
+
+ public String toString()
+ {
+ return attachments.toString();
+ }
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+//$Id$
+
+/**
+ * A basic ExecutionContext.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 15-Aug-2008
+ */
+public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
+{
+ public BasicExecutionContext()
+ {
+ }
+
+ public BasicExecutionContext(Attachments att)
+ {
+ super(att);
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.runtime;
+
+// $Id$
+
+
+/**
+ * An execution context that can take attachments.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface ExecutionContext extends Attachments
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.runtime;
+
+//$Id$
+
+
+/**
+ * The ProcessEngine invokes the ExecutionHandler on a
+ * Node to execute user provided business logic.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler extends Handler
+{
+ /**
+ * Execute the associated business logic.
+ */
+ void execute(Token token);
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on an {@link HandlerSupport}
+ * {@link Node} to move the {@link Token} to the next {@link Node}.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler extends Handler
+{
+ /**
+ * Execute the FlowHandler.
+ * <p/>
+ * The FlowHandler typically invoves one of the {@link TokenExecutor}
+ * methods to move the {@link Token} to the next {@link Node}.
+ */
+ void execute(TokenExecutor tokenExecutor, Token token);
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+import java.io.Serializable;
+
+//$Id$
+
+/**
+ * The generic base for handlers that can be associated with a Node.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Handler extends Serializable
+{
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Signal;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on an {@link HandlerSupport}
+ * {@link Node} to send {@link Signal}s.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler extends Handler
+{
+ /**
+ * Get signal for enter
+ */
+ void throwEnterSignal(Token token);
+
+ /**
+ * Get signal for exit
+ */
+ void throwExitSignal(Token token);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ *
+ * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into parallel paths, the normal Sequence Flow should be
+ * completely definable.
+ *
+ * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent process instances or the splitting of the Token
+ * for parallel processing within a single process instance.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Token
+{
+ public enum TokenStatus
+ {
+ Created, Started, Stoped, Destroyed, Suspended
+ }
+
+ /**
+ * Get the token status
+ */
+ TokenStatus getTokenStatus();
+
+ /**
+ * Get the unique token identity
+ */
+ String getTokenID();
+
+ /**
+ * Get the associated {@link ExecutionContext}
+ */
+ ExecutionContext getExecutionContext();
+
+ /**
+ * Get the current {@link SequenceFlow}
+ */
+ SequenceFlow getFlow();
+
+ /**
+ * Create a schallow copy of this Token.
+ * <p/>
+ * The content in the ExecutionContext will be copied by reference.
+ */
+ Token copyToken();
+
+ /**
+ * Merge this Token with another token.
+ */
+ void mergeToken(Token token);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,83 @@
+/*
+ * 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.api.runtime;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s
+ * along the {@link SequenceFlow}s in the {@link Process}.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TokenExecutor
+{
+ /**
+ * Get the set of active tokens
+ */
+ Set<Token> getRunnableTokens();
+
+ /**
+ * True if there are active tokens
+ */
+ boolean hasRunnableTokens();
+
+ /**
+ * Create a {@link Token} with an initial flow
+ */
+ void create(Token token, SequenceFlow flow);
+
+ /**
+ * Start a {@link Token}
+ */
+ void start(Token token);
+
+ /**
+ * Stop a {@link Token}
+ */
+ void stop(Token token);
+
+ /**
+ * Destroy a {@link Token}
+ */
+ void destroy(Token token);
+
+ /**
+ * Suspend a {@link Token}
+ */
+ String suspend(Token token);
+
+ /**
+ * Activate a {@link Token}
+ */
+ Token activate(String tokenID);
+
+ /**
+ * Move a given {@link Token} along a given flow.
+ */
+ void move(Token token, SequenceFlow flow);
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,102 @@
+/*
+ * 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.api.service;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
+ *
+ * @author Tom Baeyens
+ * @author thomas.diesler at jboss.com
+ * @since 25-Sep-2008
+ */
+public class Deployment implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private String procXML;
+
+ public Deployment(String procXML)
+ {
+ if (procXML == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ this.procXML = procXML;
+ }
+
+ public Deployment(URL procURL) throws IOException
+ {
+ if (procURL == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ StringBuilder strBuilder = new StringBuilder();
+ BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
+ String line = br.readLine();
+ while (line != null)
+ {
+ strBuilder.append(line);
+ line = br.readLine();
+ }
+ procXML = strBuilder.toString();
+ }
+
+ public String getProcessXML()
+ {
+ return procXML;
+ }
+
+ public URI getNamespaceURI()
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,49 @@
+/*
+ * 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.api.service;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The marker interface for all Services
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class DeploymentService implements Service
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
+
+ /**
+ * Deploy a new process to the process service.
+ */
+ ObjectName deploy(Deployment deployment)
+ {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -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.api.service;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URL;
+
+/**
+ * The DialectHandler converts a supported dialect to the Process model.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public interface DialectHandler
+{
+ URI DEFAULT_NAMESPACE_URI = URI.create("urn:bpm.jboss:pdl-0.1");
+
+ /**
+ * Get the the supported namespace from this dialect.
+ */
+ URI getNamespaceURI();
+
+ /**
+ * Create a {@link Process} from a descriptor.
+ * @param isInclude TODO
+ */
+ Process createProcess(String pXML);
+
+ /**
+ * Create a {@link Process} from a descriptor URL.
+ * @param isInclude TODO
+ */
+ Process createProcess(URL pURL) throws IOException;
+
+ /**
+ * Marshall the process to the given writer
+ */
+ void marshallProcess(Process proc, Writer out) throws IOException;
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,53 @@
+/*
+ * 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.api.service;
+
+//$Id$
+
+import java.net.URI;
+import java.util.Map;
+
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jul-2008
+ */
+public abstract class DialectRegistry
+{
+ // Maps namespaceURI to a DialectHandler
+ protected Map<URI, DialectHandler> dialectHandlers;
+
+ /**
+ * Get the handler for the dialect with the given namespace URI
+ */
+ public DialectHandler getDialectHandler(URI nsURI)
+ {
+ DialectHandler dialectHandler = dialectHandlers.get(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("No dialect handler registered for: " + nsURI);
+
+ return dialectHandler;
+ }
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,94 @@
+/*
+ * 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.api.service;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A registry of ProcessEngine instances per VM
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Sep-2008
+ */
+public final class ProcessEngineRegistry
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
+
+ // The process engine registry
+ static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
+
+ // Hide constructor
+ private ProcessEngineRegistry()
+ {
+ }
+
+ /**
+ * Get the set of registered engine names
+ */
+ public static Set<String> getEngineNames()
+ {
+ return engineRegistry.keySet();
+ }
+
+ /**
+ * Get a process engine by name
+ * @return null, if there is no engine registered under the given name
+ */
+ public static ProcessEngine getEngine(String engineName)
+ {
+ return engineRegistry.get(engineName);
+ }
+
+ /**
+ * Register a ProcessEngine
+ * @throws IllegalStateException If a ProcessEngine with that name is already registered
+ */
+ public static void registerEngine(ProcessEngine engine)
+ {
+ if (engineRegistry.get(engine.getName()) != null)
+ throw new IllegalStateException("Process engine already registered: " + engine.getName());
+
+ log.debug("Register: " + engine);
+ engineRegistry.put(engine.getName(), engine);
+ }
+
+ /**
+ * Unregister a ProcessEngine for a given name
+ */
+ public static ProcessEngine unregisterEngine(String name)
+ {
+ ProcessEngine pe = engineRegistry.remove(name);
+ log.debug("Unregister: " + name + "=" + pe);
+ return pe;
+ }
+
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The marker interface for all Services
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class ProcessService implements Service
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessService.class);
+
+ // The set of registered processes
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+
+ // Hide public constructor
+ protected ProcessService()
+ {
+ }
+
+ /**
+ * Deploy a new process to the process service.
+ */
+ ObjectName deploy(Deployment deployment)
+ {
+
+ return null;
+ }
+
+ /**
+ * Get the set of registered Processes
+ */
+ public Set<Process> getProcesses()
+ {
+ Set<Process> procSet = new HashSet<Process>(procs.values());
+ return Collections.unmodifiableSet(procSet);
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+import org.jbpm.api.client.ProcessEngine;
+
+//$Id$
+
+/**
+ * The base interface for all Services
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 25-Sep-2008
+ */
+public interface Service
+{
+ /**
+ * Get the associated ProcessEngine
+ */
+ ProcessEngine getProcessEngine();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -23,9 +23,9 @@
import java.net.URL;
-import org.jbpm.api.client.MicrocontainerConfiguration;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.ProcessEngineRegistry;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,14 +62,14 @@
MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
configuration.deployBeansConfig(cfgURL);
ProcessEngine engine = configuration.getProcessEngine(CTS_TEST_ENGINE);
- ProcessEngineRegistry.registerProcessEngine(engine);
+ ProcessEngineRegistry.registerEngine(engine);
}
@Override
protected void tearDown() throws Exception
{
URL cfgURL = helper.getResourceURL(beansConfig);
- ProcessEngineRegistry.unregisterProcessEngine(CTS_TEST_ENGINE);
+ ProcessEngineRegistry.unregisterEngine(CTS_TEST_ENGINE);
new MicrocontainerConfiguration().undeployBeansConfig(cfgURL);
super.tearDown();
}
Modified: jbpm4/branches/tdiesler/modules/cts/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 17:41:47 UTC (rev 2403)
@@ -75,27 +75,6 @@
</dependencies>
</profile>
- <!--
- Name: impl-ri
- Descr: The RI implementation profile
- -->
- <profile>
- <id>impl-ri</id>
- <activation>
- <property>
- <name>impl</name>
- <value>pvm</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-pvm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </profile>
-
</profiles>
</project>
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -25,9 +25,9 @@
import java.net.URL;
-import org.jbpm.api.client.MicrocontainerConfiguration;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.ProcessEngineRegistry;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -56,12 +56,12 @@
URL cfgURL = getResourceURL("cts/processengine/test-cfg-beans.xml");
String engineName = "CTSTestEngine";
- MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
- configuration.deployBeansConfig(cfgURL);
+ MicrocontainerConfiguration config = new MicrocontainerConfiguration();
try
{
- ProcessEngine engineOne = configuration.getProcessEngine(engineName);
+ // test that we can get the engine from the configuration
+ ProcessEngine engineOne = config.deployBeansConfig(cfgURL).getProcessEngine(engineName);
assertNotNull("ProcessEngine not null", engineOne);
assertEquals("ProcessEngine name", engineName, engineOne.getName());
@@ -70,7 +70,7 @@
assertNull("ProcessEngine null", engineTwo);
// register the engine and do the lockup again
- ProcessEngineRegistry.registerProcessEngine(engineOne);
+ ProcessEngineRegistry.registerEngine(engineOne);
engineTwo = ProcessEngine.getProcessEngine(engineName);
assertNotNull("ProcessEngine not null", engineTwo);
assertSame("ProcessEngine same", engineOne, engineTwo);
@@ -78,7 +78,7 @@
// Try to register the engine twice
try
{
- ProcessEngineRegistry.registerProcessEngine(engineTwo);
+ ProcessEngineRegistry.registerEngine(engineTwo);
fail("Expceted IllegalStateException");
}
catch (IllegalStateException e)
@@ -88,7 +88,8 @@
}
finally
{
- configuration.undeployBeansConfig(cfgURL);
+ ProcessEngineRegistry.unregisterEngine(engineName);
+ config.undeployBeansConfig(cfgURL);
}
}
}
Deleted: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1 +0,0 @@
-org.jbpm.api.client.MicrocontainerConfiguration
\ No newline at end of file
Added: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration (rev 0)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1 @@
+org.jbpm.api.config.MicrocontainerConfiguration
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/pom.xml 2008-09-26 17:41:47 UTC (rev 2403)
@@ -170,9 +170,20 @@
<!-- DistributionManagement -->
<distributionManagement>
+ <!--
+ Add this to your ~/.m2/settings.xml
+ <servers>
+ <server>
+ <id>jbpm.dyndns.org</id>
+ <username>yourname</username>
+ <privateKey>/home/yourname/.ssh/id_rsa</privateKey>
+ <passphrase>yourpass</passphrase>
+ </server>
+ </servers>
+ -->
<site>
- <id>local.site</id>
- <url>file:///${publications}/pvm/site</url>
+ <id>jbpm.dyndns.org</id>
+ <url>scp://jbpm.dyndns.org/var/www/html/jbpm-site</url>
</site>
</distributionManagement>
More information about the jbpm-commits
mailing list