airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [03/25] airavata git commit: rename airavata-jpa-registry module to experiment-catalog
Date Tue, 02 Jun 2015 20:40:59 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/22bcbb40/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/resources/WorkflowNodeDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/resources/WorkflowNodeDetailResource.java b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/resources/WorkflowNodeDetailResource.java
new file mode 100644
index 0000000..47bd072
--- /dev/null
+++ b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/resources/WorkflowNodeDetailResource.java
@@ -0,0 +1,515 @@
+/*
+ *
+ * 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.experiment.catalog.resources;
+
+import org.apache.airavata.experiment.catalog.Resource;
+import org.apache.airavata.experiment.catalog.ResourceType;
+import org.apache.airavata.experiment.catalog.ResourceUtils;
+import org.apache.airavata.experiment.catalog.model.*;
+import org.apache.airavata.experiment.catalog.utils.QueryGenerator;
+import org.apache.airavata.registry.cpi.utils.StatusType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.airavata.registry.cpi.RegistryException;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+
+public class WorkflowNodeDetailResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowNodeDetailResource.class);
+    private String experimentId;
+    private String nodeInstanceId;
+    private Timestamp creationTime;
+    private String nodeName;
+    private String executionUnit;
+    private String executionUnitData;
+    private List<TaskDetailResource> taskDetailResourceList;
+    private List<NodeInputResource> nodeInputs;
+    private List<NodeOutputResource> nodeOutputs;
+    private StatusResource nodeStatus;
+    private List<ErrorDetailResource> erros;
+
+    public List<TaskDetailResource> getTaskDetailResourceList() {
+        return taskDetailResourceList;
+    }
+
+    public void setTaskDetailResourceList(List<TaskDetailResource> taskDetailResourceList) {
+        this.taskDetailResourceList = taskDetailResourceList;
+    }
+
+    public void setNodeInputs(List<NodeInputResource> nodeInputs) {
+        this.nodeInputs = nodeInputs;
+    }
+
+    public void setNodeOutputs(List<NodeOutputResource> nodeOutputs) {
+        this.nodeOutputs = nodeOutputs;
+    }
+
+    public StatusResource getNodeStatus() {
+        return nodeStatus;
+    }
+
+    public void setNodeStatus(StatusResource nodeStatus) {
+        this.nodeStatus = nodeStatus;
+    }
+
+    public List<ErrorDetailResource> getErros() {
+        return erros;
+    }
+
+    public void setErros(List<ErrorDetailResource> erros) {
+        this.erros = erros;
+    }
+
+    public String getExperimentId() {
+        return experimentId;
+    }
+
+    public void setExperimentId(String experimentId) {
+        this.experimentId = experimentId;
+    }
+
+    public String getNodeInstanceId() {
+        return nodeInstanceId;
+    }
+
+    public void setNodeInstanceId(String nodeInstanceId) {
+        this.nodeInstanceId = nodeInstanceId;
+    }
+
+    public Timestamp getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Timestamp creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public String getNodeName() {
+        return nodeName;
+    }
+
+    public void setNodeName(String nodeName) {
+        this.nodeName = nodeName;
+    }
+
+    public Resource create(ResourceType type) throws RegistryException{
+        switch (type){
+            case TASK_DETAIL:
+                TaskDetailResource taskDetailResource = new TaskDetailResource();
+                taskDetailResource.setNodeId(nodeInstanceId);
+                return taskDetailResource;
+            case ERROR_DETAIL:
+                ErrorDetailResource errorDetailResource = new ErrorDetailResource();
+                errorDetailResource.setNodeId(nodeInstanceId);;
+                return errorDetailResource;
+            case NODE_INPUT:
+                NodeInputResource nodeInputResource = new NodeInputResource();
+                nodeInputResource.setNodeId(nodeInstanceId);
+                return nodeInputResource;
+            case NODE_OUTPUT:
+                NodeOutputResource nodeOutputResource = new NodeOutputResource();
+                nodeOutputResource.setNodeId(nodeInstanceId);
+                return nodeOutputResource;
+            case STATUS:
+                StatusResource statusResource = new StatusResource();
+                statusResource.setNodeId(nodeInstanceId);
+                return statusResource;
+            default:
+                logger.error("Unsupported resource type for workflow node detail resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported resource type for workflow node detail resource.");
+        }
+    }
+
+    public void remove(ResourceType type, Object name) throws RegistryException{
+        EntityManager em = null;
+        try {
+            em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+            Query q;
+            QueryGenerator generator;
+            switch (type) {
+                case TASK_DETAIL:
+                    generator = new QueryGenerator(TASK_DETAIL);
+                    generator.setParameter(TaskDetailConstants.TASK_ID, name);
+                    q = generator.deleteQuery(em);
+                    q.executeUpdate();
+                    break;
+                case ERROR_DETAIL:
+                    generator = new QueryGenerator(ERROR_DETAIL);
+                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_ID, name);
+                    q = generator.deleteQuery(em);
+                    q.executeUpdate();
+                    break;
+                case NODE_INPUT:
+                    generator = new QueryGenerator(NODE_INPUT);
+                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, name);
+                    q = generator.deleteQuery(em);
+                    q.executeUpdate();
+                    break;
+                case NODE_OUTPUT:
+                    generator = new QueryGenerator(NODE_OUTPUT);
+                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, name);
+                    q = generator.deleteQuery(em);
+                    q.executeUpdate();
+                    break;
+                case STATUS:
+                    generator = new QueryGenerator(STATUS);
+                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, name);
+                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.WORKFLOW_NODE.toString());
+                    q = generator.deleteQuery(em);
+                    q.executeUpdate();
+                    break;
+                default:
+                    logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
+                    break;
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RegistryException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+    public Resource get(ResourceType type, Object name) throws RegistryException{
+        EntityManager em = null;
+        try {
+            em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+            QueryGenerator generator;
+            Query q;
+            switch (type) {
+                case TASK_DETAIL:
+                    generator = new QueryGenerator(TASK_DETAIL);
+                    generator.setParameter(TaskDetailConstants.TASK_ID, name);
+                    q = generator.selectQuery(em);
+                    TaskDetail taskDetail = (TaskDetail) q.getSingleResult();
+                    TaskDetailResource taskDetailResource = (TaskDetailResource) Utils.getResource(ResourceType.TASK_DETAIL, taskDetail);
+                    em.getTransaction().commit();
+                    em.close();
+                    return taskDetailResource;
+                case ERROR_DETAIL:
+                    generator = new QueryGenerator(ERROR_DETAIL);
+                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_ID, name);
+                    q = generator.selectQuery(em);
+                    ErrorDetail errorDetail = (ErrorDetail) q.getSingleResult();
+                    ErrorDetailResource errorDetailResource = (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
+                    em.getTransaction().commit();
+                    em.close();
+                    return errorDetailResource;
+                case NODE_INPUT:
+                    generator = new QueryGenerator(NODE_INPUT);
+                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, name);
+                    q = generator.selectQuery(em);
+                    NodeInput nodeInput = (NodeInput) q.getSingleResult();
+                    NodeInputResource nodeInputResource = (NodeInputResource) Utils.getResource(ResourceType.NODE_INPUT, nodeInput);
+                    em.getTransaction().commit();
+                    em.close();
+                    return nodeInputResource;
+                case NODE_OUTPUT:
+                    generator = new QueryGenerator(NODE_OUTPUT);
+                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, name);
+                    q = generator.selectQuery(em);
+                    NodeOutput nodeOutput = (NodeOutput) q.getSingleResult();
+                    NodeOutputResource nodeOutputResource = (NodeOutputResource) Utils.getResource(ResourceType.NODE_OUTPUT, nodeOutput);
+                    em.getTransaction().commit();
+                    em.close();
+                    return nodeOutputResource;
+                case STATUS:
+                    generator = new QueryGenerator(STATUS);
+                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, name);
+                    generator.setParameter(StatusConstants.STATUS_TYPE, StatusType.WORKFLOW_NODE.toString());
+                    q = generator.selectQuery(em);
+                    Status status = (Status) q.getSingleResult();
+                    StatusResource statusResource = (StatusResource) Utils.getResource(ResourceType.STATUS, status);
+                    em.getTransaction().commit();
+                    em.close();
+                    return statusResource;
+                default:
+                    em.getTransaction().commit();
+                    em.close();
+                    logger.error("Unsupported resource type for workflow node resource.", new IllegalArgumentException());
+                    throw new IllegalArgumentException("Unsupported resource type for workflow node resource.");
+            }
+        } catch (Exception e) {
+            throw new RegistryException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+    public List<Resource> get(ResourceType type) throws RegistryException{
+        List<Resource> resourceList = new ArrayList<Resource>();
+        EntityManager em = null;
+        try {
+            em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+            Query q;
+            QueryGenerator generator;
+            List results;
+            switch (type) {
+                case TASK_DETAIL:
+                    generator = new QueryGenerator(TASK_DETAIL);
+                    generator.setParameter(TaskDetailConstants.NODE_INSTANCE_ID, nodeInstanceId);
+                    q = generator.selectQuery(em);
+                    results = q.getResultList();
+                    if (results.size() != 0) {
+                        for (Object result : results) {
+                            TaskDetail taskDetail = (TaskDetail) result;
+                            TaskDetailResource taskDetailResource =
+                                    (TaskDetailResource) Utils.getResource(ResourceType.TASK_DETAIL, taskDetail);
+                            resourceList.add(taskDetailResource);
+                        }
+                    }
+                    break;
+                case ERROR_DETAIL:
+                    generator = new QueryGenerator(ERROR_DETAIL);
+                    generator.setParameter(ErrorDetailConstants.NODE_INSTANCE_ID, nodeInstanceId);
+                    q = generator.selectQuery(em);
+                    results = q.getResultList();
+                    if (results.size() != 0) {
+                        for (Object result : results) {
+                            ErrorDetail errorDetail = (ErrorDetail) result;
+                            ErrorDetailResource errorDetailResource =
+                                    (ErrorDetailResource) Utils.getResource(ResourceType.ERROR_DETAIL, errorDetail);
+                            resourceList.add(errorDetailResource);
+                        }
+                    }
+                    break;
+                case NODE_INPUT:
+                    generator = new QueryGenerator(NODE_INPUT);
+                    generator.setParameter(NodeInputConstants.NODE_INSTANCE_ID, nodeInstanceId);
+                    q = generator.selectQuery(em);
+                    results = q.getResultList();
+                    if (results.size() != 0) {
+                        for (Object result : results) {
+                            NodeInput nodeInput = (NodeInput) result;
+                            NodeInputResource nodeInputResource =
+                                    (NodeInputResource) Utils.getResource(ResourceType.NODE_INPUT, nodeInput);
+                            resourceList.add(nodeInputResource);
+                        }
+                    }
+                    break;
+                case NODE_OUTPUT:
+                    generator = new QueryGenerator(NODE_OUTPUT);
+                    generator.setParameter(NodeOutputConstants.NODE_INSTANCE_ID, nodeInstanceId);
+                    q = generator.selectQuery(em);
+                    results = q.getResultList();
+                    if (results.size() != 0) {
+                        for (Object result : results) {
+                            NodeOutput nodeOutput = (NodeOutput) result;
+                            NodeOutputResource nodeOutputResource =
+                                    (NodeOutputResource) Utils.getResource(ResourceType.NODE_OUTPUT, nodeOutput);
+                            resourceList.add(nodeOutputResource);
+                        }
+                    }
+                    break;
+                case STATUS:
+                    generator = new QueryGenerator(STATUS);
+                    generator.setParameter(StatusConstants.NODE_INSTANCE_ID, nodeInstanceId);
+                    q = generator.selectQuery(em);
+                    results = q.getResultList();
+                    if (results.size() != 0) {
+                        for (Object result : results) {
+                            Status status = (Status) result;
+                            StatusResource statusResource =
+                                    (StatusResource) Utils.getResource(ResourceType.STATUS, status);
+                            resourceList.add(statusResource);
+                        }
+                    }
+                    break;
+                default:
+                    em.getTransaction().commit();
+                    em.close();
+                    logger.error("Unsupported resource type for workflow node details resource.", new UnsupportedOperationException());
+                    throw new UnsupportedOperationException();
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+//            logger.error(e.getMessage(), e);
+            throw new RegistryException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+        return resourceList;
+    }
+
+    public void save() throws RegistryException{
+        EntityManager em = null;
+        try {
+            em = ResourceUtils.getEntityManager();
+            WorkflowNodeDetail existingNode = em.find(WorkflowNodeDetail.class, nodeInstanceId);
+            em.close();
+
+            em = ResourceUtils.getEntityManager();
+            em.getTransaction().begin();
+            WorkflowNodeDetail workflowNodeDetail = new WorkflowNodeDetail();
+            workflowNodeDetail.setNodeId(nodeInstanceId);
+            workflowNodeDetail.setExpId(experimentId);
+            workflowNodeDetail.setCreationTime(creationTime);
+            workflowNodeDetail.setNodeName(nodeName);
+            workflowNodeDetail.setExecutionUnit(getExecutionUnit());
+            workflowNodeDetail.setExecutionUnitData(getExecutionUnitData());
+
+            if (existingNode != null) {
+                existingNode.setExpId(experimentId);
+                existingNode.setCreationTime(creationTime);
+                existingNode.setNodeName(nodeName);
+                existingNode.setExecutionUnit(getExecutionUnit());
+                existingNode.setExecutionUnitData(getExecutionUnitData());
+                workflowNodeDetail = em.merge(existingNode);
+            } else {
+                em.persist(workflowNodeDetail);
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RegistryException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+    public List<NodeInputResource> getNodeInputs() {
+        return nodeInputs;
+    }
+
+    public List<NodeOutputResource> getNodeOutputs() {
+        return nodeOutputs;
+    }
+
+    public List<NodeInputResource> getNodeInputs1() throws RegistryException{
+        List<NodeInputResource> nodeInputResourceList = new ArrayList<NodeInputResource>();
+        List<Resource> resources = get(ResourceType.NODE_INPUT);
+        for (Resource resource : resources) {
+            NodeInputResource nodeInputResource = (NodeInputResource) resource;
+            nodeInputResourceList.add(nodeInputResource);
+        }
+        return nodeInputResourceList;
+    }
+
+    public List<NodeOutputResource> getNodeOutputs1() throws RegistryException{
+        List<NodeOutputResource> outputResources = new ArrayList<NodeOutputResource>();
+        List<Resource> resources = get(ResourceType.NODE_OUTPUT);
+        for (Resource resource : resources) {
+            NodeOutputResource nodeOutputResource = (NodeOutputResource) resource;
+            outputResources.add(nodeOutputResource);
+        }
+        return outputResources;
+    }
+
+    public StatusResource getWorkflowNodeStatus() throws RegistryException{
+        List<Resource> resources = get(ResourceType.STATUS);
+        for (Resource resource : resources) {
+            StatusResource nodeStatus = (StatusResource) resource;
+            if(nodeStatus.getStatusType().equals(StatusType.WORKFLOW_NODE.toString())){
+                if (nodeStatus.getState() == null || nodeStatus.getState().equals("") ){
+                    nodeStatus.setState("UNKNOWN");
+                }
+                return nodeStatus;
+            }
+        }
+        return null;
+    }
+
+    public StatusResource getTaskStatus(String taskId) throws RegistryException{
+        List<Resource> resources = get(ResourceType.STATUS);
+        for (Resource resource : resources) {
+            StatusResource taskStatus = (StatusResource) resource;
+            if(taskStatus.getStatusType().equals(StatusType.TASK.toString()) && taskStatus.getTaskId().equals(taskId)){
+                if (taskStatus.getState() == null || taskStatus.getState().equals("") ){
+                    taskStatus.setState("UNKNOWN");
+                }
+                return taskStatus;
+            }
+        }
+        return null;
+    }
+
+    public List<TaskDetailResource> getTaskDetails() throws RegistryException{
+        List<TaskDetailResource> taskDetailResources = new ArrayList<TaskDetailResource>();
+        List<Resource> resources = get(ResourceType.TASK_DETAIL);
+        for (Resource resource : resources) {
+            TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
+            taskDetailResources.add(taskDetailResource);
+        }
+        return taskDetailResources;
+    }
+
+    public List<ErrorDetailResource> getErrorDetails() throws RegistryException{
+        List<ErrorDetailResource> errorDetails = new ArrayList<ErrorDetailResource>();
+        List<Resource> resources = get(ResourceType.ERROR_DETAIL);
+        for (Resource resource : resources) {
+            ErrorDetailResource errorDetailResource = (ErrorDetailResource) resource;
+            errorDetails.add(errorDetailResource);
+        }
+        return errorDetails;
+    }
+
+    public TaskDetailResource getTaskDetail(String taskId) throws RegistryException{
+        return (TaskDetailResource)get(ResourceType.TASK_DETAIL, taskId);
+    }
+
+	public String getExecutionUnit() {
+		return executionUnit;
+	}
+
+	public void setExecutionUnit(String executionUnit) {
+		this.executionUnit = executionUnit;
+	}
+
+	public String getExecutionUnitData() {
+		return executionUnitData;
+	}
+
+	public void setExecutionUnitData(String executionUnitData) {
+		this.executionUnitData = executionUnitData;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/22bcbb40/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/QueryGenerator.java
----------------------------------------------------------------------
diff --git a/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/QueryGenerator.java b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/QueryGenerator.java
new file mode 100644
index 0000000..2c6c219
--- /dev/null
+++ b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/QueryGenerator.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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.experiment.catalog.utils;
+
+import org.apache.airavata.registry.cpi.ResultOrderType;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.HashMap;
+import java.util.Map;
+
+public class QueryGenerator {
+	private String tableName;
+	private Map<String,Object> matches=new HashMap<String, Object>();
+	private static final String SELECT_OBJ="p";
+	private static final String DELETE_OBJ="p";
+	private static final String TABLE_OBJ="p";
+//	
+//	public QueryGenerator(String tableName) {
+//		setTableName(tableName);
+//	}
+	
+	public QueryGenerator(String tableName, Object[]...params) {
+		setTableName(tableName);
+		for (Object[] param : params) {
+			addMatch(param[0].toString(), param[1]);
+		}
+	}
+	
+	public String getTableName() {
+		return tableName;
+	}
+	public void setTableName(String tableName) {
+		this.tableName = tableName;
+	}
+	public void addMatch(String colName, Object matchValue){
+		matches.put(colName, matchValue);
+	}
+	
+	public void setParameter(String colName, Object matchValue){
+		addMatch(colName, matchValue);
+	}
+
+    /**
+     * Select query
+     * @param entityManager
+     * @return
+     */
+	public Query selectQuery(EntityManager entityManager){
+        String queryString="SELECT "+ SELECT_OBJ + " FROM " +getTableName()+" "+TABLE_OBJ;
+        return generateQueryWithParameters(entityManager, queryString);
+    }
+
+    /**
+     * Select query with pagination
+     * @param entityManager
+     * @param orderByColumn
+     * @param resultOrderType
+     * @return
+     */
+    public Query selectQuery(EntityManager entityManager, String orderByColumn,
+                             ResultOrderType resultOrderType){
+        String order = (resultOrderType == ResultOrderType.ASC) ? "ASC" : "DESC";
+        String orderByClause = " ORDER BY " + SELECT_OBJ + "." + orderByColumn + " " + order;
+        String queryString="SELECT "+ SELECT_OBJ + " FROM " +getTableName()+" "+TABLE_OBJ;
+        return generateQueryWithParameters(entityManager, queryString, orderByClause);
+    }
+
+//    public Query countQuery(EntityManager entityManager){
+//        SELECT COUNT(p.host_descriptor_ID) FROM Host_Descriptor p WHERE p.gateway_name =:gate_ID and p.host_descriptor_ID =:host_desc_name")
+//        String queryString="SELECT COUNT("+ SELECT_OBJ + " FROM " +getTableName()+" "+TABLE_OBJ;
+//        return generateQueryWithParameters(entityManager, queryString);
+//    }
+	
+	public Query deleteQuery(EntityManager entityManager){
+		String queryString="Delete FROM "+getTableName()+" "+TABLE_OBJ;
+		return generateQueryWithParameters(entityManager, queryString);
+	}
+
+	private Query generateQueryWithParameters(EntityManager entityManager,
+			String queryString) {
+		return generateQueryWithParameters(entityManager, queryString, "");
+	}
+
+    private Query generateQueryWithParameters(EntityManager entityManager,
+                                              String queryString, String orderByClause) {
+        Map<String,Object> queryParameters=new HashMap<String, Object>();
+        if (matches.size()>0){
+            String matchString = "";
+            int paramCount=0;
+            for (String colName : matches.keySet()) {
+                String paramName="param"+paramCount;
+                queryParameters.put(paramName, matches.get(colName));
+                if (!matchString.equals("")){
+                    matchString+=" AND ";
+                }
+                matchString+=TABLE_OBJ+"."+colName+" =:"+paramName;
+                paramCount++;
+            }
+            queryString+=" WHERE "+matchString;
+        }
+        queryString += orderByClause;
+        Query query = entityManager.createQuery(queryString);
+        for (String paramName : queryParameters.keySet()) {
+            query.setParameter(paramName, queryParameters.get(paramName));
+        }
+        return query;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/22bcbb40/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/ThriftDataModelConversion.java
new file mode 100644
index 0000000..45acd3a
--- /dev/null
+++ b/modules/registry/experiment-catalog/src/main/java/org/apache/airavata/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -0,0 +1,686 @@
+/*
+*
+* 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.experiment.catalog.utils;
+
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.model.workspace.experiment.*;
+import org.apache.airavata.experiment.catalog.Resource;
+import org.apache.airavata.experiment.catalog.ResourceType;
+import org.apache.airavata.experiment.catalog.resources.*;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ThriftDataModelConversion {
+    private final static Logger logger = LoggerFactory.getLogger(ThriftDataModelConversion.class);
+
+    public static Project getProject (ProjectResource pr) throws RegistryException {
+        if (pr != null) {
+            Project project = new Project();
+            project.setProjectID(pr.getId());
+            project.setName(pr.getName());
+            if (pr.getCreationTime()!=null) {
+				project.setCreationTime(pr.getCreationTime().getTime());
+			}
+			project.setDescription(pr.getDescription());
+            project.setOwner(pr.getWorker().getUser());
+            List<ProjectUserResource> projectUserList = pr.getProjectUserList();
+            List<String> sharedUsers = new ArrayList<String>();
+            if (projectUserList != null && !projectUserList.isEmpty()){
+                for (ProjectUserResource resource : projectUserList){
+                    sharedUsers.add(resource.getUserName());
+                }
+            }
+            project.setSharedUsers(sharedUsers);
+            return project;
+        }
+        return null;
+    }
+
+    public static Gateway getGateway (GatewayResource resource){
+        Gateway gateway = new Gateway();
+        gateway.setGatewayId(resource.getGatewayId());
+        gateway.setGatewayName(resource.getGatewayName());
+        gateway.setDomain(resource.getDomain());
+        gateway.setEmailAddress(resource.getEmailAddress());
+        return gateway;
+    }
+
+    public static List<Gateway> getAllGateways (List<Resource> gatewayList){
+        List<Gateway> gateways = new ArrayList<Gateway>();
+        for (Resource resource : gatewayList){
+            gateways.add(getGateway((GatewayResource)resource));
+        }
+        return gateways;
+    }
+
+
+    public static Experiment getExperiment(ExperimentResource experimentResource) throws RegistryException {
+        if (experimentResource != null){
+            Experiment experiment = new Experiment();
+            experiment.setProjectID(experimentResource.getProjectId());
+            experiment.setExperimentID(experimentResource.getExpID());
+            experiment.setCreationTime(experimentResource.getCreationTime().getTime());
+            experiment.setUserName(experimentResource.getExecutionUser());
+            experiment.setName(experimentResource.getExpName());
+            experiment.setDescription(experimentResource.getDescription());
+            experiment.setApplicationId(experimentResource.getApplicationId());
+            experiment.setApplicationVersion(experimentResource.getApplicationVersion());
+            experiment.setWorkflowTemplateId(experimentResource.getWorkflowTemplateId());
+            experiment.setEnableEmailNotification(experimentResource.isEnableEmailNotifications());
+            experiment.setGatewayExecutionId(experimentResource.getGatewayExecutionId());
+            if (experiment.isEnableEmailNotification()){
+                List<NotificationEmailResource> notificationEmails = experimentResource.getNotificationEmails();
+                experiment.setEmailAddresses(getEmailAddresses(notificationEmails));
+            }
+            experiment.setWorkflowTemplateVersion(experimentResource.getWorkflowTemplateVersion());
+            experiment.setWorkflowExecutionInstanceId(experimentResource.getWorkflowExecutionId());
+            List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
+            experiment.setExperimentInputs(getExpInputs(experimentInputs));
+            List<ExperimentOutputResource> experimentOutputs = experimentResource.getExperimentOutputs();
+            experiment.setExperimentOutputs(getExpOutputs(experimentOutputs));
+            StatusResource experimentStatus = experimentResource.getExperimentStatus();
+            if (experimentStatus != null){
+                experiment.setExperimentStatus(getExperimentStatus(experimentStatus));
+            }
+            List<StatusResource> changeList = experimentResource.getWorkflowNodeStatuses();
+            if (changeList != null && !changeList.isEmpty()){
+                experiment.setStateChangeList(getWorkflowNodeStatusList(changeList));
+            }
+
+            List<WorkflowNodeDetailResource> workflowNodeDetails = experimentResource.getWorkflowNodeDetails();
+            if (workflowNodeDetails != null && !workflowNodeDetails.isEmpty()){
+                experiment.setWorkflowNodeDetailsList(getWfNodeList(workflowNodeDetails));
+            }
+            List<ErrorDetailResource> errorDetails = experimentResource.getErrorDetails();
+            if (errorDetails!= null && !errorDetails.isEmpty()){
+                experiment.setErrors(getErrorDetailList(errorDetails));
+            }
+            if (experimentResource.isExists(ResourceType.CONFIG_DATA, experimentResource.getExpID())){
+                ConfigDataResource userConfigData = experimentResource.getUserConfigData(experimentResource.getExpID());
+                experiment.setUserConfigurationData(getUserConfigData(userConfigData));
+            }
+            return experiment;
+        }
+        return null;
+    }
+
+    public static ExperimentSummary getExperimentSummary(ExperimentSummaryResource experimentSummaryResource) throws RegistryException {
+        if (experimentSummaryResource != null){
+            ExperimentSummary experimentSummary = new ExperimentSummary();
+            experimentSummary.setProjectID(experimentSummaryResource.getProjectID());
+            experimentSummary.setExperimentID(experimentSummaryResource.getExpID());
+            experimentSummary.setCreationTime(experimentSummaryResource.getCreationTime().getTime());
+            experimentSummary.setUserName(experimentSummaryResource.getExecutionUser());
+            experimentSummary.setName(experimentSummaryResource.getExpName());
+            experimentSummary.setDescription(experimentSummaryResource.getDescription());
+            experimentSummary.setApplicationId(experimentSummaryResource.getApplicationId());
+            StatusResource experimentStatus = experimentSummaryResource.getStatus();
+            if (experimentStatus != null){
+                experimentSummary.setExperimentStatus(getExperimentStatus(experimentStatus));
+            }
+            return experimentSummary;
+        }
+        return null;
+    }
+
+    public static InputDataObjectType getInput(Object object){
+        if (object != null){
+            InputDataObjectType dataObjectType = new InputDataObjectType();
+            if (object instanceof  ExperimentInputResource){
+                ExperimentInputResource expInput = (ExperimentInputResource) object;
+                dataObjectType.setName(expInput.getExperimentKey());
+                dataObjectType.setValue(expInput.getValue());
+                if (expInput.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(expInput.getDataType()));
+                }
+                dataObjectType.setMetaData(expInput.getMetadata());
+                dataObjectType.setApplicationArgument(expInput.getAppArgument());
+                dataObjectType.setStandardInput(expInput.isStandardInput());
+                dataObjectType.setUserFriendlyDescription(expInput.getUserFriendlyDesc());
+                dataObjectType.setInputOrder(expInput.getInputOrder());
+                dataObjectType.setIsRequired(expInput.getRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(expInput.getRequiredToCMD());
+                dataObjectType.setDataStaged(expInput.isDataStaged());
+                return dataObjectType;
+            }else if (object instanceof NodeInputResource){
+                NodeInputResource nodeInputResource = (NodeInputResource)object;
+                dataObjectType.setName(nodeInputResource.getInputKey());
+                dataObjectType.setValue(nodeInputResource.getValue());
+                if (nodeInputResource.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(nodeInputResource.getDataType()));
+                }
+                dataObjectType.setMetaData(nodeInputResource.getMetadata());
+                dataObjectType.setApplicationArgument(nodeInputResource.getAppArgument());
+                dataObjectType.setStandardInput(nodeInputResource.isStandardInput());
+                dataObjectType.setUserFriendlyDescription(nodeInputResource.getUserFriendlyDesc());
+                dataObjectType.setInputOrder(nodeInputResource.getInputOrder());
+                dataObjectType.setIsRequired(nodeInputResource.getRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(nodeInputResource.getRequiredToCMD());
+                dataObjectType.setDataStaged(nodeInputResource.isDataStaged());
+                return dataObjectType;
+            }else if (object instanceof ApplicationInputResource){
+                ApplicationInputResource inputResource = (ApplicationInputResource)object;
+                dataObjectType.setName(inputResource.getInputKey());
+                dataObjectType.setValue(inputResource.getValue());
+                if (inputResource.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
+                }
+                dataObjectType.setMetaData(inputResource.getMetadata());
+                dataObjectType.setApplicationArgument(inputResource.getAppArgument());
+                dataObjectType.setStandardInput(inputResource.isStandardInput());
+                dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDesc());
+                dataObjectType.setInputOrder(inputResource.getInputOrder());
+                dataObjectType.setIsRequired(inputResource.isRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(inputResource.isRequiredToCMD());
+                dataObjectType.setDataStaged(inputResource.isDataStaged());
+                return dataObjectType;
+            }else {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    public static OutputDataObjectType getOutput(Object object){
+        if (object != null){
+            OutputDataObjectType dataObjectType = new OutputDataObjectType();
+            if (object instanceof ExperimentOutputResource){
+                ExperimentOutputResource expOutput = (ExperimentOutputResource)object;
+                dataObjectType.setName(expOutput.getExperimentKey());
+                dataObjectType.setValue(expOutput.getValue());
+                if (expOutput.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(expOutput.getDataType()));
+                }
+                dataObjectType.setIsRequired(expOutput.getRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(expOutput.getRequiredToCMD());
+                dataObjectType.setDataMovement(expOutput.isDataMovement());
+                dataObjectType.setLocation(expOutput.getDataNameLocation());
+                dataObjectType.setSearchQuery(expOutput.getSearchQuery());
+                dataObjectType.setApplicationArgument(expOutput.getAppArgument());
+                return dataObjectType;
+            }else if (object instanceof NodeOutputResource){
+                NodeOutputResource nodeOutputResource = (NodeOutputResource)object;
+                dataObjectType.setName(nodeOutputResource.getOutputKey());
+                dataObjectType.setValue(nodeOutputResource.getValue());
+                if (nodeOutputResource.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(nodeOutputResource.getDataType()));
+                }
+                dataObjectType.setIsRequired(nodeOutputResource.getRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(nodeOutputResource.getRequiredToCMD());
+                dataObjectType.setDataMovement(nodeOutputResource.isDataMovement());
+                dataObjectType.setLocation(nodeOutputResource.getDataNameLocation());
+                dataObjectType.setSearchQuery(nodeOutputResource.getSearchQuery());
+                dataObjectType.setApplicationArgument(nodeOutputResource.getAppArgument());
+                return dataObjectType;
+            }else if (object instanceof ApplicationOutputResource){
+                ApplicationOutputResource outputResource = (ApplicationOutputResource)object;
+                dataObjectType.setName(outputResource.getOutputKey());
+                dataObjectType.setValue(outputResource.getValue());
+                dataObjectType.setIsRequired(outputResource.isRequired());
+                dataObjectType.setRequiredToAddedToCommandLine(outputResource.isRequiredToCMD());
+                if (outputResource.getDataType() != null){
+                    dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
+                }
+                dataObjectType.setDataMovement(outputResource.isDataMovement());
+                dataObjectType.setLocation(outputResource.getDataNameLocation());
+                dataObjectType.setSearchQuery(outputResource.getSearchQuery());
+                dataObjectType.setApplicationArgument(outputResource.getAppArgument());
+                return dataObjectType;
+            }else {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    public static List<String> getEmailAddresses (List<NotificationEmailResource> resourceList){
+        List<String> emailAddresses = new ArrayList<String>();
+        if (resourceList != null && !resourceList.isEmpty()){
+            for (NotificationEmailResource emailResource : resourceList){
+                emailAddresses.add(emailResource.getEmailAddress());
+            }
+        }
+        return emailAddresses;
+    }
+
+    public static List<InputDataObjectType> getExpInputs (List<ExperimentInputResource> exInputList){
+        List<InputDataObjectType> expInputs = new ArrayList<InputDataObjectType>();
+        if (exInputList != null && !exInputList.isEmpty()){
+            for (ExperimentInputResource inputResource : exInputList){
+                InputDataObjectType exInput = getInput(inputResource);
+                expInputs.add(exInput);
+            }
+        }
+        return expInputs;
+    }
+
+    public static List<OutputDataObjectType> getExpOutputs (List<ExperimentOutputResource> experimentOutputResourceList){
+        List<OutputDataObjectType> exOutputs = new ArrayList<OutputDataObjectType>();
+        if (experimentOutputResourceList != null && !experimentOutputResourceList.isEmpty()){
+            for (ExperimentOutputResource outputResource : experimentOutputResourceList){
+                OutputDataObjectType output = getOutput(outputResource);
+                exOutputs.add(output);
+            }
+        }
+        return exOutputs;
+    }
+
+    public static List<InputDataObjectType> getNodeInputs (List<NodeInputResource> nodeInputResources){
+        List<InputDataObjectType> nodeInputs = new ArrayList<InputDataObjectType>();
+        if (nodeInputResources != null && !nodeInputResources.isEmpty()){
+            for (NodeInputResource inputResource : nodeInputResources){
+                InputDataObjectType nodeInput = getInput(inputResource);
+                nodeInputs.add(nodeInput);
+            }
+        }
+        return nodeInputs;
+    }
+
+    public static List<OutputDataObjectType> getNodeOutputs (List<NodeOutputResource> nodeOutputResourceList){
+        List<OutputDataObjectType> nodeOutputs = new ArrayList<OutputDataObjectType>();
+        if (nodeOutputResourceList != null && !nodeOutputResourceList.isEmpty()){
+            for (NodeOutputResource outputResource : nodeOutputResourceList){
+                OutputDataObjectType output = getOutput(outputResource);
+                nodeOutputs.add(output);
+            }
+        }
+        return nodeOutputs;
+    }
+
+    public static List<InputDataObjectType> getApplicationInputs (List<ApplicationInputResource> applicationInputResources){
+        List<InputDataObjectType> appInputs = new ArrayList<InputDataObjectType>();
+        if (applicationInputResources != null && !applicationInputResources.isEmpty()){
+            for (ApplicationInputResource inputResource : applicationInputResources){
+                InputDataObjectType appInput = getInput(inputResource);
+                appInputs.add(appInput);
+            }
+        }
+        return appInputs;
+    }
+
+    public static List<OutputDataObjectType> getApplicationOutputs (List<ApplicationOutputResource> outputResources){
+        List<OutputDataObjectType> appOutputs = new ArrayList<OutputDataObjectType>();
+        if (outputResources != null && !outputResources.isEmpty()){
+            for (ApplicationOutputResource outputResource : outputResources){
+                OutputDataObjectType output = getOutput(outputResource);
+                appOutputs.add(output);
+            }
+        }
+        return appOutputs;
+    }
+
+    public static ExperimentStatus getExperimentStatus(StatusResource status){
+        if (status != null){
+            ExperimentStatus experimentStatus = new ExperimentStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            experimentStatus.setExperimentState(ExperimentState.valueOf(status.getState()));
+            experimentStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            return experimentStatus;
+        }
+        return null;
+    }
+
+    public static WorkflowNodeStatus getWorkflowNodeStatus (StatusResource status){
+        if (status != null){
+            WorkflowNodeStatus workflowNodeStatus = new WorkflowNodeStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.valueOf(status.getState()));
+            workflowNodeStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            return workflowNodeStatus;
+        }
+        return null;
+    }
+
+    public static TaskStatus getTaskStatus (StatusResource status){
+        if (status != null){
+            TaskStatus taskStatus = new TaskStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            taskStatus.setExecutionState(TaskState.valueOf(status.getState()));
+            taskStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            return taskStatus;
+        }
+        return null;
+    }
+
+    public static JobStatus getJobStatus (StatusResource status){
+        if (status != null){
+            JobStatus jobStatus = new JobStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            jobStatus.setJobState(JobState.valueOf(status.getState()));
+            if (status.getStatusUpdateTime() == null){
+                jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+            }else {
+                jobStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            }
+            return jobStatus;
+        }
+        return null;
+    }
+
+    public static TransferStatus getTransferStatus (StatusResource status){
+        if (status != null){
+            TransferStatus transferStatus = new TransferStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            transferStatus.setTransferState(TransferState.valueOf(status.getState()));
+            transferStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            return transferStatus;
+        }
+        return null;
+    }
+
+    public static ApplicationStatus getApplicationStatus (StatusResource status){
+        if (status != null){
+            ApplicationStatus applicationStatus = new ApplicationStatus();
+            if (status.getState() == null || status.getState().equals("")){
+                status.setState("UNKNOWN");
+            }
+            applicationStatus.setApplicationState(status.getState());
+            applicationStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+            return applicationStatus;
+        }
+        return null;
+    }
+
+    public static List<WorkflowNodeStatus> getWorkflowNodeStatusList(List<StatusResource> statuses){
+        List<WorkflowNodeStatus> wfNodeStatuses = new ArrayList<WorkflowNodeStatus>();
+        if (statuses != null && !statuses.isEmpty()){
+            for (StatusResource statusResource : statuses){
+                wfNodeStatuses.add(getWorkflowNodeStatus(statusResource));
+            }
+        }
+        return wfNodeStatuses;
+    }
+
+    public static WorkflowNodeDetails getWorkflowNodeDetails(WorkflowNodeDetailResource nodeDetailResource) throws RegistryException {
+        if (nodeDetailResource != null){
+            WorkflowNodeDetails wfNode = new WorkflowNodeDetails();
+            wfNode.setNodeInstanceId(nodeDetailResource.getNodeInstanceId());
+            wfNode.setCreationTime(nodeDetailResource.getCreationTime().getTime());
+            wfNode.setNodeName(nodeDetailResource.getNodeName());
+            List<NodeInputResource> nodeInputs = nodeDetailResource.getNodeInputs();
+            wfNode.setNodeInputs(getNodeInputs(nodeInputs));
+            List<NodeOutputResource> nodeOutputs = nodeDetailResource.getNodeOutputs();
+            wfNode.setNodeOutputs(getNodeOutputs(nodeOutputs));
+            List<TaskDetailResource> taskDetails = nodeDetailResource.getTaskDetails();
+            wfNode.setTaskDetailsList(getTaskDetailsList(taskDetails));
+            wfNode.setWorkflowNodeStatus(getWorkflowNodeStatus(nodeDetailResource.getWorkflowNodeStatus()));
+            List<ErrorDetailResource> errorDetails = nodeDetailResource.getErrorDetails();
+            wfNode.setErrors(getErrorDetailList(errorDetails));
+            wfNode.setExecutionUnit(ExecutionUnit.valueOf(nodeDetailResource.getExecutionUnit()));
+            wfNode.setExecutionUnitData(nodeDetailResource.getExecutionUnitData());
+            return wfNode;
+        }
+        return null;
+    }
+
+    public static List<WorkflowNodeDetails> getWfNodeList (List<WorkflowNodeDetailResource> resources) throws RegistryException {
+        List<WorkflowNodeDetails> workflowNodeDetailsList = new ArrayList<WorkflowNodeDetails>();
+        if (resources != null && !resources.isEmpty()){
+            for (WorkflowNodeDetailResource resource : resources){
+                workflowNodeDetailsList.add(getWorkflowNodeDetails(resource));
+            }
+        }
+        return workflowNodeDetailsList;
+    }
+
+    public static TaskDetails getTaskDetail (TaskDetailResource taskDetailResource) throws RegistryException {
+        if (taskDetailResource != null){
+            TaskDetails taskDetails = new TaskDetails();
+            String taskId = taskDetailResource.getTaskId();
+            taskDetails.setTaskID(taskId);
+            taskDetails.setApplicationId(taskDetailResource.getApplicationId());
+            taskDetails.setApplicationVersion(taskDetailResource.getApplicationVersion());
+            List<ApplicationInputResource> applicationInputs = taskDetailResource.getApplicationInputs();
+            taskDetails.setApplicationInputs(getApplicationInputs(applicationInputs));
+            List<ApplicationOutputResource> applicationOutputs = taskDetailResource.getApplicationOutputs();
+            taskDetails.setApplicationOutputs(getApplicationOutputs(applicationOutputs));
+            taskDetails.setEnableEmailNotification(taskDetailResource.isEnableEmailNotifications());
+            if (taskDetails.isEnableEmailNotification()){
+                List<NotificationEmailResource> notificationEmails = taskDetailResource.getNotificationEmails();
+                taskDetails.setEmailAddresses(getEmailAddresses(notificationEmails));
+            }
+            taskDetails.setApplicationDeploymentId(taskDetailResource.getApplicationDeploymentId());
+            if (taskDetailResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, taskId)){
+                ComputationSchedulingResource computationScheduling = taskDetailResource.getComputationScheduling(taskId);
+                taskDetails.setTaskScheduling(getComputationalResourceScheduling(computationScheduling));
+            }
+
+            if (taskDetailResource.isExists(ResourceType.ADVANCE_INPUT_DATA_HANDLING, taskId)){
+                AdvanceInputDataHandlingResource inputDataHandling = taskDetailResource.getInputDataHandling(taskId);
+                taskDetails.setAdvancedInputDataHandling(getAdvanceInputDataHandling(inputDataHandling));
+            }
+
+            if (taskDetailResource.isExists(ResourceType.ADVANCE_OUTPUT_DATA_HANDLING, taskId)){
+                AdvancedOutputDataHandlingResource outputDataHandling = taskDetailResource.getOutputDataHandling(taskId);
+                taskDetails.setAdvancedOutputDataHandling(getAdvanceOutputDataHandling(outputDataHandling));
+            }
+
+            taskDetails.setTaskStatus(getTaskStatus(taskDetailResource.getTaskStatus()));
+            List<JobDetailResource> jobDetailList = taskDetailResource.getJobDetailList();
+            taskDetails.setJobDetailsList(getJobDetailsList(jobDetailList));
+            taskDetails.setErrors(getErrorDetailList(taskDetailResource.getErrorDetailList()));
+            taskDetails.setDataTransferDetailsList(getDataTransferlList(taskDetailResource.getDataTransferDetailList()));
+            return taskDetails;
+        }
+        return null;
+    }
+
+    public static List<TaskDetails> getTaskDetailsList (List<TaskDetailResource> resources) throws RegistryException {
+        List<TaskDetails> taskDetailsList = new ArrayList<TaskDetails>();
+        if (resources != null && !resources.isEmpty()){
+            for (TaskDetailResource resource : resources){
+                taskDetailsList.add(getTaskDetail(resource));
+            }
+        }
+        return taskDetailsList;
+    }
+
+    public static List<JobDetails> getJobDetailsList(List<JobDetailResource> jobs) throws RegistryException {
+        List<JobDetails> jobDetailsList = new ArrayList<JobDetails>();
+        if (jobs != null && !jobs.isEmpty()){
+            for (JobDetailResource resource : jobs){
+                jobDetailsList.add(getJobDetail(resource));
+            }
+        }
+        return jobDetailsList;
+    }
+
+
+    public static JobDetails getJobDetail(JobDetailResource jobDetailResource) throws RegistryException {
+        if (jobDetailResource != null){
+            JobDetails jobDetails = new JobDetails();
+            jobDetails.setJobID(jobDetailResource.getJobId());
+            jobDetails.setJobDescription(jobDetailResource.getJobDescription());
+            jobDetails.setCreationTime(jobDetailResource.getCreationTime().getTime());
+            StatusResource jobStatus = jobDetailResource.getJobStatus();
+            jobDetails.setJobStatus(getJobStatus(jobStatus));
+            jobDetails.setJobName(jobDetailResource.getJobName());
+            jobDetails.setWorkingDir(jobDetailResource.getWorkingDir());
+            StatusResource applicationStatus = jobDetailResource.getApplicationStatus();
+            jobDetails.setApplicationStatus(getApplicationStatus(applicationStatus));
+            List<ErrorDetailResource> errorDetails = jobDetailResource.getErrorDetails();
+            jobDetails.setErrors(getErrorDetailList(errorDetails));
+            jobDetails.setComputeResourceConsumed(jobDetailResource.getComputeResourceConsumed());
+            return jobDetails;
+        }
+        return null;
+    }
+
+    public static ErrorDetails getErrorDetails (ErrorDetailResource resource){
+        if (resource != null){
+            ErrorDetails errorDetails = new ErrorDetails();
+            errorDetails.setErrorID(String.valueOf(resource.getErrorId()));
+            errorDetails.setCreationTime(resource.getCreationTime().getTime());
+            errorDetails.setActualErrorMessage(resource.getActualErrorMsg());
+            errorDetails.setUserFriendlyMessage(resource.getUserFriendlyErrorMsg());
+            errorDetails.setErrorCategory(ErrorCategory.valueOf(resource.getErrorCategory()));
+            errorDetails.setTransientOrPersistent(resource.isTransientPersistent());
+            errorDetails.setCorrectiveAction(CorrectiveAction.valueOf(resource.getCorrectiveAction()));
+            errorDetails.setActionableGroup(ActionableGroup.valueOf(resource.getActionableGroup()));
+            return errorDetails;
+        }
+        return null;
+    }
+
+    public static List<ErrorDetails> getErrorDetailList (List<ErrorDetailResource> errorDetailResources){
+        List<ErrorDetails> errorDetailsList = new ArrayList<ErrorDetails>();
+        if (errorDetailResources != null && !errorDetailResources.isEmpty()){
+            for (ErrorDetailResource errorDetailResource : errorDetailResources){
+                errorDetailsList.add(getErrorDetails(errorDetailResource));
+            }
+        }
+        return errorDetailsList;
+    }
+
+    public static DataTransferDetails getDataTransferDetail (DataTransferDetailResource resource) throws RegistryException {
+        if (resource != null){
+            DataTransferDetails details = new DataTransferDetails();
+            details.setTransferID(resource.getTransferId());
+            details.setCreationTime(resource.getCreationTime().getTime());
+            details.setTransferDescription(resource.getTransferDescription());
+            details.setTransferStatus(getTransferStatus(resource.getDataTransferStatus()));
+            return details;
+        }
+        return null;
+    }
+
+    public static List<DataTransferDetails> getDataTransferlList (List<DataTransferDetailResource> resources) throws RegistryException {
+        List<DataTransferDetails> transferDetailsList = new ArrayList<DataTransferDetails>();
+        if (resources != null && !resources.isEmpty()){
+            for (DataTransferDetailResource resource : resources){
+                transferDetailsList.add(getDataTransferDetail(resource));
+            }
+        }
+        return transferDetailsList;
+    }
+
+
+    public static UserConfigurationData getUserConfigData (ConfigDataResource resource) throws RegistryException {
+        if (resource != null){
+            UserConfigurationData data = new UserConfigurationData();
+            data.setAiravataAutoSchedule(resource.isAiravataAutoSchedule());
+            data.setOverrideManualScheduledParams(resource.isOverrideManualParams());
+            data.setShareExperimentPublicly(resource.isShareExp());
+            data.setUserDN(resource.getUserDn());
+            data.setGenerateCert(resource.isGenerateCert());
+            String expID = resource.getExperimentId();
+            ExperimentResource experimentResource = new ExperimentResource();
+            experimentResource.setExpID(expID);
+            if (experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, expID)){
+                ComputationSchedulingResource computationScheduling = experimentResource.getComputationScheduling(expID);
+                data.setComputationalResourceScheduling(getComputationalResourceScheduling(computationScheduling));
+            }
+
+            if (experimentResource.isExists(ResourceType.ADVANCE_INPUT_DATA_HANDLING, expID)){
+                AdvanceInputDataHandlingResource inputDataHandling = experimentResource.getInputDataHandling(expID);
+                data.setAdvanceInputDataHandling(getAdvanceInputDataHandling(inputDataHandling));
+            }
+
+            if (experimentResource.isExists(ResourceType.ADVANCE_OUTPUT_DATA_HANDLING, expID)){
+                AdvancedOutputDataHandlingResource outputDataHandling = experimentResource.getOutputDataHandling(expID);
+                data.setAdvanceOutputDataHandling(getAdvanceOutputDataHandling(outputDataHandling));
+            }
+
+            if (experimentResource.isExists(ResourceType.QOS_PARAM, expID)){
+                QosParamResource qoSparams = experimentResource.getQOSparams(expID);
+                data.setQosParams(getQOSParams(qoSparams));
+            }
+            return data;
+        }
+        return null;
+    }
+
+
+    public static ComputationalResourceScheduling getComputationalResourceScheduling (ComputationSchedulingResource csr){
+        if (csr != null){
+            ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling();
+            scheduling.setResourceHostId(csr.getResourceHostId());
+            scheduling.setTotalCPUCount(csr.getCpuCount());
+            scheduling.setNodeCount(csr.getNodeCount());
+            scheduling.setNumberOfThreads(csr.getNumberOfThreads());
+            scheduling.setQueueName(csr.getQueueName());
+            scheduling.setWallTimeLimit(csr.getWalltimeLimit());
+            scheduling.setJobStartTime((int)csr.getJobStartTime().getTime());
+            scheduling.setTotalPhysicalMemory(csr.getPhysicalMemory());
+            scheduling.setComputationalProjectAccount(csr.getProjectName());
+            scheduling.setChassisName(csr.getChessisName());
+            return scheduling;
+        }
+        return null;
+    }
+
+    public static AdvancedInputDataHandling getAdvanceInputDataHandling(AdvanceInputDataHandlingResource adhr){
+        if (adhr != null){
+            AdvancedInputDataHandling adih = new AdvancedInputDataHandling();
+            adih.setStageInputFilesToWorkingDir(adhr.isStageInputFiles());
+            adih.setParentWorkingDirectory(adhr.getWorkingDirParent());
+            adih.setUniqueWorkingDirectory(adhr.getWorkingDir());
+            adih.setCleanUpWorkingDirAfterJob(adhr.isCleanAfterJob());
+            return adih;
+        }
+        return null;
+    }
+
+    public static AdvancedOutputDataHandling getAdvanceOutputDataHandling(AdvancedOutputDataHandlingResource adodh){
+        if (adodh != null){
+            AdvancedOutputDataHandling outputDataHandling = new AdvancedOutputDataHandling();
+            outputDataHandling.setOutputDataDir(adodh.getOutputDataDir());
+            outputDataHandling.setDataRegistryURL(adodh.getDataRegUrl());
+            outputDataHandling.setPersistOutputData(adodh.isPersistOutputData());
+            return outputDataHandling;
+        }
+        return null;
+    }
+
+    public static QualityOfServiceParams getQOSParams (QosParamResource qos){
+        if (qos != null){
+            QualityOfServiceParams qosParams = new QualityOfServiceParams();
+            qosParams.setStartExecutionAt(qos.getStartExecutionAt());
+            qosParams.setExecuteBefore(qos.getExecuteBefore());
+            qosParams.setNumberofRetries(qos.getNoOfRetries());
+            return qosParams;
+        }
+        return null;
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/22bcbb40/modules/registry/experiment-catalog/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/registry/experiment-catalog/src/main/resources/META-INF/persistence.xml b/modules/registry/experiment-catalog/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..8df44f9
--- /dev/null
+++ b/modules/registry/experiment-catalog/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!--*
+ *
+ * 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.
+ *
+* -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
+    <persistence-unit name="airavata_data">
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+        <class>org.apache.airavata.experiment.catalog.model.Gateway</class>
+        <class>org.apache.airavata.experiment.catalog.model.Configuration</class>
+        <class>org.apache.airavata.experiment.catalog.model.Users</class>
+        <class>org.apache.airavata.experiment.catalog.model.Gateway_Worker</class>
+        <class>org.apache.airavata.experiment.catalog.model.Project</class>
+        <class>org.apache.airavata.experiment.catalog.model.ProjectUser</class>
+        <class>org.apache.airavata.experiment.catalog.model.Experiment</class>
+        <class>org.apache.airavata.experiment.catalog.model.Notification_Email</class>
+        <class>org.apache.airavata.experiment.catalog.model.Experiment_Input</class>
+        <class>org.apache.airavata.experiment.catalog.model.Experiment_Output</class>
+        <class>org.apache.airavata.experiment.catalog.model.WorkflowNodeDetail</class>
+        <class>org.apache.airavata.experiment.catalog.model.TaskDetail</class>
+		<class>org.apache.airavata.experiment.catalog.model.ErrorDetail</class>
+		<class>org.apache.airavata.experiment.catalog.model.ApplicationInput</class>
+		<class>org.apache.airavata.experiment.catalog.model.ApplicationOutput</class>
+		<class>org.apache.airavata.experiment.catalog.model.NodeInput</class>
+		<class>org.apache.airavata.experiment.catalog.model.NodeOutput</class>
+		<class>org.apache.airavata.experiment.catalog.model.JobDetail</class>
+		<class>org.apache.airavata.experiment.catalog.model.DataTransferDetail</class>
+		<class>org.apache.airavata.experiment.catalog.model.Status</class>
+		<class>org.apache.airavata.experiment.catalog.model.ExperimentConfigData</class>
+		<class>org.apache.airavata.experiment.catalog.model.Computational_Resource_Scheduling</class>
+		<class>org.apache.airavata.experiment.catalog.model.AdvancedInputDataHandling</class>
+		<class>org.apache.airavata.experiment.catalog.model.AdvancedOutputDataHandling</class>
+		<class>org.apache.airavata.experiment.catalog.model.QosParam</class>
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+        <!--properties>
+            <property name="openjpa.ConnectionURL"
+                      value="jdbc:mysql://localhost:3306/persitant_data" />
+            <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver" />
+            <property name="openjpa.ConnectionUserName" value="airavata" />
+            <property name="openjpa.ConnectionPassword" value="airavata" />
+            <property name="openjpa.DynamicEnhancementAgent" value="true" />
+            <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
+            <property name="openjpa.Log" value="SQL=TRACE" />
+            <property name="openjpa.ConnectionFactoryProperties"
+                      value="PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000" />
+       </properties-->
+    </persistence-unit>
+</persistence>

http://git-wip-us.apache.org/repos/asf/airavata/blob/22bcbb40/modules/registry/experiment-catalog/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/experiment-catalog/src/main/resources/registry-derby.sql b/modules/registry/experiment-catalog/src/main/resources/registry-derby.sql
new file mode 100644
index 0000000..7ab3755
--- /dev/null
+++ b/modules/registry/experiment-catalog/src/main/resources/registry-derby.sql
@@ -0,0 +1,391 @@
+/*
+ *
+ * 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.
+ *
+ */
+CREATE TABLE GATEWAY
+(
+        GATEWAY_ID VARCHAR (255),
+        GATEWAY_NAME VARCHAR(255),
+	      DOMAIN VARCHAR(255),
+	      EMAIL_ADDRESS VARCHAR(255),
+        PRIMARY KEY (GATEWAY_ID)
+);
+
+CREATE TABLE CONFIGURATION
+(
+        CONFIG_KEY VARCHAR(255),
+        CONFIG_VAL VARCHAR(255),
+        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        CATEGORY_ID VARCHAR (255),
+        PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
+
+CREATE TABLE USERS
+(
+        USER_NAME VARCHAR(255),
+        PASSWORD VARCHAR(255),
+        PRIMARY KEY(USER_NAME)
+);
+
+CREATE TABLE GATEWAY_WORKER
+(
+        GATEWAY_ID VARCHAR(255),
+        USER_NAME VARCHAR(255),
+        PRIMARY KEY (GATEWAY_ID, USER_NAME),
+        FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
+        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT
+(
+         GATEWAY_ID VARCHAR(255),
+         USER_NAME VARCHAR(255) NOT NULL,
+         PROJECT_ID VARCHAR(255),
+         PROJECT_NAME VARCHAR(255) NOT NULL,
+         DESCRIPTION VARCHAR(255),
+         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+         PRIMARY KEY (PROJECT_ID),
+         FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
+         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE PROJECT_USER
+(
+    PROJECT_ID VARCHAR(255),
+    USER_NAME VARCHAR(255),
+    PRIMARY KEY (PROJECT_ID,USER_NAME),
+    FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
+    FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        GATEWAY_ID VARCHAR(255),
+        EXECUTION_USER VARCHAR(255) NOT NULL,
+        PROJECT_ID VARCHAR(255) NOT NULL,
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        EXPERIMENT_NAME VARCHAR(255) NOT NULL,
+        EXPERIMENT_DESCRIPTION VARCHAR(255),
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        WORKFLOW_TEMPLATE_ID VARCHAR(255),
+        WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
+        WORKFLOW_EXECUTION_ID VARCHAR(255),
+        ALLOW_NOTIFICATION SMALLINT,
+        GATEWAY_EXECUTION_ID VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID),
+        FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
+        FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
+        FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_INPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255) NOT NULL,
+        DATA_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        APP_ARGUMENT VARCHAR(255),
+        STANDARD_INPUT SMALLINT,
+        USER_FRIENDLY_DESC VARCHAR(255),
+        VALUE CLOB,
+        INPUT_ORDER INTEGER,
+        IS_REQUIRED SMALLINT,
+        REQUIRED_TO_COMMANDLINE SMALLINT,
+        DATA_STAGED SMALLINT,
+        PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EXPERIMENT_OUTPUT
+(
+        EXPERIMENT_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255) NOT NULL,
+        DATA_TYPE VARCHAR(255),
+        VALUE CLOB,
+        IS_REQUIRED SMALLINT,
+        REQUIRED_TO_COMMANDLINE SMALLINT,
+        DATA_MOVEMENT SMALLINT,
+        DATA_NAME_LOCATION VARCHAR(255),
+        SEARCH_QUERY VARCHAR(255),
+        APP_ARGUMENT VARCHAR(255),
+        PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+
+CREATE TABLE WORKFLOW_NODE_DETAIL
+(
+        EXPERIMENT_ID VARCHAR(255) NOT NULL,
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        NODE_NAME VARCHAR(255) NOT NULL,
+        EXECUTION_UNIT VARCHAR(255) NOT NULL,
+        EXECUTION_UNIT_DATA VARCHAR(255),
+        PRIMARY KEY(NODE_INSTANCE_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE TASK_DETAIL
+(
+        TASK_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        APPLICATION_ID VARCHAR(255),
+        APPLICATION_VERSION VARCHAR(255),
+        APPLICATION_DEPLOYMENT_ID VARCHAR(255),
+        ALLOW_NOTIFICATION SMALLINT,
+        PRIMARY KEY(TASK_ID),
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NOTIFICATION_EMAIL
+(
+  EMAIL_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+  EXPERIMENT_ID VARCHAR(255),
+  TASK_ID VARCHAR(255),
+  EMAIL_ADDRESS VARCHAR(255),
+  PRIMARY KEY(EMAIL_ID),
+  FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+  FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ERROR_DETAIL
+(
+         ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+         EXPERIMENT_ID VARCHAR(255),
+         TASK_ID VARCHAR(255),
+         NODE_INSTANCE_ID VARCHAR(255),
+         JOB_ID VARCHAR(255),
+         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+         ACTUAL_ERROR_MESSAGE CLOB,
+         USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
+         TRANSIENT_OR_PERSISTENT SMALLINT,
+         ERROR_CATEGORY VARCHAR(255),
+         CORRECTIVE_ACTION VARCHAR(255),
+         ACTIONABLE_GROUP VARCHAR(255),
+         PRIMARY KEY(ERROR_ID),
+         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+         FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_INPUT
+(
+        TASK_ID VARCHAR(255),
+        INPUT_KEY VARCHAR(255) NOT NULL,
+        DATA_TYPE VARCHAR(255),
+        METADATA VARCHAR(255),
+        APP_ARGUMENT VARCHAR(255),
+        STANDARD_INPUT SMALLINT,
+        USER_FRIENDLY_DESC VARCHAR(255),
+        VALUE CLOB,
+        INPUT_ORDER INTEGER,
+        IS_REQUIRED SMALLINT,
+        REQUIRED_TO_COMMANDLINE SMALLINT,
+        DATA_STAGED SMALLINT,
+        PRIMARY KEY(TASK_ID,INPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE APPLICATION_OUTPUT
+(
+        TASK_ID VARCHAR(255),
+        OUTPUT_KEY VARCHAR(255) NOT NULL,
+        DATA_TYPE VARCHAR(255),
+        VALUE CLOB,
+        IS_REQUIRED SMALLINT,
+        REQUIRED_TO_COMMANDLINE SMALLINT,
+        DATA_MOVEMENT SMALLINT,
+        DATA_NAME_LOCATION VARCHAR(255),
+        SEARCH_QUERY VARCHAR(255),
+        APP_ARGUMENT VARCHAR(255),
+        PRIMARY KEY(TASK_ID,OUTPUT_KEY),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_INPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       INPUT_KEY VARCHAR(255) NOT NULL,
+       DATA_TYPE VARCHAR(255),
+       METADATA VARCHAR(255),
+       APP_ARGUMENT VARCHAR(255),
+       STANDARD_INPUT SMALLINT,
+       USER_FRIENDLY_DESC VARCHAR(255),
+       VALUE VARCHAR(255),
+       INPUT_ORDER INTEGER,
+       IS_REQUIRED SMALLINT,
+       REQUIRED_TO_COMMANDLINE SMALLINT,
+       DATA_STAGED SMALLINT,
+       PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE_OUTPUT
+(
+       NODE_INSTANCE_ID VARCHAR(255),
+       OUTPUT_KEY VARCHAR(255) NOT NULL,
+       DATA_TYPE VARCHAR(255),
+       VALUE VARCHAR(255),
+       IS_REQUIRED SMALLINT,
+       REQUIRED_TO_COMMANDLINE SMALLINT,
+       DATA_MOVEMENT SMALLINT,
+       DATA_NAME_LOCATION VARCHAR(255),
+       SEARCH_QUERY VARCHAR(255),
+       APP_ARGUMENT VARCHAR(255),
+       PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
+       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE JOB_DETAIL
+(
+        JOB_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_DESCRIPTION CLOB NOT NULL,
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
+        JOBNAME VARCHAR (255),
+        WORKING_DIR VARCHAR(255),
+        PRIMARY KEY (TASK_ID, JOB_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE DATA_TRANSFER_DETAIL
+(
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        TRANSFER_DESC VARCHAR(255) NOT NULL,
+        PRIMARY KEY(TRANSFER_ID),
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE STATUS
+(
+        STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        NODE_INSTANCE_ID VARCHAR(255),
+        TRANSFER_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        JOB_ID VARCHAR(255),
+        STATE VARCHAR(255),
+        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        STATUS_TYPE VARCHAR(255),
+        PRIMARY KEY(STATUS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
+        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE CONFIG_DATA
+(
+        EXPERIMENT_ID VARCHAR(255),
+        AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
+        OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
+        SHARE_EXPERIMENT SMALLINT,
+        USER_DN VARCHAR(255),
+        GENERATE_CERT SMALLINT,
+        PRIMARY KEY(EXPERIMENT_ID)
+);
+
+CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
+(
+        RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        RESOURCE_HOST_ID VARCHAR(255),
+        CPU_COUNT INTEGER,
+        NODE_COUNT INTEGER,
+        NO_OF_THREADS INTEGER,
+        QUEUE_NAME VARCHAR(255),
+        WALLTIME_LIMIT INTEGER,
+        JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+        TOTAL_PHYSICAL_MEMORY INTEGER,
+        COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
+        CHESSIS_NAME VARCHAR(255),
+        PRIMARY KEY(RESOURCE_SCHEDULING_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
+(
+       INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       WORKING_DIR_PARENT VARCHAR(255),
+       UNIQUE_WORKING_DIR VARCHAR(255),
+       STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
+       CLEAN_AFTER_JOB SMALLINT,
+       PRIMARY KEY(INPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
+(
+       OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+       EXPERIMENT_ID VARCHAR(255),
+       TASK_ID VARCHAR(255),
+       OUTPUT_DATA_DIR VARCHAR(255),
+       DATA_REG_URL VARCHAR (255),
+       PERSIST_OUTPUT_DATA SMALLINT,
+       PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
+       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE QOS_PARAM
+(
+        QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+        EXPERIMENT_ID VARCHAR(255),
+        TASK_ID VARCHAR(255),
+        START_EXECUTION_AT VARCHAR(255),
+        EXECUTE_BEFORE VARCHAR(255),
+        NO_OF_RETRIES INTEGER,
+        PRIMARY KEY(QOS_ID),
+        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
+        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMMUNITY_USER
+(
+        GATEWAY_ID VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
+        PRIMARY KEY (GATEWAY_ID, COMMUNITY_USER_NAME, TOKEN_ID)
+);
+
+CREATE TABLE CREDENTIALS
+(
+        GATEWAY_ID VARCHAR(256) NOT NULL,
+        TOKEN_ID VARCHAR(256) NOT NULL,
+        CREDENTIAL BLOB NOT NULL,
+        PORTAL_USER_ID VARCHAR(256) NOT NULL,
+        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+);
+
+


Mime
View raw message