]> SALOME platform Git repositories - modules/superv.git/blobdiff - src/Supervision/CNode_Impl.cxx
Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / src / Supervision / CNode_Impl.cxx
index 02cf4adcbd6a024636545457ec1b48c317ca6b6b..452dff0e3357de1b60dabd4e33a612b57ba3506c 100644 (file)
@@ -17,11 +17,11 @@ using namespace std;
 
 //#include "utilities.h"
 
-#include "Graph_Impl.hxx"
+#include "StreamGraph_Impl.hxx"
 
 #include "CNode_Impl.hxx"
 
-#include "Port_Impl.hxx"
+#include "StreamPort_Impl.hxx"
 
 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::POA_ptr poa ,
@@ -142,6 +142,9 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
     _thisObj = this ;
     _id = _poa->activate_object(_thisObj);
   }
+  else {
+    MESSAGE( "CNode_Impl::CNode_Impl NO _poa->activate_object " );
+  }
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
@@ -167,7 +170,7 @@ void CNode_Impl::destroy() {
       _thisObj->_remove_ref();
     }
   }
-  endService( "CNode_Impl::Destroy" );
+//  endService( "CNode_Impl::Destroy" );
 }
 
 bool CNode_Impl::Delete() {
@@ -176,7 +179,7 @@ bool CNode_Impl::Delete() {
   if ( _DataFlowEditor->IsEditing() ) {
     RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
     if ( RetVal ) {
-      RetVal = _DataFlowEditor->IsValid() ;
+      RetVal = _DataFlowEditor->UnValid() ;
     }
   }
   endService( "CNode_Impl::Delete" );
@@ -203,7 +206,7 @@ char * CNode_Impl::Name() {
     RetVal = _DataFlowNode->Name() ;
   }
   else {
-    RetVal = _DataFlowEditor->Name() ;
+    RetVal = _DataFlowEditor->Graph()->Name() ;
   }
 //  endService( "CNode_Impl::Name" );
   return CORBA::string_dup( RetVal );
@@ -217,7 +220,7 @@ bool CNode_Impl::SetName( const char * aDataFlowName ) {
                                             aDataFlowName ) ;
     }
     else {
-      RetVal = _DataFlowEditor->Name( aDataFlowName ) ;
+      RetVal = _DataFlowEditor->Graph()->Name( aDataFlowName ) ;
     }
   }
 //  endService( "CNode_Impl::SetName" );
@@ -230,7 +233,7 @@ SUPERV::KindOfNode CNode_Impl::Kind() {
     RetVal = _DataFlowNode->Kind() ;
   }
   else {
-    RetVal = _DataFlowEditor->Kind() ;
+    RetVal = _DataFlowEditor->Graph()->Kind() ;
   }
 //  endService( "CNode_Impl::Kind" );
   return RetVal ;
@@ -242,11 +245,23 @@ bool CNode_Impl::IsGraph() {
     RetVal = _DataFlowNode->IsDataFlowNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsDataFlowNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsDataFlowNode() ;
   }
 //  endService( "CNode_Impl::IsGraph" );
   return RetVal ;
 }
+bool CNode_Impl::IsStreamGraph() {
+//  beginService( "CNode_Impl::IsStreamGraph" );
+  bool RetVal = false ;
+  if ( _IsNode ) {
+    RetVal = _DataFlowNode->IsDataStreamNode() ;
+  }
+  else {
+    RetVal = _DataFlowEditor->Graph()->IsDataStreamNode() ;
+  }
+//  endService( "CNode_Impl::IsStreamGraph" );
+  return RetVal ;
+}
 bool CNode_Impl::IsComputing() {
 //  beginService( "CNode_Impl::IsComputing" );
   bool RetVal = SUPERV::UnknownNode ;
@@ -254,7 +269,7 @@ bool CNode_Impl::IsComputing() {
     RetVal = _DataFlowNode->IsComputingNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsComputingNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsComputingNode() ;
   }
 //  endService( "CNode_Impl::IsComputing" );
   return RetVal ;
@@ -266,7 +281,7 @@ bool CNode_Impl::IsFactory() {
     RetVal = _DataFlowNode->IsFactoryNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsFactoryNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsFactoryNode() ;
   }
 //  endService( "CNode_Impl::IsFactory" );
   return RetVal ;
@@ -278,7 +293,7 @@ bool CNode_Impl::IsInLine() {
     RetVal = _DataFlowNode->IsInLineNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsInLineNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsInLineNode() ;
   }
 //  endService( "CNode_Impl::IsInLine" );
   return RetVal ;
@@ -290,7 +305,7 @@ bool CNode_Impl::IsGOTO() {
     RetVal = _DataFlowNode->IsGOTONode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsGOTONode() ;
+    RetVal = _DataFlowEditor->Graph()->IsGOTONode() ;
   }
 //  endService( "CNode_Impl::IsGOTO" );
   return RetVal ;
@@ -302,7 +317,7 @@ bool CNode_Impl::IsLoop() {
     RetVal = _DataFlowNode->IsLoopNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsLoopNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsLoopNode() ;
   }
 //  endService( "CNode_Impl::IsLoop" );
   return RetVal ;
@@ -314,7 +329,7 @@ bool CNode_Impl::IsEndLoop() {
     RetVal = _DataFlowNode->IsEndLoopNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsEndLoopNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsEndLoopNode() ;
   }
 //  endService( "CNode_Impl::IsEndLoop" );
   return RetVal ;
@@ -326,7 +341,7 @@ bool CNode_Impl::IsSwitch() {
     RetVal = _DataFlowNode->IsSwitchNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsSwitchNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsSwitchNode() ;
   }
 //  endService( "CNode_Impl::IsSwitch" );
   return RetVal ;
@@ -338,7 +353,7 @@ bool CNode_Impl::IsEndSwitch() {
     RetVal = _DataFlowNode->IsEndSwitchNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsEndSwitchNode() ;
+    RetVal = _DataFlowEditor->Graph()->IsEndSwitchNode() ;
   }
 //  endService( "CNode_Impl::IsEndSwitch" );
   return RetVal ;
@@ -353,7 +368,7 @@ SUPERV::SDate CNode_Impl::CreationDate() {
   else {
 //    cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation()
 //         << endl ;
-    RetVal = new SUPERV::SDate( _DataFlowEditor->FirstCreation() ) ;
+    RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->FirstCreation() ) ;
   }
 //  endService( "CNode_Impl::CreationDate" );
   return (RetVal._retn()) ;
@@ -365,7 +380,7 @@ SUPERV::SDate CNode_Impl::LastUpdateDate() {
     RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ;
   }
   else {
-    RetVal = new SUPERV::SDate( _DataFlowEditor->LastModification() ) ;
+    RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->LastModification() ) ;
   }
 //  endService( "CNode_Impl::LastUpdateDate" );
   return  (RetVal._retn()) ;
