[jbpm-commits] JBoss JBPM SVN: r1611 - in api/branches/tdiesler: modules/api/src/main/java/org/jboss/bpm/model and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jul 14 01:02:28 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-07-14 01:02:27 -0400 (Mon, 14 Jul 2008)
New Revision: 1611

Added:
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ActivityImpl.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObjectImpl.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/GatewayImpl.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBActivity.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBFlowObject.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/internal/
Removed:
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
Modified:
   api/branches/tdiesler/.classpath
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Flow.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java
   api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
Log:
wip

Modified: api/branches/tdiesler/.classpath
===================================================================
--- api/branches/tdiesler/.classpath	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/.classpath	2008-07-14 05:02:27 UTC (rev 1611)
@@ -2,6 +2,7 @@
 <classpath>
 	<classpathentry kind="src" output="modules/api/target/classes" path="modules/api/src/main/java"/>
 	<classpathentry kind="src" output="modules/api/target/test-classes" path="modules/api/src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="modules/api/target/classes" path="modules/api/src/main/resources"/>
 	<classpathentry excluding="**" kind="src" output="modules/api/target/test-classes" path="modules/api/src/test/resources"/>
 	<classpathentry kind="src" output="modules/testsuite/target/test-classes" path="modules/testsuite/src/test/java"/>
 	<classpathentry excluding="**" kind="src" output="modules/testsuite/target/test-classes" path="modules/testsuite/src/test/resources"/>

Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,77 +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.jboss.bpm.model;
-
-//$Id$
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * An activity is a generic term for work that a company or organization performs via business processes. 
- * An activity can be atomic or non-atomic (compound). 
- * The types of activities that are a part of a Process Model are: Process, Sub-Process, and Task. 
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name="AbstractActivity")
-abstract class AbstractActivity extends FlowObject implements NamedFlowObject
-{
-  protected String name;
-  
-  /**
-   * Construct an anonymous Activity
-   */
-  public AbstractActivity()
-  {
-  }
-
-  /**
-   * Construct a Activity with a given name
-   */
-  public AbstractActivity(String name)
-  {
-    this.name = name;
-  }
-  
-  /**
-   * Get the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Set the name. 
-   * Note, this MUST NOT leak into the public API.
-   */
-  @XmlAttribute(required = true)
-  public void setName(String name)
-  {
-    if (this.name != null)
-      throw new IllegalStateException("Cannot rename: " + name);
-
-    this.name = name;
-  }
-}
\ No newline at end of file

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -26,6 +26,7 @@
 
 
 
