Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/superv.git] / src / Supervision / CNode_Impl.cxx
index 860dd16a33e58d9d57c3b47c329550cfd35955f2..1175c0051b039d634e73ff3735306d1a3f52baff 100644 (file)
@@ -17,18 +17,19 @@ 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 ,
                        PortableServer::ObjectId * contId , 
                        const char *instanceName ,
                         const char *interfaceName ,
-                        const char *aDataFlowName ) :
+                        const char *aDataFlowName ,
+                        const SUPERV::KindOfNode aKindOfNode ) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
 //  MESSAGE("CNode_Impl::CNode_Impl activate object instanceName("
 //          << instanceName << ") interfaceName(" << interfaceName << ") --> "
@@ -36,13 +37,19 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
 //  _thisObj = this ;
 //  _id = _poa->activate_object(_thisObj);
 //  MESSAGE( "CNode_Impl::CNode_Impl " << aDataFlowName << " " );
-  beginService( "CNode_Impl::CNode_Impl" );
+//  beginService( "CNode_Impl::CNode_Impl" );
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
+  _DataFlowEditor = NULL ;
   _DataFlowNode = NULL ;
-  _IsNode = false ;
-  endService( "CNode_Impl::CNode_Impl" );  
+  if ( aKindOfNode == SUPERV::MacroNode ) {
+    _IsNode = true ;
+  }
+  else {
+    _IsNode = false ;
+  }
+//  endService( "CNode_Impl::CNode_Impl" );  
 }
 
 CNode_Impl::CNode_Impl() {
@@ -53,14 +60,14 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::ObjectId * contId , 
                        const char *instanceName ,
                         const char *interfaceName ,
-                        GraphEditor::DataFlow * DataFlowEditor ,
+                        GraphEditor::DataFlow * aDataFlowEditor ,
                         const SALOME_ModuleCatalog::Service &NodeService ,
                         const char * NodeName ,
                         const SUPERV::KindOfNode NodeKindOfNode ,
                         const char * FuncName  ,
                         const SUPERV::ListOfStrings & PythonFunction ) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
-  beginService( "CNode_Impl::CNode_Impl" );
+//  beginService( "CNode_Impl::CNode_Impl" );
 //  cout << "CNode_Impl::CNode_Impl -->" << endl ;
 //  if ( FuncName && NodeName ) {
 //    cout << "CNode_Impl::CNode_Impl " << (void *) NodeName << " " << NodeName
@@ -68,14 +75,15 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
 //         << " " << strlen( FuncName ) << endl ;
 //  }
   if ( NodeKindOfNode == SUPERV::ComputingNode ) {
-    MESSAGE( "CNode_Impl::CNode_Impl " << FuncName << " _poa->activate_object" );
+//    MESSAGE( "CNode_Impl::CNode_Impl " << FuncName << " _poa->activate_object" );
     _thisObj = this ;
     _id = _poa->activate_object(_thisObj);
   }
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
-  _DataFlowEditor = DataFlowEditor ;
+  _DataFlowEditor = aDataFlowEditor ;
+  DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
   GraphBase::ListOfFuncName aFuncName ;
   GraphBase::ListOfPythonFunctions aPythonFunction ;
   if ( FuncName ) {
@@ -84,12 +92,12 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
     aPythonFunction.resize(1) ;
     aPythonFunction[0] = &PythonFunction ;
   }
-  _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
+  _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
                                             NodeKindOfNode ,
                                             aFuncName ,
                                             aPythonFunction ) ;
   _IsNode = true ;
-  endService( "CNode_Impl::CNode_Impl" );  
+//  endService( "CNode_Impl::CNode_Impl" );  
 //  cout << "<-- CNode_Impl::CNode_Impl" << endl ;
 }
 
@@ -98,33 +106,34 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::ObjectId * contId , 
                        const char *instanceName ,
                         const char *interfaceName ,
-                        GraphEditor::DataFlow * DataFlowEditor ,
+                        GraphEditor::DataFlow * aDataFlowEditor ,
                         const SALOME_ModuleCatalog::Service &NodeService ,
                         const char * NodeName ,
                         const SUPERV::KindOfNode NodeKindOfNode ,
                         const GraphBase::ListOfFuncName & aFuncName  ,
                         const GraphBase::ListOfPythonFunctions & aPythonFunction ) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
-  MESSAGE( NodeName << " " );
-  beginService( "CNode_Impl::CNode_Impl" );
+//  MESSAGE( NodeName << " " );
+//  beginService( "CNode_Impl::CNode_Impl" );
   if ( NodeName ) {
-    MESSAGE("CNode_Impl::CNode_Impl " << NodeName << " " << strlen( NodeName ) ) ;
+//    MESSAGE("CNode_Impl::CNode_Impl " << NodeName << " " << strlen( NodeName ) ) ;
   }
   if ( NodeKindOfNode == SUPERV::ComputingNode ) {
-    MESSAGE( "CNode_Impl::CNode_Impl " << aFuncName[0] << " _poa->activate_object" );
+//    MESSAGE( "CNode_Impl::CNode_Impl " << aFuncName[0] << " _poa->activate_object" );
     _thisObj = this ;
     _id = _poa->activate_object(_thisObj);
   }
   _Orb = CORBA::ORB::_duplicate(orb);
   _Poa = poa ;
   _ContId = contId ;
-  _DataFlowEditor = DataFlowEditor ;
-  _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName ,
+  _DataFlowEditor = aDataFlowEditor ;
+  DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
+  _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
                                             NodeKindOfNode ,
                                             aFuncName ,
                                             aPythonFunction ) ;
   _IsNode = true ;
-  endService( "CNode_Impl::CNode_Impl" );  
+//  endService( "CNode_Impl::CNode_Impl" );  
 }
 
 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
@@ -132,23 +141,31 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::ObjectId * contId , 
                        const char *instanceName ,
                         const char *interfaceName ,