@@ -377,7 +392,7 @@ char * CNode_Impl::Version() {
     RetVal = _DataFlowNode->EditorRelease() ;
   }
   else {
-    RetVal = _DataFlowEditor->EditorRelease() ;
+    RetVal = _DataFlowEditor->Graph()->EditorRelease() ;
   }
 //  endService( "CNode_Impl::Version" );
   return CORBA::string_dup( RetVal ) ;
@@ -389,7 +404,7 @@ char * CNode_Impl::Author() {
     RetVal = _DataFlowNode->Author() ;
   }
   else {
-    RetVal = _DataFlowEditor->Author() ;
+    RetVal = _DataFlowEditor->Graph()->Author() ;
   }
 //  endService( "CNode_Impl::Author" );
   return CORBA::string_dup( RetVal ) ;
@@ -402,7 +417,7 @@ bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
       RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ;
     }
     else {
-      RetVal = _DataFlowEditor->Author( aDataFlowAuthor ) ;
+      RetVal = _DataFlowEditor->Graph()->Author( aDataFlowAuthor ) ;
     }
   }
 //  endService( "CNode_Impl::SetAuthor" );
@@ -415,7 +430,7 @@ char * CNode_Impl::Comment() {
     RetVal = _DataFlowNode->Comment() ;
   }
   else {
-    RetVal = _DataFlowEditor->Comment() ;
+    RetVal = _DataFlowEditor->Graph()->Comment() ;
   }
 //  endService( "CNode_Impl::Comment" );
   return CORBA::string_dup( RetVal ) ;
@@ -428,23 +443,13 @@ bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
       RetVal = _DataFlowNode->Comment( aDataFlowComment ) ;
     }
     else {
-      RetVal = _DataFlowEditor->Comment( aDataFlowComment ) ;
+      RetVal = _DataFlowEditor->Graph()->Comment( aDataFlowComment ) ;
     }
   }
 //  endService( "CNode_Impl::SetComment" );
   return RetVal ;
 }
 
-SUPERV::ListOfLinks * CNode_Impl::Links() {
-  beginService( "CNode_Impl::Links" ) ;
-  SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
-  if ( _DataFlowNode ) {
-    RetVal = DataFlowEditor()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ;
-  }
-  endService( "CNode_Impl::Links" ) ;
-  return ( RetVal._retn() ) ;
-}
-
 void CNode_Impl::Coords(long X , long Y ) {
 //  beginService( "CNode_Impl::Coords" );
   if ( _DataFlowEditor->IsEditing() ) {
@@ -452,7 +457,7 @@ void CNode_Impl::Coords(long X , long Y ) {
       ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ;
     }
     else {
-      _DataFlowEditor->Coordinates( X , Y ) ;
+      _DataFlowEditor->Graph()->Coordinates( X , Y ) ;
     }
   }
 //  endService( "CNode_Impl::Coords" );
@@ -464,8 +469,7 @@ long CNode_Impl::X() {
     RetVal = _DataFlowNode->XCoordinate() ;
   }
   else {
-//    RetVal = _DataFlowEditor->XCoordinate() ;
-    RetVal = 0 ;
+    RetVal = _DataFlowEditor->Graph()->XCoordinate() ;
   }
 //  endService( "CNode_Impl::X" );
   return RetVal ;
@@ -477,32 +481,12 @@ long CNode_Impl::Y() {
     RetVal = _DataFlowNode->YCoordinate() ;
   }
   else {
-//    RetVal = _DataFlowEditor->YCoordinate() ;
-    RetVal = 0 ;
+    RetVal = _DataFlowEditor->Graph()->YCoordinate() ;
   }
 //  endService( "CNode_Impl::Y" );
   return RetVal ;
 }
 