+
 // $Id$
 
 /**
@@ -36,7 +37,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name="AbstractEvent")
-abstract class AbstractEvent extends FlowObject
+abstract class AbstractEvent extends FlowObjectImpl
 {
   protected ExecutionHandler executionHandler;
   protected FlowHandler flowHandler;

Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlowObject.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name = "AbstractFlowObject")
-abstract class AbstractFlowObject
-{
-  private Process process;
-
-  public Process getProcess()
-  {
-    return process;
-  }
-
-  @XmlTransient
-  public void setProcess(Process process)
-  {
-    this.process = process;
-  }
-}
\ No newline at end of file

Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,151 +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.jboss.bpm.model;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Gateways are modelling 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.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name = "AbstractGateway")
-abstract class AbstractGateway extends FlowObject implements NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
-{
-  private String name;
-  protected ExecutionHandler executionHandler;
-  protected FlowHandler flowHandler;
-  protected SignalHandler signalHandler;
-  
-  @XmlElements( { 
-    @XmlElement(name = "sequence", type = SequenceFlow.class), 
-    @XmlElement(name = "message", type = MessageFlow.class) 
-    })
-  protected List<Flow> outFlows = new ArrayList<Flow>();
-  
-  /**
-   * Construct an anonymous Gateway
-   */
-  public AbstractGateway()
-  {
-  }
-
-  /**
-   * Construct a Activity with a given name
-   */
-  public AbstractGateway(String name)
-  {
-    this.name = name;
-  }
-  
-  /**
-   * Get the name
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-  /**
-   * Set the name. 
-   * Note, this MUST NOT leak into the public API.
-   */
-  @XmlAttribute(required = true)
-  protected void setName(String name)
-  {
-    if (this.name != null)
-      throw new IllegalStateException("Cannot rename: " + name);
-
-    this.name = name;
-  }
-  
-  public List<Flow> getOutFlows()
-  {
-    return outFlows;
-  }
-
-  protected void setOutFlow(List<Flow> outFlow)
-  {
-    this.outFlows = outFlow;
-  }
-
-  /**
-   * Get the ExecutionHandler for this Event
-   */
-  public ExecutionHandler getExecutionHandler()
-  {
-    return executionHandler;
-  }
-  
-  /**
-   * Set the ExecutionHandler for this Event
-   */
-  @XmlElement(name = "execution-handler")
-  protected void setExecutionHandler(ExecutionHandler executionHandler)
-  {
-    this.executionHandler = executionHandler;
-  }
-  
-  /**
-   * Get the FlowHandler for this Event
-   */
-  public FlowHandler getFlowHandler()
-  {
-    return flowHandler;
-  }
-  
-  /**
-   * Set the FlowHandler for this Event
-   */
-  @XmlElement(name = "flow-handler")
-  protected void setFlowHandler(FlowHandler flowHandler)
-  {
-    this.flowHandler = flowHandler;
-  }
-  
-  /**
-   * Get the SignalHandler for this Event
-   */
-  public SignalHandler getSignalHandler()
-  {
-    return signalHandler;
-  }
-  
-  /**
-   * Set the SignalHandler for this Event
-   */
-  @XmlElement(name = "signal-handler")
-  protected void setSignalHandler(SignalHandler signalHandler)
-  {
-    this.signalHandler = signalHandler;
-  }
-}
\ No newline at end of file

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractProcess.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -31,6 +31,7 @@
 import javax.xml.bind.annotation.XmlType;
 
 
+
 /**
  * A Process is any Activity performed within a company or organization.
  * 
@@ -38,7 +39,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name = "AbstractProcess")
-abstract class AbstractProcess extends Activity
+abstract class AbstractProcess extends ActivityImpl
 {
   @XmlElements( { 
     @XmlElement(name = "start", type = StartEvent.class), 
@@ -51,7 +52,7 @@
     @XmlElement(name = "sub-process", type = SubProcess.class), 
     @XmlElement(name = "end", type = EndEvent.class) 
     })
-  protected List<FlowObject> flowObjects = new ArrayList<FlowObject>();
+  protected List<FlowObjectImpl> flowObjects = new ArrayList<FlowObjectImpl>();
 
   /**
    * Construct an anonymous process
@@ -71,7 +72,7 @@
   /**
    * Get the list of flow objects
    */
-  public List<FlowObject> getFlowObjects()
+  public List<FlowObjectImpl> getFlowObjects()
   {
     return flowObjects;
   }

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -38,7 +38,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name = "AbstractTask")
-abstract class AbstractTask extends Activity implements SingleOutFlowSupport
+abstract class AbstractTask extends ActivityImpl implements SingleOutFlowSupport
 {
   protected ExecutionHandler executionHandler;
   protected FlowHandler flowHandler;

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Activity.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Activity.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,55 +1,6 @@
-/*
- * 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.jboss.bpm.model;
 
-import javax.xml.bind.annotation.XmlType;
-
-// $Id$
-
-/**
- * An activity is a generic term for work that a company or organization performs via business processes. 
- * An activity can be atomic or non-atomic (compound). 
- * The types of activities that are a part of a Process Model are: Process, Sub-Process, and Task. 
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name="Activity")
-public abstract class Activity extends AbstractActivity implements NamedFlowObject
+public interface Activity extends NamedFlowObject
 {
-  /**
-   * Construct an anonymous Activity
-   * Note, this MUST NOT leak into the public API.
-   */
-  protected Activity()
-  {
-  }
 
-  /**
-   * Construct a Activity with a given name
-   * Note, this MUST NOT leak into the public API.
-   */
-  public Activity(String name)
-  {
-    super(name);
-  }
 }
