airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [1/3] airavata git commit: Changed dag classes to work with thrift workflow data models
Date Mon, 01 Feb 2016 21:48:39 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 72a6f6a5a -> ad0116126


Changed dag classes to work with thrift workflow data models


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9859af32
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9859af32
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9859af32

Branch: refs/heads/develop
Commit: 9859af32bfd71aa95ec0e5e170d4937398899ecd
Parents: 494e0d7
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Mon Feb 1 13:17:05 2016 -0500
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Mon Feb 1 13:17:05 2016 -0500

----------------------------------------------------------------------
 .../org/apache/airavata/model/PortModel.java    | 122 +++++++++++++++++--
 .../workflow/core/dag/edge/DirectedEdge.java    |  12 ++
 .../airavata/workflow/core/dag/edge/Edge.java   |   5 +
 .../core/dag/nodes/ApplicationNode.java         |   2 +
 .../core/dag/nodes/ApplicationNodeImpl.java     |  62 +++++-----
 .../core/dag/nodes/WorkflowInputNodeImpl.java   |  44 ++++---
 .../workflow/core/dag/nodes/WorkflowNode.java   |  14 ++-
 .../core/dag/nodes/WorkflowOutputNodeImpl.java  |  44 ++++---
 .../workflow/core/dag/port/InputPortIml.java    |  24 ++--
 .../workflow/core/dag/port/OutPortImpl.java     |  19 ++-
 .../airavata/workflow/core/dag/port/Port.java   |   5 +
 .../workflow-models/workflow_data_model.thrift  |   5 +-
 12 files changed, 270 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/PortModel.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/PortModel.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/PortModel.java
index 5b5c9fd..41cf054 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/PortModel.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/PortModel.java
@@ -58,7 +58,8 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
   private static final org.apache.thrift.protocol.TField PORT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("portId",
org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name",
org.apache.thrift.protocol.TType.STRING, (short)2);
   private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status",
org.apache.thrift.protocol.TType.STRUCT, (short)3);
-  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description",
org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value",
org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description",
org.apache.thrift.protocol.TType.STRING, (short)5);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -69,6 +70,7 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
   private String portId; // required
   private String name; // optional
   private ComponentStatus status; // optional
+  private String value; // optional
   private String description; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
@@ -76,7 +78,8 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
     PORT_ID((short)1, "portId"),
     NAME((short)2, "name"),
     STATUS((short)3, "status"),
-    DESCRIPTION((short)4, "description");
+    VALUE((short)4, "value"),
+    DESCRIPTION((short)5, "description");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -97,7 +100,9 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
           return NAME;
         case 3: // STATUS
           return STATUS;
-        case 4: // DESCRIPTION
+        case 4: // VALUE
+          return VALUE;
+        case 5: // DESCRIPTION
           return DESCRIPTION;
         default:
           return null;
@@ -139,7 +144,7 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
   }
 
   // isset id assignments
-  private static final _Fields optionals[] = {_Fields.NAME,_Fields.STATUS,_Fields.DESCRIPTION};
+  private static final _Fields optionals[] = {_Fields.NAME,_Fields.STATUS,_Fields.VALUE,_Fields.DESCRIPTION};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields,
org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -149,6 +154,8 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.OPTIONAL,

         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
ComponentStatus.class)));
+    tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,

+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description",
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -180,6 +187,9 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
     if (other.isSetStatus()) {
       this.status = new ComponentStatus(other.status);
     }
+    if (other.isSetValue()) {
+      this.value = other.value;
+    }
     if (other.isSetDescription()) {
       this.description = other.description;
     }
@@ -195,6 +205,7 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
 
     this.name = null;
     this.status = null;
+    this.value = null;
     this.description = null;
   }
 
@@ -267,6 +278,29 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
     }
   }
 