-#if 0
-SUPERV::Link_ptr CNode_Impl::Link( const char * ToServiceParameterName ,
-                                   const SUPERV::Value_ptr aValue ) {
-  beginService( "CNode_Impl::Link" );
-  Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
-                                      instanceName() , interfaceName() ,
-                                      _DataFlowEditor ,
-                                      _DataFlowNode ,
-                                      ToServiceParameterName ,
-                                      aValue ) ;
-  PortableServer::ObjectId * id = myLink->getId() ;
-  CORBA::Object_var obj = _poa->id_to_reference(*id);
-  SUPERV::Link_var iobject ;
-  iobject = SUPERV::Link::_narrow(obj) ;
-  endService( "CNode_Impl::Link" );
-  return SUPERV::Link::_duplicate( iobject ) ;
-}
-#endif
-
 SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
   bool begin = true ;
   Port_Impl * myPort = NULL ;
@@ -520,7 +504,7 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
   }
   else {
     anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ;
-  }  
+  }
   if ( aninport ) {
     GraphBase::InPort * anInPort ;
     if ( _IsNode ) {
@@ -529,7 +513,10 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
     else {
       anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ;
     }
-    if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+    if ( anInPort->IsDataStream() ) {
+      MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
+    }
+    else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
       if ( begin ) {
         beginService( "CNode_Impl::Port" );
         begin = false ;
@@ -578,7 +565,10 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
     else {
       anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ;
     }
-    if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+    if ( anOutPort->IsDataStream() ) {
+      MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
+    }
+    else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
       if ( begin ) {
         beginService( "CNode_Impl::Port" );
         begin = false ;
@@ -604,6 +594,7 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
   if ( !begin ) {
     endService( "CNode_Impl::Port" );
   }
+  DataFlowEditor()->UnValid() ;
   return SUPERV::Port::_duplicate( iobject ) ;
 }
 
@@ -622,10 +613,10 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
     }
     else {
-      sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Name() ,
+      sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Graph()->Name() ,
                                            ToServiceParameterName ,
                                            *aValue->ToAny() ) ;
-      anInPort = _DataFlowEditor->GetChangeInPort( ToServiceParameterName ) ;
+      anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
     }
     if ( sts && anInPort ) {
       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
@@ -660,10 +651,10 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
       anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
     }
     else {
-      sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Name() ,
+      sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Graph()->Name() ,
                                                 ToServiceParameterName ,
                                                 *aValue->ToAny() ) ;
-      anInPort = _DataFlowEditor->GetChangeInPort( ToServiceParameterName ) ;
+      anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ;
     }
     if ( sts && anInPort ) {
       if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
@@ -697,129 +688,239 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
     MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts << " anInPort "
              << anInPort ) ;
   }
+  DataFlowEditor()->UnValid() ;
   return SUPERV::Port::_duplicate( iobject ) ;
 }
 
