You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/09/20 19:30:36 UTC

svn commit: r1388121 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client/impl/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/ commons...

Author: samindaw
Date: Thu Sep 20 17:30:35 2012
New Revision: 1388121

URL: http://svn.apache.org/viewvc?rev=1388121&view=rev
Log:
refactoring class names & updating airavata API to reflect the new experiment data structure

Added:
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java
      - copied, changed from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java
      - copied, changed from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java
      - copied, changed from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java
Removed:
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java
Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
    airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java (original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ProvenanceManager.java Thu Sep 20 17:30:35 2012
@@ -25,15 +25,15 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.airavata.registry.api.workflow.ExperimentData;
+import org.apache.airavata.registry.api.workflow.ExperimentMetadata;
+import org.apache.airavata.registry.api.workflow.ExperimentName;
+import org.apache.airavata.registry.api.workflow.ExperimentUser;
 import org.apache.airavata.registry.api.workflow.WorkflowInstance;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceName;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceUser;
 
 /**
  * This interface provide and API to manage all the provenance related methods, get Workflow inputs outputs
@@ -45,7 +45,7 @@ public interface ProvenanceManager {
      * @param data
      * @throws AiravataAPIInvocationException
      */
-	public void addWorkflowInstanceNodeInputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
+	public void setWorkflowInstanceNodeInput(WorkflowInstanceNode node, String data) throws AiravataAPIInvocationException;
 
     /**
      * Add input port data for a node in a running instance of a Workflow
@@ -55,14 +55,14 @@ public interface ProvenanceManager {
      * @param data
      * @throws AiravataAPIInvocationException
      */
-	public void addWorkflowInstanceNodeInputData(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
+	public void setWorkflowInstanceNodeInput(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
 
     /**
      * Add output port data for a node in a running instance of a Workflow
      * @param data
      * @throws AiravataAPIInvocationException
      */
-	public void addWorkflowInstanceNodeOutputData(WorkflowInstanceNodePortData data) throws AiravataAPIInvocationException;
+	public void setWorkflowInstanceNodeOutput(WorkflowInstanceNode node, String data) throws AiravataAPIInvocationException;
 
     /**
      * Add output port data for a node in a running instance of a Workflow
@@ -72,7 +72,7 @@ public interface ProvenanceManager {
      * @param data
      * @throws AiravataAPIInvocationException
      */
-	public void addWorkflowInstanceNodeOutputData(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
+	public void setWorkflowInstanceNodeOutput(String experimentId, String workflowInstanceId, String nodeId, String data) throws AiravataAPIInvocationException;
 
     /**
      * Get data of input ports of a node in a running instance of a Workflow
@@ -80,7 +80,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
+	public String getWorkflowInstanceNodeInput(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
 
     /**
      * Get data of input ports of a node in a running instance of a Workflow
@@ -90,7 +90,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
+	public String getWorkflowInstanceNodeInput(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
      * Get data of input ports of a node in all the running instance of a particular Workflow template
@@ -99,7 +99,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeInputData(String workflowTemplateId, String nodeId) throws AiravataAPIInvocationException;
+	public Map<WorkflowInstanceNode,String> getWorkflowInstanceNodeInput(String workflowTemplateId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
      * Get data of output ports of a node in a running instance of a Workflow
@@ -107,7 +107,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
+	public String getWorkflowInstanceNodeOutput(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
 
     /**
      * Get data of output ports of a node in a running instance of a Workflow
@@ -117,7 +117,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
+	public String getWorkflowInstanceNodeOutput(String experimentId, String workflowInstanceId, String nodeId) throws AiravataAPIInvocationException;
 
     /**
      * Get data of output ports of a node in all the running instance of a particular Workflow template
@@ -126,7 +126,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeOutputData(String workflowName, String nodeId) throws AiravataAPIInvocationException;
+	public Map<WorkflowInstanceNode,String> getWorkflowInstanceNodeOutput(String workflowName, String nodeId) throws AiravataAPIInvocationException;
 
     /**
      * Update the status of the Workflow instance
@@ -164,35 +164,25 @@ public interface ProvenanceManager {
     /**
      * Update the User of the Workflow instance
      * @param experimentId
-     * @param workflowInstanceId
      * @param user
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceUser(String experimentId, String workflowInstanceId, String user) throws AiravataAPIInvocationException;
+	public void setExperimentUser(String experimentId, String user) throws AiravataAPIInvocationException;
 
     /**
      * Update the User of the Workflow instance
      * @param user
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceUser(WorkflowInstanceUser user) throws AiravataAPIInvocationException;
+	public void setExperimentUser(ExperimentUser user) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve the User of the Workflow instance
      * @param experimentId
-     * @param workflowInstanceId
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public WorkflowInstanceUser getWorkflowInstanceUser(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
-
-    /**
-     * Retrieve the User of the Workflow instance
-     * @param workflowInstance
-     * @return
-     * @throws AiravataAPIInvocationException
-     */
-	public WorkflowInstanceUser getWorkflowInstanceUser(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	public ExperimentUser getExperimentUser(String experimentId) throws AiravataAPIInvocationException;
 
     /**
      * Update the metadata of the Workflow instance
@@ -201,64 +191,45 @@ public interface ProvenanceManager {
      * @param metadata
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceMetadata(String experimentId, String workflowInstanceId, String metadata) throws AiravataAPIInvocationException;
+	public void setExperimentMetadata(String experimentId, String metadata) throws AiravataAPIInvocationException;
 
     /**
      * Update the metadata of the Workflow instance
-     * @param instanceMetadata
+     * @param experimentMetadata
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceMetadata(WorkflowInstanceMetadata instanceMetadata) throws AiravataAPIInvocationException;
+	public void setExperimentMetadata(ExperimentMetadata experimentMetadata) throws AiravataAPIInvocationException;
 	
     /**
      * Retrieve the metadata of the Workflow instance
      * @param experimentId
-     * @param workflowInstanceId
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
-
-    /**
-     * Retrieve the metadata of the Workflow instance
-     * @param workflowInstance
-     * @return
-     * @throws AiravataAPIInvocationException
-     */
-	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	public ExperimentMetadata getExperimentMetadata(String experimentId) throws AiravataAPIInvocationException;
 
 	   /**
      * Update the instance name of the Workflow
      * @param experimentId
-     * @param workflowInstanceId
      * @param instanceName
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceName(String experimentId, String workflowInstanceId, String instanceName) throws AiravataAPIInvocationException;
+	public void setExperimentName(String experimentId, String instanceName) throws AiravataAPIInvocationException;
 
     /**
      * Update the instance name of the Workflow
-     * @param instanceName
+     * @param experimentName
      * @throws AiravataAPIInvocationException
      */
-	public void setWorkflowInstanceName(WorkflowInstanceName instanceName) throws AiravataAPIInvocationException;
+	public void setExperimentName(ExperimentName experimentName) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve the metadata of the Workflow instance
      * @param experimentId
-     * @param workflowInstanceId
-     * @return
-     * @throws AiravataAPIInvocationException
-     */
-	public WorkflowInstanceName getWorkflowInstanceName(String experimentId, String workflowInstanceId) throws AiravataAPIInvocationException;
-
-    /**
-     * Retrieve the metadata of the Workflow instance
-     * @param workflowInstance
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public WorkflowInstanceName getWorkflowInstanceName(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	public ExperimentName getExperimentName(String experimentId) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve the id's of all the experiments run by the given owner  
@@ -266,21 +237,21 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<String> getExperiments(String owner) throws AiravataAPIInvocationException;
+	public List<String> getExperimentIdList(String owner) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve the id's of all the experiments run by the current user
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<String> getExperiments() throws AiravataAPIInvocationException;
+	public List<String> getExperimentIdList() throws AiravataAPIInvocationException;
 
     /**
      * Retrieve all the experiments run by the current user
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<ExperimentData> getWorkflowExperimentData() throws AiravataAPIInvocationException;
+	public List<ExperimentData> getWorkflowExperimentDataList() throws AiravataAPIInvocationException;
 
     /**
      * Retrieve all the experiments run by the given owner
@@ -288,7 +259,7 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public List<ExperimentData> getWorkflowExperimentData(String user) throws AiravataAPIInvocationException;
+	public List<ExperimentData> getWorkflowExperimentDataList(String user) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve all the experiment data run by the given owner with paging
@@ -300,6 +271,16 @@ public interface ProvenanceManager {
      */
 	public List<ExperimentData> getWorkflowExperimentData(String user, int pageSize, int pageNo) throws AiravataAPIInvocationException;
 
+	/**
+     * Retrieve all the experiment data run by the given owner with paging
+     * @param user
+     * @param pageSize
+     * @param pageNo
+     * @return
+     * @throws AiravataAPIInvocationException
+     */
+	public ExperimentData getWorkflowExperimentData(String experimentId) throws AiravataAPIInvocationException;
+	
     /**
      * Retrieve experiment data for a given workflow instance
      * @param experimentId
@@ -315,13 +296,28 @@ public interface ProvenanceManager {
      * @return
      * @throws AiravataAPIInvocationException
      */
-	public WorkflowInstanceData getWorkflowIsntanceData(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	public WorkflowInstanceData getWorkflowInstanceData(WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
 
     /**
      * Retrieve output node names of a experiment
      * @param experimentId
+     * @deprecated
      * @return
      * @throws AiravataAPIInvocationException
      */
 	public String[] getWorkflowExecutionOutputNames(String experimentId) throws AiravataAPIInvocationException;
+	
+	public void setWorkflowInstanceNodeStatus(String experimentId, String workflowInstaceId, String nodeId, ExecutionStatus status) throws AiravataAPIInvocationException;
+	
+	public void setWorkflowInstanceNodeStatus(WorkflowInstanceNodeStatus status) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceNodeStatus getWorkflowInstanceNodeStatus(String experimentId, String workflowInstaceId, String nodeId) throws AiravataAPIInvocationException;
+	
+	public WorkflowInstanceNodeStatus getWorkflowInstanceNodeStatus(WorkflowInstanceNode node) throws AiravataAPIInvocationException;
+	
+	public void addExperiment(String projectName, String experimentId, String experimentName) throws AiravataAPIInvocationException;
+	
+	public void addWorkflowInstance(String experimentId, WorkflowInstance workflowInstance) throws AiravataAPIInvocationException;
+	
+	//TODO setup node type for the node & gram data for the node
 }

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java (original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ProvenanceManagerImpl.java Thu Sep 20 17:30:35 2012
@@ -21,7 +21,6 @@
 
 package org.apache.airavata.client.impl;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -30,16 +29,17 @@ import org.apache.airavata.client.Airava
 import org.apache.airavata.client.api.AiravataAPIInvocationException;
 import org.apache.airavata.client.api.ProvenanceManager;
 import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.AiravataExperiment;
 import org.apache.airavata.registry.api.workflow.ExperimentData;
+import org.apache.airavata.registry.api.workflow.ExperimentMetadata;
+import org.apache.airavata.registry.api.workflow.ExperimentName;
+import org.apache.airavata.registry.api.workflow.ExperimentUser;
 import org.apache.airavata.registry.api.workflow.WorkflowInstance;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceMetadata;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceName;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceUser;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
 
 public class ProvenanceManagerImpl implements ProvenanceManager {
@@ -50,85 +50,57 @@ public class ProvenanceManagerImpl imple
 	}
 	
 	@Override
-	public void addWorkflowInstanceNodeInputData(
-			WorkflowInstanceNodePortData data)
+	public void setWorkflowInstanceNodeInput(WorkflowInstanceNode node, String data)
 			throws AiravataAPIInvocationException {
 		try {
-			getClient().getRegistry().updateWorkflowNodeInput(data);
+			getClient().getRegistry().updateWorkflowNodeInput(node, data);
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public void addWorkflowInstanceNodeInputData(String experimentId,
+	public void setWorkflowInstanceNodeInput(String experimentId,
 			String workflowInstanceId, String nodeId, String data)
 			throws AiravataAPIInvocationException {
-		addWorkflowInstanceNodeInputData(new WorkflowInstanceNodePortData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId), data));
+		setWorkflowInstanceNodeInput(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId), data);
 	}
 
 	@Override
-	public void addWorkflowInstanceNodeOutputData(
-			WorkflowInstanceNodePortData data)
+	public void setWorkflowInstanceNodeOutput(WorkflowInstanceNode node, String data)
 			throws AiravataAPIInvocationException {
 		try {
-			getClient().getRegistry().updateWorkflowNodeOutput(data);
+			getClient().getRegistry().updateWorkflowNodeOutput(node, data);
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public void addWorkflowInstanceNodeOutputData(String experimentId,
+	public void setWorkflowInstanceNodeOutput(String experimentId,
 			String workflowInstanceId, String nodeId, String data)
 			throws AiravataAPIInvocationException {
-		addWorkflowInstanceNodeOutputData(new WorkflowInstanceNodePortData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId), data));
+		setWorkflowInstanceNodeOutput(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId), data);
 		
 	}
 
 	@Override
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(
-			WorkflowInstanceNode node) throws AiravataAPIInvocationException {
+	public String getWorkflowInstanceNodeInput(WorkflowInstanceNode node) throws AiravataAPIInvocationException {
 		try {
-			List<WorkflowNodeIOData> list = getClient().getRegistry().searchWorkflowInstanceNodeInput(node.getWorkflowInstance().getExperimentId(), ".*", node.getNodeId());
-			return generateWorkflowInstanceNodePortData(list);
+			return getClient().getRegistry().getWorkflowInstanceNodeData(node.getWorkflowInstance().getWorkflowInstanceId(), node.getNodeId()).getInput();
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
-	private List<WorkflowInstanceNodePortData> generateWorkflowInstanceNodePortData(
-			List<WorkflowNodeIOData> list) {
-		List<WorkflowInstanceNodePortData> portData=new ArrayList<WorkflowInstanceNodePortData>();
-		for (WorkflowNodeIOData data : list) {
-			portData.add(new WorkflowInstanceNodePortData(data));
-		}
-		return portData;
-	}
-
 	@Override
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeInputData(
-			String experimentId, String workflowInstanceId, String nodeId)
+	public String getWorkflowInstanceNodeInput(String experimentId, String workflowInstanceId, String nodeId)
 			throws AiravataAPIInvocationException {
-		return getWorkflowInstanceNodeInputData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));
-	}
-	
-	private List<WorkflowInstanceNodePortData> getWorkflowInstanceNodePortDataListForWorkflowInstanceNode(Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> portData, WorkflowInstanceNode instanceNode, boolean createIfNotPresent){
-		for (WorkflowInstanceNode node : portData.keySet()) {
-			if (node.getWorkflowInstance().getExperimentId().equals(instanceNode.getWorkflowInstance().getExperimentId()) && node.getWorkflowInstance().getWorkflowInstanceId().equals(instanceNode.getWorkflowInstance().getWorkflowInstanceId()) &&
-					node.getNodeId().equals(instanceNode.getNodeId())){
-				return portData.get(node);
-			}
-		}
-		if (createIfNotPresent){
-			portData.put(instanceNode, new ArrayList<WorkflowInstanceNodePortData>());
-			return portData.get(instanceNode);
-		}
-		return null;
+		return getWorkflowInstanceNodeInput(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));
 	}
 	
 	@Override
-	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeInputData(String workflowName, String nodeId) throws AiravataAPIInvocationException{
+	public Map<WorkflowInstanceNode,String> getWorkflowInstanceNodeInput(String workflowName, String nodeId) throws AiravataAPIInvocationException{
 		try {
 			List<WorkflowNodeIOData> list = getClient().getRegistry().searchWorkflowInstanceNodeInput(".*", workflowName, nodeId);
 			return groupNodePortData(list);
@@ -137,38 +109,32 @@ public class ProvenanceManagerImpl imple
 		}
 	}
 
-	private Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortData(
-			List<WorkflowNodeIOData> list) {
-		Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> portData=new HashMap<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>>();
+	private Map<WorkflowInstanceNode, String> groupNodePortData(List<WorkflowNodeIOData> list) {
+		Map<WorkflowInstanceNode,String> portData=new HashMap<WorkflowInstanceNode, String>();
 		for (WorkflowNodeIOData data : list) {
-			WorkflowInstanceNodePortData workflowInstanceNodePortData = new WorkflowInstanceNodePortData(data);
-			List<WorkflowInstanceNodePortData> portDataList = getWorkflowInstanceNodePortDataListForWorkflowInstanceNode(portData, workflowInstanceNodePortData.getWorkflowInstanceNode(), true);
-			portDataList.add(workflowInstanceNodePortData);
+			portData.put(new WorkflowInstanceNode(new WorkflowInstance(data.getExperimentId(), data.getWorkflowInstanceId()), data.getNodeId()), data.getValue());
 		}
 		return portData;
 	}
 
 	@Override
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(
-			WorkflowInstanceNode node) throws AiravataAPIInvocationException {
+	public String getWorkflowInstanceNodeOutput(WorkflowInstanceNode node) throws AiravataAPIInvocationException {
 		try {
-			List<WorkflowNodeIOData> list = getClient().getRegistry().searchWorkflowInstanceNodeOutput(node.getWorkflowInstance().getExperimentId(), ".*", node.getNodeId());
-			return generateWorkflowInstanceNodePortData(list);
+			return getClient().getRegistry().getWorkflowInstanceNodeData(node.getWorkflowInstance().getWorkflowInstanceId(), node.getNodeId()).getOutput();
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public List<WorkflowInstanceNodePortData> getWorkflowInstanceNodeOutputData(
-			String experimentId, String workflowInstanceId, String nodeId)
+	public String getWorkflowInstanceNodeOutput(String experimentId, String workflowInstanceId, String nodeId)
 			throws AiravataAPIInvocationException {
-		return getWorkflowInstanceNodeOutputData(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));
+		return getWorkflowInstanceNodeOutput(new WorkflowInstanceNode(new WorkflowInstance(experimentId, workflowInstanceId), nodeId));
 
 	}
 
 	@Override
-	public Map<WorkflowInstanceNode,List<WorkflowInstanceNodePortData>> getWorkflowInstanceNodeOutputData(String workflowName, String nodeId) throws AiravataAPIInvocationException{
+	public Map<WorkflowInstanceNode,String> getWorkflowInstanceNodeOutput(String workflowName, String nodeId) throws AiravataAPIInvocationException{
 		try {
 			List<WorkflowNodeIOData> list = getClient().getRegistry().searchWorkflowInstanceNodeOutput(".*", workflowName, nodeId);
 			return groupNodePortData(list);
@@ -213,8 +179,7 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void setWorkflowInstanceUser(String experimentId, String workflowInstanceId,
-			String user) throws AiravataAPIInvocationException {
+	public void setExperimentUser(String experimentId, String user) throws AiravataAPIInvocationException {
 		try {
 			getClient().getRegistry().updateExperimentExecutionUser(experimentId, user);
 		} catch (RegistryException e) {
@@ -223,31 +188,22 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void setWorkflowInstanceUser(WorkflowInstanceUser user)
+	public void setExperimentUser(ExperimentUser user)
 			throws AiravataAPIInvocationException {
-		setWorkflowInstanceUser(user.getWorkflowInstance().getExperimentId(), user.getWorkflowInstance().getWorkflowInstanceId(), user.getUser());
+		setExperimentUser(user.getExperimentId(), user.getUser());
 	}
 
 	@Override
-	public WorkflowInstanceUser getWorkflowInstanceUser(String experimentId,
-			String workflowInstanceId) throws AiravataAPIInvocationException {
-		return getWorkflowInstanceUser(new WorkflowInstance(experimentId, workflowInstanceId));
-	}
-
-	@Override
-	public WorkflowInstanceUser getWorkflowInstanceUser(
-			WorkflowInstance workflowInstance)
-			throws AiravataAPIInvocationException {
+	public ExperimentUser getExperimentUser(String experimentId)throws AiravataAPIInvocationException {
 		try {
-			return new WorkflowInstanceUser(workflowInstance,getClient().getRegistry().getExperimentExecutionUser(workflowInstance.getExperimentId()));
+			return new ExperimentUser(experimentId,getClient().getRegistry().getExperimentExecutionUser(experimentId));
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public void setWorkflowInstanceMetadata(String experimentId,
-			String workflowInstanceId, String metadata)
+	public void setExperimentMetadata(String experimentId, String metadata)
 			throws AiravataAPIInvocationException {
 		try {
 			getClient().getRegistry().updateExperimentMetadata(experimentId, metadata);
@@ -258,32 +214,22 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void setWorkflowInstanceMetadata(
-			WorkflowInstanceMetadata instanceMetadata)
+	public void setExperimentMetadata(ExperimentMetadata instanceMetadata)
 			throws AiravataAPIInvocationException {
-		setWorkflowInstanceMetadata(instanceMetadata.getWorkflowInstance().getExperimentId(), instanceMetadata.getWorkflowInstance().getWorkflowInstanceId(), instanceMetadata.getMetadata());
+		setExperimentMetadata(instanceMetadata.getExperimentId(), instanceMetadata.getMetadata());
 	}
 
 	@Override
-	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(
-			String experimentId, String workflowInstanceId)
-			throws AiravataAPIInvocationException {
-		return getWorkflowInstanceMetadata(new WorkflowInstance(experimentId, workflowInstanceId));
-	}
-
-	@Override
-	public WorkflowInstanceMetadata getWorkflowInstanceMetadata(
-			WorkflowInstance workflowInstance)
-			throws AiravataAPIInvocationException {
+	public ExperimentMetadata getExperimentMetadata(String experimentId)throws AiravataAPIInvocationException {
 		try {
-			return new WorkflowInstanceMetadata(workflowInstance, getClient().getRegistry().getExperimentMetadata(workflowInstance.getExperimentId()));
+			return new ExperimentMetadata(experimentId, getClient().getRegistry().getExperimentMetadata(experimentId));
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public List<String> getExperiments(String owner) throws AiravataAPIInvocationException{
+	public List<String> getExperimentIdList(String owner) throws AiravataAPIInvocationException{
 		try {
 			return getClient().getRegistry().getExperimentIdByUser(owner);
 		} catch (RegistryException e) {
@@ -292,18 +238,18 @@ public class ProvenanceManagerImpl imple
 	}
 	
 	@Override
-	public List<String> getExperiments() throws AiravataAPIInvocationException {
-		return getExperiments(getClient().getCurrentUser());
+	public List<String> getExperimentIdList() throws AiravataAPIInvocationException {
+		return getExperimentIdList(getClient().getCurrentUser());
 	}
 
 	@Override
-	public List<ExperimentData> getWorkflowExperimentData()
+	public List<ExperimentData> getWorkflowExperimentDataList()
 			throws AiravataAPIInvocationException {
-		return getWorkflowExperimentData(getClient().getCurrentUser());
+		return getWorkflowExperimentDataList(getClient().getCurrentUser());
 	}
 
 	@Override
-	public List<ExperimentData> getWorkflowExperimentData(String user)
+	public List<ExperimentData> getWorkflowExperimentDataList(String user)
 			throws AiravataAPIInvocationException {
 		try {
 			return  getClient().getRegistry().getExperimentByUser(user);
@@ -333,7 +279,7 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public WorkflowInstanceData getWorkflowIsntanceData(WorkflowInstance workflowInstance)
+	public WorkflowInstanceData getWorkflowInstanceData(WorkflowInstance workflowInstance)
 			throws AiravataAPIInvocationException {
 		return getWorkflowInstanceData(workflowInstance.getExperimentId(), workflowInstance.getWorkflowInstanceId());
 	}
@@ -353,37 +299,103 @@ public class ProvenanceManagerImpl imple
 	}
 
 	@Override
-	public void setWorkflowInstanceName(String experimentId,
-			String workflowInstanceId, String instanceName)
+	public void setExperimentName(String experimentId, String experimentName)
 			throws AiravataAPIInvocationException {
 		try {
-			getClient().getRegistry().updateExperimentName(experimentId, instanceName);
+			getClient().getRegistry().updateExperimentName(experimentId, experimentName);
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
 	}
 
 	@Override
-	public void setWorkflowInstanceName(WorkflowInstanceName instanceName)
+	public void setExperimentName(ExperimentName experimentName)
 			throws AiravataAPIInvocationException {
-		setWorkflowInstanceName(instanceName.getWorkflowInstance().getExperimentId(),instanceName.getWorkflowInstance().getWorkflowInstanceId(),instanceName.getInstanceName());
+		setExperimentName(experimentName.getExperimentId(),experimentName.getInstanceName());
 	}
 
 	@Override
-	public WorkflowInstanceName getWorkflowInstanceName(String experimentId,
-			String workflowInstanceId) throws AiravataAPIInvocationException {
-		return getWorkflowInstanceName(new WorkflowInstance(experimentId, workflowInstanceId));
+	public ExperimentName getExperimentName(String experimentId)
+			throws AiravataAPIInvocationException {
+		try {
+			return new ExperimentName(experimentId, getClient().getRegistry().getExperimentName(experimentId));
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public ExperimentData getWorkflowExperimentData(String experimentId)
+			throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getExperiment(experimentId);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
 	}
 
 	@Override
-	public WorkflowInstanceName getWorkflowInstanceName(
+	public void setWorkflowInstanceNodeStatus(String experimentId,
+			String workflowInstaceId, String nodeId, ExecutionStatus status)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().updateWorkflowNodeStatus(workflowInstaceId, nodeId, status);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+		
+	}
+
+	@Override
+	public void setWorkflowInstanceNodeStatus(WorkflowInstanceNodeStatus status)
+			throws AiravataAPIInvocationException {
+		try {
+			getClient().getRegistry().updateWorkflowNodeStatus(status);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}
+	}
+
+	@Override
+	public WorkflowInstanceNodeStatus getWorkflowInstanceNodeStatus(
+			String experimentId, String workflowInstaceId, String nodeId)
+			throws AiravataAPIInvocationException {
+		return getWorkflowInstanceNodeStatus(new WorkflowInstanceNode(new WorkflowInstance(experimentId,workflowInstaceId),nodeId));
+	}
+
+	@Override
+	public WorkflowInstanceNodeStatus getWorkflowInstanceNodeStatus(
+			WorkflowInstanceNode node) throws AiravataAPIInvocationException {
+		try {
+			return getClient().getRegistry().getWorkflowNodeStatus(node);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}	
+	}
+
+	@Override
+	public void addExperiment(String projectName, String experimentId, String experimentName)
+			throws AiravataAPIInvocationException {
+		try {
+			AiravataExperiment experiment = new AiravataExperiment();
+			experiment.setExperimentId(experimentId);
+			getClient().getRegistry().addExperiment(projectName, experiment);
+			getClient().getRegistry().updateExperimentName(experimentId, experimentName);
+		} catch (RegistryException e) {
+			throw new AiravataAPIInvocationException(e);
+		}	
+	}
+
+	@Override
+	public void addWorkflowInstance(String experimentId,
 			WorkflowInstance workflowInstance)
 			throws AiravataAPIInvocationException {
 		try {
-			return new WorkflowInstanceName(workflowInstance, getClient().getRegistry().getExperimentName(workflowInstance.getExperimentId()));
+			getClient().getRegistry().addWorkflowInstance(experimentId, workflowInstance.getWorkflowInstanceId(),workflowInstance.getTemplateName());
 		} catch (RegistryException e) {
 			throw new AiravataAPIInvocationException(e);
 		}
+		
 	}
 
 	

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java Thu Sep 20 17:30:35 2012
@@ -33,6 +33,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeData;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
@@ -155,7 +156,7 @@ public interface ProvenanceRegistry exte
 	 * @return true if successfully saved
 	 * @throws RegistryException
 	 */
-	public abstract boolean updateWorkflowNodeInput(WorkflowNodeIOData workflowInputData) throws RegistryException;
+	public abstract boolean updateWorkflowNodeInput(WorkflowInstanceNode node, String data) throws RegistryException;
 
     /**
      * Save the output data of a node in the workflow instance of an experiment
@@ -163,7 +164,7 @@ public interface ProvenanceRegistry exte
      * @return true if successfully saved
      * @throws RegistryException
      */
-	public abstract boolean updateWorkflowNodeOutput(WorkflowNodeIOData workflowOutputData)throws RegistryException;
+	public abstract boolean updateWorkflowNodeOutput(WorkflowInstanceNode node, String data)throws RegistryException;
     
     /**
      * Return a list of data passed as input for service node which regex matched nodeId, workflow template id & experiment id 
@@ -303,5 +304,9 @@ public interface ProvenanceRegistry exte
     public boolean isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId)throws RegistryException;
     
     public WorkflowInstanceNodeData getWorkflowInstanceNodeData(String workflowInstanceId, String nodeId)throws RegistryException;
+
+    public boolean addWorkflowInstance(String experimentId, String workflowInstanceId, String templateName) throws RegistryException;
+    
+    public boolean updateWorkflowNodeType(WorkflowInstanceNode node, WorkflowNodeType type) throws RegistryException;
     
 }
\ No newline at end of file

Added: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java?rev=1388121&view=auto
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java (added)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java Thu Sep 20 17:30:35 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.airavata.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class WorkflowInstanceAlreadyExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public WorkflowInstanceAlreadyExistsException(String instanceId) {
+		super("The workflow instance "+instanceId+" is already added to the registry & workflowInstanceId should be unique for the system!!!");
+	}
+
+}

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java Thu Sep 20 17:30:35 2012
@@ -836,16 +836,16 @@ public class AiravataJCRRegistry extends
     }
 
     public boolean saveWorkflowExecutionServiceInput(WorkflowNodeIOData workflowInputData) throws RegistryException{
-    	if (getProvenanceRegistry()!=null){
-    		return getProvenanceRegistry().updateWorkflowNodeInput(workflowInputData);
-    	}
+//    	if (getProvenanceRegistry()!=null){
+//    		return getProvenanceRegistry().updateWorkflowNodeInput(workflowInputData);
+//    	}
         return saveWorkflowIO(workflowInputData, INPUT);
     }
 
     public boolean saveWorkflowExecutionServiceOutput(WorkflowNodeIOData workflowOutputData) throws RegistryException{
-    	if (getProvenanceRegistry()!=null){
-    		return getProvenanceRegistry().updateWorkflowNodeOutput(workflowOutputData);
-    	}
+//    	if (getProvenanceRegistry()!=null){
+//    		return getProvenanceRegistry().updateWorkflowNodeOutput(workflowOutputData);
+//    	}
         return saveWorkflowIO(workflowOutputData, OUTPUT);
     }
 

Copied: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java (from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java)
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java?p2=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java&p1=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java&r1=1388055&r2=1388121&rev=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceMetadata.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java Thu Sep 20 17:30:35 2012
@@ -21,23 +21,15 @@
 
 package org.apache.airavata.registry.api.workflow;
 
-public class WorkflowInstanceMetadata {
-	private WorkflowInstance workflowInstance;
+public class ExperimentMetadata {
+	private String experimentId;
 	private String metadata;
 	
-	public WorkflowInstanceMetadata(WorkflowInstance workflowInstance, String metadata) {
-		setWorkflowInstance(workflowInstance);
+	public ExperimentMetadata(String experimentId, String metadata) {
+		setExperimentId(experimentId);
 		setMetadata(metadata);
 	}
 
-	public WorkflowInstance getWorkflowInstance() {
-		return workflowInstance;
-	}
-
-	public void setWorkflowInstance(WorkflowInstance workflowInstance) {
-		this.workflowInstance = workflowInstance;
-	}
-
 	public String getMetadata() {
 		return metadata;
 	}
@@ -46,4 +38,12 @@ public class WorkflowInstanceMetadata {
 		this.metadata = metadata;
 	}
 
+	public String getExperimentId() {
+		return experimentId;
+	}
+
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
+
 }

Copied: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java (from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java)
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java?p2=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java&p1=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java&r1=1388055&r2=1388121&rev=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceName.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java Thu Sep 20 17:30:35 2012
@@ -21,23 +21,15 @@
 
 package org.apache.airavata.registry.api.workflow;
 
-public class WorkflowInstanceName {
-	private WorkflowInstance workflowInstance;
+public class ExperimentName {
+	private String experimentId;
 	private String instanceName;
 	
-	public WorkflowInstanceName(WorkflowInstance workflowInstance, String instanceName) {
-		setWorkflowInstance(workflowInstance);
+	public ExperimentName(String experimentId, String instanceName) {
+		setExperimentId(experimentId);
 		setInstanceName(instanceName);
 	}
 
-	public WorkflowInstance getWorkflowInstance() {
-		return workflowInstance;
-	}
-
-	public void setWorkflowInstance(WorkflowInstance workflowInstance) {
-		this.workflowInstance = workflowInstance;
-	}
-
 	public String getInstanceName() {
 		return instanceName;
 	}
@@ -46,4 +38,12 @@ public class WorkflowInstanceName {
 		this.instanceName = instanceName;
 	}
 
+	public String getExperimentId() {
+		return experimentId;
+	}
+
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
+
 }

Copied: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java (from r1388055, airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java)
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java?p2=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java&p1=airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java&r1=1388055&r2=1388121&rev=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceUser.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java Thu Sep 20 17:30:35 2012
@@ -21,23 +21,15 @@
 
 package org.apache.airavata.registry.api.workflow;
 
-public class WorkflowInstanceUser {
-	private WorkflowInstance workflowInstance;
+public class ExperimentUser {
+	private String experimentId;
 	private String user;
 	
-	public WorkflowInstanceUser(WorkflowInstance workflowInstance, String user) {
-		setWorkflowInstance(workflowInstance);
+	public ExperimentUser(String experimentId, String user) {
+		setExperimentId(experimentId);
 		setUser(user);
 	}
 
-	public WorkflowInstance getWorkflowInstance() {
-		return workflowInstance;
-	}
-
-	public void setWorkflowInstance(WorkflowInstance workflowInstance) {
-		this.workflowInstance = workflowInstance;
-	}
-
 	public String getUser() {
 		return user;
 	}
@@ -45,4 +37,12 @@ public class WorkflowInstanceUser {
 	public void setUser(String user) {
 		this.user = user;
 	}
+
+	public String getExperimentId() {
+		return experimentId;
+	}
+
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
 }

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstance.java Thu Sep 20 17:30:35 2012
@@ -24,17 +24,17 @@ package org.apache.airavata.registry.api
 public class WorkflowInstance {
 	private String experimentId;
 	private String workflowInstanceId;
-	private String workflowName;
+	private String templateName;
 	
-	public WorkflowInstance(String experimentId,String topicId) {
+	public WorkflowInstance(String experimentId,String instanceId) {
 		setExperimentId(experimentId);
-		setWorkflowInstanceId(topicId);
+		setWorkflowInstanceId(instanceId);
 	}
 
-    public WorkflowInstance(String experimentId, String workflowInstanceId, String workflowName) {
+    public WorkflowInstance(String experimentId, String workflowInstanceId, String templateName) {
         this.experimentId = experimentId;
         this.workflowInstanceId = workflowInstanceId;
-        this.workflowName = workflowName;
+        this.templateName = templateName;
     }
 
     public String getWorkflowInstanceId() {
@@ -53,11 +53,11 @@ public class WorkflowInstance {
 		this.experimentId = experimentId;
 	}
 
-	public String getWorkflowName() {
-		return workflowName;
+	public String getTemplateName() {
+		return templateName;
 	}
 
-	public void setWorkflowName(String workflowName) {
-		this.workflowName = workflowName;
+	public void setTemplateName(String templateName) {
+		this.templateName = templateName;
 	}
 }

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceData.java Thu Sep 20 17:30:35 2012
@@ -62,7 +62,7 @@ public class WorkflowInstanceData {
 	}
 	
 	public String getWorkflowName(){
-		return workflowInstance.getWorkflowName();
+		return workflowInstance.getTemplateName();
 	}
 	
 	public ExecutionStatus getStatus(){

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodeData.java Thu Sep 20 17:30:35 2012
@@ -24,16 +24,14 @@ package org.apache.airavata.registry.api
 import java.util.List;
 
 public class WorkflowInstanceNodeData{
-	private WorkflowInstanceData workflowInstanceData;
 	private WorkflowInstanceNode workflowInstanceNode;
 	private List<WorkflowInstanceNodePortData> inputData;
 	private List<WorkflowInstanceNodePortData> outputData;
+	private String input;
+	private String output;
 	
-	public WorkflowInstanceNodeData(WorkflowInstanceData workflowInstanceData, WorkflowInstanceNode workflowInstanceNode, List<WorkflowInstanceNodePortData> inputData,List<WorkflowInstanceNodePortData> outputData) {
-		setWorkflowInstanceData(workflowInstanceData);
+	public WorkflowInstanceNodeData(WorkflowInstanceNode workflowInstanceNode) {
 		setWorkflowInstanceNode(workflowInstanceNode);
-		setInputData(inputData);
-		setOutputData(outputData);
 	}
 
 	public WorkflowInstanceNode getWorkflowInstanceNode() {
@@ -60,11 +58,19 @@ public class WorkflowInstanceNodeData{
 		this.outputData = outputData;
 	}
 
-	public WorkflowInstanceData getWorkflowInstanceData() {
-		return workflowInstanceData;
+	public String getInput() {
+		return input;
 	}
 
-	public void setWorkflowInstanceData(WorkflowInstanceData workflowInstanceData) {
-		this.workflowInstanceData = workflowInstanceData;
+	public void setInput(String input) {
+		this.input = input;
+	}
+
+	public String getOutput() {
+		return output;
+	}
+
+	public void setOutput(String output) {
+		this.output = output;
 	}
 }

Modified: airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java (original)
+++ airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java Thu Sep 20 17:30:35 2012
@@ -21,13 +21,15 @@
 
 package org.apache.airavata.registry.api.workflow;
 
-public class WorkflowInstanceNodePortData extends WorkflowNodeIOData {
+public class WorkflowInstanceNodePortData {
 	private WorkflowInstanceNode workflowInstanceNode;
+	private String name;
+	private String value;
 	
-	public WorkflowInstanceNodePortData(WorkflowNodeIOData data) {
-		workflowInstanceNode=new WorkflowInstanceNode(new WorkflowInstance(data.getExperimentId(), data.getWorkflowId()),data.getNodeId());
-		workflowInstanceNode.getWorkflowInstance().setWorkflowName(data.getWorkflowName());
-		setValue(data.getValue());
+	public WorkflowInstanceNodePortData(WorkflowInstanceNode workflowInstanceNode, String portName, String portValue) {
+		setWorkflowInstanceNode(workflowInstanceNode);
+		setName(portName);
+		setValue(portValue);
 	}
 	
 	public WorkflowInstanceNodePortData(WorkflowInstanceNode workflowInstanceNode, String data) {
@@ -43,18 +45,19 @@ public class WorkflowInstanceNodePortDat
 		this.workflowInstanceNode = workflowInstanceNode;
 	}
 
-	@Override
-	public String getNodeId() {
-		return getWorkflowInstanceNode().getNodeId();
+	public String getValue() {
+		return value;
 	}
-	
-	@Override
-	public String getExperimentId() {
-		return getWorkflowInstanceNode().getWorkflowInstance().getExperimentId();
+
+	public void setValue(String value) {
+		this.value = value;
 	}
-	
-	@Override
-	public String getWorkflowId() {
-		return getWorkflowInstanceNode().getWorkflowInstance().getWorkflowInstanceId();
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
 	}
 }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Thu Sep 20 17:30:35 2012
@@ -66,6 +66,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
 import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException;
 import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
+import org.apache.airavata.registry.api.exception.worker.WorkflowInstanceAlreadyExistsException;
 import org.apache.airavata.registry.api.exception.worker.WorkflowInstanceDoesNotExistsException;
 import org.apache.airavata.registry.api.exception.worker.WorkflowInstanceNodeDoesNotExistsException;
 import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectAlreadyExistsException;
@@ -77,9 +78,9 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceData;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeData;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodeStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
@@ -887,7 +888,7 @@ public class AiravataJPARegistry extends
 		List<WorkflowDataResource> workflowInstances = data.getWorkflowInstances();
 		for (WorkflowDataResource resource : workflowInstances) {
 			WorkflowInstance workflowInstance = new WorkflowInstance(resource.getExperimentID(), resource.getWorkflowInstanceID());
-			workflowInstance.setWorkflowName(resource.getTemplateName());
+			workflowInstance.setTemplateName(resource.getTemplateName());
 			result.add(workflowInstance);
 		}
 		return result;
@@ -947,37 +948,38 @@ public class AiravataJPARegistry extends
 
 
 	@Override
-	public boolean updateWorkflowNodeInput(WorkflowNodeIOData workflowInputData)
+	public boolean updateWorkflowNodeInput(WorkflowInstanceNode node, String data)
 			throws RegistryException {
-		if (!isWorkflowInstanceExists(workflowInputData.getWorkflowInstanceId())){
-			throw new WorkflowInstanceDoesNotExistsException(workflowInputData.getWorkflowInstanceId());
+		if (!isWorkflowInstanceExists(node.getWorkflowInstance().getWorkflowInstanceId())){
+			throw new WorkflowInstanceDoesNotExistsException(node.getWorkflowInstance().getWorkflowInstanceId());
 		}
-		WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowInputData.getWorkflowInstanceId());
+		WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(node.getWorkflowInstance().getWorkflowInstanceId());
 		NodeDataResource nodeData;
-		if (wi.isNodeExists(workflowInputData.getNodeId())){
-			nodeData = wi.getNodeData(workflowInputData.getNodeId());
+		if (wi.isNodeExists(node.getNodeId())){
+			nodeData = wi.getNodeData(node.getNodeId());
 		}else{
-			nodeData = wi.createNodeData(workflowInputData.getNodeId());
+			nodeData = wi.createNodeData(node.getNodeId());
 		}
-		nodeData.setInputs(workflowInputData.getValue());
+		nodeData.setInputs(data);
+		nodeData.save();
 		return true;
 	}
 
 
 	@Override
-	public boolean updateWorkflowNodeOutput(
-			WorkflowNodeIOData workflowOutputData) throws RegistryException {
-		if (!isWorkflowInstanceExists(workflowOutputData.getWorkflowInstanceId())){
-			throw new WorkflowInstanceDoesNotExistsException(workflowOutputData.getWorkflowInstanceId());
+	public boolean updateWorkflowNodeOutput(WorkflowInstanceNode node, String data) throws RegistryException {
+		if (!isWorkflowInstanceExists(node.getWorkflowInstance().getWorkflowInstanceId())){
+			throw new WorkflowInstanceDoesNotExistsException(node.getWorkflowInstance().getWorkflowInstanceId());
 		}
-		WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(workflowOutputData.getWorkflowInstanceId());
+		WorkflowDataResource wi = jpa.getWorker().getWorkflowInstance(node.getWorkflowInstance().getWorkflowInstanceId());
 		NodeDataResource nodeData;
-		if (wi.isNodeExists(workflowOutputData.getNodeId())){
-			nodeData = wi.getNodeData(workflowOutputData.getNodeId());
+		if (wi.isNodeExists(node.getNodeId())){
+			nodeData = wi.getNodeData(node.getNodeId());
 		}else{
-			nodeData = wi.createNodeData(workflowOutputData.getNodeId());
+			nodeData = wi.createNodeData(node.getNodeId());
 		}
-		nodeData.setOutputs(workflowOutputData.getValue());
+		nodeData.setOutputs(data);
+		nodeData.save();
 		return true;
 	}
 
@@ -1229,9 +1231,9 @@ public class AiravataJPARegistry extends
 			throw new WorkflowInstanceNodeDoesNotExistsException(workflowInstanceId,nodeId);
 		}
 		NodeDataResource nodeData = jpa.getWorker().getWorkflowInstance(workflowInstanceId).getNodeData(nodeId);
-		WorkflowInstanceNodeData data = new WorkflowInstanceNodeData(null,null,null,null);
-		data.getInputData().add(new WorkflowInstanceNodePortData(new WorkflowNodeIOData(nodeData.getInputs(), null, null, nodeId,(String) null)));
-		data.getOutputData().add(new WorkflowInstanceNodePortData(new WorkflowNodeIOData(nodeData.getOutputs(), null, null, nodeId,(String) null)));
+		WorkflowInstanceNodeData data = new WorkflowInstanceNodeData(new WorkflowInstanceNode(new WorkflowInstance(nodeData.getWorkflowDataResource().getExperimentID(),nodeData.getWorkflowDataResource().getWorkflowInstanceID()),nodeData.getNodeID()));
+		data.setInput(nodeData.getInputs());
+		data.setOutput(nodeData.getOutputs());
 		//TODO setup status
 		return data;
 	}
@@ -1247,4 +1249,35 @@ public class AiravataJPARegistry extends
 
 	}
 
+
+	@Override
+	public boolean addWorkflowInstance(String experimentId,
+			String workflowInstanceId, String templateName) throws RegistryException {
+		if (!isExperimentExists(experimentId)){
+			throw new ExperimentDoesNotExistsException(experimentId);
+		}
+		if (isWorkflowInstanceExists(workflowInstanceId)){
+			throw new WorkflowInstanceAlreadyExistsException(workflowInstanceId);
+		}
+		ExperimentResource experiment = jpa.getWorker().getExperiment(experimentId);
+		ExperimentDataResource data = experiment.getData();
+		WorkflowDataResource workflowInstanceResource = data.createWorkflowInstanceResource(workflowInstanceId);
+		workflowInstanceResource.setTemplateName(templateName);
+		workflowInstanceResource.save();
+		return true;
+	}
+
+
+	@Override
+	public boolean updateWorkflowNodeType(WorkflowInstanceNode node, WorkflowNodeType type)
+			throws RegistryException {
+		if (!isWorkflowInstanceNodePresent(node.getWorkflowInstance().getWorkflowInstanceId(),node.getNodeId())){
+			throw new WorkflowInstanceNodeDoesNotExistsException(node.getWorkflowInstance().getWorkflowInstanceId(),node.getNodeId());
+		}
+		NodeDataResource nodeData = jpa.getWorker().getWorkflowInstance(node.getWorkflowInstance().getWorkflowInstanceId()).getNodeData(node.getNodeId());
+		nodeData.setNodeType(type.getNodeType().toString());
+		nodeData.save();
+		return false;
+	}
+
 }

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java Thu Sep 20 17:30:35 2012
@@ -27,7 +27,8 @@ import java.util.Map;
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
 import org.apache.airavata.workflow.model.exceptions.WorkflowException;
 import org.apache.airavata.workflow.model.graph.DataPort;
 import org.apache.airavata.workflow.model.graph.ForEachExecutableNode;
@@ -175,9 +176,7 @@ public final class ProvenanceWrite imple
 			}
             if (inputs!=null) {
 				try {
-					this.registry.updateWorkflowNodeInput(new WorkflowNodeIOData(
-							xsul5.XmlConstants.BUILDER.serializeToString(inputs),
-							experimentId,experimentId, node.getID(), this.workflowName));
+					this.registry.updateWorkflowNodeInput(new WorkflowInstanceNode(new WorkflowInstance(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(inputs));
 				} catch (RegistryException e) {
 					throw new WorkflowException(e);
 				}
@@ -207,7 +206,7 @@ public final class ProvenanceWrite imple
 				}
 			}
             try {
-				this.registry.updateWorkflowNodeOutput(new WorkflowNodeIOData(xsul5.XmlConstants.BUILDER.serializeToString(outputs), experimentId,experimentId, node.getID(),this.workflowName));
+				this.registry.updateWorkflowNodeOutput(new WorkflowInstanceNode(new WorkflowInstance(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(outputs));
             } catch (RegistryException e) {
 				throw new WorkflowException(e);
 			}

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java?rev=1388121&r1=1388120&r2=1388121&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java Thu Sep 20 17:30:35 2012
@@ -22,9 +22,10 @@ package org.apache.airavata.xbaya.proven
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,12 +40,12 @@ public class WorkflowNodeStatusUpdater {
 
     public boolean workflowStarted(String workflowInstanceID,String nodeID,String inputs,String workflowID){
         try {
-            WorkflowNodeIOData workflowServiceIOData = new WorkflowNodeIOData(inputs, workflowInstanceID,workflowInstanceID, workflowID, nodeID, null);
             //todo we currently save only service nodes
             WorkflowNodeType workflowNodeType = new WorkflowNodeType();
             workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-            workflowServiceIOData.setNodeType(workflowNodeType);
-            registry.updateWorkflowNodeInput(workflowServiceIOData);                                                                                             registry.updateWorkflowNodeStatus(workflowInstanceID, nodeID, WorkflowInstanceStatus.ExecutionStatus.STARTED);
+            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowInstance(workflowInstanceID,workflowInstanceID), nodeID);
+			registry.updateWorkflowNodeInput(node,inputs);
+            registry.updateWorkflowNodeType(node, workflowNodeType);
             registry.updateWorkflowNodeStatus(workflowInstanceID, nodeID, WorkflowInstanceStatus.ExecutionStatus.STARTED);
         } catch (RegistryException e) {
             logger.error("Error updating Wokflow Node status !!");
@@ -65,10 +66,11 @@ public class WorkflowNodeStatusUpdater {
 
     public boolean workflowFinished(String workflowInstanceID,String nodeID,String inputs,String workflowID){
         try {
-            WorkflowNodeIOData workflowServiceIOData = new WorkflowNodeIOData(inputs, workflowInstanceID,workflowInstanceID, workflowID, nodeID, null);
-             WorkflowNodeType workflowNodeType = new WorkflowNodeType();
+        	WorkflowNodeType workflowNodeType = new WorkflowNodeType();
             workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-            registry.updateWorkflowNodeOutput(workflowServiceIOData);
+            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowInstance(workflowInstanceID,workflowInstanceID), nodeID);
+            registry.updateWorkflowNodeOutput(node,inputs);
+            registry.updateWorkflowNodeType(node,workflowNodeType);
             registry.updateWorkflowNodeStatus(workflowInstanceID, nodeID, WorkflowInstanceStatus.ExecutionStatus.FINISHED);
         } catch (RegistryException e) {
             logger.error("Error updating Wokflow Node status !!");