+  public String getValue() {
+    return this.value;
+  }
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public void unsetValue() {
+    this.value = null;
+  }
+
+  /** Returns true if field value is set (has been assigned a value) and false otherwise
*/
+  public boolean isSetValue() {
+    return this.value != null;
+  }
+
+  public void setValueIsSet(boolean value) {
+    if (!value) {
+      this.value = null;
+    }
+  }
+
   public String getDescription() {
     return this.description;
   }
@@ -316,6 +350,14 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
       }
       break;
 
+    case VALUE:
+      if (value == null) {
+        unsetValue();
+      } else {
+        setValue((String)value);
+      }
+      break;
+
     case DESCRIPTION:
       if (value == null) {
         unsetDescription();
@@ -338,6 +380,9 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
     case STATUS:
       return getStatus();
 
+    case VALUE:
+      return getValue();
+
     case DESCRIPTION:
       return getDescription();
 
@@ -358,6 +403,8 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
       return isSetName();
     case STATUS:
       return isSetStatus();
+    case VALUE:
+      return isSetValue();
     case DESCRIPTION:
       return isSetDescription();
     }
@@ -404,6 +451,15 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
         return false;
     }
 
+    boolean this_present_value = true && this.isSetValue();
+    boolean that_present_value = true && that.isSetValue();
+    if (this_present_value || that_present_value) {
+      if (!(this_present_value && that_present_value))
+        return false;
+      if (!this.value.equals(that.value))
+        return false;
+    }
+
     boolean this_present_description = true && this.isSetDescription();
     boolean that_present_description = true && that.isSetDescription();
     if (this_present_description || that_present_description) {
@@ -435,6 +491,11 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
     if (present_status)
       list.add(status);
 
+    boolean present_value = true && (isSetValue());
+    list.add(present_value);
+    if (present_value)
+      list.add(value);
+
     boolean present_description = true && (isSetDescription());
     list.add(present_description);
     if (present_description)
@@ -481,6 +542,16 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetValue()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
     if (lastComparison != 0) {
       return lastComparison;
@@ -538,6 +609,16 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
       }
       first = false;
     }
+    if (isSetValue()) {
+      if (!first) sb.append(", ");
+      sb.append("value:");
+      if (this.value == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.value);
+      }
+      first = false;
+    }
     if (isSetDescription()) {
       if (!first) sb.append(", ");
       sb.append("description:");
@@ -623,7 +704,15 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 4: // DESCRIPTION
+          case 4: // VALUE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.value = iprot.readString();
+              struct.setValueIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // DESCRIPTION
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.description = iprot.readString();
               struct.setDescriptionIsSet(true);
@@ -663,6 +752,13 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
           oprot.writeFieldEnd();
         }
       }