\ No newline at end of file

Copied: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ActivityImpl.java (from rev 1610, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Activity.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ActivityImpl.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ActivityImpl.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -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.jboss.bpm.model;
+
+
+// $Id$
+
+/**
+ * An activity is a generic term for work that a company or organization performs via business processes. 
+ * An activity can be atomic or non-atomic (compound). 
+ * The types of activities that are a part of a Process Model are: Process, Sub-Process, and Task. 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class ActivityImpl extends FlowObjectImpl implements Activity
+{
+  private JAXBActivity delegate;
+  
+  /**
+   * Construct an anonymous Activity
+   * Note, this MUST NOT leak into the public API.
+   */
+  protected ActivityImpl()
+  {
+  }
+
+  /**
+   * Construct a Activity with a given name
+   * Note, this MUST NOT leak into the public API.
+   */
+  public ActivityImpl(String name)
+  {
+    delegate.setName(name);
+  }
+  
+  /**
+   * Get the name
+   */
+  public String getName()
+  {
+    return delegate.getName();
+  }
+  
+  public void setName(String name)
+  {
+    if (delegate.getName() != null)
+      throw new IllegalStateException("Cannot rename: " + name);
+
+    delegate.setName(name);
+  }
+}
\ No newline at end of file

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -37,7 +37,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name="ComplexGateway")
-public class ComplexGateway extends Gateway
+public class ComplexGateway extends GatewayImpl
 {
   /**
    * Construct an anonymous Task

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -33,7 +33,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name="ExclusiveGateway")
-public class ExclusiveGateway extends Gateway
+public class ExclusiveGateway extends GatewayImpl
 {
   /**
    * Construct an anonymous Task

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Flow.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Flow.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Flow.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -74,7 +74,7 @@
    * Note, this MUST NOT leak into the public API.
    */
   @XmlTransient
-  protected void setSource(FlowObject source)
+  public void setSource(FlowObject source)
   {
     this.source = source;
   }

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,147 +1,10 @@
-/*
- * 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.jboss.bpm.model;
 
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.NameNotUniqueException;
-
-//$Id$
-
-/**
- * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name="FlowObject")
-public abstract class FlowObject extends AbstractFlowObject
+public interface FlowObject
 {
-  /**
-   * Construct an anonymous StartEvent. 
-   * Note, this MUST NOT leak into the public API.
-   */
-  protected FlowObject()
-  {
-  }
-  
-  /**
-   * Initialize the flow object
-   */
-  protected void initialize(Process proc)
-  {
-    setProcess(proc);
-
-    if (this instanceof NamedFlowObject)
-    {
-      // Check required name 
-      String name = ((NamedFlowObject)this).getName();
-      if (name == null)
-        throw new InvalidProcessException("Name is required for: " + this);
-      
-      // Check name uniqueness 
-      for (FlowObject aux : proc.getFlowObjects())
-      {
-        if (aux != this && aux instanceof NamedFlowObject)
-        {
-          String auxName = ((NamedFlowObject)aux).getName(); 
-          if (name.equals(auxName))
-            throw new NameNotUniqueException("NamedFlowObject: " + this);
-        }
-      }
-    }
-      
-    // Initialize in/out flows
-    Flow outFlow = null;
-    if (this instanceof SingleOutFlowSupport)
-    {
-      SingleOutFlowSupport sof = (SingleOutFlowSupport)this;
-      outFlow = sof.getOutFlow();
-      initFlow(proc, outFlow);
-    }
-    else if (this instanceof MultipleOutFlowSupport)
-    {
-      MultipleOutFlowSupport mof = (MultipleOutFlowSupport)this;
-      for (Flow flow : mof.getOutFlows())
-      {
-        outFlow = flow;
-        initFlow(proc, flow);
-      }
-    }
-    
-    Flow inFlow = null;
-    if (this instanceof SingleInFlowSupport)
-    {
-      SingleInFlowSupport sif = (SingleInFlowSupport)this;
-      inFlow = sif.getInFlow();
-    }
-    else if (this instanceof MultipleInFlowSupport)
-    {
-      MultipleInFlowSupport mif = (MultipleInFlowSupport)this;
-      for (Flow flow : mif.getInFlows())
-      {
-        inFlow = flow;
-      }
-    }
-    
-    if (inFlow == null && outFlow == null)
-      throw new InvalidProcessException("Unconnected flow object: " + this);
-  }
-
-  private void initFlow(Process proc, Flow flow)
-  {
-    if (flow != null)
-    {
-      String name = flow.getTargetName();
-      FlowObject target = proc.findFlowObject(name);
-      if (target == null)
-        throw new InvalidProcessException("Cannot find target for out flow: " + name);
-      
-      if (target instanceof SingleInFlowSupport)
-      {
-        SingleInFlowSupport sif = (SingleInFlowSupport)target;
-        sif.setInFlow(flow);
-      }
-      else if (target instanceof MultipleInFlowSupport)
-      {
-        MultipleInFlowSupport mif = (MultipleInFlowSupport)target;
-        mif.addInFlow(flow);
-      }
-      else
-      {
-        throw new InvalidProcessException("Target does not support in flow: " + target);
-      }
-      
-      flow.setSource(this);
-      flow.setTarget(target);
-    }
-  }
-  
   /** 
    * Get the associated Process 
    */
-  public Process getProcess()
-  {
-    return super.getProcess();
-  }
+  Process getProcess();
+
 }
