You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ad...@apache.org on 2006/02/28 17:35:26 UTC

svn commit: r381694 [21/38] - in /incubator/ode/scratch: bpe/ ode/ ode/bpelTests/ ode/bpelTests/probeService/ ode/bpelTests/test1/ ode/bpelTests/test10/ ode/bpelTests/test12/ ode/bpelTests/test13/ ode/bpelTests/test14/ ode/bpelTests/test15/ ode/bpelTes...

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDChangeCondition.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDChangeCondition.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDChangeCondition.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDChangeCondition.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/***********************************************************************
+ * Module:  IPMDChangeCondition.java
+ * Author:  waterman
+ * Purpose: Defines the Interface IPMDChangeCondition
+ ***********************************************************************/
+
+package org.apache.ode.definition;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.apache.ode.condition.Conditional;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.util.BPException;
+
+/** An implementation of the interface holds the metadata needed to  create a Conditional implementation. */
+public interface IPMDChangeCondition extends IPMDLocatorHolder
+{
+   /** A verbose human readable description of the condition evaluation logic. It allows a business process analyst to augment a business process design. 
+     * 
+     * @return the descritpion of the conditional implemenation */
+   java.lang.String getDescription();
+   /** A human readable tag for the conditon. 
+     * 
+     * @return a human readable tag */
+   java.lang.String getLabel();
+   /** Returns the action metadata associated with a conditional evaluation. A conditional evaluation returns a collection of subscriptions ( or rule nodes ) that evaluate to true. Note: a conditional evaluation may contain hundreds of rules within its ruleset.
+     * 
+     * @return a collection of IPMDAction implementations */
+   Iterator getActions();
+
+   /** Uses metadata properties and a Conditional factory to instantiate a Conditional implemenation. The metadata properties were deployed into the metadata repository through the mutator interface.
+     * 
+     * @return an implementation of the Conditional interface */
+   Conditional getConditionalImpl() throws BPException;
+   
+   /** Returns the name of a class that implements the Conditional interface. Used as input into the ConditionalFactory.
+	 * 
+	 * @return the class name of a Conditional implementation */
+   java.lang.String getConditionalClass();
+   
+   void setConditionalClass(String c);
+   
+   /** Returns a list of name/value pairs. These properties are used to initialize a Conditional implementation. They are consumed by the ConditionalFactory.
+	 * 
+	 * @return a collection of IPMDProperty */
+   java.util.Properties getMetadata();
+
+   /** Creates an action metadata object in the metadata repository */
+   IPMDAction createAction(String label, String actionClass) throws DefinitionServiceException;
+
+   /** Creates a name/value pair property in the metadata repository and associates it with the change condition definition.
+	 * 
+	 * @param name 
+	 * @param value */
+   void addMetadata(java.lang.String name, java.lang.Object value) throws DefinitionServiceException;
+   public void setMetadata(Properties p);
+   
+   void setDescription(java.lang.String value);
+   
+   /**
+    * Add an action to be evaluated when condition evealutes to false.
+    * @param label
+    * @param actionClass
+    * @return
+    * @throws DefinitionServiceException
+    */
+   IPMDAction createFalseAction(String label, String actionClass) throws DefinitionServiceException;
+   /**
+    * List of actions to be run when condition evaluates to false.
+    * @return
+    */
+   Iterator getFalseActions();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelation.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelation.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelation.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 21, 2003
+ *
+ */
+package org.apache.ode.definition;
+
+import java.util.Collection;
+
+
+/**
+ * @author charper
+ *
+ */
+public interface IPMDCorrelation {
+	
+	/**
+	 * Add a correlation set to this correlations
+	 * @param corr the correlation set
+	 * @param instantiating if this correlation set is instantiating
+	 * @param pattern the pattern for this correlation set to follow
+	 */
+	public void addCorrelationSet(IPMDCorrelationSetDef corlSet, 
+		boolean instantiating, String pattern);
+	
+	/**
+	 * Get a list of the correlation sets.
+	 * @return
+	 */	
+	public Collection getCorrelationSets();
+	
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSet.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSet.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSet.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSet.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 22, 2003
+ *
+ */
+package org.apache.ode.definition;
+
+
+
+/**
+ * @author charper
+ *
+ */
+public interface IPMDCorrelationSet extends IPMDCorrelationSetDef {
+	
+	/**
+	 * If this correlation set is instantiating it's correlation set key values
+	 * @return
+	 */
+	public boolean isInstantiating();
+	
+	/**
+	 * The pattern for this correlation set.
+	 * @return
+	 */
+	public String getPattern();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSetDef.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSetDef.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSetDef.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDCorrelationSetDef.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 21, 2003
+ *
+ */
+package org.apache.ode.definition;
+
+import java.util.Collection;
+
+/**
+ * @author charper
+ *
+ */
+public interface IPMDCorrelationSetDef {
+	
+	/**
+	 * Get the list of part queries.
+	 * @return PartQuery collection
+	 */
+	public Collection getPartQueries();
+	
+	/**
+	 * Get the correlation set name.
+	 * @return
+	 */
+	public String getName();
+	
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocator.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocator.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocator.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocator.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/***********************************************************************
+ * Module:  IPMDContainer.java
+ * Author:  waterman
+ * Purpose: Defines the Interface IPMDContainer
+ ***********************************************************************/
+
+package org.apache.ode.definition;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.interaction.IInvocation;
+import org.apache.ode.interaction.builders.IInteractionBuilder;
+
+
+/** A read only interface that defines a data container. The container metadata is consumed by the ContainerService to create a DataContainer instance. */
+public interface IPMDLocator
+{
+	/**
+	 * the name of the locator
+	 * @return
+	 */
+	String getName();
+ 	/**
+ 	 * The path into the context
+ 	 * @return
+ 	 */
+   java.lang.String getPath();
+  
+	/**
+	 * A query into a context node
+	 * @return
+	 */
+   IInvocation getQuery();
+
+	/**
+	 * The type of the data located
+	 * @return
+	 */
+	int getType();
+	
+	/**
+	 * Indicates weather or not the location is contentious
+	 * @return
+	 */
+	boolean getContentious();
+	
+	/**
+	 * Indicates weather or not the location is contentious
+	 * @param contentious
+	 */
+	void setContentious(boolean contentious);
+	
+	/**
+	 * If the locator is for output
+	 * @return
+	 */
+	boolean getForOutput();
+	
+	/**
+	 * if the locator is for input
+	 */
+	boolean getForInput();
+	
+	/** Creates a property object in the metadata repository.
+	   * 
+	   * @param name 
+	   * @param value */
+	 void addProperty(java.lang.String name, java.lang.String value) throws DefinitionServiceException;
+	 
+	Properties getProperties();
+	
+	void setForOutput(boolean forOutput);
+	
+	IInteractionBuilder getInteractionBuilder();
+	
+	/**
+	 * Is the path absolute.
+	 * @return
+	 */
+	boolean isAbsolute();
+	
+	ArrayList getArrayListPath();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocatorHolder.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocatorHolder.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocatorHolder.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDLocatorHolder.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+package org.apache.ode.definition;
+
+import java.util.Iterator;
+
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.interaction.IInvocation;
+import org.apache.ode.interaction.builders.IInteractionBuilder;
+
+
+/**
+ * @author charper
+ *
+ */
+public interface IPMDLocatorHolder {
+	/**
+	 * Get a locator by name
+	 * @param locator
+	 * @return
+	 */
+	IPMDLocator getLocator(String name);
+
+	/**
+	 * Create a locator
+	 * @param name
+	 * @param path
+	 * @param query
+	 * @param interactionBuilder
+	 * @param type
+	 * @param forOutput
+	 * @param contentious
+	 * @return
+	 * @throws DefinitionServiceException
+	 */
+	IPMDLocator createLocator(String name, String path, IInvocation query, IInteractionBuilder interactionBuilder, int type, boolean forOutput,  boolean contentious) throws DefinitionServiceException;
+	
+
+	/**
+	 * Add a locator object.
+	 * @param name
+	 * @param locatorObj
+	 * @return
+	 */
+	IPMDLocator addLocator(String name, IPMDLocator locatorObj );
+	
+	/**
+	 * 
+	 * @return An iterator of locators.
+	 */
+	Iterator getLocators();
+	
+	/**
+	 * @return the number of locators held in the collection
+	 * @return
+	 */
+	int getLocatorSize();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDOperation.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDOperation.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDOperation.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 21, 2003
+ *
+ */
+package org.apache.ode.definition;
+
+import org.apache.ode.event.IStaticKey;
+
+/**
+ * @author charper
+ *
+ */
+public interface IPMDOperation {
+	
+	/**
+	 * Get the correlation for this operation.
+	 * @return
+	 */
+	public IPMDCorrelation getCorrelation();
+	
+	/**
+	 * True if this operation creates a new IPMIProcess.
+	 * @return
+	 */
+	public boolean isInstanceCreating();
+	
+	/**
+	 * Get the static key for this operation.
+	 * @return
+	 */
+	public IStaticKey getKey();
+	
+	/**
+	 * Get the root def Id associated with this operation.
+	 * @return
+	 */
+	public String getRootDefId();
+	
+	/**
+	 * Get the def Id associated with this operation.
+	 * @return
+	 */
+	public String getDefId();
+	
+	/**
+	 * Get the operation identifier.
+	 * @return
+	 */
+	public String getOperationId();
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProcess.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProcess.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProcess.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProcess.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/***********************************************************************
+ * Module:  IPMDProcess.java
+ * Author:  waterman
+ * Purpose: Defines the Interface IPMDProcess
+ ***********************************************************************/
+
+package org.apache.ode.definition;
+
+import java.util.Iterator;
+
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.engine.ProcessDefinitionKey;
+
+/** This persistent component holds the definition of a process. A group of related processes form an executable business process. A process may have a parent process with a different root, this use case would arise when an entire process definition is used as a sub-process within another processs definition. Note: stateful and stateless root processes may not be grafted into each other.
+  * <P>
+  * A definition entity is created when process design tooling generates business process metadata and that metadata is deployed into the process engine.
+  * <P>
+  * The process definition is an internal component to the business process engine and as such will not be exposed through a remote interface.
+  * <P>
+  * The process definition is used to clone process instances that define an executing business processes. Many process instances will hold a reference to the process definition.
+  * <P>
+  * Sub-processes can be obtained from the finder method on the Home interface. */
+public interface IPMDProcess
+{
+   /** A verbose human readable description of the process. It allows a business process analyst to augment a business process design. Will be used by debug tooling, BAM tooling and process simulation tooling to identify to the user where they are within a business process graph.
+     * 
+     * @return a process definition description */
+   java.lang.String getDescription();
+   /** A human readable tag for the process. Will be used by debug tooling, BAM tooling and process simulation tooling to identify to the user where they are within a business process graph.
+     * 
+     * @return a human readable tag for the process definition */
+   java.lang.String getLabel();
+   /** The process definition version
+    * 
+    * @return a process verison */
+   java.lang.String getVersion();
+   /** The root proces definition for the entire business process graph.
+     * 
+     * @return the unique identifier of the root definition */
+   ProcessDefinitionKey getRootKey();
+   
+   /** The root process definition instance
+    * 
+    * @return the root process instance
+    */
+   IPMDRoot getRoot();
+   /** The proces definition unique identifier
+     * 
+     * @return the unique identifier of the definition */
+   ProcessDefinitionKey getKey();
+   /** Returns a list of change conditions. Change conditions are mapped to actions and contain action execution decision logic.
+     * 
+     * @return a collection of IPMDChangeCondition */
+   Iterator getChangeConditions();
+   /** Returns a list of change conditions. Change conditions are mapped to actions and contain action execution decision logic.
+     * 
+     * @return an implementation of IPMDChangeCondition */
+   IPMDChangeCondition getPrecondition();
+   /** A process may have 0..* processes with observing  preconditions. Observing pre-conditions are evaluated when an event occurs on a process instance.
+     * 
+     * @return a collection of IPMDProcess */
+   Iterator getObserverProcessPC();
+   
+   /** A verbose human readable description of the process. It allows a business process analyst to augment a business process design. Will be used by debug tooling, BAM tooling and process simulation tooling to identify to the user where they are within a business process graph.
+	  * 
+	  * @return a process node description */
+	void setDescription(String description);
+	/** The underly repository creates a new change condition metadata object and associates it with the process definition.
+	  * 
+	  * @return an implementation of the IPDMDChangeCondition_Mutate interface */
+	IPMDChangeCondition createChangeCondition(java.lang.String label, java.lang.String conditionalClass) throws DefinitionServiceException;
+	
+
+	/** The underly repository creates a new change condition metadata object and associates it with the process definition.
+	  * 
+	  * @return an implementation of the IPMDChangeCondition_Mutate interface */
+	IPMDChangeCondition createPrecondition(java.lang.String label, java.lang.String conditionalClass) throws DefinitionServiceException;
+	/** adds a process definition to the observer list in the underlying metadata repository
+	  * 
+	  * @param process - an observing process definition */
+	void addObserverProcessPC(IPMDProcess process) throws DefinitionServiceException;
+	/** creates a new process definition in the metadata repository and associates it with the current process definition.
+	  * 
+	  * @return a new process definition */
+	IPMDProcess createSubProcess(java.lang.String label) throws DefinitionServiceException;
+	/** A process may have 0..* associated sub-processes.
+	  * 
+	  * @return a collection of IPMDProcess_Mutate */
+	java.util.Collection getSubProcesses() throws DefinitionServiceException;
+   
+	/**
+	 * Create and unlinked process
+	 * @param label
+	 * @return
+	 * @throws DefinitionServiceException
+	 */
+	public IPMDProcess createUnLinkedProcess(String label) throws DefinitionServiceException;
+
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProperty.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProperty.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProperty.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDProperty.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/***********************************************************************
+ * Module:  IPMDProperty.java
+ * Author:  waterman
+ * Purpose: Defines the Interface IPMDProperty
+ ***********************************************************************/
+
+package org.apache.ode.definition;
+
+
+/** A read only interface to access name/value pairs in the metadata repository. */
+public interface IPMDProperty
+{
+   /** attribute name
+     * 
+     * @return an attribute name */
+   java.lang.String getName();
+   /** attribute value
+     * 
+     * @return an attribute value */
+   java.lang.String getValue();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDRoot.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDRoot.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDRoot.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/IPMDRoot.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/***********************************************************************
+ * Module:  IPMDRoot.java
+ * Author:  waterman
+ * Purpose: Defines the Interface IPMDRoot
+ ***********************************************************************/
+
+package org.apache.ode.definition;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+
+import org.apache.ode.action.external.IExternalAction;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.engine.ProcessDefinitionKey;
+import org.apache.ode.event.IStaticKey;
+
+/** An implementation of this read only interface holds the root definition of a process. A group of associated processes form an executable business process.
+  * <P>
+  * A definition entity is created when process design tooling generates business process metadata and that metadata is deployed into the process engine.
+  * <P>
+  * The process definition is an internal component to the business process engine and as such will not be exposed outside the engine. This interface will abstract the engine algorithim and deployment tooling from metadata repository details.
+  * <P>
+  * The process definition is used to clone process instances that define an executing business processes. Many process instances will hold a reference to the process definition. */
+public interface IPMDRoot
+{
+   /** Each root process definition has a unique identifier. The
+     * identifier can be used to acquire a root process definition
+     * proxy.
+     * 
+     * @return an identifier that is unique to the metadata repository */
+   ProcessDefinitionKey getKey();
+   /** A human readable tag for the entire business process graph. 
+     * 
+     * @return a human readable tag for the business process graph */
+   java.lang.String getLabel();
+   /** A version of the business process label and/or description. Allows the process definition to evolve over time. A business process definition is versioned at the root only.
+     * 
+     * @return the business process graph version */
+   java.lang.String getVersion();
+   /** A verbose human readable description of the business process. It allows a business process analyst to augment a business process design. 
+     * <P>
+     * At the business process root this description may be quite long since it is describing the entire business process graph.
+     * 
+     * @return the business process graph description */
+   java.lang.String getDescription();
+   /** An identifier as to the persistent nature of a business process. A statful business process is a long running business process that spans many event invocations. A statless business process is short lived and exists for one event invocation.
+     * 
+     * @return true indicates a stateless process definition */
+   boolean getIsStateless();
+   
+    /** A definition root may have only one definition process. The method will create a new IPMDProcess in the repository if one does not exist.
+     * 
+     * @return a IPMDProcess_Mutate implementation */
+   IPMDProcess getProcess();
+   
+   /** Creates a new process definition and associates it with the root node.
+	 * 
+	 * @param label - a human readable tag is required by the metadata repository */
+   IPMDProcess createProcess(java.lang.String label) throws DefinitionServiceException;
+   /** A verbose human readable description of the process. It allows a business process analyst to augment a business process design. Will be used by debug tooling, BAM tooling and process simulation tooling to identify to the user where they are within a business process graph.
+	 * 
+	 * @return a process node description */
+   void setDescription(String description);
+   
+   /**
+    * A process definition may hold references to supporting documents.
+    * ( i.e. WSDL docs, RuleML docs, etc ... )
+    * 
+    * @param key - a unique identifier for the supporting doc
+    * @param doc - a byte array holding the supporting document
+    * 
+    */
+   public void addSupportingDocument(String key, String supportDoc);
+   
+   /**
+	* A process definition may hold references to supporting documents.
+	* ( i.e. WSDL docs, RuleML docs, etc ... )
+	* 
+	* @param key - a unique identifier for the supporting doc
+	* @return doc - a byte array holding the supporting document
+	* 
+	*/
+   public String getSupportingDocument(String key);
+   
+   
+   public void setSupportingDocuments(HashMap docs);
+   
+   public void setIsStateless(boolean state);
+   
+   /**
+    * Add a process instance creating operation.
+    * @param op the operation
+    */
+   public void addInstanceCreatingOperation(IPMDOperation op);
+   
+   /**
+    * Create a correlation set.
+    * @param name  correlation set name
+    * @param partQueries a PartQuery array list
+    * @return
+    */
+   public IPMDCorrelationSetDef createCorrelationSet(String name, ArrayList partQueries);
+   
+   /**
+    * Create a correlation.
+    * @param name the name of the corrlations
+    * @return
+    */
+   public IPMDCorrelation createCorrelation(String name);
+   
+   /**
+    * Create an operation.
+    * @param operationId a unique operation identifier
+    * @param key the static key for the operation
+    * @param corrl the correlation for the operation
+    * @param instanceCreating if the operation creates a new IPMIProcess or routes
+    * @param defId if creatinga new IPMIProcess this is the def to clone
+    * to an existing IPMIProcess
+    * @return
+    */
+   public IPMDOperation createOperation(String operationId, IStaticKey key, IPMDCorrelation corrl, 
+   	boolean instanceCreating, String defId);
+   
+   /**
+    * Create an on message operation.
+    * @param operationId a unique operation identifier
+    * @param key the static key for the operation
+    * @param corrl the correlation for the operation
+    * @param instanceCreating if the operation creates a new IPMIProcess or routes
+    * @param defId if creatinga new IPMIProcess this is the def to clone
+    * to an existing IPMIProcess
+    * @return
+    */
+   public IPMDOperation createOnMessageOperation(String operationId, IStaticKey key, IPMDCorrelation corrl, 
+   	boolean instanceCreating, String defId);
+   
+   /**
+    * Create a recieve operation.
+    * @param operationId a unique operation identifier
+    * @param key the static key for the operation
+    * @param corrl the correlation for the operation
+    * @param instanceCreating if the operation creates a new IPMIProcess or routes
+    * @param defId if creatinga new IPMIProcess this is the def to clone
+    * to an existing IPMIProcess
+    * @return
+    */
+   public IPMDOperation createRecieveOperation(String operationId, IStaticKey key, IPMDCorrelation corrl, 
+   	boolean instanceCreating, String defId);
+   	
+   	/**
+   	 * Get all the instance creating operations.
+   	 * @return
+   	 */
+   	public Collection getInstanceCreatingOperations();
+   	
+   	/**
+   	 * Get a specific operation.
+   	 * @param operationId
+   	 * @return
+   	 */
+   	public IPMDOperation getOperation(String operationId);
+   	
+   	/**
+   	 * allows the definition to manage external action references
+   	 * 
+   	 * @param key
+   	 * @return
+   	 */
+	public IExternalAction getExternalAction(Object key);
+	public void putExternalAction(Object key, IExternalAction value);
+	public void clearExternalAction();
+	public Collection getMetaNonInstanceCreatingOperations();
+	
+	public void setProtectedInstantiation(boolean flag);
+	public boolean getProtectedInstantiation();
+   	
+   	/**
+   	 * Get the state of the definition
+   	 * @return
+   	 */
+   	public int getState();
+   	
+   	/**
+   	 * Set the state of the definition
+   	 * @param state
+   	 * @return
+   	 */
+   	public void setState(int state);
+   	
+    public boolean isActive();
+   	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDAction_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDAction_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDAction_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDAction_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+//import java.util.logging.Logger;
+
+import org.apache.ode.action.internal.ActionFactory;
+import org.apache.ode.action.internal.IInternalAction;
+import org.apache.ode.definition.IPMDAction;
+import org.apache.ode.definition.IPMDLocator;
+import org.apache.ode.definition.IPMDRoot;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.interaction.IInvocation;
+import org.apache.ode.interaction.builders.IInteractionBuilder;
+import org.apache.ode.util.BPException;
+
+/**
+ * @author waterman
+ *
+ * The in-memory implementation of IPMAction
+ * 
+ */
+public class PMDAction_SerialImpl implements IPMDAction, Serializable {
+    
+	static final long serialVersionUID = 1118925500981545331L;
+    	
+//	private static Logger logger = 
+//		Logger.getLogger(PMDAction_SerialImpl.class.getName());
+	
+	private String label;
+	private String description;
+	private String className;
+	private Properties props;
+	private HashMap locators;
+	private PMDRoot_SerialImpl root;
+	private transient IInternalAction actionImpl;
+	
+
+   PMDAction_SerialImpl(String label, String actionClass, PMDRoot_SerialImpl root) {
+
+	this.label = label;
+	this.className = actionClass;
+  	
+	props = new Properties();
+	locators = new HashMap();
+	this.root = root;
+  	 	
+   }
+   
+   public PMDAction_SerialImpl() {
+		
+   }
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDAction_Mutate#getActionClass()
+	 */
+	public String getActionClass() {
+		return className;
+	}
+	public void setActionClass(String name) {
+		className = name;
+		try {
+			if ( props != null && root != null && actionImpl == null ) {
+				actionImpl = ActionFactory.createAction(className,props,this);
+			}
+		} catch (BPException e) {
+			// do nothing
+		}	
+	}
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDAction_Mutate#setDescription(String)
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDAction_Mutate#getMetadata()
+	 */
+	public Properties getMetadata() {
+		return props;
+	}
+	public void setMetadata(Properties p) {
+		props = p;
+		
+		if ( className != null && root != null && actionImpl == null ) {
+			try {
+				actionImpl = ActionFactory.createAction(className,props,this);
+			} catch (BPException e) {
+				// do nothing
+			}	
+		}
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDAction_Mutate#addMetadata(String, String)
+	 */
+	public void addMetadata(String name, Object value)
+		throws DefinitionServiceException {
+			
+			props.put(name,value);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDAction_Mutate#createInputContainer(String, String, String)
+	 */
+	public IPMDLocator createLocator(
+		String name,
+		String path,
+		IInvocation query,
+		IInteractionBuilder builder,
+		int type, 
+		boolean forOutput,
+		boolean contentious)
+		throws DefinitionServiceException {
+			
+		IPMDLocator ret = new PMDLocator_SerialImpl(name,path,
+			query,builder,type,forOutput,contentious);
+			
+		locators.put(name,ret);
+		
+		return ret;
+	}
+	
+	public IPMDLocator getLocator(String name){
+		return (IPMDLocator)locators.get(name);
+	}
+	
+	public IPMDLocator addLocator(String name, IPMDLocator locatorObj){
+		locators.put(name,locatorObj);
+		return locatorObj;
+	}
+
+
+	/**
+	 * @see org.apache.ode.definition.IPMDAction#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDAction#getLabel()
+	 */
+	public String getLabel() {
+		return label;
+	}
+	public void setLabel(String label) {
+		this.label = label;
+	}
+	
+	/**
+	 * @see org.apache.ode.definition.IPMDAction#getActionImpl()
+	 */
+	public IInternalAction getActionImpl() throws BPException {
+		if ( actionImpl == null ) {
+			actionImpl = ActionFactory.createAction(className,props,this);
+			return actionImpl;
+		} else {
+			return actionImpl;
+		}	
+	}
+
+
+	
+	public HashMap getLocatorCollection() {
+		return locators;
+	}
+	public void setLocatorCollection(HashMap hm) {
+		locators = hm;
+	}
+	
+	public Iterator getLocators() {
+		return locators.values().iterator();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDLocatorHolder#getLocatorSize()
+	 */
+	public int getLocatorSize() {
+		return locators.size();
+	}
+	
+	public IPMDRoot getRoot() {
+		return root;
+	}
+	
+	public void setRoot(IPMDRoot root) {
+		this.root = (PMDRoot_SerialImpl)root;
+		try {
+			if ( props != null && className != null && actionImpl == null ) {
+				actionImpl = ActionFactory.createAction(className,props,this);
+			}
+		} catch (BPException e) {
+			// do nothing
+		}	
+	}
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDChangeCondition_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDChangeCondition_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDChangeCondition_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDChangeCondition_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,262 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Vector;
+//import java.util.logging.Logger;
+
+import org.apache.ode.condition.Conditional;
+import org.apache.ode.condition.ConditionalFactory;
+import org.apache.ode.definition.IPMDAction;
+import org.apache.ode.definition.IPMDChangeCondition;
+import org.apache.ode.definition.IPMDLocator;
+import org.apache.ode.definition.IPMDRoot;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.interaction.IInvocation;
+import org.apache.ode.interaction.builders.IInteractionBuilder;
+import org.apache.ode.util.BPException;
+
+/**
+ * @author waterman
+ *
+ * The in-memory implementation of PMDChangeCondition
+ * 
+ */
+public class PMDChangeCondition_SerialImpl implements IPMDChangeCondition, Serializable {
+	
+    static final long serialVersionUID = -8039881624470633713L;
+    
+//	private static Logger logger = 
+//		Logger.getLogger(PMDChangeCondition_SerialImpl.class.getName());
+
+	private String label;
+	private String description;
+	private String className;
+	private Properties props;
+	
+	private HashMap locators;
+	private Vector actions;
+	private Vector falseActions;
+	private PMDRoot_SerialImpl root;
+	
+	private transient Conditional conditionalImpl;
+
+   PMDChangeCondition_SerialImpl(java.lang.String label, java.lang.String conditionalClass, PMDRoot_SerialImpl root) throws DefinitionServiceException {
+
+	this.label = label;
+	className = conditionalClass;
+	
+	props = new Properties();
+	locators = new HashMap();
+	actions = new Vector();
+	falseActions = new Vector();
+	this.root = root;
+
+   }
+   
+   public PMDChangeCondition_SerialImpl() {
+		
+   }
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#getConditionalClass()
+	 */
+	public String getConditionalClass() {
+		return className;
+	}
+	public void setConditionalClass(String c) {
+		className = c;
+		try {
+			if ( props != null ) {
+				conditionalImpl = ConditionalFactory.createConditional(className,props);
+			}
+		} catch (BPException e) {
+			// do nothing	
+		}
+	}
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#getMetadata()
+	 */
+	public Properties getMetadata() {
+		return props;
+	}
+	public void setMetadata(Properties props) {
+		this.props = props;
+		if ( className != null ) {
+			try {
+				conditionalImpl = ConditionalFactory.createConditional(className,props);
+			} catch (BPException e) {
+				// do nothing
+			}	
+		}
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#createInputContainer(String, String, String)
+	 */
+	public IPMDLocator createLocator(
+		String name,
+		String path,
+		IInvocation query,
+		IInteractionBuilder builder,
+		int type, 
+		boolean forOutput,
+		boolean contentious)
+		throws DefinitionServiceException {
+		
+		IPMDLocator ret = new PMDLocator_SerialImpl(name,path,
+			query,builder,type,forOutput,contentious);
+		
+		locators.put(name,ret);
+			
+		return ret;
+	}
+	
+	public IPMDLocator getLocator(String name){
+		return (IPMDLocator)locators.get(name);
+	}
+	
+	public IPMDLocator addLocator(String name, IPMDLocator locatorObj){
+		locators.put(name,locatorObj);
+		return locatorObj;
+	}
+
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#createAction(String, String)
+	 */
+	public IPMDAction createAction(String label, String actionClass)
+		throws DefinitionServiceException {
+			
+		IPMDAction ret = new PMDAction_SerialImpl(label,actionClass,root);
+		actions.add(ret);
+		return ret;
+	}
+	
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#createFalseAction(String, String)
+	 */
+	public IPMDAction createFalseAction(String label, String actionClass)
+		throws DefinitionServiceException {
+			
+		IPMDAction ret = new PMDAction_SerialImpl(label,actionClass,root);
+		falseActions.add(ret);
+		return ret;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#addMetadata(String, String)
+	 */
+	public void addMetadata(String name, Object value)
+		throws DefinitionServiceException {
+			
+			props.put(name,value);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDChangeCondition_Mutate#setDescription(String)
+	 */
+	public void setDescription(String value) {
+		description = value;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDChangeCondition#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDChangeCondition#getLabel()
+	 */
+	public String getLabel() {
+		return label;
+	}
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDChangeCondition#getActions()
+	 */
+	public Iterator getActions() {
+		return actions.iterator();
+	}
+	
+	/**
+	 * @see org.apache.ode.definition.IPMDChangeCondition#getActions()
+	 */
+	public Iterator getFalseActions() {
+		return falseActions.iterator();
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDChangeCondition#getConditionalImpl()
+	 */
+	public Conditional getConditionalImpl() throws BPException {
+		if ( conditionalImpl == null ) {
+			conditionalImpl = ConditionalFactory.createConditional(className,props);
+			return conditionalImpl;
+		} else {
+			return conditionalImpl;
+		}		
+	}
+	
+	
+	
+	public HashMap getLocatorCollection() {
+		return locators;
+	}
+	public void setLocatorCollection(HashMap hm) {
+		locators = hm;
+	}
+	
+	
+	public Vector getActionCollection() {
+		return actions;
+	}
+	public void setActionCollection(Vector v) {
+		actions = v;
+	}
+	
+	public Iterator getLocators() {
+		return locators.values().iterator();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDLocatorHolder#getLocatorSize()
+	 */
+	public int getLocatorSize() {
+		return locators.size();
+	}
+	
+	public IPMDRoot getRoot() {
+		return root;
+	}
+	
+	public void setRoot(IPMDRoot root) {
+		this.root = (PMDRoot_SerialImpl)root;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSetDef_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSetDef_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSetDef_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSetDef_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 22, 2003
+ *
+ */
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.ode.definition.IPMDCorrelationSetDef;
+
+/**
+ * @author charper
+ *
+ */
+public class PMDCorrelationSetDef_SerialImpl implements IPMDCorrelationSetDef, Serializable {
+	
+    static final long serialVersionUID = -1904654339647957485L;
+	
+	public PMDCorrelationSetDef_SerialImpl(){}
+	
+	private ArrayList partQueries;
+	private String name;
+	
+	public PMDCorrelationSetDef_SerialImpl( String name, ArrayList partQueries ){
+		this.name = name;
+		this.partQueries = partQueries;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSetDef#getPartQueries()
+	 */
+	public Collection getPartQueries() {
+		return partQueries;
+	}
+
+	/**
+	 * @param list
+	 */
+	public void setPartQueries(Collection list) {
+		partQueries = (ArrayList)list;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSetDef#getName()
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setName(String string) {
+		name = string;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSet_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSet_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSet_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelationSet_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 22, 2003
+ *
+ */
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+import org.apache.ode.definition.IPMDCorrelationSet;
+import org.apache.ode.definition.IPMDCorrelationSetDef;
+
+/**
+ * @author charper
+ *
+ */
+public class PMDCorrelationSet_SerialImpl implements IPMDCorrelationSet, Serializable {
+	
+    static final long serialVersionUID = 3877545268892122477L;
+	
+	public PMDCorrelationSet_SerialImpl(){}
+	
+	private boolean isInstantiating;
+	private String pattern;
+	private IPMDCorrelationSetDef correlationSetDef;
+	
+	public PMDCorrelationSet_SerialImpl(IPMDCorrelationSetDef correlationSetDef,
+		boolean isInstantiating, String pattern){
+			this.correlationSetDef = correlationSetDef;
+			this.isInstantiating = isInstantiating;
+			this.pattern = pattern;
+		}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSet#isInstantiating()
+	 */
+	public boolean isInstantiating() {
+		return isInstantiating;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSet#getPattern()
+	 */
+	public String getPattern() {
+		return pattern;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSetDef#getPartQueries()
+	 */
+	public Collection getPartQueries() {
+		return correlationSetDef.getPartQueries();
+	}
+
+	/**
+	 * @return
+	 */
+	public IPMDCorrelationSetDef getCorrelationSetDef() {
+		return correlationSetDef;
+	}
+
+	/**
+	 * @param def
+	 */
+	public void setCorrelationSetDef(IPMDCorrelationSetDef def) {
+		correlationSetDef = def;
+	}
+
+	/**
+	 * @param b
+	 */
+	public void setInstantiating(boolean b) {
+		isInstantiating = b;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setPattern(String string) {
+		pattern = string;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelationSetDef#getName()
+	 */
+	public String getName() {
+		return correlationSetDef.getName();
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelation_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelation_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelation_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDCorrelation_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 22, 2003
+ *
+ */
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.ode.definition.IPMDCorrelation;
+import org.apache.ode.definition.IPMDCorrelationSetDef;
+
+/**
+ * @author charper
+ *
+ */
+public class PMDCorrelation_SerialImpl implements IPMDCorrelation, Serializable {
+	
+    static final long serialVersionUID = -8377620704085473024L;
+
+	public PMDCorrelation_SerialImpl() {
+	}
+
+	public PMDCorrelation_SerialImpl(String corrleationId) {
+		this.correlationId = corrleationId;
+		correlationSets = new ArrayList();
+	}
+
+	private ArrayList correlationSets;
+	private String correlationId;
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelation#addCorrelationSet(org.apache.ode.definition.service.IPMDCorrelationSetDef, boolean, java.lang.String)
+	 */
+	public void addCorrelationSet(
+		IPMDCorrelationSetDef corlSet,
+		boolean instantiating,
+		String pattern) {
+
+		correlationSets.add(
+			new PMDCorrelationSet_SerialImpl(corlSet, instantiating, pattern));
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDCorrelation#getCorrelationSets()
+	 */
+	public Collection getCorrelationSets() {
+		return correlationSets;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getCorrelationId() {
+		return correlationId;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setCorrelationId(String string) {
+		correlationId = string;
+	}
+	/**
+	 * @param list
+	 */
+	public void setCorrelationSets(Collection list) {
+		correlationSets = (ArrayList)list;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDLocator_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDLocator_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDLocator_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDLocator_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Properties;
+//import java.util.logging.Logger;
+
+import org.apache.ode.definition.IPMDLocator;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.interaction.IInvocation;
+import org.apache.ode.interaction.builders.IInteractionBuilder;
+
+/**
+ * @author waterman
+ *
+ * The in-memory implementation of IPMDContainer
+ * 
+ */
+public class PMDLocator_SerialImpl implements IPMDLocator, Serializable{
+	
+    static final long serialVersionUID = 1645636091619324193L;
+    
+//	private static Logger logger = 
+//		Logger.getLogger(PMDLocator_SerialImpl.class.getName());
+	
+	private String path;
+	private IInvocation query;
+	private IInteractionBuilder intBuilder;
+	private int type;
+	private boolean contentious;
+	private boolean forOutput;
+	private boolean forInput;
+	private String name;
+	private Properties props;
+	private boolean isAbsolute;
+	private ArrayList ALpath;
+
+   PMDLocator_SerialImpl(String name, String path,IInvocation query, IInteractionBuilder builder, int type,
+	boolean forOutput, boolean contentious ) throws DefinitionServiceException {
+
+	this.name = name;
+	//this.path = path;
+	setPath(path);
+	this.query = query;
+	this.type = type;
+	this.forOutput = forOutput;
+	this.forInput = !forOutput;
+	this.contentious = contentious;
+	this.intBuilder = builder;
+	props = new Properties();
+  	
+   }
+   
+   public PMDLocator_SerialImpl() {
+		
+   }
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDContainer_Mutate#addProperty(String, String)
+	 */
+	public void addProperty(String name, String value)
+		throws DefinitionServiceException {
+			props.setProperty(name,value);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDContainer#getContainerName()
+	 */
+	public String getPath() {
+		return path;
+	}
+	public void setPath(String path){
+		this.path = path;
+		int startIndx = 0;
+		
+		ALpath = new ArrayList();
+		String [] pathArray = path.split("/");
+		
+		if ( path.startsWith("/") ) {
+			isAbsolute = true;
+			startIndx = 1;
+		} else {
+			isAbsolute = false;
+		}
+		
+		for ( int i = startIndx; i < pathArray.length ; i++ ){
+			ALpath.add(pathArray[i]);
+		}
+	}
+	/**
+	 * @see org.apache.ode.definition.service.IPMDContainer#getPartName()
+	 */
+	public IInvocation getQuery() {
+		return query;
+	}
+	public void setQuery(IInvocation query) {
+		this.query = query;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDContainer#getProperties()
+	 */
+	public Properties getProperties() {
+		
+		return props;
+	}
+	public void setProperties (Properties p){
+		props = p;
+	}
+	
+	public int getType() {
+		return type;
+	}
+	public void setType(int type) {
+		this.type = type;
+	}
+	
+	public boolean getContentious() {
+		return contentious;
+	}
+	
+	public void setContentious(boolean contentious) {
+		this.contentious = contentious;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+	
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public boolean getForOutput(){
+		return this.forOutput;
+	}
+	
+	public boolean getForInput() {
+		return this.forInput;
+	}
+	
+	public void setForOutput(boolean forOutput){
+		this.forOutput = forOutput;
+		if ( !forInput ) {
+			forInput = !forOutput;
+		}
+	}
+	
+	public void setForInput(boolean forInput) {
+		this.forInput = forInput;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDLocator#getInteractionBuilder()
+	 */
+	public IInteractionBuilder getInteractionBuilder() {
+		return intBuilder;
+	}
+	public void setInteractionBuilder(IInteractionBuilder builder) {
+		intBuilder = builder;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDLocator#isAbsolute()
+	 */
+	public boolean isAbsolute() {
+		return isAbsolute;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDLocator#getArrayListPath()
+	 */
+	public ArrayList getArrayListPath() {
+		return ALpath;
+	}
+	
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDOperation_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDOperation_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDOperation_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDOperation_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/*
+ * Created on Aug 22, 2003
+ *
+ */
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+
+import org.apache.ode.definition.IPMDCorrelation;
+import org.apache.ode.definition.IPMDOperation;
+import org.apache.ode.event.IStaticKey;
+
+/**
+ * @author charper
+ *
+ */
+public class PMDOperation_SerialImpl implements IPMDOperation, Serializable {
+	
+    static final long serialVersionUID = 3842424938795408906L;
+	
+	private IStaticKey key;
+	private IPMDCorrelation correlation;
+	private boolean instanceCreating;
+	private String rootDefId;
+	private String operationId;
+	private String defId;
+	
+	public PMDOperation_SerialImpl(){}
+	
+	public PMDOperation_SerialImpl(IStaticKey key, IPMDCorrelation correlation,
+		boolean instanceCreating, String rootDefId, String defId, String operationId){
+		this.correlation = correlation;
+		this.key = key;
+		this.instanceCreating = instanceCreating;
+		this.rootDefId = rootDefId;
+		this.operationId = operationId;
+		this.defId = defId;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDOperation#getCorrelation()
+	 */
+	public IPMDCorrelation getCorrelation() {
+		return correlation;
+	}
+
+	/**
+	 * @return
+	 */
+	public IStaticKey getKey() {
+		return key;
+	}
+
+	/**
+	 * @param correlation
+	 */
+	public void setCorrelation(IPMDCorrelation correlation) {
+		this.correlation = correlation;
+	}
+
+	/**
+	 * @param key
+	 */
+	public void setKey(IStaticKey key) {
+		this.key = key;
+	}
+
+	/**
+	 * @return
+	 */
+	public boolean isInstanceCreating() {
+		return instanceCreating;
+	}
+
+	/**
+	 * @param b
+	 */
+	public void setInstanceCreating(boolean b) {
+		instanceCreating = b;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getRootDefId() {
+		return rootDefId;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setRootDefId(String string) {
+		rootDefId = string;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getOperationId() {
+		return operationId;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setOperationId(String string) {
+		operationId = string;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getDefId() {
+		return defId;
+	}
+
+	/**
+	 * @param string
+	 */
+	public void setDefId(String string) {
+		defId = string;
+	}
+	
+	
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object arg0) {
+		if ( arg0 instanceof PMDOperation_SerialImpl ) {
+			PMDOperation_SerialImpl op = (PMDOperation_SerialImpl)arg0;
+			if ( op.getOperationId().equals(this.getOperationId())) {
+				return true;
+			} else {
+				return false;
+			}
+		} else {
+			return false;
+		}
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDProcess_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDProcess_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDProcess_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDProcess_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Vector;
+//import java.util.logging.Logger;
+
+import org.apache.ode.definition.IPMDChangeCondition;
+import org.apache.ode.definition.IPMDProcess;
+import org.apache.ode.definition.IPMDRoot;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.engine.ProcessDefinitionKey;
+import org.apache.ode.uuid.UUIDService;
+
+/**
+ * @author waterman
+ *
+ * The in-memory implementation of PMDProcess
+ * 
+ */
+public class PMDProcess_SerialImpl implements IPMDProcess, Serializable {
+	
+    static final long serialVersionUID = 5087682783809845033L;
+	
+//	private static Logger logger = 
+//		Logger.getLogger(PMDProcess_SerialImpl.class.getName());
+	
+	private ProcessDefinitionKey key;
+	private PMDRoot_SerialImpl root;
+	private String label;
+	private String description;
+	private Vector changeConditions;
+	private Vector observers;
+	private PMDChangeCondition_SerialImpl preCondition;
+	transient private UUIDService us;
+
+
+	public PMDProcess_SerialImpl(java.lang.String label, PMDRoot_SerialImpl root, UUIDService us) throws DefinitionServiceException
+   {
+	  key = new ProcessDefinitionKey(us);
+      
+	  this.root = root;
+	  this.label = label;
+	  this.us = us;
+	  changeConditions = new Vector();
+	  observers = new Vector();
+ 	  
+	  // Every time a process is created it needs to be added to the indexing map
+	  root.getProcessIndex().put(key,this);
+   }
+   
+   public PMDProcess_SerialImpl() {
+	 
+   }
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#getKey()
+	 */
+	public ProcessDefinitionKey getKey() {
+		return key;
+	}
+	public void setKey (ProcessDefinitionKey key) {
+		this.key = key;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#setDescription(String)
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#createChangeCondition(String, String)
+	 */
+	public IPMDChangeCondition createChangeCondition(
+		String label,
+		String conditionalClass)
+		throws DefinitionServiceException {
+			
+		IPMDChangeCondition ret = new PMDChangeCondition_SerialImpl(label,conditionalClass,root);
+		changeConditions.add(ret);
+		
+		return ret;
+	}
+	
+	public void addChangeCondition(IPMDChangeCondition cc) {
+		changeConditions.add(cc);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#createPrecondition(String, String)
+	 */
+	public IPMDChangeCondition createPrecondition(
+		String label,
+		String conditionalClass)
+		throws DefinitionServiceException {
+			
+		preCondition = new PMDChangeCondition_SerialImpl(label,conditionalClass,root);
+		return preCondition;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#addObserverProcessPC(IPMDProcess_Mutate)
+	 */
+	public void addObserverProcessPC(IPMDProcess process)
+		throws DefinitionServiceException {
+		
+		observers.add(process);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#createSubProcess(String, ProcessDefinitionKey)
+	 */
+	public IPMDProcess createSubProcess(String label)
+		throws DefinitionServiceException {
+			
+		IPMDProcess ret = new PMDProcess_SerialImpl(label,root,us);
+		observers.add(ret);
+		return ret;
+	}
+	
+	public IPMDProcess createUnLinkedProcess(String label)
+		throws DefinitionServiceException {
+			
+		return new PMDProcess_SerialImpl(label,root,us);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDProcess_Mutate#getSubProcesses()
+	 */
+	public Collection getSubProcesses() throws DefinitionServiceException {
+		return observers;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getLabel()
+	 */
+	public String getLabel() {
+		return label;
+	}
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getVersion()
+	 */
+	public String getVersion() {
+		return null;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getRootKey()
+	 */
+	public ProcessDefinitionKey getRootKey() {
+		return root.getProcess().getKey();
+	}
+	
+	public IPMDRoot getRoot() {
+		return root;
+	}
+	public void setRoot(IPMDRoot root) {
+		this.root = (PMDRoot_SerialImpl)root;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getChangeConditions()
+	 */
+	public Iterator getChangeConditions() {
+		return changeConditions.iterator();
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getPrecondition()
+	 */
+	public IPMDChangeCondition getPrecondition() {
+		return preCondition;
+	}
+	public void setPrecondition(IPMDChangeCondition preCond) {
+		preCondition = (PMDChangeCondition_SerialImpl)preCond;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDProcess#getObserverProcessPC()
+	 */
+	public Iterator getObserverProcessPC() {
+		return observers.iterator();
+	}
+	
+	public Vector getObserverCollection() {
+		return observers;
+	}
+	public void setObserverCollection(Vector v) {
+		observers = v;
+	}
+	
+	public Vector getCCCollection(){
+		return changeConditions;
+	}
+	public void setCCCollection(Vector v) {
+		changeConditions = v;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDRoot_SerialImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDRoot_SerialImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDRoot_SerialImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/definition/serialimpl/PMDRoot_SerialImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,420 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package org.apache.ode.definition.serialimpl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+//import java.util.logging.Logger;
+
+import org.apache.ode.action.external.IExternalAction;
+import org.apache.ode.definition.IPMDCorrelation;
+import org.apache.ode.definition.IPMDCorrelationSetDef;
+import org.apache.ode.definition.IPMDOperation;
+import org.apache.ode.definition.IPMDProcess;
+import org.apache.ode.definition.IPMDRoot;
+import org.apache.ode.definition.service.DefinitionServiceException;
+import org.apache.ode.definition.service.unmanaged.DefinitionStateCache;
+import org.apache.ode.definition.service.unmanaged.DefinitionStateEnum;
+import org.apache.ode.engine.ProcessDefinitionKey;
+import org.apache.ode.event.IStaticKey;
+import org.apache.ode.uuid.UUIDService;
+
+/**
+ * @author waterman
+ *
+ * An in-memory implementation of IPMDRoot. 
+ * 
+ */
+public class PMDRoot_SerialImpl implements IPMDRoot, Serializable {
+
+    static final long serialVersionUID = -6876388314218052261L;
+    
+//	private static Logger logger = 
+//		Logger.getLogger(PMDRoot_SerialImpl.class.getName());
+
+	private ProcessDefinitionKey key;
+	private String label;
+	private String version;
+	private boolean state_type;
+	private boolean protectedInstantiation;
+	private String description;
+	protected PMDProcess_SerialImpl process;
+	transient protected UUIDService us;
+	private ArrayList instaceCreatingOperations;
+	private ArrayList metaNonInstanceCreatingOperations;
+	private ArrayList operations;
+	private HashMap operationHash;
+	private ArrayList correlationSetDefs;
+	private HashMap actionHash;
+	private DefinitionStateEnum state = DefinitionStateEnum.ACTIVE;
+	
+	private transient Hashtable definitions;
+	private transient Hashtable newDefinitions;
+	
+	private HashMap supportingDocs = new HashMap();
+	
+	// This hashmap is used as an index into the business process definition graph. 
+	private HashMap processIndex;
+
+	public PMDRoot_SerialImpl(
+		java.lang.String label,
+		java.lang.String version,
+		boolean stateless,
+		UUIDService us,
+		Hashtable definitions,
+		Hashtable newDefinitions)
+		throws DefinitionServiceException {
+
+		key = new ProcessDefinitionKey(us);
+
+		this.label = label;
+		this.version = version;
+		this.state_type = stateless;
+		this.us = us;
+		this.definitions = definitions;
+		this.newDefinitions = newDefinitions;
+		this.operations = new ArrayList();
+		processIndex = new HashMap();
+		this.operationHash = new HashMap();
+		this.correlationSetDefs = new ArrayList();
+		this.instaceCreatingOperations = new ArrayList();
+		this.metaNonInstanceCreatingOperations = new ArrayList();
+		this.actionHash = new HashMap();
+	}
+	
+	public PMDRoot_SerialImpl() {
+		this.operations = new ArrayList();
+		processIndex = new HashMap();
+		this.operationHash = new HashMap();
+		this.correlationSetDefs = new ArrayList();
+		this.instaceCreatingOperations = new ArrayList();
+		this.metaNonInstanceCreatingOperations = new ArrayList();
+		this.actionHash = new HashMap();
+	}
+
+
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDRoot_Mutate#getProcess()
+	 */
+	public IPMDProcess getProcess() {
+		return process;
+	}
+	public void setProcess(IPMDProcess process) {
+		this.process = (PMDProcess_SerialImpl)process;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.service.IPMDRoot_Mutate#createProcess(String, ProcessDefinitionKey)
+	 */
+	public IPMDProcess createProcess(String label)
+		throws DefinitionServiceException {
+			
+		process = new PMDProcess_SerialImpl(label,this,us);	
+		
+		// index the definitions via the root process key
+		definitions.put(process.getKey(),this);
+		newDefinitions.put(process.getKey(),this);
+		
+		return process;
+		
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getKey()
+	 */
+	public ProcessDefinitionKey getKey() {
+
+		return key;
+
+	}
+	public void setKey (ProcessDefinitionKey key) {
+		this.key = key;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getLabel()
+	 */
+	public String getLabel() {
+		return label;
+	}
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getVersion()
+	 */
+	public String getVersion() {
+		return version;
+	}
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+	/**
+	 * @see org.apache.ode.definition.service.IPMDRoot_Mutate#setDescription(String)
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getIsStateless()
+	 */
+	public boolean getIsStateless() {
+		return state_type;
+	}
+	public void setIsStateless(boolean state) {
+		state_type = state;
+	}
+	
+	/**
+	 * Get the process index collection. The process index collection allows searches for
+	 * PMDProcess instances based on DefinitionKeys.
+	 */
+	public HashMap getProcessIndex() {
+		return processIndex;
+	}
+	public void setProcessIndex(HashMap index) {
+		processIndex = index;
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#addSupportingDocument(java.lang.String, byte[])
+	 */
+	public void addSupportingDocument(String key, String supportDoc) {
+		supportingDocs.put(key,supportDoc);
+	}
+
+	/**
+	 * @see org.apache.ode.definition.IPMDRoot#getSupportingDocument(java.lang.String)
+	 */
+	public String getSupportingDocument(String key) {
+		return (String)supportingDocs.get(key);
+	}
+	
+	
+	public HashMap getSupportingDocuments() {
+		return supportingDocs;
+	}
+	
+
+	public void setSupportingDocuments(HashMap docs) {
+		supportingDocs = docs;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#addInstaceCreatingOperation(org.apache.ode.definition.service.IPMDOperation)
+	 */
+	public void addInstanceCreatingOperation(IPMDOperation op) {
+		this.instaceCreatingOperations.add(op);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#createCorrelationSet(java.lang.String, java.util.ArrayList)
+	 */
+	public IPMDCorrelationSetDef createCorrelationSet(String name, ArrayList partQueries) {
+		PMDCorrelationSetDef_SerialImpl def = 
+			new PMDCorrelationSetDef_SerialImpl(name,partQueries);
+		this.correlationSetDefs.add(def);
+		return def;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#createCorrelation(java.lang.String)
+	 */
+	public IPMDCorrelation createCorrelation(String name) {
+		PMDCorrelation_SerialImpl cor = new PMDCorrelation_SerialImpl(name);
+		return cor;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#createOperation(org.apache.ode.event.IStaticKey, org.apache.ode.definition.service.IPMDCorrelation, boolean)
+	 */
+	public IPMDOperation createOperation(String operationId, IStaticKey key, 
+		IPMDCorrelation corrl, boolean instanceCreating, String defId) {
+		PMDOperation_SerialImpl op = 
+			new PMDOperation_SerialImpl(key,corrl,instanceCreating,this.getProcess().getKey().getValue(), defId,operationId);
+		this.operations.add(op);
+		this.operationHash.put(operationId,op);
+		return op;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#getInstaceCreatingOperations()
+	 */
+	public Collection getInstanceCreatingOperations() {
+		return this.instaceCreatingOperations;
+	}
+
+	/**
+	 * @return
+	 */
+	public ArrayList getCorrelationSetDefs() {
+		return correlationSetDefs;
+	}
+
+	/**
+	 * @return
+	 */
+	public ArrayList getOperations() {
+		return operations;
+	}
+
+	/**
+	 * @param list
+	 */
+	public void setCorrelationSetDefs(ArrayList list) {
+		correlationSetDefs = list;
+	}
+
+	/**
+	 * @param list
+	 */
+	public void setInstaceCreatingOperations(Collection list) {
+		instaceCreatingOperations = (ArrayList)list;
+	}
+
+	/**
+	 * @param list
+	 */
+	public void setOperations(ArrayList list) {
+		operations = list;
+		if ( list != null ) {
+			Iterator it = list.iterator();
+			while (it.hasNext()){
+				IPMDOperation op = (IPMDOperation)it.next();
+				this.operationHash.put(op.getOperationId(),op);
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#getOperation(java.lang.String)
+	 */
+	public IPMDOperation getOperation(String operationId) {
+		if ( operationHash.size() != operations.size() ) {
+			setOperations(operations);
+		}
+		return (IPMDOperation)operationHash.get(operationId);
+	}
+	
+	public IExternalAction getExternalAction(Object key) {
+		return (IExternalAction)actionHash.get(key);
+	}
+	public void putExternalAction(Object key, IExternalAction value) {
+		actionHash.put(key,value);
+	}
+	public void clearExternalAction() {
+		for ( Iterator itr = actionHash.values().iterator(); itr.hasNext();) {
+			IExternalAction iea = (IExternalAction)itr.next();
+			iea.release();
+		}
+		actionHash.clear();
+	}
+
+	private IPMDOperation createMetaNonInstOp(String operationId, IStaticKey key, IPMDCorrelation corrl, boolean instanceCreating, String defId) {
+		IPMDOperation op = createOperation(operationId, key, corrl, instanceCreating, defId);
+		metaNonInstanceCreatingOperations.add(op);
+		return op;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#createOnMessageOperation(java.lang.String, org.apache.ode.event.IStaticKey, org.apache.ode.definition.service.IPMDCorrelation, boolean, java.lang.String)
+	 */
+	public IPMDOperation createOnMessageOperation(String operationId, IStaticKey key, IPMDCorrelation corrl, boolean instanceCreating, String defId) {
+		return createMetaNonInstOp(operationId, key, corrl, instanceCreating, defId);
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#createRecieveOperation(java.lang.String, org.apache.ode.event.IStaticKey, org.apache.ode.definition.service.IPMDCorrelation, boolean, java.lang.String)
+	 */
+	public IPMDOperation createRecieveOperation(String operationId, IStaticKey key, IPMDCorrelation corrl, boolean instanceCreating, String defId) {
+		return createMetaNonInstOp(operationId, key, corrl, instanceCreating, defId);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#getMetaNonInstanceCreatingOperations()
+	 */
+	public Collection getMetaNonInstanceCreatingOperations() {
+		return this.metaNonInstanceCreatingOperations;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#setProtectedInstantiation(boolean)
+	 */
+	public void setProtectedInstantiation(boolean flag) {
+		protectedInstantiation = flag;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#getProtectedInstantiation()
+	 */
+	public boolean getProtectedInstantiation() {
+		return protectedInstantiation;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#getState()
+	 */
+	public int getState() 
+	{
+	    DefinitionStateEnum returnState = 
+	        DefinitionStateCache.getState(key);
+	    if ( returnState == null )
+	    {
+	        returnState = this.state;
+	        DefinitionStateCache.setState(key, returnState);
+	    }
+	    else
+	    {
+	        this.state = returnState;
+	    }
+		return returnState.intValue();
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.ode.definition.service.IPMDRoot#setState(int)
+	 */
+	public void setState(int state) {
+		this.state = DefinitionStateEnum.getState(state);
+		DefinitionStateCache.setState(key, this.state);
+	}
+
+    public boolean isActive()
+    {
+        if ( getState() == DefinitionStateEnum.ACTIVE.intValue() )
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+}