-                        GraphEditor::DataFlow * DataFlowEditor ,
-                        GraphEditor::InNode * DataFlowNode ) :
+                        GraphEditor::DataFlow * aDataFlowEditor ,
+                        GraphEditor::InNode * aDataFlowNode ) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
-  MESSAGE( DataFlowNode->Name() << " " );
-  beginService( "CNode_Impl::CNode_Impl" );
-  if ( DataFlowNode->IsComputingNode() ) {
-    MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" );
+//  beginService( "CNode_Impl::CNode_Impl" );
+  if ( aDataFlowNode && aDataFlowNode->IsComputingNode() ) {
+//    MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" );
     _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 ;
-  _DataFlowEditor = DataFlowEditor ;
-  _DataFlowNode = DataFlowNode ;
-  _IsNode = true ;
-  endService( "CNode_Impl::CNode_Impl" );  
+  _DataFlowEditor = aDataFlowEditor ;
+  DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ;
+  _DataFlowNode = aDataFlowNode ;
+  if ( aDataFlowNode ) {
+    _IsNode = true ;
+  }
+  else {
+    _IsNode = false ;
+  }
+//  endService( "CNode_Impl::CNode_Impl" );  
 }
 
 CNode_Impl::~CNode_Impl() {
@@ -158,7 +175,7 @@ CNode_Impl::~CNode_Impl() {
 
 void CNode_Impl::destroy() {
   beginService( "CNode_Impl::Destroy" );
-  if ( _DataFlowEditor->IsEditing() ) {
+  if ( DataFlowEditor()->IsEditing() ) {
     if ( Delete() ) {
       _DataFlowNode = NULL ;
       _poa->deactivate_object(*_id) ;
@@ -167,29 +184,51 @@ void CNode_Impl::destroy() {
       _thisObj->_remove_ref();
     }
   }
-  endService( "CNode_Impl::Destroy" );
+//  endService( "CNode_Impl::Destroy" );
 }
 
 bool CNode_Impl::Delete() {
   beginService( "CNode_Impl::Delete" );
   bool RetVal = false ;
-  if ( _DataFlowEditor->IsEditing() ) {
-    RetVal = _DataFlowEditor->RemoveNode( Name() ) ;
-    if ( RetVal )
-      RetVal = _DataFlowEditor->IsValid() ;
+  if ( DataFlowEditor()->IsEditing() ) {
+    DeletePorts() ;
+    RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
+    if ( RetVal ) {
+      RetVal = DataFlowEditor()->UnValid() ;
+    }
   }
   endService( "CNode_Impl::Delete" );
   return RetVal ;
 }
 
+void CNode_Impl::DeletePorts() {
+  beginService( "CNode_Impl::DeletePorts" );
+  if ( DataFlowEditor()->IsEditing() && DataFlowNode() ) {
+    int i ;
+    for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeInPortsSize() ; i++ ) {
+      SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeInPort( i )->ObjRef() ;
+      if ( !CORBA::is_nil( aPort ) ) {
+        aPort->Remove() ;
+      }
+    }
+    for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeOutPortsSize() ; i++ ) {
+      SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeOutPort( i )->ObjRef() ;
+      if ( !CORBA::is_nil( aPort ) ) {
+        aPort->Remove() ;
+      }
+    }
+  }
+  endService( "CNode_Impl::DeletePorts" );
+}
+
 SALOME_ModuleCatalog::Service * CNode_Impl::Service() {
 //  beginService( "CNode_Impl::Service" );
   SALOME_ModuleCatalog::Service * RetVal ;
   if ( _IsNode ) {
-    RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowNode->GetService() ) ;
+    RetVal = new SALOME_ModuleCatalog::Service( *DataFlowNode()->GetService() ) ;
   }
   else {
-    RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowEditor->GetService() ) ;
+    RetVal = new SALOME_ModuleCatalog::Service( *DataFlowEditor()->GetService() ) ;
   }
 //  endService( "CNode_Impl::Service" );
   return RetVal ;
@@ -199,10 +238,10 @@ char * CNode_Impl::Name() {
 //  beginService( "CNode_Impl::Name" );
   char * RetVal = NULL ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->Name() ;
+    RetVal = DataFlowNode()->Name() ;
   }
   else {
-   RetVal = _DataFlowEditor->Name() ;
+    RetVal = DataFlowEditor()->Graph()->Name() ;
   }
 //  endService( "CNode_Impl::Name" );
   return CORBA::string_dup( RetVal );
@@ -210,13 +249,14 @@ char * CNode_Impl::Name() {
 bool CNode_Impl::SetName( const char * aDataFlowName ) {
 //  beginService( "CNode_Impl::SetName" );
   bool RetVal = false ;
-  if ( _DataFlowEditor->IsEditing() ) {
+  if ( DataFlowEditor()->IsEditing() ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowEditor->ReNameNode( _DataFlowNode->Name() ,
+      RetVal = DataFlowEditor()->ReNameNode( DataFlowNode()->Name() ,
                                             aDataFlowName ) ;
     }
     else {
-     RetVal = _DataFlowEditor->Name( aDataFlowName ) ;
+//      RetVal = DataFlowEditor()->Graph()->Name( aDataFlowName ) ;
+      RetVal = DataFlowEditor()->Name( aDataFlowName ) ;
     }
   }
 //  endService( "CNode_Impl::SetName" );
@@ -226,10 +266,10 @@ SUPERV::KindOfNode CNode_Impl::Kind() {
 //  beginService( "CNode_Impl::Kind" );
   SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->Kind() ;
+    RetVal = DataFlowNode()->Kind() ;
   }
   else {
-    RetVal = _DataFlowEditor->Kind() ;
+    RetVal = DataFlowEditor()->Graph()->Kind() ;
   }
 //  endService( "CNode_Impl::Kind" );
   return RetVal ;
@@ -238,22 +278,75 @@ bool CNode_Impl::IsGraph() {
 //  beginService( "CNode_Impl::IsGraph" );
   bool RetVal = false ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsDataFlowNode() ;
+    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::IsMacro() {
+//  beginService( "CNode_Impl::IsMacro" );
+  bool RetVal = false ;
+  if ( _IsNode && DataFlowNode()->IsMacroNode() ) {
+    RetVal = true ;
+  }
+//  endService( "CNode_Impl::IsMacro" );
+  return RetVal ;
+}
+bool CNode_Impl::IsFlowMacro() {
+//  beginService( "CNode_Impl::IsFlowMacro" );
+  bool RetVal = false ;
+  if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsGraph() ) {
+    RetVal = true ;
+  }
+//  endService( "CNode_Impl::IsFlowMacro" );
+  return RetVal ;
+}
+bool CNode_Impl::IsStreamMacro() {
+//  beginService( "CNode_Impl::IsStreamMacro" );
+  bool RetVal = false ;
+  if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsStreamGraph() ) {
+    RetVal = true ;
+  }
+//  endService( "CNode_Impl::IsStreamMacro" );
+  return RetVal ;
+}
+bool CNode_Impl::IsHeadGraph() {
+  bool RetVal = false ;
+  beginService( "CNode_Impl::IsHeadGraph" );
+  endService( "CNode_Impl::IsHeadGraph" );
+  return RetVal ;
+}
+long CNode_Impl::GraphLevel() {
+  long RetVal = 0 ;
+  beginService( "CNode_Impl::GraphLevel" );
+  RetVal = DataFlowEditor()->Graph()->GraphMacroLevel() ;
+  endService( "CNode_Impl::GraphLevel" );
+  return RetVal ;
+}
+
 bool CNode_Impl::IsComputing() {
 //  beginService( "CNode_Impl::IsComputing" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsComputingNode() ;
+    RetVal = DataFlowNode()->IsComputingNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsComputingNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsComputingNode() ;
   }
 //  endService( "CNode_Impl::IsComputing" );
   return RetVal ;
@@ -262,10 +355,10 @@ bool CNode_Impl::IsFactory() {
 //  beginService( "CNode_Impl::IsFactory" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsFactoryNode() ;
+    RetVal = DataFlowNode()->IsFactoryNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsFactoryNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsFactoryNode() ;
   }
 //  endService( "CNode_Impl::IsFactory" );
   return RetVal ;
@@ -274,10 +367,10 @@ bool CNode_Impl::IsInLine() {
 //  beginService( "CNode_Impl::IsInLine" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsInLineNode() ;
+    RetVal = DataFlowNode()->IsInLineNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsInLineNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsInLineNode() ;
   }
 //  endService( "CNode_Impl::IsInLine" );
   return RetVal ;
@@ -286,10 +379,10 @@ bool CNode_Impl::IsGOTO() {
 //  beginService( "CNode_Impl::IsGOTO" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsGOTONode() ;
+    RetVal = DataFlowNode()->IsGOTONode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsGOTONode() ;
+    RetVal = DataFlowEditor()->Graph()->IsGOTONode() ;
   }
 //  endService( "CNode_Impl::IsGOTO" );
   return RetVal ;
@@ -298,10 +391,10 @@ bool CNode_Impl::IsLoop() {
 //  beginService( "CNode_Impl::IsLoop" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsLoopNode() ;
+    RetVal = DataFlowNode()->IsLoopNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsLoopNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsLoopNode() ;
   }
 //  endService( "CNode_Impl::IsLoop" );
   return RetVal ;
@@ -310,10 +403,10 @@ bool CNode_Impl::IsEndLoop() {
 //  beginService( "CNode_Impl::IsEndLoop" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsEndLoopNode() ;
+    RetVal = DataFlowNode()->IsEndLoopNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsEndLoopNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsEndLoopNode() ;
   }
 //  endService( "CNode_Impl::IsEndLoop" );
   return RetVal ;
@@ -322,10 +415,10 @@ bool CNode_Impl::IsSwitch() {
 //  beginService( "CNode_Impl::IsSwitch" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsSwitchNode() ;
+    RetVal = DataFlowNode()->IsSwitchNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsSwitchNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsSwitchNode() ;
   }
 //  endService( "CNode_Impl::IsSwitch" );
   return RetVal ;
@@ -334,10 +427,10 @@ bool CNode_Impl::IsEndSwitch() {
 //  beginService( "CNode_Impl::IsEndSwitch" );
   bool RetVal = SUPERV::UnknownNode ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->IsEndSwitchNode() ;
+    RetVal = DataFlowNode()->IsEndSwitchNode() ;
   }
   else {
-    RetVal = _DataFlowEditor->IsEndSwitchNode() ;
+    RetVal = DataFlowEditor()->Graph()->IsEndSwitchNode() ;
   }
 //  endService( "CNode_Impl::IsEndSwitch" );
   return RetVal ;
@@ -347,12 +440,12 @@ SUPERV::SDate CNode_Impl::CreationDate() {
 //  beginService( "CNode_Impl::CreationDate" );
   SUPERV::SDate_var RetVal ;
   if ( _IsNode ) {
-    RetVal = new SUPERV::SDate( _DataFlowNode->FirstCreation() ) ;
+    RetVal = new SUPERV::SDate( DataFlowNode()->FirstCreation() ) ;
   }
   else {
-//    cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation()
+//    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()) ;
@@ -361,10 +454,10 @@ SUPERV::SDate CNode_Impl::LastUpdateDate() {
 //  beginService( "CNode_Impl::LastUpdateDate" );
   SUPERV::SDate_var RetVal ;
   if ( _IsNode ) {
-    RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ;
+    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()) ;
@@ -373,10 +466,10 @@ char * CNode_Impl::Version() {
 //  beginService( "CNode_Impl::Version" );
   char * RetVal ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->EditorRelease() ;
+    RetVal = DataFlowNode()->EditorRelease() ;
   }
   else {
-    RetVal = _DataFlowEditor->EditorRelease() ;
+    RetVal = DataFlowEditor()->Graph()->EditorRelease() ;
   }
 //  endService( "CNode_Impl::Version" );
   return CORBA::string_dup( RetVal ) ;
@@ -385,10 +478,10 @@ char * CNode_Impl::Author() {
 //  beginService( "CNode_Impl::Author" );
   char * RetVal ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->Author() ;
+    RetVal = DataFlowNode()->Author() ;
   }
   else {
-    RetVal = _DataFlowEditor->Author() ;
+    RetVal = DataFlowEditor()->Graph()->Author() ;
   }
 //  endService( "CNode_Impl::Author" );
   return CORBA::string_dup( RetVal ) ;
@@ -396,12 +489,12 @@ char * CNode_Impl::Author() {
 bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) {
 //  beginService( "CNode_Impl::SetAuthor" );
   bool RetVal = false ;
-  if ( _DataFlowEditor->IsEditing() ) {
+  if ( DataFlowEditor()->IsEditing() ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ;
+      RetVal = DataFlowNode()->Author( aDataFlowAuthor ) ;
     }
     else {
-      RetVal = _DataFlowEditor->Author( aDataFlowAuthor ) ;
+      RetVal = DataFlowEditor()->Graph()->Author( aDataFlowAuthor ) ;
     }
   }
 //  endService( "CNode_Impl::SetAuthor" );
@@ -411,10 +504,10 @@ char * CNode_Impl::Comment() {
 //  beginService( "CNode_Impl::Comment" );
   char * RetVal ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->Comment() ;
+    RetVal = DataFlowNode()->Comment() ;
   }
   else {
-    RetVal = _DataFlowEditor->Comment() ;
+    RetVal = DataFlowEditor()->Graph()->Comment() ;
   }
 //  endService( "CNode_Impl::Comment" );
   return CORBA::string_dup( RetVal ) ;
@@ -422,36 +515,26 @@ char * CNode_Impl::Comment() {
 bool CNode_Impl::SetComment( const char * aDataFlowComment ) {
 //  beginService( "CNode_Impl::SetComment" );
   bool RetVal = false ;
-  if ( _DataFlowEditor->IsEditing() ) {
+  if ( DataFlowEditor()->IsEditing() ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowNode->Comment( 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() ) {
+  if ( DataFlowEditor()->IsEditing() ) {
     if ( _IsNode ) {
-      ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ;
+      ((GraphEditor::InNode *) DataFlowNode())->Coordinates( X , Y ) ;
     }
     else {
-      _DataFlowEditor->Coordinates( X , Y ) ;
+      DataFlowEditor()->Graph()->Coordinates( X , Y ) ;
     }
   }
 //  endService( "CNode_Impl::Coords" );
@@ -460,11 +543,10 @@ long CNode_Impl::X() {
 //  beginService( "CNode_Impl::X" );
   long RetVal ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->XCoordinate() ;
+    RetVal = DataFlowNode()->XCoordinate() ;
   }
   else {
-//    RetVal = _DataFlowEditor->XCoordinate() ;
-    RetVal = 0 ;
+    RetVal = DataFlowEditor()->Graph()->XCoordinate() ;
   }
 //  endService( "CNode_Impl::X" );
   return RetVal ;
@@ -473,79 +555,62 @@ long CNode_Impl::Y() {
 //  beginService( "CNode_Impl::Y" );
   long RetVal ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->YCoordinate() ;
+    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 ;
   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
   bool aninport ;
   if ( _IsNode ) {
-    aninport = _DataFlowNode->GetInPort( ServiceParameterName ) ;
+    aninport = DataFlowNode()->GetInPort( ServiceParameterName ) ;
   }
   else {
-    aninport = _DataFlowEditor->GetInPort( ServiceParameterName ) ;
+    aninport = DataFlowEditor()->GetInPort( ServiceParameterName ) ;
   }  
   bool anoutport ;
   if ( _IsNode ) {
-    anoutport = _DataFlowNode->GetOutPort( ServiceParameterName ) ;
+    anoutport = DataFlowNode()->GetOutPort( ServiceParameterName ) ;
   }
   else {
-    anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ;
-  }  
+    anoutport = DataFlowEditor()->GetOutPort( ServiceParameterName ) ;
+  }
   if ( aninport ) {
     GraphBase::InPort * anInPort ;
     if ( _IsNode ) {
-      anInPort = _DataFlowNode->GetChangeInPort( ServiceParameterName ) ;
+      anInPort = DataFlowNode()->GetChangeInPort( ServiceParameterName ) ;
     }
     else {
-      anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ;
+      anInPort = DataFlowEditor()->GetChangeInPort( ServiceParameterName ) ;
+    }
+    if ( anInPort->IsDataStream() ) {
+      MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ;
     }
-    if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+    else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
       if ( begin ) {
         beginService( "CNode_Impl::Port" );
         begin = false ;
       }
       bool hasinput ;
       if ( _IsNode ) {
-        hasinput = _DataFlowNode->HasInput( anInPort->PortName() ) ;
+        hasinput = DataFlowNode()->HasInput( anInPort->PortName() ) ;
       }
       else {
-        hasinput = _DataFlowEditor->HasInput( anInPort->PortName() ) ;
+        hasinput = DataFlowEditor()->HasInput( anInPort->PortName() ) ;
       }
       if ( hasinput ) {
         const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                 instanceName() , interfaceName() ,
-                                _DataFlowEditor ,
-                                _DataFlowNode ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
 //                                ServiceParameterName ,
                                 (GraphBase::Port * ) anInPort ,
                                 true ,
@@ -554,8 +619,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
       else {
         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                 instanceName() , interfaceName() ,
-                                _DataFlowEditor ,
-                                _DataFlowNode ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
 //                                ServiceParameterName ) ;
                                 (GraphBase::Port * ) anInPort ,
                                 true ) ;
@@ -572,12 +637,15 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
   else if ( anoutport ) {
     GraphBase::OutPort * anOutPort ;
     if ( _IsNode ) {
-      anOutPort = _DataFlowNode->GetChangeOutPort( ServiceParameterName ) ;
+      anOutPort = DataFlowNode()->GetChangeOutPort( ServiceParameterName ) ;
     }
     else {
-      anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ;
+      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 ;
@@ -585,8 +653,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
       const CORBA::Any * anAny = anOutPort->Value() ;
       myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                               instanceName() , interfaceName() ,
-                              _DataFlowEditor ,
-                              _DataFlowNode ,
+                              DataFlowEditor() ,
+                              DataFlowNode() ,
 //                              ServiceParameterName ,
                               (GraphBase::Port * ) anOutPort ,
                               false ,
@@ -603,6 +671,7 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) {
   if ( !begin ) {
     endService( "CNode_Impl::Port" );
   }
+  DataFlowEditor()->UnValid() ;
   return SUPERV::Port::_duplicate( iobject ) ;
 }
 
@@ -610,21 +679,21 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
                                     const SUPERV::Value_ptr aValue ) {
   bool begin = true ;
   SUPERV::Port_var iobject = SUPERV::Port::_nil() ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowEditor->IsEditing() ) {
-    bool sts = false ;
-    GraphBase::InPort * anInPort ;
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  bool sts = false ;
+  GraphBase::InPort * anInPort = NULL ;
+if ( DataFlowEditor()->IsEditing() /*&& DataFlowEditor()->Graph()->GraphMacroLevel() == 0*/ ) {
     if ( _IsNode ) {
-      sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() ,
+      sts = DataFlowEditor()->AddInputData( DataFlowNode()->Name() ,
                                            ToServiceParameterName ,
                                            *aValue->ToAny() ) ;
-      anInPort = _DataFlowNode->GetChangeInPort( 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() ) ) {
@@ -635,8 +704,8 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
         Port_Impl * myPort ;
         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                 instanceName() , interfaceName() ,
-                                _DataFlowEditor ,
-                                _DataFlowNode ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
 //                                ToServiceParameterName ,
                                 (GraphBase::Port * ) anInPort ,
                                 true ,
@@ -650,21 +719,20 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
         iobject = anInPort->ObjRef() ;
       }
     }
+    DataFlowEditor()->UnValid() ;
   }
-  else if ( _DataFlowExecutor ) {
-    bool sts = false ;
-    GraphBase::InPort * anInPort ;
+  else if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() ,
+      sts = aDataFlowExecutor->ChangeInputData( DataFlowNode()->Name() ,
                                                 ToServiceParameterName ,
                                                 *aValue->ToAny() ) ;
-      anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ;
+      anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ;
     }
     else {
-      sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Name() ,
+      sts = aDataFlowExecutor->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() ) ) {
@@ -675,8 +743,8 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
         Port_Impl * myPort ;
         myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                 instanceName() , interfaceName() ,
-                                _DataFlowEditor ,
-                                _DataFlowNode ,
+                                DataFlowEditor() ,
+                                DataFlowNode() ,
 //                                ToServiceParameterName ,
                                 (GraphBase::Port * ) anInPort ,
                                 true ,
@@ -694,255 +762,701 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName ,
   if ( !begin ) {
     endService( "CNode_Impl::Input" );
   }
+  if ( CORBA::is_nil( iobject ) ) {
+    MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts
+             << " Node " << Name() << " ToServiceParameterName " << ToServiceParameterName
+             << " anInPort " << anInPort ) ;
+  }
   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 );
+}
+
+bool CNode_Impl::HasStreamPort() {
+  bool RetVal = false ;
+  beginService( "CNode_Impl::HasStreamPort" );
+  endService( "CNode_Impl::HasStreamPort" );
+  return RetVal ;
+}
+
+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 ) ) ;
+                                            DataFlowEditor() ,
+                                            DataFlowNode() ,
+                                            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 ) {
+    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->IsNotConnected() && 
+                                     ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+//          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
+        }
+        else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
+//          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting "
+//                   << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
+//                   << "/" << anInPort->IsNotConnected() ) ;
           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 ,
+                                    DataFlowEditor() ,
+                                    DataFlowNode() ,
+                                    (GraphBase::Port * ) anInPort ,
                                     true ,
                                     anAny ) ;
           }
           else {
             myPort = new Port_Impl( _Orb , _Poa , _ContId ,
                                     instanceName() , interfaceName() ,
-                                    _DataFlowEditor ,
-                                    _DataFlowNode ,
-//                                    anOutPort->PortName() ) ;
-                                    (GraphBase::Port * ) anOutPort ,
+                                    DataFlowEditor() ,
+                                    DataFlowNode() ,
+                                    (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 ) ;
-          anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
+          anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
         }
         else {
-          RetVal[ i ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
+//          MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anInPort->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 ;
-         }
-          Port_Impl * myPort ;
-          if ( anInPort->IsDataConnected() ) {
-            const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
-            myPort = new Port_Impl( _Orb , _Poa , _ContId ,
-                                    instanceName() , interfaceName() ,
-                                    _DataFlowEditor ,
-                                    _DataFlowNode ,
-//                                    anInPort->PortName() ,
-                                    (GraphBase::Port * ) anInPort ,
-                                    false ,
-                                    anAny ) ;
-          }
-          else {
-            myPort = new Port_Impl( _Orb , _Poa , _ContId ,
-                                    instanceName() , interfaceName() ,
-                                    _DataFlowEditor ,
-                                    _DataFlowNode ,
-//                                    anInPort->PortName() ) ;
-                                    anInPort ,
-                                    false ) ;
-          }
+      else {
+//        MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
+      }
+    }
+    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->IsNotConnected() &&
+                                      ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+//          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
+        }
+        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) ;
-          RetVal[ j + i ] = SUPERV::Port::_duplicate( iobject ) ;
-          anInPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( iobject ) ;
+          anOutPort->ObjRef( SUPERV::Port::_duplicate( iobject ) ) ;
+        }
+        else {
+//          MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ;
+          PortCount += 1 ;
+          RetVal->length( PortCount ) ;
+          RetVal[ PortCount - 1 ] = SUPERV::Port::_duplicate( anOutPort->ObjRef() ) ;
+        }
+      }
+      else {
+//        MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " IsDataStream" ) ;
+      }
+    }
+  }
+  else {
+    if ( DataFlowEditor()->IsValid() ) {
+      //DataFlowEditor()->Graph()->Values() ;
+      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() ) ;
+         }
+        }
+        else {
+        }
+      }
+      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( anInPort->ObjRef() ) ;
         }
       }
     }
   }
