[jbpm-commits] JBoss JBPM SVN: r3660 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm and 9 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jan 16 05:11:22 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-01-16 05:11:21 -0500 (Fri, 16 Jan 2009)
New Revision: 3660

Added:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java
Removed:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/DescriptorBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/NodeBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java
Modified:
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/UnresolvedFlow.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/println/PrintlnTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
Log:
renamed package org.jbpm.pvm.builder to org.jbpm.pvm.internal.builder

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBuilder.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBuilder.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -21,9 +21,9 @@
  */
 package org.jbpm.jpdl.activity;
 
-import org.jbpm.pvm.builder.ActivityBehaviourBuilder;
-import org.jbpm.pvm.builder.CompositeBuilder;
-import org.jbpm.pvm.builder.ActivityBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBehaviourBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBuilder;
+import org.jbpm.pvm.internal.builder.CompositeBuilder;
 import org.jbpm.pvm.internal.wire.Descriptor;
 
 

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder (from rev 3641, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder)


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java (from rev 3653, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/ActivityBehaviourBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.builder;
+
+import org.jbpm.pvm.internal.model.NodeImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityBehaviourBuilder {
+  
+  protected ActivityBuilder activityBuilder;
+  protected NodeImpl node;
+
+  public ActivityBehaviourBuilder(ActivityBuilder activityBuilder) {
+    this.activityBuilder = activityBuilder;
+    this.node = activityBuilder.node;
+  }
+  
+  public ActivityBuilder endBehaviour() {
+    return activityBuilder;
+  }
+}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java (from rev 3653, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/ActivityBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.builder;
+
+import java.lang.reflect.Constructor;
+
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityBuilder extends CompositeBuilder {
+  
+  private static final Class<?>[] ACTIVITYBEHAVIOURBUILDER_PARAMTYPES = new Class<?>[]{ActivityBuilder.class};
+
+  /** the enclosing composite */
+  protected CompositeBuilder compositeBuilder;
+  protected NodeImpl node;
+  
+  public ActivityBuilder(CompositeBuilder compositeBuilder, String nodeName) {
+    this.compositeBuilder = compositeBuilder;
+    this.node = compositeBuilder.createActivity();
+    this.compositeElement = node;
+    this.node.setName(nodeName);
+  }
+  
+  public ActivityBuilder initial() {
+    setProcessDefinitionInitial(node);
+    return this;
+  }
+  
+  protected void setProcessDefinitionInitial(NodeImpl initial) {
+    compositeBuilder.setProcessDefinitionInitial(initial);
+  }
+
+  public <T extends ActivityBehaviourBuilder> T startBehaviour(Class<T> activityBehaviourBuilderType) {
+    return startBehaviour(null, activityBehaviourBuilderType);
+  }
+
+  public <T extends ActivityBehaviourBuilder> T startBehaviour(String nodeName, Class<T> activityBehaviourBuilderType) {
+    if (activityBehaviourBuilderType==null) {
+      throw new RuntimeException("activityBuilderType is null");
+    }
+    try {
+      Constructor<T> constructor = activityBehaviourBuilderType.getConstructor(ACTIVITYBEHAVIOURBUILDER_PARAMTYPES);
+      T nodeBuilder = constructor.newInstance(new Object[]{this});
+      return nodeBuilder;
+    } catch (Exception e) {
+      throw new RuntimeException("couldn't instantiate activity behaviour builder type "+activityBehaviourBuilderType.getName(), e);
+    }
+  }
+  
+  public CompositeBuilder endActivity() {
+    return compositeBuilder;
+  }
+  
+  public FlowBuilder startFlow(String to) {
+    UnresolvedFlow unresolvedFlow = new UnresolvedFlow();
+    unresolvedFlow.transition = node.createOutgoingTransition();
+    unresolvedFlow.destinationName = to;
+    addUnresolvedFlow(unresolvedFlow);
+    return new FlowBuilder(this, unresolvedFlow.transition);
+  }
+  
+  public ProcessDefinitionImpl endProcess() {
+    return compositeBuilder.endProcess();
+  }
+  
+  public ActivityBuilder flow(String to) {
+    startFlow(to);
+    return this;
+  }
+
+  public ActivityBuilder flow(String to, String name) {
+    startFlow(to).name(name);
+    return this;
+  }
+
+  protected void addUnresolvedFlow(UnresolvedFlow unresolvedFlow) {
+    compositeBuilder.addUnresolvedFlow(unresolvedFlow);
+  }
+}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/CompositeBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,110 +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.pvm.builder;
-
-import java.lang.reflect.Constructor;
-
-import org.jbpm.JbpmException;
-import org.jbpm.activity.Activity;
-import org.jbpm.pvm.internal.model.CompositeElementImpl;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.wire.Descriptor;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class CompositeBuilder {
-
-  private static final Class<?>[] NODEBUILDER_PARAMTYPES = new Class<?>[]{CompositeBuilder.class, String.class};
-  
-  protected CompositeElementImpl compositeElement;
-  
-  protected abstract void addUnresolvedFlow(UnresolvedFlow unresolvedFlow);
-  public abstract ProcessDefinitionImpl endProcess();
-
-  protected NodeImpl createNode() {
-    return compositeElement.createNode();
-  }
-
-  public EventImpl createEvent(String eventName) {
-    return compositeElement.createEvent(eventName);
-  }
-
-
-  public <T extends NodeBuilder> T startNode(Descriptor activityDescriptor) {
-    return (T) startNode(null, activityDescriptor);
-  }
-
-  public NodeBuilder<NodeBuilder<?>> startNode(String nodeName, Descriptor activityDescriptor) {
-    if (activityDescriptor==null) {
-      throw new RuntimeException("activityDescriptor is null");
-    }
-    NodeBuilder<NodeBuilder<?>> nodeBuilder = new NodeBuilder<NodeBuilder<?>>(this, nodeName);
-    nodeBuilder.node.setBehaviour(activityDescriptor);
-    return nodeBuilder;
-  }
-
-  public NodeBuilder<NodeBuilder<?>> startNode(Activity activity) {
-    return startNode(null, activity);
-  }
-
-  public NodeBuilder<NodeBuilder<?>> startNode(String nodeName, Activity activity) {
-    if (activity==null) {
-      throw new RuntimeException("activity is null");
-    }
-    NodeBuilder<NodeBuilder<?>> nodeBuilder = new NodeBuilder<NodeBuilder<?>>(this, nodeName);
-    nodeBuilder.node.setBehaviour(activity);
-    return nodeBuilder;
-  }
-
-  public <T extends NodeBuilder> T startNode(Class<T> nodeBuilderType) {
-    return startNode(null, nodeBuilderType);
-  }
-
-  public <T extends NodeBuilder> T startNode(String nodeName, Class<T> nodeBuilderType) {
-    if (nodeBuilderType==null) {
-      throw new RuntimeException("nodeBuilderType is null");
-    }
-    try {
-      Constructor<T> constructor = nodeBuilderType.getConstructor(NODEBUILDER_PARAMTYPES);
-      T nodeBuilder = constructor.newInstance(new Object[]{this, nodeName});
-      return nodeBuilder;
-    } catch (Exception e) {
-      throw new RuntimeException("couldn't instantiate node builder type "+nodeBuilderType.getName(), e);
-    }
-  }
-  
-  public EventBuilder startEvent(String eventName) {
-    return new EventBuilder(this, compositeElement, eventName);
-  }
-
-  public CompositeBuilder endNode() {
-    throw new JbpmException("calling endNode on a processBuilder is invalid");
-  }
-
-  public FlowBuilder startFlow(String to) {
-    throw new JbpmException("calling startFlow on a processBuilder is invalid");
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java (from rev 3659, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/CompositeBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.builder;
+
+import org.jbpm.JbpmException;
+import org.jbpm.activity.Activity;
+import org.jbpm.pvm.internal.model.CompositeElementImpl;
+import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class CompositeBuilder {
+
+  private static final Class<?>[] ACTIVITYBUILDER_PARAMTYPES = new Class<?>[]{CompositeBuilder.class, String.class};
+  
+  protected CompositeElementImpl compositeElement;
+  
+  public abstract ProcessDefinitionImpl endProcess();
+  protected abstract void addUnresolvedFlow(UnresolvedFlow unresolvedFlow);
+  protected abstract void setProcessDefinitionInitial(NodeImpl initial);
+
+  protected NodeImpl createActivity() {
+    return compositeElement.createNode();
+  }
+
+  public EventImpl createEvent(String eventName) {
+    return compositeElement.createEvent(eventName);
+  }
+  
+  public CompositeBuilder variable(String name, String type) {
+    return startVariable(name, type).endVariable();
+  }
+  
+  public VariableBuilder startVariable(String name, String type) {
+    return new VariableBuilder(this);
+  }
+
+  public ActivityBuilder startActivity() {
+    return startActivity((String)null);
+  }
+
+  public ActivityBuilder startActivity(String nodeName) {
+    return new ActivityBuilder(this, nodeName);
+  }
+
+  public ActivityBuilder startActivity(Descriptor activityDescriptor) {
+    return startActivity(null, activityDescriptor);
+  }
+
+  public ActivityBuilder startActivity(String nodeName, Descriptor activityDescriptor) {
+    if (activityDescriptor==null) {
+      throw new RuntimeException("activityDescriptor is null");
+    }
+    ActivityBuilder activityBuilder = new ActivityBuilder(this, nodeName);
+    activityBuilder.node.setBehaviour(activityDescriptor);
+    return activityBuilder;
+  }
+
+  public ActivityBuilder startActivity(Activity activity) {
+    return startActivity(null, activity);
+  }
+
+  public ActivityBuilder startActivity(String nodeName, Activity activity) {
+    if (activity==null) {
+      throw new RuntimeException("activity is null");
+    }
+    ActivityBuilder activityBuilder = new ActivityBuilder(this, nodeName);
+    activityBuilder.node.setBehaviour(activity);
+    return activityBuilder;
+  }
+
+  public EventBuilder startEvent(String eventName) {
+    return new EventBuilder(this, compositeElement, eventName);
+  }
+
+  public CompositeBuilder endActivity() {
+    throw new JbpmException("calling endNode on a processBuilder is invalid");
+  }
+
+  public FlowBuilder startFlow(String to) {
+    throw new JbpmException("calling startFlow on a processBuilder is invalid");
+  }
+}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/DescriptorBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/DescriptorBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/DescriptorBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,83 +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.pvm.builder;
-
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.descriptor.LongDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DescriptorBuilder {
-  
-  ObjectDescriptor objectDescriptor;
-
-  protected DescriptorBuilder(String className) {
-    objectDescriptor = new ObjectDescriptor();
-    objectDescriptor.setClassName(className);
-  }
-  
-  public static DescriptorBuilder startObjectDescriptor(String className) {
-    return new DescriptorBuilder(className);
-  }
-
-  public static Descriptor createObjectDescriptor(String className) {
-    return new ObjectDescriptor(className);
-  }
-
-  public static Descriptor createReferenceDescriptor(String objectName) {
-    return new ReferenceDescriptor(objectName);
-  }
-
-  public static Descriptor createStringDescriptor(String text) {
-    return new StringDescriptor(text);
-  }
-  
-  public static Descriptor createLongDescriptor(Long l) {
-    return new LongDescriptor(l);
-  }
-  
-  public DescriptorBuilder inject(String fieldName, Descriptor valueDescriptor) {
-    objectDescriptor.addInjection(fieldName, valueDescriptor);
-    return this;
-  }
-
-  public DescriptorBuilder inject(String fieldName, String value) {
-    StringDescriptor stringDescriptor = new StringDescriptor(value);
-    objectDescriptor.addInjection(fieldName, stringDescriptor);
-    return this;
-  }
-
-  public DescriptorBuilder inject(String fieldName, Long value) {
-    LongDescriptor longDescriptor = new LongDescriptor(value);
-    objectDescriptor.addInjection(fieldName, longDescriptor);
-    return this;
-  }
-
-  public Descriptor endObjectDescriptor() {
-    return objectDescriptor;
-  }
-}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/EventBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.builder;
-
-import org.jbpm.JbpmException;
-import org.jbpm.listener.EventListener;
-import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.EventListenerReference;
-import org.jbpm.pvm.internal.model.ObservableElementImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class EventBuilder {
-
-  protected CompositeBuilder compositeBuilder;
-  protected ObservableElementImpl observableElement;
-  protected String eventName;
-  protected EventImpl event = null;
-
-  public EventBuilder(CompositeBuilder compositeBuilder, ObservableElementImpl observableElement, String eventName) {
-    this.compositeBuilder = compositeBuilder;
-    this.observableElement = observableElement;
-    this.eventName = eventName;
-  }
-  
-  public EventBuilder listener(EventListener eventListener) {
-    getEvent().createEventListenerReference(eventListener);
-    return this;
-  }
-
-  private EventImpl getEvent() {
-    if (event==null) {
-      this.event = observableElement.createEvent(eventName);
-    }
-    return event;
-  }
-
-  public CompositeBuilder endEvent() {
-    return compositeBuilder;
-  }
-  
-  public NodeBuilder<NodeBuilder<?>> endFlow() {
-    throw new JbpmException("endFlow is only allowed on flows");
-  }
-
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java (from rev 3653, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/EventBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/EventBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,72 @@
+/*
+ * 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.pvm.internal.builder;
+
+import org.jbpm.JbpmException;
+import org.jbpm.listener.EventListener;
+import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.EventListenerReference;
+import org.jbpm.pvm.internal.model.ObservableElementImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EventBuilder {
+
+  protected CompositeBuilder compositeBuilder;
+  protected ObservableElementImpl observableElement;
+  protected String eventName;
+  protected EventImpl event = null;
+
+  public EventBuilder(CompositeBuilder compositeBuilder, ObservableElementImpl observableElement, String eventName) {
+    this.compositeBuilder = compositeBuilder;
+    this.observableElement = observableElement;
+    this.eventName = eventName;
+  }
+  
+  public EventBuilder listener(EventListener eventListener) {
+    getEvent().createEventListenerReference(eventListener);
+    return this;
+  }
+
+  public EventBuilder listener(EventListener eventListener, boolean propagation) {
+    EventListenerReference eventListenerReference = getEvent().createEventListenerReference(eventListener);
+    eventListenerReference.setPropagationEnabled(propagation);
+    return this;
+  }
+
+  private EventImpl getEvent() {
+    if (event==null) {
+      this.event = observableElement.createEvent(eventName);
+    }
+    return event;
+  }
+
+  public CompositeBuilder endEvent() {
+    return compositeBuilder;
+  }
+  
+  public ActivityBuilder endFlow() {
+    throw new JbpmException("endFlow is only allowed on flows");
+  }
+}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/FlowBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,55 +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.pvm.builder;
-
-import org.jbpm.model.Event;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FlowBuilder extends EventBuilder {
-
-  protected NodeBuilder<?> nodeBuilder;
-  protected TransitionImpl transition;
-  
-  public FlowBuilder(NodeBuilder<?> nodeBuilder, TransitionImpl transition) {
-    super(nodeBuilder, transition, Event.TRANSITION_TAKE);
-    this.nodeBuilder = nodeBuilder;
-    this.transition = transition;
-  }
-  
-  public FlowBuilder name(String name) {
-    transition.setName(name);
-    return this;
-  }
-  
-  public FlowBuilder expr(String expression) {
-    // transition.setExpression(expression);
-    return this;
-  }
-  
-  public NodeBuilder<NodeBuilder<?>> endFlow() {
-    return (NodeBuilder) nodeBuilder;
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java (from rev 3653, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/FlowBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.builder;
+
+import org.jbpm.model.Event;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FlowBuilder extends EventBuilder {
+
+  protected ActivityBuilder activityBuilder;
+  protected TransitionImpl transition;
+  
+  public FlowBuilder(ActivityBuilder nodeBuilder, TransitionImpl transition) {
+    super(nodeBuilder, transition, Event.TRANSITION_TAKE);
+    this.activityBuilder = nodeBuilder;
+    this.transition = transition;
+  }
+  
+  public FlowBuilder name(String name) {
+    transition.setName(name);
+    return this;
+  }
+  
+  public FlowBuilder expr(String expression) {
+    // transition.setExpression(expression);
+    return this;
+  }
+  
+  public ActivityBuilder endFlow() {
+    return (ActivityBuilder) activityBuilder;
+  }
+}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/NodeBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/NodeBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/NodeBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,72 +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.pvm.builder;
-
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class NodeBuilder<T> extends CompositeBuilder {
-
-  /** the enclosing composite */
-  protected CompositeBuilder compositeBuilder;
-  protected NodeImpl node;
-  
-  public NodeBuilder(CompositeBuilder compositeBuilder, String nodeName) {
-    this.compositeBuilder = compositeBuilder;
-    this.node = compositeBuilder.createNode();
-    this.compositeElement = node;
-    this.node.setName(nodeName);
-  }
-
-  public CompositeBuilder endNode() {
-    return compositeBuilder;
-  }
-  
-  public FlowBuilder startFlow(String to) {
-    UnresolvedFlow unresolvedFlow = new UnresolvedFlow();
-    unresolvedFlow.transition = node.createOutgoingTransition();
-    unresolvedFlow.destinationName = to;
-    addUnresolvedFlow(unresolvedFlow);
-    return new FlowBuilder(this, unresolvedFlow.transition);
-  }
-  
-  public ProcessDefinitionImpl endProcess() {
-    return compositeBuilder.endProcess();
-  }
-  
-  public T flow(String to) {
-    startFlow(to);
-    return (T) this;
-  }
-
-  public T flow(String to, String name) {
-    startFlow(to).name(name);
-    return (T) this;
-  }
-
-  protected void addUnresolvedFlow(UnresolvedFlow unresolvedFlow) {
-    compositeBuilder.addUnresolvedFlow(unresolvedFlow);
-  }
-}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/ProcessDefinitionBuilder.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -1,113 +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.pvm.builder;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.model.NodeImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessDefinitionBuilder extends CompositeBuilder {
-  
-  private static final Log log = Log.getLog(ProcessDefinitionBuilder.class.getName());
-  
-  protected ProcessDefinitionImpl processDefinition;
-  protected String initialNodeName = null;
-  protected List<UnresolvedFlow> unresolvedFlows = new ArrayList<UnresolvedFlow>();
-
-  protected ProcessDefinitionBuilder(ProcessDefinitionImpl processDefinition) {
-    this.processDefinition = processDefinition;
-    this.compositeElement = processDefinition;
-  }
-
-  public static ProcessDefinitionBuilder startProcess() {
-    return startProcess(null);
-  }
-
-  public static ProcessDefinitionBuilder startProcess(String processDefinitionName) {
-    ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
-    processDefinition.setName(processDefinitionName);
-    return new ProcessDefinitionBuilder(processDefinition);
-  }
-
-  public ProcessDefinitionImpl endProcess() {
-    resolveInitialNode();
-    resolveFlows();
-    return processDefinition;
-  }
-
-  protected void resolveInitialNode() {
-    NodeImpl initial = (NodeImpl) processDefinition.findNode(initialNodeName);
-    if (initial==null) {
-      errorUnexistingInitial();
-    }
-    processDefinition.setInitial(initial);
-  }
-
-  protected void resolveFlows() {
-    for (UnresolvedFlow unresolvedFlow: unresolvedFlows) {
-      NodeImpl destination = (NodeImpl) processDefinition.findNode(unresolvedFlow.destinationName);
-      if (destination==null) {
-        errorUnexistingFlowDestination(unresolvedFlow);
-      }
-      unresolvedFlow.transition.setDestination(destination);
-    }
-  }
-
-  protected void errorUnexistingInitial() {
-    log.error("unexisting initial "+initialNodeName);
-  }
-
-  protected void errorUnexistingFlowDestination(UnresolvedFlow unresolvedFlow) {
-    String sourceNodeName = unresolvedFlow.transition.getSource().getName();
-    log.error("unexisting flow destination: "+sourceNodeName+"-->"+unresolvedFlow.destinationName);
-  }
-
-  public ProcessDefinitionBuilder key(String key) {
-    processDefinition.setKey(key);
-    return this;
-  }
-
-  public ProcessDefinitionBuilder version(int version) {
-    processDefinition.setVersion(version);
-    return this;
-  }
-
-  public ProcessDefinitionBuilder description(String description) {
-    processDefinition.setDescription(description);
-    return this;
-  }
-
-  public ProcessDefinitionBuilder initial(String initialNodeName) {
-    this.initialNodeName = initialNodeName;
-    return this;
-  }
-
-  protected void addUnresolvedFlow(UnresolvedFlow unresolvedFlow) {
-    unresolvedFlows.add(unresolvedFlow);
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java (from rev 3653, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/ProcessDefinitionBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -0,0 +1,116 @@
+/*
+ * 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.pvm.internal.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessDefinitionBuilder extends CompositeBuilder {
+  
+  private static final Log log = Log.getLog(ProcessDefinitionBuilder.class.getName());
+  
+  protected ProcessDefinitionImpl processDefinition;
+  protected List<UnresolvedFlow> unresolvedFlows = new ArrayList<UnresolvedFlow>();
+
+  protected ProcessDefinitionBuilder(ProcessDefinitionImpl processDefinition) {
+    this.processDefinition = processDefinition;
+    this.compositeElement = processDefinition;
+  }
+
+  public static ProcessDefinitionBuilder startProcess() {
+    return startProcess(null);
+  }
+
+  public static ProcessDefinitionBuilder startProcess(String processDefinitionName) {
+    ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
+    processDefinition.setName(processDefinitionName);
+    return new ProcessDefinitionBuilder(processDefinition);
+  }
+
+  public ProcessDefinitionImpl endProcess() {
+    verifyInitial();
+    resolveFlows();
+    return processDefinition;
+  }
+
+  protected void verifyInitial() {
+    if (processDefinition.getInitial()==null) {
+      errorNoInitial();
+    }
+  }
+
+  protected void resolveFlows() {
+    for (UnresolvedFlow unresolvedFlow: unresolvedFlows) {
+      NodeImpl destination = (NodeImpl) processDefinition.findNode(unresolvedFlow.destinationName);
+      if (destination==null) {
+        errorUnexistingFlowDestination(unresolvedFlow);
+      }
+      unresolvedFlow.transition.setDestination(destination);
+    }
+  }
+
+  public ProcessDefinitionBuilder key(String key) {
+    processDefinition.setKey(key);
+    return this;
+  }
+
+  public ProcessDefinitionBuilder version(int version) {
+    processDefinition.setVersion(version);
+    return this;
+  }
+
+  public ProcessDefinitionBuilder description(String description) {
+    processDefinition.setDescription(description);
+    return this;
+  }
+
+  protected void addUnresolvedFlow(UnresolvedFlow unresolvedFlow) {
+    unresolvedFlows.add(unresolvedFlow);
+  }
+
+  protected void setProcessDefinitionInitial(NodeImpl initial) {
+    if (processDefinition.getInitial()!=null) {
+      errorMultipleInitials(initial);
+    }
+    processDefinition.setInitial(initial);
+  }
+
+  protected void errorMultipleInitials(NodeImpl initial) {
+    log.error("multiple initial activities: "+processDefinition.getInitial()+" and "+initial);
+  }
+
+  protected void errorNoInitial() {
+    log.error("no initial activity");
+  }
+
+  protected void errorUnexistingFlowDestination(UnresolvedFlow unresolvedFlow) {
+    String sourceNodeName = unresolvedFlow.transition.getSource().getName();
+    log.error("unexisting flow destination: "+sourceNodeName+"-->"+unresolvedFlow.destinationName);
+  }
+}

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/UnresolvedFlow.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/UnresolvedFlow.java	2009-01-15 00:09:44 UTC (rev 3641)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/UnresolvedFlow.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -19,7 +19,7 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jbpm.pvm.builder;
+package org.jbpm.pvm.internal.builder;
 
 import org.jbpm.pvm.internal.model.TransitionImpl;
 

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java (from rev 3659, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/builder/VariableBuilder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -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.jbpm.pvm.internal.builder;
+
+import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariableBuilder {
+  
+  protected CompositeBuilder compositeBuilder;
+  protected VariableDefinitionImpl variableDefinition; 
+
+  public VariableBuilder(CompositeBuilder compositeBuilder) {
+    this.compositeBuilder = compositeBuilder;
+    variableDefinition = compositeBuilder.compositeElement.createVariableDefinition();
+  }
+  
+  public VariableBuilder name(String name) {
+    variableDefinition.setName(name);
+    return this;
+  }
+
+  public VariableBuilder type(String type) {
+    variableDefinition.setTypeName(type);
+    return this;
+  }
+  
+  public VariableBuilder initialValue(Descriptor initialValueDescriptor) {
+    variableDefinition.setInDescriptor(initialValueDescriptor);
+    return this;
+  }
+
+  public VariableBuilder initialExpression(String initialExpression) {
+    variableDefinition.setInExpression(initialExpression);
+    return this;
+  }
+
+  public VariableBuilder initialVariable(String initialVariable) {
+    variableDefinition.setInVariableName(initialVariable);
+    return this;
+  }
+  
+  public VariableBuilder outVariable(String outVariable) {
+    variableDefinition.setOutVariableName(outVariable);
+    return this;
+  }
+  
+  public CompositeBuilder endVariable() {
+    return compositeBuilder;
+  }
+
+}

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -21,8 +21,8 @@
  */
 package org.jbpm.pvm.activities;
 
-import org.jbpm.pvm.builder.ActivityBehaviourBuilder;
-import org.jbpm.pvm.builder.ActivityBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBehaviourBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBuilder;
 
 
 /**

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -26,6 +26,7 @@
 
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.model.NodeImpl;
 import org.jbpm.test.JbpmTestCase;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -21,7 +21,10 @@
  */
 package org.jbpm.pvm.builder;
 
+import org.jbpm.pvm.internal.builder.ActivityBehaviourBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBuilder;
 
+
 /**
  * @author Tom Baeyens
  */

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -28,7 +28,7 @@
 import org.jbpm.pvm.activities.PrintLn;
 import org.jbpm.pvm.activities.TestConsoleTestCase;
 import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 
 public class EventListenerTest extends TestConsoleTestCase {
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -30,7 +30,7 @@
 import org.jbpm.pvm.activities.DisplaySource;
 import org.jbpm.pvm.activities.TestConsole;
 import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.test.JbpmTestCase;
 
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -24,7 +24,7 @@
 
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 
 /**
  * @author Tom Baeyens

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -27,7 +27,7 @@
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.activities.AutomaticActivity;
 import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 
 public class ObjectExecutionModeTest extends TestCase {
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/println/PrintlnTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/println/PrintlnTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/println/PrintlnTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -24,7 +24,7 @@
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.activities.PrintLnBuilder;
 import org.jbpm.pvm.activities.TestConsoleTestCase;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 
 public class PrintlnTest extends TestConsoleTestCase {
   

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java	2009-01-16 10:07:28 UTC (rev 3659)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java	2009-01-16 10:11:21 UTC (rev 3660)
@@ -26,7 +26,7 @@
 
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.activities.WaitState;
-import org.jbpm.pvm.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.type.Variable;
 import org.jbpm.pvm.internal.type.variable.DateVariable;




More information about the jbpm-commits mailing list