[jbpm-commits] JBoss JBPM SVN: r2419 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/service and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Sep 29 03:22:59 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-09-29 03:22:59 -0400 (Mon, 29 Sep 2008)
New Revision: 2419

Added:
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java
Removed:
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleInFlowSupport.java
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleOutFlowSupport.java
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleInFlowSupport.java
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleOutFlowSupport.java
Modified:
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
   projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
   projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/NodeImpl.java
   projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java
   projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/ProcessImpl.java
   projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlowImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExpressionImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
   projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java
Log:
wip

Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleInFlowSupport.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleInFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import java.util.List;
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * Implementing {@link Node} support multiple incomming {@link SequenceFlow}s.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface MultipleInFlowSupport
-{
-  /**
-   * Gat the incomming SequenceFlows
-   */
-  List<SequenceFlow> getInFlows();
-  
-  /**
-   * Add an incomming SequenceFlow
-   */
-  void addInFlow(SequenceFlow flow);
-
-}

Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleOutFlowSupport.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleOutFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import java.util.List;
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * Implementing {@link Node} support multiple outgoing {@link SequenceFlow}s.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface MultipleOutFlowSupport
-{
-  /**
-   * Gat the outgoing SequenceFlows
-   */
-  List<SequenceFlow> getOutFlows();
-  
-  /**
-   * Add an outgoing SequenceFlow
-   */
-  void addOutFlow(SequenceFlow flow);
-
-}

Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -23,7 +23,6 @@
 
 //$Id$
 
-import org.jbpm.api.model.Node;
 import org.jbpm.api.model.Process;
 import org.jbpm.api.model.Gateway.GatewayType;
 import org.jbpm.api.model.Task.TaskType;
@@ -83,9 +82,4 @@
    * Add a Gateway with a given name
    */
   ProcessBuilder addGateway(String name, GatewayType type);
-  
-  /**
-   * Add a user defined Node
-   */
-  ProcessBuilder addNode(Node node);
 }