+#if 0
+  int RetVallength = (unsigned int ) RetVal->length() ;
+  for ( i = 0 ; i < RetVallength ; i++ ) {
+    MESSAGE( "Port " << i << " " <<  RetVal[i]->Name() << " of Node " << Name() ) ;
+  }
+#endif
   if ( !begin ) {
-    endService( "CNode_Impl::Ports" );
+    endService( "CNode_Impl::Ports " ) ;
   }
   return ( RetVal._retn() ) ;
 }
 
-SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) {
+SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() {
   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 ) ) ) {
+  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::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 ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() && 
+                                     ( 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 "
+                   << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate()
+                   << "/" << anInPort->IsNotConnected() ) ;
+          StreamPort_Impl * myStreamPort ;
+          if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) {
+            const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ;
+            myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                    instanceName() , interfaceName() ,
+                                    DataFlowEditor() ,
+                                    DataFlowNode() ,
+                                    (GraphBase::Port * ) anInPort ,
+                                    true ,
+                                    anAny ) ;
+          }
+          else {
+            myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId ,
+                                    instanceName() , interfaceName() ,
+                                    DataFlowEditor() ,
+                                    DataFlowNode() ,
+                                    (GraphBase::Port * ) anInPort ,
+                                    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 ) ;
+          anInPort->ObjRef( SUPERV::StreamPort::_duplicate( iobject ) ) ;
+        }
+        else {
+          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 {
-        iobject = anOutPort->InPortObjRef( anInPort ) ;
+//        RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_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::StreamPorts" );
+          begin = false ;
+        }
+        if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() &&
+                                      ( 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 {
+//        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() ) {
+//    MESSAGE( "CNode_Impl::Links " << DataFlowEditor() << " " << DataFlowEditor()->Graph() << " " << DataFlowEditor()->Graph()->ObjImpl() << " " << DataFlowNode()->ComputingNode() << " " << DataFlowNode()->ComputingNode()->Name() ) ;
+    RetVal = ((Graph_Impl * ) DataFlowEditor()->Graph()->ObjImpl())->Links( DataFlowNode()->ComputingNode() , NULL ) ;
+  }
+  else {
+    RetVal = ((Graph_Impl * ) 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() {
 //  beginService( "CNode_Impl::SubGraph" );
   long RetVal = 0 ;
   if ( _IsNode ) {
-    RetVal = _DataFlowNode->SubGraph() ;
+    RetVal = DataFlowNode()->SubGraph() ;
   }
 //  endService( "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 ) ;
+  bool RetVal = DataFlowNode()->IsLinked( ServiceParameterName ) ;
   MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
   endService( "CNode_Impl::IsLinked" );
   return RetVal ;
@@ -950,7 +1464,7 @@ bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
 
 bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
 //  beginService( "CNode_Impl::HasInput" );
-  bool RetVal = _DataFlowNode->HasInput( ServiceParameterName ) ;
+  bool RetVal = DataFlowNode()->HasInput( ServiceParameterName ) ;
 //  endService( "CNode_Impl::HasInput" );
   return RetVal ;
 }
@@ -958,14 +1472,14 @@ bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
 SUPERV::GraphState CNode_Impl::State() {
 //  beginService( "CNode_Impl::State" );
   SUPERV::GraphState RetVal = SUPERV::EditingState ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor && !_DataFlowEditor->EditedAfterExecution() ) {
-    //JR : 12/06/03  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor && !DataFlowEditor()->EditedAfterExecution() ) {
+    //JR : 12/06/03  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->State( Name() ) ;
+      RetVal = aDataFlowExecutor->State( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->State() ;
+      RetVal = aDataFlowExecutor->State() ;
     }
   }
 //  endService( "CNode_Impl::State" );
@@ -974,28 +1488,28 @@ SUPERV::GraphState CNode_Impl::State() {
 long CNode_Impl::Thread() {
 //  beginService( "CNode_Impl::Thread" );
   long RetVal = 0 ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Thread( Name() ) ;
+      RetVal = aDataFlowExecutor->Thread( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->Thread() ;
+      RetVal = aDataFlowExecutor->Thread() ;
     }
   }
 //  endService( "CNode_Impl::Thread" );
   return RetVal ;
 }
-SUPERV::AutomatonState CNode_Impl::AutoState() {
+GraphExecutor::AutomatonState CNode_Impl::AutoState() {
 //  beginService( "CNode_Impl::AutoState" );
-  SUPERV::AutomatonState RetVal = SUPERV::UnKnownState ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::AutomatonState RetVal = GraphExecutor::UnKnownState ;
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->AutomatonState( Name() ) ;
+      RetVal = aDataFlowExecutor->AutomatonState( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->AutomatonState() ;
+      RetVal = aDataFlowExecutor->AutomatonState() ;
     }
   }
 //  endService( "CNode_Impl::AutoState" );
@@ -1004,13 +1518,13 @@ SUPERV::AutomatonState CNode_Impl::AutoState() {
 SUPERV::ControlState CNode_Impl::Control() {
 //  beginService( "CNode_Impl::Control" );
   SUPERV::ControlState RetVal = SUPERV::VoidState ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->ControlState( Name() ) ;
+      RetVal = aDataFlowExecutor->ControlState( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->ControlState() ;
+      RetVal = aDataFlowExecutor->ControlState() ;
     }
   }
 //  endService( "CNode_Impl::Control" );
@@ -1019,13 +1533,13 @@ SUPERV::ControlState CNode_Impl::Control() {
 void CNode_Impl::ControlClear() {
 //  beginService( "CNode_Impl::ControlClear" );
 //  SUPERV::ControlState RetVal = SUPERV::VoidState ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      _DataFlowExecutor->ControlClear( Name() ) ;
+      aDataFlowExecutor->ControlClear( Name() ) ;
     }
     else {
-      _DataFlowExecutor->ControlClear() ;
+      aDataFlowExecutor->ControlClear() ;
     }
   }
 //  endService( "CNode_Impl::ControlClear" );
@@ -1035,13 +1549,13 @@ void CNode_Impl::ControlClear() {
 bool CNode_Impl::IsReady() {
 //  beginService( "CNode_Impl::IsReady" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->IsReady( Name() ) ;
+      RetVal = aDataFlowExecutor->IsReady( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->IsReady() ;
+      RetVal = aDataFlowExecutor->IsReady() ;
     }
   }
 //  endService( "CNode_Impl::IsReady" );
@@ -1051,13 +1565,13 @@ bool CNode_Impl::IsReady() {
 bool CNode_Impl::IsWaiting() {
 //  beginService( "CNode_Impl::IsWaiting" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->IsWaiting( Name() ) ;
+      RetVal = aDataFlowExecutor->IsWaiting( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->IsWaiting() ;
+      RetVal = aDataFlowExecutor->IsWaiting() ;
     }
   }
 //  endService( "CNode_Impl::IsWaiting" );
@@ -1067,13 +1581,13 @@ bool CNode_Impl::IsWaiting() {
 bool CNode_Impl::IsRunning() {
 //  beginService( "CNode_Impl::IsRunning" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->IsRunning( Name() ) ;
+      RetVal = aDataFlowExecutor->IsRunning( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->IsRunning() ;
+      RetVal = aDataFlowExecutor->IsRunning() ;
     }
   }
 //  endService( "CNode_Impl::IsRunning" );
@@ -1083,13 +1597,13 @@ bool CNode_Impl::IsRunning() {
 bool CNode_Impl::IsDone() {
 //  beginService( "CNode_Impl::IsDone" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->IsDone( Name() ) ;
+      RetVal = aDataFlowExecutor->IsDone( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->IsDone() ;
+      RetVal = aDataFlowExecutor->IsDone() ;
     }
   }
 //  endService( "CNode_Impl::IsDone" );
@@ -1099,13 +1613,13 @@ bool CNode_Impl::IsDone() {
 bool CNode_Impl::IsSuspended() {
 //  beginService( "CNode_Impl::IsSuspended" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->IsSuspended( Name() ) ;
+      RetVal = aDataFlowExecutor->IsSuspended( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->IsSuspended() ;
+      RetVal = aDataFlowExecutor->IsSuspended() ;
     }
   }
 //  endService( "CNode_Impl::IsSuspended" );
@@ -1115,13 +1629,13 @@ bool CNode_Impl::IsSuspended() {
 bool CNode_Impl::ReadyW() {
 //  beginService( "CNode_Impl::ReadyW" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->ReadyWait( Name() ) ;
+      RetVal = aDataFlowExecutor->ReadyWait( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->ReadyWait() ;
+      RetVal = aDataFlowExecutor->ReadyWait() ;
     }
   }
 //  endService( "CNode_Impl::ReadyW" );
@@ -1131,13 +1645,13 @@ bool CNode_Impl::ReadyW() {
 bool CNode_Impl::RunningW() {
 //  beginService( "CNode_Impl::RunningW" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->RunningWait( Name() ) ;
+      RetVal = aDataFlowExecutor->RunningWait( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->RunningWait() ;
+      RetVal = aDataFlowExecutor->RunningWait() ;
     }
   }
 //  endService( "CNode_Impl::RunningW" );
@@ -1147,13 +1661,13 @@ bool CNode_Impl::RunningW() {
 bool CNode_Impl::DoneW() {
 //  beginService( "CNode_Impl::DoneW" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->DoneWait( Name() ) ;
+      RetVal = aDataFlowExecutor->DoneWait( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->DoneWait() ;
+      RetVal = aDataFlowExecutor->DoneWait() ;
     }
   }
 //  endService( "CNode_Impl::DoneW" );
@@ -1163,13 +1677,13 @@ bool CNode_Impl::DoneW() {
 bool CNode_Impl::SuspendedW() {
 //  beginService( "CNode_Impl::SuspendedW" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->SuspendedWait( Name() ) ;
+      RetVal = aDataFlowExecutor->SuspendedWait( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->SuspendedWait() ;
+      RetVal = aDataFlowExecutor->SuspendedWait() ;
     }
   }
 //  endService( "CNode_Impl::SuspendedW" );
@@ -1179,10 +1693,10 @@ bool CNode_Impl::SuspendedW() {
 void CNode_Impl::ping() {
 //  beginService( "CNode_Impl::ping" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Ping( Name() ) ;
+      RetVal = aDataFlowExecutor->Ping( Name() ) ;
     }
     else {
       RetVal = false ;
@@ -1195,40 +1709,42 @@ void CNode_Impl::ping() {
 bool CNode_Impl::ContainerKill() {
   beginService( "CNode_Impl::ContainerKill" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor && _DataFlowEditor->IsExecuting() ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor && IsExecuting() ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->ContainerKill( Name() ) ;
+      RetVal = aDataFlowExecutor->ContainerKill( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->ContainerKill() ;
+      RetVal = aDataFlowExecutor->ContainerKill() ;
     }
   }
   endService( "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 ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Kill( Name() ) ;
+      RetVal = aDataFlowExecutor->Kill( Name() ) ;
+      MESSAGE( "Node "  << Name() << " execution was killed : " << RetVal ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->Kill() ;
+      RetVal = aDataFlowExecutor->Kill() ;
+      MESSAGE( "Graph execution was killed : " << RetVal ) ;
     }
   }
-//  endService( "CNode_Impl::Kill" );
+  endService( "CNode_Impl::Kill" );
   return RetVal ;
 }
 bool CNode_Impl::KillDone() {
 //  beginService( "CNode_Impl::KillDone" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->KillDone( Name() ) ;
+      RetVal = aDataFlowExecutor->KillDone( Name() ) ;
     }
   }
 //  endService( "CNode_Impl::KillDone" );
@@ -1236,67 +1752,74 @@ bool CNode_Impl::KillDone() {
 }
 bool CNode_Impl::Stop() {
 //  beginService( "CNode_Impl::Stop" );
-  bool RetVal ; // = _DataFlowExecutor->Stop() ;
+  bool RetVal ; // = aDataFlowExecutor->Stop() ;
 //  endService( "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 ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Suspend( Name() ) ;
+      MESSAGE( "CNode_Impl::Suspend " << Name() ) ;
+      RetVal = aDataFlowExecutor->Suspend( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->Suspend() ;
+      MESSAGE( "CNode_Impl::Suspend " << aDataFlowExecutor->Graph()->Name() ) ;
+      RetVal = aDataFlowExecutor->Suspend() ;
     }
   }
-//  endService( "CNode_Impl::Suspend" );
+  endService( "CNode_Impl::Suspend" );
   return RetVal ;
 }
 bool CNode_Impl::SuspendDone() {
 //  beginService( "CNode_Impl::SuspendDone" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->SuspendDone( Name() ) ;
+      RetVal = aDataFlowExecutor->SuspendDone( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->SuspendDone() ;
+      RetVal = aDataFlowExecutor->SuspendDone() ;
     }
   }
 //  endService( "CNode_Impl::SuspendDone" );
   return RetVal ;
 }
 bool CNode_Impl::Resume() {
-//  beginService( "CNode_Impl::Resume" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  beginService( "CNode_Impl::Resume" );
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Resume( Name() ) ;
+      MESSAGE( "CNode_Impl::Resume " << Name() ) ;
+      RetVal = aDataFlowExecutor->Resume( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->Resume() ;
+      MESSAGE( "CNode_Impl::Resume " << aDataFlowExecutor->Graph()->Name() ) ;
+      RetVal = aDataFlowExecutor->Resume() ;
     }
   }
-//  endService( "CNode_Impl::Resume" );
+  endService( "CNode_Impl::Resume" );
   return RetVal ;
 }
 
+// Old method used in the past for initial study about GOTO and Loop
+// Should not be used
 bool CNode_Impl::Run() {
   beginService( "CNode_Impl::Run" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
-    _DataFlowEditor->EditedAfterExecution( false ) ;
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  MESSAGE( "CNode_Impl::Run DataFlowExecutor " << aDataFlowExecutor << Name() << " _IsNode " << _IsNode ) ;
+  if ( aDataFlowExecutor ) {
+    DataFlowEditor()->EditedAfterExecution( false ) ;
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
+      RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->Run( false ) ;
+      RetVal = aDataFlowExecutor->Run( false ) ;
     }
   }
   endService( "CNode_Impl::Run" );
@@ -1306,29 +1829,35 @@ bool CNode_Impl::Run() {
 bool CNode_Impl::ReRun() {
   beginService( "CNode_Impl::ReRun" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
-    _DataFlowEditor->EditedAfterExecution( false ) ;
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
+    DataFlowEditor()->EditedAfterExecution( false ) ;
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ;
+      RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ;
     }
+// The GUI calls directly that method instead of calling Graph_Impl::Run() :
+// I redirect the call to Graph_Impl::Run()
     else if ( DataFlowEditor()->IsEditing() ) {
-      //      RetVal = _DataFlowExecutor->Run( false ) ;
-      return ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
+      RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
+    }
+    else {
+      RetVal = aDataFlowExecutor->Run( false ) ;
     }
   }
   endService( "CNode_Impl::ReRun" );
   return RetVal ;
 }
 
+// Old method used in the past for initial study about GOTO and Loop
+// Should not be used
 bool CNode_Impl::ReRunAt( const char * aNodeName ) {
   beginService( "CNode_Impl::ReRunAt" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
-    _DataFlowEditor->EditedAfterExecution( false ) ;
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
+    DataFlowEditor()->EditedAfterExecution( false ) ;
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Run( Name() , aNodeName , false ) ;
+      RetVal = aDataFlowExecutor->Run( Name() , aNodeName , false ) ;
     }
   }
   endService( "CNode_Impl::ReRunAt" );
@@ -1338,26 +1867,33 @@ bool CNode_Impl::ReRunAt( const char * aNodeName ) {
 bool CNode_Impl::ReStart() {
   beginService( "CNode_Impl::ReStart" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Run( Name() , Name() , true ) ;
+      RetVal = aDataFlowExecutor->Run( Name() , Name() , true ) ;
+    }
+// The GUI calls directly that method instead of calling Graph_Impl::Start() :
+// I redirect the call to Graph_Impl::Start()
+    else if ( DataFlowEditor()->IsEditing() ) {
+      RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Start() ;
     }
     else {
-      RetVal = _DataFlowExecutor->Run( true ) ;
+      RetVal = aDataFlowExecutor->Run( true ) ;
     }
   }
   endService( "CNode_Impl::ReStart" );
   return RetVal ;
 }
 
+// Old method used in the past for initial study about GOTO and Loop
+// Should not be used
 bool CNode_Impl::ReStartAt( const char * aNodeName ) {
   beginService( "CNode_Impl::ReStartAt" );
   bool RetVal = false ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->Run( Name() , aNodeName , true ) ;
+      RetVal = aDataFlowExecutor->Run( Name() , aNodeName , true ) ;
     }
   }
   endService( "CNode_Impl::ReStartAt" );
@@ -1366,16 +1902,25 @@ bool CNode_Impl::ReStartAt( const char * aNodeName ) {
 
 long CNode_Impl::CpuUsed() {
   long RetVal = 0 ;
-  GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-  if ( _DataFlowExecutor ) {
+  GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
+  if ( aDataFlowExecutor ) {
     if ( _IsNode ) {
-      RetVal = _DataFlowExecutor->CpuUsed( Name() ) ;
+      RetVal = aDataFlowExecutor->CpuUsed( Name() ) ;
     }
     else {
-      RetVal = _DataFlowExecutor->CpuUsed() ;
+      RetVal = aDataFlowExecutor->CpuUsed() ;
     }
   }
   return RetVal ;
 }
 
+bool CNode_Impl::IsExecuting() {
+  bool RetVal = false;
+  if ( !IsMacro() && DataFlowEditor() && DataFlowEditor()->Executor() ) {
+    if ( DataFlowEditor()->IsExecuting() && DataFlowEditor()->Executor()->IsDone() )
+      DataFlowEditor()->Executing( false );
 
+    RetVal = DataFlowEditor()->IsExecuting();
+  }
+  return RetVal;
+}