\ No newline at end of file

Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObjectImpl.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObjectImpl.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowObjectImpl.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -0,0 +1,148 @@
+/*
+ * 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.jboss.bpm.model;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NameNotUniqueException;
+
+//$Id$
+
+/**
+ * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class FlowObjectImpl implements FlowObject
+{
+  private JAXBFlowObject delegate;
+  
+  /**
+   * Construct an anonymous StartEvent. 
+   * Note, this MUST NOT leak into the public API.
+   */
+  protected FlowObjectImpl()
+  {
+  }
+  
+  public Process getProcess()
+  {
+    return delegate.getProcess();
+  }
+  
+  protected void setProcess(Process process)
+  {
+    delegate.setProcess(process);
+  }
+  
+  /**
+   * Initialize the flow object
+   */
+  protected void initialize(Process proc)
+  {
+    delegate.setProcess(proc);
+
+    if (this instanceof NamedFlowObject)
+    {
+      // Check required name 
+      String name = ((NamedFlowObject)this).getName();
+      if (name == null)
+        throw new InvalidProcessException("Name is required for: " + this);
+      
+      // Check name uniqueness 
+      for (FlowObject aux : proc.getFlowObjects())
+      {
+        if (aux != this && aux instanceof NamedFlowObject)
+        {
+          String auxName = ((NamedFlowObject)aux).getName(); 
+          if (name.equals(auxName))
+            throw new NameNotUniqueException("NamedFlowObject: " + this);
+        }
+      }
+    }
+      
+    // Initialize in/out flows
+    Flow outFlow = null;
+    if (this instanceof SingleOutFlowSupport)
+    {
+      SingleOutFlowSupport sof = (SingleOutFlowSupport)this;
+      outFlow = sof.getOutFlow();
+      initFlow(proc, outFlow);
+    }
+    else if (this instanceof MultipleOutFlowSupport)
+    {
+      MultipleOutFlowSupport mof = (MultipleOutFlowSupport)this;
+      for (Flow flow : mof.getOutFlows())
+      {
+        outFlow = flow;
+        initFlow(proc, flow);
+      }
+    }
+    
+    Flow inFlow = null;
+    if (this instanceof SingleInFlowSupport)
+    {
+      SingleInFlowSupport sif = (SingleInFlowSupport)this;
+      inFlow = sif.getInFlow();
+    }
+    else if (this instanceof MultipleInFlowSupport)
+    {
+      MultipleInFlowSupport mif = (MultipleInFlowSupport)this;
+      for (Flow flow : mif.getInFlows())
+      {
+        inFlow = flow;
+      }
+    }
+    
+    if (inFlow == null && outFlow == null)
+      throw new InvalidProcessException("Unconnected flow object: " + this);
+  }
+
+  private void initFlow(Process proc, Flow flow)
+  {
+    if (flow != null)
+    {
+      String name = flow.getTargetName();
+      FlowObject target = proc.findFlowObject(name);
+      if (target == null)
+        throw new InvalidProcessException("Cannot find target for out flow: " + name);
+      
+      if (target instanceof SingleInFlowSupport)
+      {
+        SingleInFlowSupport sif = (SingleInFlowSupport)target;
+        sif.setInFlow(flow);
+      }
+      else if (target instanceof MultipleInFlowSupport)
+      {
+        MultipleInFlowSupport mif = (MultipleInFlowSupport)target;
+        mif.addInFlow(flow);
+      }
+      else
+      {
+        throw new InvalidProcessException("Target does not support in flow: " + target);
+      }
+      
+      flow.setSource(this);
+      flow.setTarget(target);
+    }
+  }
+  }
\ No newline at end of file

Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -1,127 +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.jboss.bpm.model;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.runtime.Token;
-
-/**
- * Gateways are modelling 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.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
- at XmlType(name = "Gateway")
-public abstract class Gateway extends AbstractGateway implements NamedFlowObject, Executable
-{
-  // provide logging
-  private static final Log log = LogFactory.getLog(Gateway.class);
-
-  @XmlTransient
-  protected List<Flow> inFlows = new ArrayList<Flow>();
-
-  /**
-   * Construct an anonymous Gateway Note, this MUST NOT leak into the public API.
-   */
-  protected Gateway()
-  {
-  }
-
-  /**
-   * Construct a Gateway with a given name Note, this MUST NOT leak into the public API.
-   */
-  protected Gateway(String name)
-  {
-    super(name);
-  }
-
-  public void addOutFlow(Flow flow)
-  {
-    outFlows.add(flow);
-  }
-
-  public List<Flow> getInFlows()
-  {
-    return Collections.unmodifiableList(inFlows);
-  }
-
-  public void addInFlow(Flow inFlow)
-  {
-    this.inFlows.add(inFlow);
-  }
-
-  @XmlTransient
-  public FlowHandler getDefaultFlowHandler()
-  {
-    return new FlowHandler()
-    {
-      @Override
-      public void transfer(Token token)
-      {
-        List<Flow> outFlows = getOutFlows();
-        if (outFlows.size() == 1)
-          token.addTailFlow(outFlows.get(0));
-      }
-    };
-  }
-
-  public SignalHandler getDefaultSignalHandler()
-  {
-    final FlowObject gateway = this;
-    return new SignalHandler()
-    {
-      public Signal getEnterSignal()
-      {
-        return new Signal(gateway, Signal.Type.ENTER_GATEWAY);
-      }
-
-      public Signal getExitSignal()
-      {
-        return new Signal(gateway, Signal.Type.EXIT_GATEWAY);
-      }
-    };
-  }
-
-  @XmlTransient
-  public ExecutionHandler getDefaultExecutionHandler()
-  {
-    return new ExecutionHandler()
-    {
-      @Override
-      public void execute(Token token)
-      {
-        log.debug("Nothing to do in gateway: " + getName());
-      }
-    };
-  }
-}
\ No newline at end of file