-SUPERV::ListOfPorts * CNode_Impl::Ports() {
-  bool begin = true ;
-  SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
-  if ( _IsNode ) {
-    int i , j ;
-    RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
-                    _DataFlowNode->GetNodeOutPortsSize() ) ;
-    for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
-      GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
-      if ( begin ) {
-        beginService( "CNode_Impl::Ports" );
-        begin = false ;
+SUPERV::Port_ptr CNode_Impl::GetInPort( const char *aParameterName ) {
+  SUPERV::Port_ptr Inobject = SUPERV::Port::_nil() ;
+  Port_Impl * myInPort = NULL ;
+  GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
+  if ( anInPort && !anInPort->IsDataStream() ) {
+    Inobject = anInPort->ObjRef() ;
+    if ( CORBA::is_nil( Inobject ) ) {
+      myInPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                instanceName() , interfaceName() ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
+                                (GraphBase::Port * ) anInPort ,
+                                true ) ;
+      if ( myInPort ) {
+        PortableServer::ObjectId * id = myInPort->getId() ;
+        CORBA::Object_var obj = _poa->id_to_reference(*id) ;
+        Inobject = SUPERV::Port::_narrow(obj) ;
+        anInPort->ObjRef( SUPERV::Port::_duplicate( Inobject ) ) ;
       }
-      if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
-                                   ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
-//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
-        RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+    }
+  }
+  return SUPERV::Port::_duplicate( Inobject ) ;
+}
+
+SUPERV::Port_ptr CNode_Impl::GetOutPort( const char *aParameterName ) {
+  Port_Impl * myOutPort = NULL ;
+  SUPERV::Port_ptr Outobject = SUPERV::Port::_nil() ;
+  GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
+  if ( anOutPort && !anOutPort->IsDataStream() ) {
+    Outobject = anOutPort->ObjRef() ;
+    if ( CORBA::is_nil( Outobject ) ) {
+      const CORBA::Any * anAny = anOutPort->Value() ;
+      myOutPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                 instanceName() , interfaceName() ,
+                                 DataFlowEditor() ,
+                                 DataFlowNode() ,
+                                 (GraphBase::Port * ) anOutPort ,
+                                 false ,
+                                 anAny ) ;
+      if ( myOutPort ) {
+        PortableServer::ObjectId * id = myOutPort->getId() ;
+        CORBA::Object_var obj = _poa->id_to_reference(*id) ;
+        Outobject = SUPERV::Port::_narrow(obj) ;
+        anOutPort->ObjRef( SUPERV::Port::_duplicate( Outobject ) ) ;
       }
-      else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
-//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
-//                 << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
-//                 << "/" << anInPort->IsConnected() ) ;
-        Port_Impl * myPort ;
-        if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
-          const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
-          myPort = new Port_Impl( _Orb , _Poa , _ContId ,
-                                  instanceName() , interfaceName() ,
-                                  _DataFlowEditor ,
-                                  _DataFlowNode ,
-//                                  anInPort->PortName() ,
-                                  (GraphBase::Port * ) anInPort ,
-                                  true ,
-                                  anAny ) ;
-        }
-        else {
-          myPort = new Port_Impl( _Orb , _Poa , _ContId ,
-                                  instanceName() , interfaceName() ,
-                                  _DataFlowEditor ,
-                                  _DataFlowNode ,
-//                                  anInPort->PortName() ) ;
-                                  (GraphBase::Port * ) anInPort ,
-                                  true ) ;
+    }
+  }
+  return SUPERV::Port::_duplicate( Outobject );
+}
+
+SUPERV::StreamPort_ptr CNode_Impl::GetInStreamPort( const char *aParameterName ) {
+  SUPERV::StreamPort_ptr Inobject = SUPERV::StreamPort::_nil() ;
+  if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+    StreamPort_Impl * myInStreamPort = NULL ;
+    GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( aParameterName ) ;
+    if ( anInPort && anInPort->IsDataStream() ) {
+      Inobject = SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ;
+      if ( CORBA::is_nil( Inobject ) ) {
+        myInStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                instanceName() , interfaceName() ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
+                                (GraphBase::Port * ) anInPort ,
+                                true ) ;
+        if ( myInStreamPort ) {
+          PortableServer::ObjectId * id = myInStreamPort->getId() ;
+          CORBA::Object_var obj = _poa->id_to_reference(*id) ;
+          Inobject = SUPERV::StreamPort::_narrow(obj) ;
+          anInPort->ObjRef( SUPERV::StreamPort::_duplicate( Inobject ) ) ;
+       }
+      }      
+    }
+  }
+  return SUPERV::StreamPort::_duplicate( Inobject ) ;
+}
+
+SUPERV::StreamPort_ptr CNode_Impl::GetOutStreamPort( const char *aParameterName ) {
+  StreamPort_Impl * myOutStreamPort = NULL ;
+  SUPERV::StreamPort_ptr Outobject = SUPERV::StreamPort::_nil() ;
+  if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+    GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeOutPort( aParameterName ) ;
+    if ( anOutPort && anOutPort->IsDataStream() ) {
+      Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ;
+      if ( CORBA::is_nil( Outobject ) ) {
+        const CORBA::Any * anAny = anOutPort->Value() ;
+        myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                 instanceName() , interfaceName() ,
+                                 DataFlowEditor() ,
+                                 DataFlowNode() ,
+                                 (GraphBase::Port * ) anOutPort ,
+                                 false ,
+                                 anAny ) ;
+        if ( myOutStreamPort ) {
+          PortableServer::ObjectId * id = myOutStreamPort->getId() ;
+          CORBA::Object_var obj = _poa->id_to_reference(*id) ;
+          Outobject = SUPERV::StreamPort::_narrow(obj) ;
+          anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( Outobject ) ) ;
         }
-        PortableServer::ObjectId * id = myPort->getId() ;
-        CORBA::Object_var obj = _poa->id_to_reference(*id);
-        SUPERV::Port_var iobject ;
-        iobject = SUPERV::Port::_narrow(obj) ;
-        RetVal[ i ] = SUPERV::Port::_duplicate( iobject ) ;
-        anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
-      }
-      else {
-//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
-        RetVal[ i ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
       }
     }
-    for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
-      GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
-      if ( begin ) {
-        beginService( "CNode_Impl::Ports" );
-        begin = false ;
-      }
-      if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
-                                    ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
-//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
-        RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
-      }
-      else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
-//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
-        const CORBA::Any * anAny = anOutPort->Value() ;
-        Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+  }
+  return SUPERV::StreamPort::_duplicate( Outobject );
+}
+
+SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
+  bool begin = true ;
+  SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
+  char* FromNodeName ;
+  char* FromServiceParameterName ;
+  bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
+                                          ToServiceParameterName ,
+                                          & FromNodeName ,
+                                          & FromServiceParameterName ) ;
+  if ( status ) {
+    GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
+    if ( !anInPort->IsDataStream() && anInPort->GetOutPort() ) {
+      GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
+      if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
+        if ( begin ) {
+          beginService( "CNode_Impl::GetLink" );
+          begin = false ;
+       }
+        bool Success ;
+        Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
                                             instanceName() , interfaceName() ,
                                             _DataFlowEditor ,
                                             _DataFlowNode ,
-//                                            anOutPort->PortName() ,
-                                            (GraphBase::Port * ) anOutPort ,
-                                            false ,
-                                            anAny ) ;
-        PortableServer::ObjectId * id = myPort->getId() ;
-        CORBA::Object_var obj = _poa->id_to_reference(*id);
-        SUPERV::Port_var iobject ;
-        iobject = SUPERV::Port::_narrow(obj) ;
-        RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( iobject ) ;
-        anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+                                            ToServiceParameterName ,
+                                            (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
+                                            FromServiceParameterName ,
+                                            true , false , Success ) ;
+        if ( Success ) {
+          PortableServer::ObjectId * id = myLink->getId() ;
+          CORBA::Object_var obj = _poa->id_to_reference(*id);
+          iobject = SUPERV::Link::_narrow(obj) ;
+          anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
+       }
       }
       else {
-//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
-        RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
-      }
-    }
-    for ( i = 0 ; i < (int ) RetVal->length() ; i++ ) {
-      if ( CORBA::is_nil( RetVal[ i ] ) ) {
-        for ( j = i ; j < (int ) RetVal->length() - 1 ; j++ ) {
-          RetVal[ j ] = RetVal[ j + 1 ] ;
-       }
-        RetVal->length( RetVal->length() - 1 ) ;
-        i-- ;
+        iobject = anOutPort->InPortObjRef( anInPort ) ;
       }
     }
   }