+      if (struct.value != null) {
+        if (struct.isSetValue()) {
+          oprot.writeFieldBegin(VALUE_FIELD_DESC);
+          oprot.writeString(struct.value);
+          oprot.writeFieldEnd();
+        }
+      }
       if (struct.description != null) {
         if (struct.isSetDescription()) {
           oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
@@ -695,16 +791,22 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
       if (struct.isSetStatus()) {
         optionals.set(1);
       }
-      if (struct.isSetDescription()) {
+      if (struct.isSetValue()) {
         optionals.set(2);
       }
-      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetDescription()) {
+        optionals.set(3);
+      }
+      oprot.writeBitSet(optionals, 4);
       if (struct.isSetName()) {
         oprot.writeString(struct.name);
       }
       if (struct.isSetStatus()) {
         struct.status.write(oprot);
       }
+      if (struct.isSetValue()) {
+        oprot.writeString(struct.value);
+      }
       if (struct.isSetDescription()) {
         oprot.writeString(struct.description);
       }
@@ -715,7 +817,7 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
       TTupleProtocol iprot = (TTupleProtocol) prot;
       struct.portId = iprot.readString();
       struct.setPortIdIsSet(true);
-      BitSet incoming = iprot.readBitSet(3);
+      BitSet incoming = iprot.readBitSet(4);
       if (incoming.get(0)) {
         struct.name = iprot.readString();
         struct.setNameIsSet(true);
@@ -726,6 +828,10 @@ public class PortModel implements org.apache.thrift.TBase<PortModel,
PortModel._
         struct.setStatusIsSet(true);
       }
       if (incoming.get(2)) {
+        struct.value = iprot.readString();
+        struct.setValueIsSet(true);
+      }
+      if (incoming.get(3)) {
         struct.description = iprot.readString();
         struct.setDescriptionIsSet(true);
       }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/DirectedEdge.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/DirectedEdge.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/DirectedEdge.java
index 91118cc..b1d79b1 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/DirectedEdge.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/DirectedEdge.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.workflow.core.dag.edge;
 
+import org.apache.airavata.model.EdgeModel;
 import org.apache.airavata.workflow.core.dag.port.InPort;
 import org.apache.airavata.workflow.core.dag.port.OutPort;
 
@@ -29,6 +30,17 @@ public class DirectedEdge implements Edge {
 
     private InPort inPort;
     private OutPort outPort;
+    private EdgeModel edgeModel;
+
+    @Override
+    public void setEdgeModel(EdgeModel edgeModel) {
+        this.edgeModel = edgeModel;
+    }
+
+    @Override
+    public EdgeModel getEdgeModel() {
+        return edgeModel;
+    }
 
     @Override
     public InPort getToPort() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/Edge.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/Edge.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/Edge.java
index ee11371..d1c340e 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/Edge.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/edge/Edge.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.workflow.core.dag.edge;
 
+import org.apache.airavata.model.EdgeModel;
 import org.apache.airavata.workflow.core.dag.port.InPort;
 import org.apache.airavata.workflow.core.dag.port.OutPort;
 
@@ -31,6 +32,10 @@ import org.apache.airavata.workflow.core.dag.port.OutPort;
 
 public interface Edge {
 
+    public void setEdgeModel(EdgeModel edgeModel);
+
+    public EdgeModel getEdgeModel();
+
     public InPort getToPort();
 
     public void setToPort(InPort inPort);

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNode.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNode.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNode.java
index d775bf4..ab876cc 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNode.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNode.java
@@ -30,6 +30,8 @@ public interface ApplicationNode extends WorkflowNode {
 
     public String getApplicationId();
 
+    public String getApplicationName();
+
     public void addInPort(InPort inPort);
 
     public List<InPort> getInputPorts();

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNodeImpl.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNodeImpl.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNodeImpl.java
index ad7bd63..adc865f 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNodeImpl.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/ApplicationNodeImpl.java
@@ -21,6 +21,9 @@
 
 package org.apache.airavata.workflow.core.dag.nodes;
 
+import org.apache.airavata.model.ComponentState;
+import org.apache.airavata.model.ComponentStatus;
+import org.apache.airavata.model.NodeModel;
 import org.apache.airavata.workflow.core.dag.port.InPort;
 import org.apache.airavata.workflow.core.dag.port.OutPort;
 
@@ -29,35 +32,32 @@ import java.util.List;
 
 public class ApplicationNodeImpl implements ApplicationNode {
 
-    private final String nodeId;
-    private NodeState myState = NodeState.WAITING;
-    private String applicationId;
-    private List<InPort> inPorts = new ArrayList<InPort>();
-    private List<OutPort> outPorts = new ArrayList<OutPort>();
-    private String applicationName;
+    private NodeModel nodeModel;
+    private List<InPort> inPorts = new ArrayList<>();
+    private List<OutPort> outPorts = new ArrayList<>();
 
-//    public ApplicationNodeImpl(String nodeId) {
-//        this(nodeId, null);
-//    }
-//
-//    public ApplicationNodeImpl(String nodeId, String applicationId) {
-//        this(nodeId, null, applicationId);
-//    }
+    public ApplicationNodeImpl(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
+    }
+
+    @Override
+    public void setNodeModel(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
+    }
 
-    public ApplicationNodeImpl(String nodeId, String applicationName, String applicationId)
{
-        this.nodeId = nodeId;
-        this.applicationName = applicationName;
-        this.applicationId = applicationId;
+    @Override
+    public NodeModel getNodeModel() {
+        return nodeModel;
     }
 
     @Override
     public String getId() {
-        return this.nodeId;
+        return nodeModel.getNodeId();
     }
 
     @Override
     public String getName() {
-        return applicationName;
+        return getNodeModel().getName();
     }
 
     @Override
@@ -66,17 +66,18 @@ public class ApplicationNodeImpl implements ApplicationNode {
     }
 
     @Override
-    public NodeState getState() {
-        return myState;
+    public ComponentState getState() {
+        return getStatus().getState();
     }
 
     @Override
-    public void setState(NodeState newState) {
-        if (newState.getLevel() > myState.getLevel()) {
-            myState = newState;
-        } else {
-            throw new IllegalStateException("Node state can't be reversed. currentState :
" + myState.toString() + " , newState " + newState.toString());
-        }
+    public ComponentStatus getStatus() {
+        return getNodeModel().getStatus();
+    }
+
+    @Override
+    public void setStatus(ComponentStatus newStatus) {
+        getNodeModel().setStatus(newStatus);
     }
 
     @Override
@@ -91,7 +92,12 @@ public class ApplicationNodeImpl implements ApplicationNode {
 
     @Override
     public String getApplicationId() {
-        return this.applicationId;
+        return getNodeModel().getApplicationId();
+    }
+
+    @Override
+    public String getApplicationName() {
+        return null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowInputNodeImpl.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowInputNodeImpl.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowInputNodeImpl.java
index 608bdbd..3ecc865 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowInputNodeImpl.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowInputNodeImpl.java
@@ -19,35 +19,40 @@
 
 package org.apache.airavata.workflow.core.dag.nodes;
 
+import org.apache.airavata.model.ComponentState;
+import org.apache.airavata.model.ComponentStatus;
+import org.apache.airavata.model.NodeModel;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.workflow.core.dag.port.OutPort;
 
 public class WorkflowInputNodeImpl implements WorkflowInputNode {
 
-    private NodeState myState = NodeState.READY;
-    private final String nodeId;
-    private String nodeName;
+    private NodeModel nodeModel;
     private OutPort outPort;
     private InputDataObjectType inputDataObjectType;
-    private String name;
 
-    public WorkflowInputNodeImpl(String nodeId) {
-        this(nodeId, null);
+    public WorkflowInputNodeImpl(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
     }
 
-    public WorkflowInputNodeImpl(String nodeId, String nodeName) {
-        this.nodeId = nodeId;
-        this.nodeName = nodeName;
+    @Override
+    public void setNodeModel(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
+    }
+
+    @Override
+    public NodeModel getNodeModel() {
+        return nodeModel;
     }
 
     @Override
     public String getId() {
-        return this.nodeId;
+        return getNodeModel().getNodeId();
     }
 
     @Override
     public String getName() {
-        return this.nodeName;
+        return getNodeModel().getName();
     }
 
     @Override
@@ -56,17 +61,18 @@ public class WorkflowInputNodeImpl implements WorkflowInputNode {
     }
 
     @Override
-    public NodeState getState() {
-        return myState;
+    public ComponentState getState() {
+        return getStatus().getState();
+    }
+
+    @Override
+    public ComponentStatus getStatus() {
+        return getNodeModel().getStatus();
     }
 
     @Override
-    public void setState(NodeState newState) {
-        if (newState.getLevel() > myState.getLevel()) {
-            myState = newState;
-        } else {
-            throw new IllegalStateException("Node state can't be reversed. currentState :
" + myState.toString() + " , newState " + newState.toString());
-        }
+    public void setStatus(ComponentStatus newStatus) {
+        getNodeModel().setStatus(newStatus);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowNode.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowNode.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowNode.java
index e86a740..b774465 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowNode.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowNode.java
@@ -21,17 +21,27 @@
 
 package org.apache.airavata.workflow.core.dag.nodes;
 
+import org.apache.airavata.model.ComponentState;
+import org.apache.airavata.model.ComponentStatus;
+import org.apache.airavata.model.NodeModel;
+
 public interface WorkflowNode {
 
+    public void setNodeModel(NodeModel nodeModel);
+
+    public NodeModel getNodeModel();
+
     public String getId();
 
     public String getName();
 
     public NodeType getType();
 
-    public NodeState getState();
+    public ComponentState getState();
+
+    public ComponentStatus getStatus();
 
-    public void setState(NodeState newState);
+    public void setStatus(ComponentStatus newStatus);
 
     public boolean isReady();
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowOutputNodeImpl.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowOutputNodeImpl.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowOutputNodeImpl.java
index b592de8..5844753 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowOutputNodeImpl.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/nodes/WorkflowOutputNodeImpl.java
@@ -21,34 +21,40 @@
 
 package org.apache.airavata.workflow.core.dag.nodes;
 
+import org.apache.airavata.model.ComponentState;
+import org.apache.airavata.model.ComponentStatus;
+import org.apache.airavata.model.NodeModel;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.workflow.core.dag.port.InPort;
 
 public class WorkflowOutputNodeImpl implements WorkflowOutputNode {
 
-    private NodeState myState = NodeState.WAITING;
-    private final String nodeId;
-    private String nodeName;
+    private NodeModel nodeModel;
     private OutputDataObjectType outputDataObjectType;
     private InPort inPort;
 
-    public WorkflowOutputNodeImpl(String nodeId) {
-        this(nodeId, null);
+    public WorkflowOutputNodeImpl(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
     }
 
-    public WorkflowOutputNodeImpl(String nodeId, String nodeName) {
-        this.nodeId = nodeId;
-        this.nodeName = nodeName;
+    @Override
+    public void setNodeModel(NodeModel nodeModel) {
+        this.nodeModel = nodeModel;
+    }
+
+    @Override
+    public NodeModel getNodeModel() {
+        return nodeModel;
     }
 
     @Override
     public String getId() {
-        return this.nodeId;
+        return getNodeModel().getNodeId();
     }
 
     @Override
     public String getName() {
-        return this.nodeName;
+        return getNodeModel().getName();
     }
 
     @Override
@@ -57,20 +63,22 @@ public class WorkflowOutputNodeImpl implements WorkflowOutputNode {
     }
 
     @Override
-    public NodeState getState() {
-        return myState;
+    public ComponentState getState() {
+        return getStatus().getState();
     }
 
     @Override
-    public void setState(NodeState newState) {
-        if (newState.getLevel() > myState.getLevel()) {
-            myState = newState;
-        } else {
-            throw new IllegalStateException("Node state can't be reversed. currentState :
" + myState.toString() + " , newState " + newState.toString());
-        }
+    public ComponentStatus getStatus() {
+        return getNodeModel().getStatus();
     }
 
     @Override
+    public void setStatus(ComponentStatus newStatus) {
+        getNodeModel().setStatus(newStatus);
+    }
+
+
+    @Override
     public boolean isReady() {
         return !(inPort.getInputObject() == null || inPort.getInputObject().getValue() ==
null
                 || inPort.getInputObject().getValue().equals(""));

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/InputPortIml.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/InputPortIml.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/InputPortIml.java
index 0341dd7..3f5d036 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/InputPortIml.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/InputPortIml.java
@@ -19,6 +19,7 @@
 
 package org.apache.airavata.workflow.core.dag.port;
 
+import org.apache.airavata.model.PortModel;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.workflow.core.dag.edge.Edge;
 import org.apache.airavata.workflow.core.dag.nodes.WorkflowNode;
@@ -27,13 +28,12 @@ public class InputPortIml implements InPort {
 
     private InputDataObjectType inputDataObjectType;
     private boolean ready = false;
-    private String portId;
     private Edge edge;
     private WorkflowNode node;
-    private String defaultValue;
+    private PortModel portModel;
 
-    public InputPortIml(String portId) {
-        this.portId = portId;
+    public InputPortIml(PortModel portModel) {
+        this.portModel = portModel;
     }
 
     @Override
@@ -60,11 +60,21 @@ public class InputPortIml implements InPort {
 
     @Override
     public String getDefaultValue() {
-        return defaultValue;
+        return getPortModel().getValue();
     }
 
     public void setDefaultValue(String defaultValue) {
-        this.defaultValue = defaultValue;
+        getPortModel().setValue(defaultValue);
+    }
+
+    @Override
+    public void setPortModel(PortModel portModel) {
+        this.portModel = portModel;
+    }
+
+    @Override
+    public PortModel getPortModel() {
+        return portModel;
     }
 
     @Override
@@ -85,7 +95,7 @@ public class InputPortIml implements InPort {
 
     @Override
     public String getId() {
-        return this.portId;
+        return getPortModel().getPortId();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/OutPortImpl.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/OutPortImpl.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/OutPortImpl.java
index fd3045d..4d90308 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/OutPortImpl.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/OutPortImpl.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.workflow.core.dag.port;
 
+import org.apache.airavata.model.PortModel;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.workflow.core.dag.edge.Edge;
 import org.apache.airavata.workflow.core.dag.nodes.WorkflowNode;
@@ -33,11 +34,11 @@ public class OutPortImpl implements OutPort {
     private OutputDataObjectType outputDataObjectType;
     private List<Edge> outEdges = new ArrayList<Edge>();
     private boolean isSatisfy = false;
-    private String portId;
     private WorkflowNode node;
+    private PortModel portModel;
 
-    public OutPortImpl(String portId) {
-        this.portId = portId;
+    public OutPortImpl(PortModel portModel) {
+        this.portModel = portModel;
     }
 
     @Override
@@ -61,6 +62,16 @@ public class OutPortImpl implements OutPort {
     }
 
     @Override
+    public void setPortModel(PortModel portModel) {
+        this.portModel = portModel;
+    }
+
+    @Override
+    public PortModel getPortModel() {
+        return portModel;
+    }
+
+    @Override
     public boolean isReady() {
         return this.outputDataObjectType.getValue() != null
                 && !this.outputDataObjectType.getValue().equals("");
@@ -78,6 +89,6 @@ public class OutPortImpl implements OutPort {
 
     @Override
     public String getId() {
-        return portId;
+        return getPortModel().getPortId();
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/Port.java
----------------------------------------------------------------------
diff --git a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/Port.java
b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/Port.java
index e3756cf..9fda882 100644
--- a/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/Port.java
+++ b/modules/workflow/workflow-core/src/main/java/org/apache/airavata/workflow/core/dag/port/Port.java
@@ -21,10 +21,15 @@
 
 package org.apache.airavata.workflow.core.dag.port;
 
+import org.apache.airavata.model.PortModel;
 import org.apache.airavata.workflow.core.dag.nodes.WorkflowNode;
 
 public interface Port {
 
+    public void setPortModel(PortModel portModel);
+
+    public PortModel getPortModel();
+
     public boolean isReady();
 
     public WorkflowNode getNode();

http://git-wip-us.apache.org/repos/asf/airavata/blob/9859af32/thrift-interface-descriptions/data-models/workflow-models/workflow_data_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/workflow-models/workflow_data_model.thrift
b/thrift-interface-descriptions/data-models/workflow-models/workflow_data_model.thrift
index 62ed885..547ac3a 100644
--- a/thrift-interface-descriptions/data-models/workflow-models/workflow_data_model.thrift
+++ b/thrift-interface-descriptions/data-models/workflow-models/workflow_data_model.thrift
@@ -83,9 +83,10 @@ struct EdgeModel {
 
 struct PortModel {
     1: required string portId = airavata_commons.DEFAULT_ID,
-    2: optional string name
+    2: optional string name,
     3: optional ComponentStatus status,
-    4: optional string description
+    4: optional string value,
+    5: optional string description
 
 }
 


Mime
View raw message