Copied: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/GatewayImpl.java (from rev 1610, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/GatewayImpl.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/GatewayImpl.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -0,0 +1,127 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Gateways are modelling 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.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "Gateway")
+public abstract class GatewayImpl extends JAXBGateway implements NamedFlowObject, Executable
+{
+  // provide logging
+  private static final Log log = LogFactory.getLog(GatewayImpl.class);
+
+  @XmlTransient
+  protected List<Flow> inFlows = new ArrayList<Flow>();
+
+  /**
+   * Construct an anonymous Gateway Note, this MUST NOT leak into the public API.
+   */
+  protected GatewayImpl()
+  {
+  }
+
+  /**
+   * Construct a Gateway with a given name Note, this MUST NOT leak into the public API.
+   */
+  protected GatewayImpl(String name)
+  {
+    super(name);
+  }
+
+  public void addOutFlow(Flow flow)
+  {
+    outFlows.add(flow);
+  }
+
+  public List<Flow> getInFlows()
+  {
+    return Collections.unmodifiableList(inFlows);
+  }
+
+  public void addInFlow(Flow inFlow)
+  {
+    this.inFlows.add(inFlow);
+  }
+
+  @XmlTransient
+  public FlowHandler getDefaultFlowHandler()
+  {
+    return new FlowHandler()
+    {
+      @Override
+      public void transfer(Token token)
+      {
+        List<Flow> outFlows = getOutFlows();
+        if (outFlows.size() == 1)
+          token.addTailFlow(outFlows.get(0));
+      }
+    };
+  }
+
+  public SignalHandler getDefaultSignalHandler()
+  {
+    final FlowObject gateway = this;
+    return new SignalHandler()
+    {
+      public Signal getEnterSignal()
+      {
+        return new Signal(gateway, Signal.Type.ENTER_GATEWAY);
+      }
+
+      public Signal getExitSignal()
+      {
+        return new Signal(gateway, Signal.Type.EXIT_GATEWAY);
+      }
+    };
+  }
+
+  @XmlTransient
+  public ExecutionHandler getDefaultExecutionHandler()
+  {
+    return new ExecutionHandler()
+    {
+      @Override
+      public void execute(Token token)
+      {
+        log.debug("Nothing to do in gateway: " + getName());
+      }
+    };
+  }
+}
\ No newline at end of file

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -35,7 +35,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name="InclusiveGateway")
-public class InclusiveGateway extends Gateway
+public class InclusiveGateway extends GatewayImpl
 {
   /**
    * Construct an anonymous Task

Copied: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBActivity.java (from rev 1610, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractActivity.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBActivity.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBActivity.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -0,0 +1,75 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * An activity is a generic term for work that a company or organization performs via business processes. 
+ * An activity can be atomic or non-atomic (compound). 
+ * The types of activities that are a part of a Process Model are: Process, Sub-Process, and Task. 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name="Activity")
+abstract class JAXBActivity extends FlowObjectImpl implements Activity
+{
+  protected String name;
+  
+  /**
+   * Construct an anonymous Activity
+   */
+  public JAXBActivity()
+  {
+  }
+
+  /**
+   * Construct a Activity with a given name
+   */
+  public JAXBActivity(String name)
+  {
+    this.name = name;
+  }
+  
+  /**
+   * Get the name
+   */
+  public String getName()
+  {
+    return name;
+  }
+
+  /**
+   * Set the name. 
+   * Note, this MUST NOT leak into the public API.
+   */
+  @XmlAttribute(required = true)
+  public void setName(String name)
+  {
+    this.name = name;
+  }
+}
\ No newline at end of file

Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBFlowObject.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBFlowObject.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBFlowObject.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -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.jboss.bpm.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "FlowObject")
+abstract class JAXBFlowObject implements FlowObject
+{
+  private Process process;
+
+  public Process getProcess()
+  {
+    return process;
+  }
+
+  @XmlTransient
+  public void setProcess(Process process)
+  {
+    this.process = process;
+  }
+}
\ No newline at end of file