-  else {
-    if ( _DataFlowEditor->IsValid() ) {
-      int i , j ;
-      RetVal->length( _DataFlowEditor->GetNodeInDataNodePortsSize() +
-                      _DataFlowEditor->GetNodeOutDataNodePortsSize() ) ;
-      for ( i = 0 ; i < _DataFlowEditor->GetNodeInDataNodePortsSize() ; i++ ) {
-        GraphBase::OutPort * anOutPort = _DataFlowEditor->GetChangeNodeInDataNodePort(i) ;
-        if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+  if ( !begin ) {
+    endService( "CNode_Impl::GetLink" );
+  }
+  return SUPERV::Link::_duplicate( iobject ) ;
+}
+
+SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameterName ) {
+  bool begin = true ;
+  SUPERV::StreamLink_var iobject = SUPERV::StreamLink::_nil() ;
+  char* FromNodeName ;
+  char* FromServiceParameterName ;
+  if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+    bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
+                                            ToServiceParameterName ,
+                                            & FromNodeName ,
+                                            & FromServiceParameterName ) ;
+    if ( status ) {
+      GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
+      if ( anInPort->IsDataStream() && anInPort->GetOutPort() ) {
+        GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
+        if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
           if ( begin ) {
-            beginService( "CNode_Impl::Ports" );
+            beginService( "CNode_Impl::GetLink" );
             begin = false ;
+         }
+          bool Success ;
+          StreamLink_Impl * myStreamLink = new StreamLink_Impl(
+                                            _Orb , _Poa , _ContId ,
+                                            instanceName() , interfaceName() ,
+                                            _DataFlowEditor ,
+                                            _DataFlowNode ,
+                                            ToServiceParameterName ,
+                                            (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() ,
+                                            FromServiceParameterName ,
+                                            true , Success ) ;
+          if ( Success ) {
+            PortableServer::ObjectId * id = myStreamLink->getId() ;
+            CORBA::Object_var obj = _poa->id_to_reference(*id);
+            iobject = SUPERV::StreamLink::_narrow(obj) ;
+            anOutPort->AddInPortObjRef( anInPort , SUPERV::StreamLink::_duplicate( iobject ) ) ;
          }
+        }
+        else {
+          iobject = SUPERV::StreamLink::_narrow( anOutPort->InPortObjRef( anInPort ) ) ;
+        }
+      }
+    }
+  }
+  if ( !begin ) {
+    endService( "CNode_Impl::GetLink" );
+  }
+  return SUPERV::StreamLink::_duplicate( iobject ) ;
+}
+
+SUPERV::ListOfPorts * CNode_Impl::Ports() {
+  bool begin = true ;
+  int i , j ;
+  int PortCount = 0 ;
+  SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ;
+  if ( _IsNode ) {
+//    RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
+//                    _DataFlowNode->GetNodeOutPortsSize() ) ;
+    for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
+      GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
+      if ( !anInPort->IsDataStream() ) {
+        if ( begin ) {
+          beginService( "CNode_Impl::Ports" );
+          begin = false ;
+        }
+        if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
+                                     ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
+          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//          RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+        else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
+                   << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
+                   << "/" << anInPort->IsConnected() ) ;
           Port_Impl * myPort ;
-          if ( anOutPort->IsDataConnected() ) {
-            const CORBA::Any * anAny = anOutPort->Value() ;
+          if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
+            const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                     instanceName() , interfaceName() ,
                                     _DataFlowEditor ,
                                     _DataFlowNode ,
-//                                    anOutPort->PortName() ,
-                                    (GraphBase::Port * ) anOutPort ,
+                                    (GraphBase::Port * ) anInPort ,
                                     true ,
                                     anAny ) ;
           }
@@ -828,109 +929,427 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() {
                                     instanceName() , interfaceName() ,
                                     _DataFlowEditor ,
                                     _DataFlowNode ,
-//                                    anOutPort->PortName() ) ;
-                                    (GraphBase::Port * ) anOutPort ,
+                                    (GraphBase::Port * ) anInPort ,
                                     true ) ;
           }
           PortableServer::ObjectId * id = myPort->getId() ;
           CORBA::Object_var obj = _poa->id_to_reference(*id);
           SUPERV::Port_var iobject ;
           iobject = SUPERV::Port::_narrow(obj) ;