\ No newline at end of file

Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleInFlowSupport.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleInFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -1,45 +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.model.builder;
-
-//$Id$
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * Implementing {@link Node}s support a single incomming {@link SequenceFlow}.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface SingleInFlowSupport
-{
-  /**
-   * Get the incomming SequenceFlow
-   */
-  SequenceFlow getInFlow();
-  
-  /**
-   * Set the incomming SequenceFlow
-   */
-  void setInFlow(SequenceFlow flow);
-}

Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleOutFlowSupport.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleOutFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -1,45 +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.model.builder;
-
-//$Id$
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * Implementing {@link Node}s support a single outgoing {@link SequenceFlow}.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface SingleOutFlowSupport
-{
-  /**
-   * Get the outgoing SequenceFlow
-   */
-  SequenceFlow getOutFlow();
-  
-  /**
-   * Set the outgoing SequenceFlow
-   */
-  void setOutFlow(SequenceFlow flow);
-}

Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -37,7 +37,7 @@
 {
   ObjectName saveProcess(Process proc);
 
-  Process loadProcess(ObjectName procID);
+  Process loadProcess(ObjectName key);
 
   void deleteProcess(Process proc);
 

Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/NodeImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/NodeImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -17,7 +17,7 @@
 
 import org.hibernate.annotations.IndexColumn;
 
- at Entity
+ at Entity( name= "Node" )
 public class NodeImpl implements Node
 {
   @Id

Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -28,6 +28,7 @@
 import org.jbpm.api.ProcessNotFoundException;
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Node;
 import org.jbpm.api.service.PersistenceService;
 import org.jbpm.api.test.CTSTestCase;
 import org.jbpm.test.cts.processbuilder.TestProcessBuilder;
@@ -50,11 +51,25 @@
 
     // Save the process
     Process proc = TestProcessBuilder.getTrivalProcess();
+    
+    System.out.println(proc);
+    for (Node node : proc.getNodes())
+      System.out.println(node);
+    
     service.saveProcess(proc);
 
+    System.out.println(proc);
+    for (Node node : proc.getNodes())
+      System.out.println(node);
+    
     // Load the process
     ObjectName procID = proc.getKey();
     Process procLoad = service.loadProcess(procID);
+    
+    System.out.println(procLoad);
+    for (Node node : procLoad.getNodes())
+      System.out.println(node);
+      
     TestProcessBuilder.validateTrivialProcess(procLoad);
 
     // Delete the process

Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/ProcessImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/ProcessImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -14,7 +14,7 @@
 import javax.persistence.Id;
 import javax.persistence.OneToMany;
 
- at Entity
+ at Entity( name= "Process" )
 public class ProcessImpl implements Process
 {
   @Id

Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlowImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlowImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlowImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -10,7 +10,7 @@
 import javax.persistence.Id;
 import javax.persistence.ManyToOne;
 
- at Entity
+ at Entity( name= "SequenceFlow" )
 public class SequenceFlowImpl implements SequenceFlow
 {
   @Id

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -24,11 +24,10 @@
 //$Id$
 
 import javax.management.ObjectName;
+import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.MappedSuperclass;
-import javax.persistence.Transient;
 
-import org.jboss.util.id.UID;
 import org.jbpm.api.model.AbstractElement;
 import org.jbpm.api.model.Process;
 
@@ -43,27 +42,22 @@
 {
   private static final long serialVersionUID = 1L;
 
-  @Id
-  private String id;
-  @Transient
-  protected transient ObjectName key;
+  @Id @GeneratedValue
+  private Integer id;
 
-  @Id
-  public String getId()
+  public Integer getId()
   {
-    if (id == null)
-      id = new UID().toString();
-
     return id;
   }
 
-  public void setId(String id)
+  // Persistence method
+  protected void setId(Integer id)
   {
     this.id = id;
   }
 
   /**
-   * Get the ID of this element
+   * Get the key for this element
    */
   public abstract ObjectName getKey();
 

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -27,7 +27,6 @@
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
-import javax.persistence.Table;
 import javax.persistence.Transient;
 
 import org.jbpm.api.Constants;
@@ -35,7 +34,7 @@
 import org.jbpm.api.model.EndEvent;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.model.builder.SingleInFlowSupport;
+import org.jbpm.ri.model.builder.SingleInFlowSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,8 +48,7 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_END_EVENT")
+ at Entity(name = "EndEvent")
 public class EndEventImpl extends EventImpl implements EndEvent, SingleInFlowSupport
 {
   // provide serial version UID
@@ -87,13 +85,10 @@
   @Transient
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=EndEvent,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=EndEvent,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
 
   @Transient
@@ -104,9 +99,10 @@
     return inFlows.get(0);
   }
 
-  public void setInFlow(SequenceFlow inFlow)
+  public void setInFlow(SequenceFlowImpl inFlow)
   {
     inFlows.add(inFlow);
+    inFlow.setSourceIndex(inFlows.size());
   }
 
   public String toString()

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -62,13 +62,10 @@
   @Override
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=Event,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=Event,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
 
   public EventType getEventType()

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExpressionImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExpressionImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExpressionImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -23,6 +23,7 @@
 
 //$Id$
 
+import javax.persistence.Column;
 import javax.persistence.Embeddable;
 
 import org.jbpm.api.model.Expression;
@@ -40,7 +41,9 @@
   // provide serial version UID
   private static final long serialVersionUID = 1L;
   
+  @Column(name = "exprBody")
   private String body;
+  @Column(name = "exprLang")
   private ExpressionLanguage lang;
 
   public ExpressionImpl(String body)

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -32,9 +32,9 @@
 import org.jbpm.api.model.Gateway;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.model.builder.MultipleInFlowSupport;
-import org.jbpm.api.model.builder.MultipleOutFlowSupport;
 import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.ri.model.builder.MultipleInFlowSupport;
+import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
 
 /**
  * Gateways are modelling elements that are used to control how Sequence Flow interact as they converge and diverge
@@ -56,13 +56,10 @@
   @Override
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=" + getGatewayType() + "Gateway,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=" + getGatewayType() + "Gateway,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
   
   public List<SequenceFlow> getGates()

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -27,13 +27,15 @@
 import java.util.List;
 
 import javax.persistence.Basic;
+import javax.persistence.CascadeType;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.Inheritance;
 import javax.persistence.InheritanceType;
 import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
+import javax.persistence.OneToMany;
 
+import org.hibernate.annotations.IndexColumn;
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.NameNotUniqueException;
 import org.jbpm.api.model.EndEvent;
@@ -41,10 +43,10 @@
 import org.jbpm.api.model.Process;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.builder.MultipleInFlowSupport;
-import org.jbpm.api.model.builder.MultipleOutFlowSupport;
-import org.jbpm.api.model.builder.SingleInFlowSupport;
-import org.jbpm.api.model.builder.SingleOutFlowSupport;
+import org.jbpm.ri.model.builder.MultipleInFlowSupport;
+import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
+import org.jbpm.ri.model.builder.SingleInFlowSupport;
+import org.jbpm.ri.model.builder.SingleOutFlowSupport;
 
 /**
  * A Flow Object is one of the set of following graphical objects: Event, Activity, and
@@ -52,8 +54,7 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_NODE")
+ at Entity(name = "Node")
 @Inheritance(strategy = InheritanceType.JOINED)
 public abstract class NodeImpl extends AbstractElementImpl implements Node
 {
@@ -62,11 +63,15 @@
 
   @Basic
   private String name;
-  @Transient // @ManyToOne(targetEntity = ProcessImpl.class)
+  @ManyToOne(targetEntity = ProcessImpl.class)
   private Process process;
-  @Transient // @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "targetRef", targetEntity = SequenceFlowImpl.class)
+  @Basic
+  private int nodeIndex;
+  @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "targetRef", targetEntity = SequenceFlowImpl.class)
+  @IndexColumn(name = "targetIndex")
   protected List<SequenceFlow> inFlows = new ArrayList<SequenceFlow>();
-  @Transient // @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "sourceRef", targetEntity = SequenceFlowImpl.class)
+  @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "sourceRef", targetEntity = SequenceFlowImpl.class)
+  @IndexColumn(name = "sourceIndex")
   protected List<SequenceFlow> outFlows = new ArrayList<SequenceFlow>();
 
   public NodeImpl(String name)
@@ -90,6 +95,17 @@
     this.process = proc;
   }
 
+  public int getNodeIndex()
+  {
+    return nodeIndex;
+  }
+
+  // Persistence method
+  public void setNodeIndex(int nodeIndex)
+  {
+    this.nodeIndex = nodeIndex;
+  }
+
   public String getName()
   {
     return name;

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -24,7 +24,6 @@
 //$Id$
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import javax.management.ObjectName;
@@ -35,9 +34,9 @@
 import javax.persistence.Enumerated;
 import javax.persistence.FetchType;
 import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.hibernate.annotations.IndexColumn;
 import org.jbpm.api.Constants;
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.NotImplementedException;
@@ -56,8 +55,7 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_PROCESS")
+ at Entity(name = "Process")
 public class ProcessImpl extends AbstractElementImpl implements Process
 {
   private static final long serialVersionUID = 1L;
@@ -69,6 +67,7 @@
   private String name;
   
   @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "process", targetEntity = NodeImpl.class)
+  @IndexColumn(name = "nodeIndex")
   private List<Node> nodes = new ArrayList<Node>();
   
   @Enumerated(EnumType.STRING)
@@ -91,13 +90,10 @@
   @Transient
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=Process,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=Process,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
 
   public String getName()
@@ -120,37 +116,36 @@
     this.status = status;
   }
 
-  public void addNode(Node node)
+  public void addNode(NodeImpl nodeImpl)
   {
-    nodes.add(node);
+    if (nodeImpl == null)
+      throw new IllegalArgumentException("Node cannot be null");
+    
+    nodes.add(nodeImpl);
+    nodeImpl.setNodeIndex(nodes.size());
   }
 
   public List<Node> getNodes()
   {
+    System.out.println(nodes);
     return nodes;
   }
 
-  // Persistence method
-  protected void setNodes(List<Node> Nodes)
-  {
-    this.nodes = Nodes;
-  }
-
   public Node getNode(String name)
   {
     if (name == null)
       throw new IllegalArgumentException("Cannot find node with name: null");
 
-    Node Node = null;
-    for (Node aux : nodes)
+    Node node = null;
+    for (Node aux : getNodes())
     {
       if (name.equals(aux.getName()))
       {
-        Node = aux;
+        node = aux;
         break;
       }
     }
-    return Node;
+    return node;
   }
 
   @SuppressWarnings("unchecked")
@@ -199,7 +194,7 @@
       throw new InvalidProcessException("Process does not have end events");
 
     // Initialize the nodes
-    for (Node node : nodes)
+    for (Node node : getNodes())
     {
       NodeImpl nodeImpl = (NodeImpl)node;
       nodeImpl.initialize(this);

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -32,8 +32,6 @@
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
 
 import org.jbpm.api.model.Expression;
 import org.jbpm.api.model.Node;
@@ -46,8 +44,7 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_SEQUENCE_FLOW")
+ at Entity(name = "SequenceFlow")
 public class SequenceFlowImpl implements SequenceFlow
 {
   // provide serial version UID
@@ -58,16 +55,21 @@
   @SuppressWarnings("unused")
   private Integer id;
 
+  @Basic
+  private int sourceIndex;
+  @Basic
+  private int targetIndex;
+  
   @Enumerated(EnumType.STRING)
   private ConditionType conditionType = ConditionType.None;
 
   @Basic
   private String targetName;
 
-  @Transient // @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
+  @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
   private Node sourceRef;
 
-  @Transient // @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
+  @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
   private Node targetRef;
 
   @Embedded
@@ -90,6 +92,26 @@
   {
   }
 
+  public int getSourceIndex()
+  {
+    return sourceIndex;
+  }
+
+  public void setSourceIndex(int sourceIndex)
+  {
+    this.sourceIndex = sourceIndex;
+  }
+
+  public int getTargetIndex()
+  {
+    return targetIndex;
+  }
+
+  public void setTargetIndex(int targetIndex)
+  {
+    this.targetIndex = targetIndex;
+  }
+
   public Node getSourceRef()
   {
     return sourceRef;

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -27,7 +27,6 @@
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
-import javax.persistence.Table;
 import javax.persistence.Transient;
 
 import org.jbpm.api.Constants;
@@ -35,7 +34,7 @@
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.StartEvent;
 import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.model.builder.SingleOutFlowSupport;
+import org.jbpm.ri.model.builder.SingleOutFlowSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,8 +46,7 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_START_EVENT")
+ at Entity(name = "StartEvent")
 public class StartEventImpl extends EventImpl implements StartEvent, SingleOutFlowSupport
 {
   private static final long serialVersionUID = 1L;
@@ -84,13 +82,10 @@
   @Override
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=StartEvent,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=StartEvent,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
 
   @Transient
@@ -101,9 +96,10 @@
     return outFlows.get(0);
   }
 
-  public void setOutFlow(SequenceFlow outFlow)
+  public void setOutFlow(SequenceFlowImpl outFlow)
   {
     outFlows.add(outFlow);
+    outFlow.setTargetIndex(outFlows.size());
   }
 
   public String toString()

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -27,7 +27,6 @@
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
-import javax.persistence.Table;
 import javax.persistence.Transient;
 
 import org.jbpm.api.Constants;
@@ -35,8 +34,8 @@
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.Task;
 import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.model.builder.SingleInFlowSupport;
-import org.jbpm.api.model.builder.SingleOutFlowSupport;
+import org.jbpm.ri.model.builder.SingleInFlowSupport;
+import org.jbpm.ri.model.builder.SingleOutFlowSupport;
 
 /**
  * A Task is an Atomic Activity that is included within a Process.
@@ -47,15 +46,15 @@
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
- at Entity
- at Table(name = "JBPM_TASK")
+ at Entity(name = "Task")
 public class TaskImpl extends NodeImpl implements Task, SingleOutFlowSupport, SingleInFlowSupport
 {
   // provide serial version UID
   private static final long serialVersionUID = 1L;
-  
+
+  @Enumerated(EnumType.STRING)
   private TaskType taskType = TaskType.None;
-  
+
   public TaskImpl(String name)
   {
     super(name);
@@ -66,12 +65,11 @@
   {
   }
 
-  @Enumerated(EnumType.STRING)
   public TaskType getTaskType()
   {
     return taskType;
   }
-  
+
   // Persistence method
   protected void setTaskType(TaskType taskType)
   {
@@ -82,15 +80,12 @@
   @Transient
   public ObjectName getKey()
   {
-    if (key == null)
-    {
-      StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
-      str.append("type=" + getTaskType() + "Task,name=" + getName() + ",id=" + getId());
-      key = ObjectNameFactory.create(str.toString());
-    }
-    return key;
+    StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":");
+    str.append("type=" + getTaskType() + "Task,name=" + getName() + ",id=" + getId());
+    ObjectName oname = ObjectNameFactory.create(str.toString());
+    return oname;
   }
-  
+
   @Transient
   public SequenceFlow getInFlow()
   {
@@ -99,9 +94,10 @@
     return inFlows.get(0);
   }
 
-  public void setInFlow(SequenceFlow inFlow)
+  public void setInFlow(SequenceFlowImpl inFlow)
   {
     inFlows.add(inFlow);
+    inFlow.setSourceIndex(inFlows.size());
   }
 
   @Transient
@@ -112,9 +108,10 @@
     return outFlows.get(0);
   }
 
-  public void setOutFlow(SequenceFlow outFlow)
+  public void setOutFlow(SequenceFlowImpl outFlow)
   {
     outFlows.add(outFlow);
+    outFlow.setTargetIndex(outFlows.size());
   }
 
   public String toString()

Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleInFlowSupport.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java	                        (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleInFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -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.ri.model.builder;
+
+//$Id$
+
+import java.util.List;
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.ri.model.SequenceFlowImpl;
+
+/**
+ * Implementing {@link Node} support multiple incomming {@link SequenceFlow}s.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MultipleInFlowSupport
+{
+  /**
+   * Gat the incomming SequenceFlows
+   */
+  List<SequenceFlow> getInFlows();
+  
+  /**
+   * Add an incomming SequenceFlow
+   */
+  void addInFlow(SequenceFlowImpl flow);
+
+}

Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MultipleOutFlowSupport.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java	                        (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/MultipleOutFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -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.ri.model.builder;
+
+//$Id$
+
+import java.util.List;
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.ri.model.SequenceFlowImpl;
+
+/**
+ * Implementing {@link Node} support multiple outgoing {@link SequenceFlow}s.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MultipleOutFlowSupport
+{
+  /**
+   * Gat the outgoing SequenceFlows
+   */
+  List<SequenceFlow> getOutFlows();
+  
+  /**
+   * Add an outgoing SequenceFlow
+   */
+  void addOutFlow(SequenceFlowImpl flow);
+
+}

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -24,13 +24,10 @@
 //$Id$
 
 import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.Node;
 import org.jbpm.api.model.Process;
 import org.jbpm.api.model.Gateway.GatewayType;
 import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.MultipleOutFlowSupport;
 import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.SingleOutFlowSupport;
 import org.jbpm.api.service.Service;
 import org.jbpm.ri.model.EndEventImpl;
 import org.jbpm.ri.model.EventImpl;
@@ -177,9 +174,9 @@
     return this;
   }
 
-  public ProcessBuilder addNode(Node node)
+  private ProcessBuilder addNode(NodeImpl nodeImpl)
   {
-    getProcessInternal().addNode(node);
+    getProcessInternal().addNode(nodeImpl);
     return this;
   }
 

Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleInFlowSupport.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java	                        (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleInFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -0,0 +1,46 @@
+/*
+ * 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.ri.model.builder;
+
+//$Id$
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.ri.model.SequenceFlowImpl;
+
+/**
+ * Implementing {@link Node}s support a single incomming {@link SequenceFlow}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleInFlowSupport
+{
+  /**
+   * Get the incomming SequenceFlow
+   */
+  SequenceFlow getInFlow();
+  
+  /**
+   * Set the incomming SequenceFlow
+   */
+  void setInFlow(SequenceFlowImpl flow);
+}

Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SingleOutFlowSupport.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java	                        (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/SingleOutFlowSupport.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -0,0 +1,46 @@
+/*
+ * 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.ri.model.builder;
+
+//$Id$
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.ri.model.SequenceFlowImpl;
+
+/**
+ * Implementing {@link Node}s support a single outgoing {@link SequenceFlow}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleOutFlowSupport
+{
+  /**
+   * Get the outgoing SequenceFlow
+   */
+  SequenceFlow getOutFlow();
+  
+  /**
+   * Set the outgoing SequenceFlow
+   */
+  void setOutFlow(SequenceFlowImpl flow);
+}

Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java	2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java	2008-09-29 07:22:59 UTC (rev 2419)
@@ -80,10 +80,9 @@
     Session session = getSessionFactory().openSession();
     try
     {
-      String key = procID.getKeyProperty("id");
-      procImpl = (ProcessImpl)session.load(ProcessImpl.class, key);
+      Integer id = Integer.valueOf(procID.getKeyProperty("id"));
+      procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
       Hibernate.initialize(procImpl);
-      procImpl.initialize(procImpl);
     }
     catch (ObjectNotFoundException ex)
     {
@@ -128,10 +127,10 @@
       anConfig.addAnnotatedClass(AbstractElementImpl.class);
       anConfig.addAnnotatedClass(EndEventImpl.class);
       anConfig.addAnnotatedClass(NodeImpl.class);
-      anConfig.addAnnotatedClass(TaskImpl.class);
       anConfig.addAnnotatedClass(ProcessImpl.class);
       anConfig.addAnnotatedClass(SequenceFlowImpl.class);
       anConfig.addAnnotatedClass(StartEventImpl.class);
+      anConfig.addAnnotatedClass(TaskImpl.class);
       sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
     }
     return sessionFactory;




More information about the jbpm-commits mailing list