Copied: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBGateway.java (from rev 1610, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBGateway.java	                        (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/JAXBGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -0,0 +1,152 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Gateways are modelling 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.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "AbstractGateway")
+abstract class JAXBGateway extends FlowObjectImpl implements NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
+{
+  private String name;
+  protected ExecutionHandler executionHandler;
+  protected FlowHandler flowHandler;
+  protected SignalHandler signalHandler;
+  
+  @XmlElements( { 
+    @XmlElement(name = "sequence", type = SequenceFlow.class), 
+    @XmlElement(name = "message", type = MessageFlow.class) 
+    })
+  protected List<Flow> outFlows = new ArrayList<Flow>();
+  
+  /**
+   * Construct an anonymous Gateway
+   */
+  public JAXBGateway()
+  {
+  }
+
+  /**
+   * Construct a Activity with a given name
+   */
+  public JAXBGateway(String name)
+  {
+    this.name = name;
+  }
+  
+  /**
+   * Get the name
+   */
+  public String getName()
+  {
+    return name;
+  }
+
+  /**
+   * Set the name. 
+   * Note, this MUST NOT leak into the public API.
+   */
+  @XmlAttribute(required = true)
+  protected void setName(String name)
+  {
+    if (this.name != null)
+      throw new IllegalStateException("Cannot rename: " + name);
+
+    this.name = name;
+  }
+  
+  public List<Flow> getOutFlows()
+  {
+    return outFlows;
+  }
+
+  protected void setOutFlow(List<Flow> outFlow)
+  {
+    this.outFlows = outFlow;
+  }
+
+  /**
+   * Get the ExecutionHandler for this Event
+   */
+  public ExecutionHandler getExecutionHandler()
+  {
+    return executionHandler;
+  }
+  
+  /**
+   * Set the ExecutionHandler for this Event
+   */
+  @XmlElement(name = "execution-handler")
+  protected void setExecutionHandler(ExecutionHandler executionHandler)
+  {
+    this.executionHandler = executionHandler;
+  }
+  
+  /**
+   * Get the FlowHandler for this Event
+   */
+  public FlowHandler getFlowHandler()
+  {
+    return flowHandler;
+  }
+  
+  /**
+   * Set the FlowHandler for this Event
+   */
+  @XmlElement(name = "flow-handler")
+  protected void setFlowHandler(FlowHandler flowHandler)
+  {
+    this.flowHandler = flowHandler;
+  }
+  
+  /**
+   * Get the SignalHandler for this Event
+   */
+  public SignalHandler getSignalHandler()
+  {
+    return signalHandler;
+  }
+  
+  /**
+   * Set the SignalHandler for this Event
+   */
+  @XmlElement(name = "signal-handler")
+  protected void setSignalHandler(SignalHandler signalHandler)
+  {
+    this.signalHandler = signalHandler;
+  }
+}
\ No newline at end of file

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -35,7 +35,7 @@
  * @since 08-Jul-2008
  */
 @XmlType(name="ParallelGateway")
-public class ParallelGateway extends Gateway
+public class ParallelGateway extends GatewayImpl
 {
   /**
    * Construct an anonymous Task

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -75,7 +75,7 @@
   /**
    * Add a flow object. Note, this MUST NOT leak into the public API.
    */
-  protected void addFlowObject(FlowObject flowObject)
+  protected void addFlowObject(FlowObjectImpl flowObject)
   {
     flowObjects.add(flowObject);
   }
@@ -116,7 +116,7 @@
   /**
    * Get the list of flow objects
    */
-  public List<FlowObject> getFlowObjects()
+  public List<FlowObjectImpl> getFlowObjects()
   {
     if (processState == ProcessState.CREATED)
       return flowObjects;
@@ -197,7 +197,7 @@
       throw new InvalidProcessException("Process does not have end events");
 
     // Set the associated process
-    for (FlowObject aux : flowObjects)
+    for (FlowObjectImpl aux : flowObjects)
       aux.initialize(this);
 
     processState = ProcessState.INITIALIZED;

Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java	2008-07-14 04:30:53 UTC (rev 1610)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java	2008-07-14 05:02:27 UTC (rev 1611)
@@ -22,6 +22,7 @@
 package org.jboss.bpm.model;
 
 
+
 // $Id$
 
 /**
@@ -33,7 +34,7 @@
 public class ProcessBuilder
 {
   private Process proc;
-  private FlowObject flowObject;
+  private FlowObjectImpl flowObject;
   
   public ProcessBuilder (String procName)
   {




More information about the jbpm-commits mailing list