-          RetVal[ i ] = SUPERV::Port::_duplicate( iobject ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
+          anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+        }
+        else {
+          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
+        }
+      }
+      else {
+        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
+//        RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+      }
+    }
+    for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
+      GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
+      if ( !anOutPort->IsDataStream() ) {
+        if ( begin ) {
+          beginService( "CNode_Impl::Ports" );
+          begin = false ;
+        }
+        if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
+                                      ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
+          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//          RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+        else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+          const CORBA::Any * anAny = anOutPort->Value() ;
+          Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                              instanceName() , interfaceName() ,
+                                              _DataFlowEditor ,
+                                              _DataFlowNode ,
+                                              (GraphBase::Port * ) anOutPort ,
+                                              false ,
+                                              anAny ) ;
+          PortableServer::ObjectId * id = myPort->getId() ;
+          CORBA::Object_var obj = _poa->id_to_reference(*id);
+          SUPERV::Port_var iobject ;
+          iobject = SUPERV::Port::_narrow(obj) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
           anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
         }
         else {
-          RetVal[ i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
+          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
         }
       }
-      j = _DataFlowEditor->GetNodeInDataNodePortsSize() ;
-      for ( i = 0 ; i < _DataFlowEditor->GetNodeOutDataNodePortsSize() ; i++ ) {
-        GraphBase::InPort * anInPort = _DataFlowEditor->GetChangeNodeOutDataNodePort(i) ;
-        if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
-          if ( begin ) {
-            beginService( "CNode_Impl::Ports" );
-            begin = false ;
+      else {
+        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
+//        RetVal[  _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+      }
+    }
+  }
+  else {
+    if ( _DataFlowEditor->IsValid() ) {
+      RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
+                      _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
+      for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
+        GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
+        if ( !anOutPort->IsDataStream() ) {
+          if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+            if ( begin ) {
+              beginService( "CNode_Impl::Ports" );
+              begin = false ;
+           }
+            Port_Impl * myPort ;
+            if ( anOutPort->IsDataConnected() ) {
+              const CORBA::Any * anAny = anOutPort->Value() ;
+              myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anOutPort ,
+                                      true ,
+                                      anAny ) ;
+            }
+            else {
+              myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anOutPort ,
+                                      true ) ;
+            }
+            PortableServer::ObjectId * id = myPort->getId() ;
+            CORBA::Object_var obj = _poa->id_to_reference(*id);
+            SUPERV::Port_var iobject ;
+            iobject = SUPERV::Port::_narrow(obj) ;
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
+            anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+          }
+          else {
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
          }
-          Port_Impl * myPort ;
-          if ( anInPort->IsDataConnected() ) {
+        }
+        else {
+//          RetVal[ i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+      }
+      j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
+      for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
+        GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
+        if ( !anInPort->IsDataStream() ) {
+          if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+            if ( begin ) {
+              beginService( "CNode_Impl::Ports" );
+              begin = false ;
+           }
+            Port_Impl * myPort ;
+            if ( anInPort->IsDataConnected() ) {
+              const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
+              myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anInPort ,
+                                      false ,
+                                      anAny ) ;
+            }
+            else {
+              myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      anInPort ,
+                                      false ) ;
+            }
+            PortableServer::ObjectId * id = myPort->getId() ;
+            CORBA::Object_var obj = _poa->id_to_reference(*id);
+            SUPERV::Port_var iobject ;
+            iobject = SUPERV::Port::_narrow(obj) ;
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
+            anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+          }
+          else {
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
+         }
+        }
+        else {
+//          RetVal[ j + i ] = SUPERV::Port::_duplicate( SUPERV::Port::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+      }
+    }
+  }
+//  int RetVallength = (unsigned int ) RetVal->length() ;
+//  for ( i = 0 ; i < RetVallength ; i++ ) {
+//    MESSAGE( "Port " << i << " " <<  RetVal[i]->Name() << " of Node " << Name() ) ;
+//  }
+  if ( !begin ) {
+    endService( "CNode_Impl::Ports " ) ;
+  }
+  return ( RetVal._retn() ) ;
+}
+
+SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() {
+  bool begin = true ;
+  int i , j ;
+  int PortCount = 0 ;
+  SUPERV::ListOfStreamPorts_var RetVal = new SUPERV::ListOfStreamPorts ;
+  if ( !DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+//    MESSAGE("CNode_Impl::StreamPorts NOT a DataStreamNode" ) ;
+  }
+  else if ( _IsNode ) {
+//    RetVal->length( _DataFlowNode->GetNodeInPortsSize() +
+//                    _DataFlowNode->GetNodeOutPortsSize() ) ;
+    for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) {
+      GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ;
+      if ( anInPort->IsDataStream() ) {
+        if ( begin ) {
+          beginService( "CNode_Impl::StreamPorts" );
+          begin = false ;
+        }
+        if ( anInPort->IsLoop() || ( anInPort->IsGate() && !anInPort->IsConnected() && 
+                                     ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
+          MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+        else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+          MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
+                   << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
+                   << "/" << anInPort->IsConnected() ) ;
+          StreamPort_Impl * myStreamPort ;
+          if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) {
             const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
-            myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+            myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
                                     instanceName() , interfaceName() ,
                                     _DataFlowEditor ,
                                     _DataFlowNode ,
-//                                    anInPort->PortName() ,
                                     (GraphBase::Port * ) anInPort ,
-                                    false ,
+                                    true ,
                                     anAny ) ;
           }
           else {
-            myPort = new Port_Impl( _Orb , _Poa , _ContId ,
+            myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
                                     instanceName() , interfaceName() ,
                                     _DataFlowEditor ,
                                     _DataFlowNode ,
-//                                    anInPort->PortName() ) ;
-                                    anInPort ,
-                                    false ) ;
+                                    (GraphBase::Port * ) anInPort ,
+                                    true ) ;
           }
-          PortableServer::ObjectId * id = myPort->getId() ;
+          PortableServer::ObjectId * id = myStreamPort->getId() ;
           CORBA::Object_var obj = _poa->id_to_reference(*id);
-          SUPERV::Port_var iobject ;
-          iobject = SUPERV::Port::_narrow(obj) ;
-          RetVal[ j + i ] = SUPERV::Port::_duplicate( iobject ) ;
-          anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+          SUPERV::StreamPort_var iobject ;
+          iobject = SUPERV::StreamPort::_narrow(obj) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
+          anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
         }
         else {
-          RetVal[ j + i ] = SUPERV::Port::_duplicate( anInPort->ObjRef() ) ;
+          MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
         }
       }
+      else {
+//        RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
+      }
     }
-  }
-  if ( !begin ) {
-    endService( "CNode_Impl::Ports" );
-  }
-  return ( RetVal._retn() ) ;
-}
-
-SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
-  bool begin = true ;
-  SUPERV::Link_var iobject = SUPERV::Link::_nil() ;
-  char* FromNodeName ;
-  char* FromServiceParameterName ;
-  bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() ,
-                                          ToServiceParameterName ,
-                                          & FromNodeName ,
-                                          & FromServiceParameterName ) ;
-  if ( status ) {
-    GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
-    if ( anInPort->GetOutPort() ) {
-      GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
-      if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) {
+    for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) {
+      GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ;
+      if ( anOutPort->IsDataStream() ) {
         if ( begin ) {
-          beginService( "CNode_Impl::GetLink" );
+          beginService( "CNode_Impl::StreamPorts" );
           begin = false ;
-       }
-        Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId ,
-                                            instanceName() , interfaceName() ,
-                                            _DataFlowEditor ,
-                                            _DataFlowNode ,
-                                            ToServiceParameterName ,
-                                            (GraphEditor::InNode *) _DataFlowEditor->GetChangeGraphNode( FromNodeName )->GetInNode() ,
-                                            FromServiceParameterName ,
-                                            true ) ;
-        PortableServer::ObjectId * id = myLink->getId() ;
-        CORBA::Object_var obj = _poa->id_to_reference(*id);
-        iobject = SUPERV::Link::_narrow(obj) ;
-        anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ;
+        }
+        if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && !anOutPort->IsConnected() &&
+                                      ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) {
+          MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
+//          RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+        else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+          MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+          const CORBA::Any * anAny = anOutPort->Value() ;
+          StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                              instanceName() , interfaceName() ,
+                                              _DataFlowEditor ,
+                                              _DataFlowNode ,
+                                              (GraphBase::Port * ) anOutPort ,
+                                              false ,
+                                              anAny ) ;
+          PortableServer::ObjectId * id = myStreamPort->getId() ;
+          CORBA::Object_var obj = _poa->id_to_reference(*id);
+          SUPERV::StreamPort_var iobject ;
+          iobject = SUPERV::StreamPort::_narrow(obj) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
+          anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
+        }
+        else {
+          MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
+        }
       }
       else {
-        iobject = anOutPort->InPortObjRef( anInPort ) ;
+//        RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
       }
     }
   }
+  else {
+    if ( _DataFlowEditor->IsValid() ) {
+//      RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() +
+//                      _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ;
+      for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) {
+        GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ;
+        if ( anOutPort->IsDataStream() ) {
+          if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
+            if ( begin ) {
+              beginService( "CNode_Impl::StreamPorts" );
+              begin = false ;
+           }
+            StreamPort_Impl * myStreamPort ;
+            if ( anOutPort->IsDataConnected() ) {
+              const CORBA::Any * anAny = anOutPort->Value() ;
+              myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anOutPort ,
+                                      true ,
+                                      anAny ) ;
+            }
+            else {
+              myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anOutPort ,
+                                      true ) ;
+            }
+            PortableServer::ObjectId * id = myStreamPort->getId() ;
+            CORBA::Object_var obj = _poa->id_to_reference(*id);
+            SUPERV::StreamPort_var iobject ;
+            iobject = SUPERV::StreamPort::_narrow(obj) ;
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
+            anOutPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
+          }
+          else {
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ) ;
+         }
+        }
+        else {
+//          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+      }
+      j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ;
+      for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
+        GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ;
+        if ( anInPort->IsDataStream() ) {
+          if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+            if ( begin ) {
+              beginService( "CNode_Impl::StreamPorts" );
+              begin = false ;
+           }
+            StreamPort_Impl * myStreamPort ;
+            if ( anInPort->IsDataConnected() ) {
+              const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
+              myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      (GraphBase::Port * ) anInPort ,
+                                      false ,
+                                      anAny ) ;
+            }
+            else {
+              myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                      instanceName() , interfaceName() ,
+                                      _DataFlowEditor ,
+                                      _DataFlowNode ,
+                                      anInPort ,
+                                      false ) ;
+            }
+            PortableServer::ObjectId * id = myStreamPort->getId() ;
+            CORBA::Object_var obj = _poa->id_to_reference(*id);
+            SUPERV::StreamPort_var iobject ;
+            iobject = SUPERV::StreamPort::_narrow(obj) ;
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( iobject ) ;
+            anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
+          }
+          else {
+            PortCount += 1 ;
+            RetVal->length( PortCount ) ;
+            RetVal[ PortCount - 1 ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( anInPort->ObjRef() ) ) ;
+         }
+        }
+        else {
+//          RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ;
+        }
+      }
+    }
+  }
+//  int RetVallength = (unsigned int ) RetVal->length() ;
+//  for ( i = 0 ; i < RetVallength ; i++ ) {
+//    MESSAGE( "StreamPort " << i << " " <<  RetVal[i]->Name() << " of Node " << Name() ) ;
+//  }
   if ( !begin ) {
-    endService( "CNode_Impl::GetLink" );
+    endService( "CNode_Impl::StreamPorts " ) ;
   }
-  return SUPERV::Link::_duplicate( iobject ) ;
+  return ( RetVal._retn() ) ;
+}
+
+SUPERV::ListOfLinks * CNode_Impl::Links() {
+  beginService( "CNode_Impl::Links" ) ;
+  SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ;
+  if ( _DataFlowNode ) {
+    RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ;
+  }
+  else {
+    RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( NULL , NULL ) ;
+  }
+  MESSAGE( "CNode_Impl::Links " << RetVal->length() << " Links" ) ;
+  endService( "CNode_Impl::Links" ) ;
+  return ( RetVal._retn() ) ;
+}
+
+SUPERV::ListOfStreamLinks * CNode_Impl::StreamLinks() {
+  beginService( "CNode_Impl::StreamLinks" ) ;
+  SUPERV::ListOfStreamLinks_var RetVal = new SUPERV::ListOfStreamLinks ;
+  if ( _DataFlowNode && DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+    RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( _DataFlowNode->ComputingNode() , NULL ) ;
+  }
+  else if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
+    RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( NULL , NULL ) ;
+  }
+  MESSAGE( "CNode_Impl::StreamLinks " << RetVal->length() << " StreamLinks" ) ;
+  endService( "CNode_Impl::StreamLinks" ) ;
+  return ( RetVal._retn() ) ;
 }
 
 long CNode_Impl::SubGraph() {
@@ -943,6 +1362,16 @@ long CNode_Impl::SubGraph() {
   return RetVal ;
 }
 
+long CNode_Impl::SubStreamGraph() {
+//  beginService( "CNode_Impl::SubStreamGraph" );
+  long RetVal = 0 ;
+  if ( _IsNode ) {
+    RetVal = _DataFlowNode->SubStreamGraph() ;
+  }
+//  endService( "CNode_Impl::SubStreamGraph" );
+  return RetVal ;
+}
+
 bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
   beginService( "CNode_Impl::IsLinked" );
   bool RetVal = _DataFlowNode->IsLinked( ServiceParameterName ) ;
@@ -1211,7 +1640,7 @@ bool CNode_Impl::ContainerKill() {
   return RetVal ;
 }
 bool CNode_Impl::Kill() {
-//  beginService( "CNode_Impl::Kill" );
+  beginService( "CNode_Impl::Kill" );
   bool RetVal = false ;
   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
   if ( _DataFlowExecutor ) {
@@ -1220,9 +1649,10 @@ bool CNode_Impl::Kill() {
     }
     else {
       RetVal = _DataFlowExecutor->Kill() ;
+      MESSAGE( "Graph execution was killed " << RetVal ) ;
     }
   }
-//  endService( "CNode_Impl::Kill" );
+  endService( "CNode_Impl::Kill" );
   return RetVal ;
 }
 bool CNode_Impl::KillDone() {
@@ -1244,18 +1674,20 @@ bool CNode_Impl::Stop() {
   return RetVal ;
 }
 bool CNode_Impl::Suspend() {
-//  beginService( "CNode_Impl::Suspend" );
+  beginService( "CNode_Impl::Suspend" );
   bool RetVal = false ;
   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
   if ( _DataFlowExecutor ) {
     if ( _IsNode ) {
+      MESSAGE( "CNode_Impl::Suspend " << Name() ) ;
       RetVal = _DataFlowExecutor->Suspend( Name() ) ;
     }
     else {
+      MESSAGE( "CNode_Impl::Suspend " << _DataFlowExecutor->Graph()->Name() ) ;
       RetVal = _DataFlowExecutor->Suspend() ;
     }
   }
-//  endService( "CNode_Impl::Suspend" );
+  endService( "CNode_Impl::Suspend" );
   return RetVal ;
 }
 bool CNode_Impl::SuspendDone() {
@@ -1274,18 +1706,20 @@ bool CNode_Impl::SuspendDone() {
   return RetVal ;
 }
 bool CNode_Impl::Resume() {
-//  beginService( "CNode_Impl::Resume" );
   bool RetVal = false ;
+  beginService( "CNode_Impl::Resume" );
   GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
   if ( _DataFlowExecutor ) {
     if ( _IsNode ) {
+      MESSAGE( "CNode_Impl::Resume " << Name() ) ;
       RetVal = _DataFlowExecutor->Resume( Name() ) ;
     }
     else {
+      MESSAGE( "CNode_Impl::Resume " << _DataFlowExecutor->Graph()->Name() ) ;
       RetVal = _DataFlowExecutor->Resume() ;
     }
   }
-//  endService( "CNode_Impl::Resume" );
+  endService( "CNode_Impl::Resume" );
   return RetVal ;
 }