]> SALOME platform Git repositories - modules/superv.git/blobdiff - src/GraphExecutor/DataFlowExecutor_OutNode.cxx
Salome HOME
DCQ:prepare 2.0.0
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_OutNode.cxx
index d8031a47151b28a9cf208e57724c2f3e30439090..26b81bffa3f9fef0aff5e4ca1ae247f284d5545d 100644 (file)
@@ -46,7 +46,7 @@ GraphExecutor::OutNode::OutNode() {
   _Done = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
-  _State = SUPERV::UnKnownState ;
+  _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
@@ -71,12 +71,12 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   if ( aKindOfNode == SUPERV::DataFlowGraph ) {
     _StreamGraph = NULL ;
 //    _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;
-    _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName ,
+    _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , aKindOfNode ,
                                    _prof_debug , _fdebug ) ;
   }
   else if ( aKindOfNode == SUPERV::DataStreamGraph ) {
 //    _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;;
-    _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName ,
+    _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , aKindOfNode ,
                                                _prof_debug , _fdebug ) ;
     _Graph = _StreamGraph ;
   }
@@ -85,7 +85,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _Done = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
-  _State = SUPERV::UnKnownState ;
+  _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
@@ -101,46 +101,45 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   cdebug_out << "GraphEditor::OutNode::OutNode" << endl;
 }
 
-GraphExecutor::OutNode::OutNode(
-               CORBA::ORB_ptr ORB, 
-              SALOME_NamingService* ptrNamingService ,
-               const SALOME_ModuleCatalog::Service& DataFlowService ,
-               const char *DataFlowComponentName ,
-               const char *DataFlowInterfaceName ,
-               const char *DataFlowName ,
-               const SUPERV::KindOfNode DataFlowkind ,
-               const SUPERV::SDate DataFlowFirstCreation ,
-               const SUPERV::SDate DataFlowLastModification ,
-               const char * DataFlowEditorRelease ,
-               const char * DataFlowAuthor ,
-               const char * DataFlowComputer ,
-               const char * DataFlowComment ,
-               const char * DebugFileName ) {
-//               Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
-//                      DataFlowInterfaceName , DataFlowName , DataFlowkind ,
-//                      DataFlowFirstCreation , DataFlowLastModification  ,
-//                      DataFlowEditorRelease , DataFlowAuthor ,
-//                      DataFlowComputer , DataFlowComment , DebugFileName ) {
+GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, 
+                                SALOME_NamingService* ptrNamingService ,
+                                 const SALOME_ModuleCatalog::Service& DataFlowService ,
+                                 const char *DataFlowComponentName ,
+                                 const char *DataFlowInterfaceName ,
+                                 const char *DataFlowName ,
+                                 const SUPERV::KindOfNode DataFlowkind ,
+                                 const SUPERV::SDate DataFlowFirstCreation ,
+                                 const SUPERV::SDate DataFlowLastModification ,
+                                 const char * DataFlowEditorRelease ,
+                                 const char * DataFlowAuthor ,
+                                 const char * DataFlowComputer ,
+                                 const char * DataFlowComment ,
+                                 const char * DebugFileName ) {
+//                                 Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
+//                                        DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+//                                        DataFlowFirstCreation , DataFlowLastModification  ,
+//                                        DataFlowEditorRelease , DataFlowAuthor ,
+//                                        DataFlowComputer , DataFlowComment , DebugFileName ) {
   Set_prof_debug( ORB , DebugFileName ) ;
 
   cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << " , " << DataFlowkind << ")" << endl;
   if ( DataFlowkind == SUPERV::DataFlowGraph ) {
     _StreamGraph = NULL ;
     _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
-                    DataFlowInterfaceName , DataFlowName , DataFlowkind ,
-                    DataFlowFirstCreation , DataFlowLastModification  ,
-                    DataFlowEditorRelease , DataFlowAuthor ,
-                    DataFlowComputer , DataFlowComment ,
-                    _prof_debug , _fdebug ) ;
-//                    DataFlowComputer , DataFlowComment , DebugFileName ) ;
+                                   DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+                                   DataFlowFirstCreation , DataFlowLastModification  ,
+                                   DataFlowEditorRelease , DataFlowAuthor ,
+                                   DataFlowComputer , DataFlowComment ,
+                                   _prof_debug , _fdebug ) ;
+//                                   DataFlowComputer , DataFlowComment , DebugFileName ) ;
   }
   else if ( DataFlowkind == SUPERV::DataStreamGraph ) {
     _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
-                    DataFlowInterfaceName , DataFlowName , DataFlowkind ,
-                    DataFlowFirstCreation , DataFlowLastModification  ,
-                    DataFlowEditorRelease , DataFlowAuthor ,
-                    DataFlowComputer , DataFlowComment ,
-                    _prof_debug , _fdebug ) ;
+                                               DataFlowInterfaceName , DataFlowName , DataFlowkind ,
+                                               DataFlowFirstCreation , DataFlowLastModification  ,
+                                               DataFlowEditorRelease , DataFlowAuthor ,
+                                               DataFlowComputer , DataFlowComment ,
+                                               _prof_debug , _fdebug ) ;
     _Graph = _StreamGraph ;
   }
   _Valid = false ;
@@ -148,7 +147,7 @@ GraphExecutor::OutNode::OutNode(
   _Done = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
-  _State = SUPERV::UnKnownState ;
+  _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
@@ -176,18 +175,19 @@ void GraphExecutor::OutNode::Set_prof_debug( CORBA::ORB_ptr ORB ,
   }
 }
 
-bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph &aDataFlow ) {
+bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph aDataFlow ) {
   bool RetVal = false ;
-  RetVal = LoadInfo( aDataFlow.Info ) ;
+  cdebug_in << "GraphExecutor::OutNode::LoadDataFlow " << (*aDataFlow).Info.theName << endl ;
+  RetVal = LoadInfo( (*aDataFlow).Info ) ;
   if ( Graph()->ServiceName() != NULL ) {
 //    MESSAGE( "GraphExecutor::OutNode::LoadDataFlow" );
     if ( RetVal ) {
-      RetVal = LoadNodes( aDataFlow.Nodes ) ;
+      RetVal = LoadNodes( (*aDataFlow).Nodes ) ;
       if ( RetVal ) {
-        RetVal = LoadLinks( aDataFlow.Links ) ;
+        RetVal = LoadLinks( (*aDataFlow).Links ) ;
         if ( RetVal ) {
           IsValid() ;
-          RetVal = LoadDatas( aDataFlow.Datas ) ;
+          RetVal = LoadDatas( (*aDataFlow).Datas ) ;
           IsExecutable() ;
           if ( !RetVal) {
             cdebug << "GraphExecutor::OutNode::LoadDataFlow LoadDatas Error."
@@ -212,26 +212,29 @@ bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph &aDataFlow ) {
   else {
     cdebug << "GraphExecutor::OutNode::LoadDataFlow ServiceName Error." << endl ;
   }
+  cdebug_in << "GraphExecutor::OutNode::LoadDataFlow " << RetVal << endl ;
   return RetVal ;
 }
 
+#if 0
 bool GraphExecutor::OutNode::LoadXml( const char* myFileName ) {
   bool RetVal = false ;
-  GraphBase::SGraph aDataFlow ;
-  if ( Graph()->LoadXml( _Orb , myFileName , aDataFlow ) ) {
-    RetVal = LoadDataFlow( aDataFlow ) ;
+  GraphBase::ListOfSGraphs aListOfDataFlows ;
+  if ( Graph()->LoadXml( _Orb , myFileName , aListOfDataFlows ) ) {
+    RetVal = LoadDataFlow( aListOfDataFlows ) ;
 //    if ( aConstructor && RetVal )
 //      RetVal = Name( aDataFlow.Info.theName.c_str() ) ;
   }
   return RetVal ;
-} 
+}
+#endif
 
 bool GraphExecutor::OutNode::LoadInfo(const GraphBase::SNode &aDataFlowInfo ) {
   cdebug << "GraphExecutor::OutNode::LoadInfo _StreamGraph " << _StreamGraph << endl ;
 //  ComponentName( aDataFlowInfo.theComponentName.c_str()  ) ;
   Graph()->Name( aDataFlowInfo.theName.c_str()  ) ;
   Graph()->Kind( aDataFlowInfo.theKind ) ;
-  if ( Graph()->IsDataStreamNode() ) {
+  if ( Graph()->IsDataStreamNode() && aDataFlowInfo.theKind == SUPERV::DataStreamGraph ) {
     StreamGraph()->SetStreamParams( aDataFlowInfo.theTimeout , aDataFlowInfo.theDataStreamTrace , aDataFlowInfo.theDeltaTime ) ;
   }
   Graph()->DataService( _Orb , aDataFlowInfo.theService , _prof_debug , _fdebug ) ;
@@ -246,7 +249,7 @@ bool GraphExecutor::OutNode::LoadInfo(const GraphBase::SNode &aDataFlowInfo ) {
   return true ;
 }
 
-bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfNodes &aListOfNodes ) {
+bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfSNodes &aListOfNodes ) {
   bool RetVal = true ;
   GraphExecutor::InNode * anInNode ;
   cdebug << "GraphExecutor::OutNode::LoadNodes" << endl ;
@@ -268,7 +271,7 @@ bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfNodes &aListOfNode
       RetVal = false ;
       break ;
     }
-    if ( anInNode->IsOneOfInLineNodes() ) {
+    if ( anInNode->IsOneOfInLineNodes() || anInNode->IsMacroNode() ) {
       anInNode->GraphExecutor::InNode::InLineNode()->DefPortsOfNode(
                                 _Orb , aNode.theService , anInNode->NamePtr() ,
                                 anInNode->Kind() ,
@@ -335,13 +338,21 @@ bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfNodes &aListOfNode
     if ( anInNode->IsOneOfGOTONodes() && strlen( aNode.theCoupledNode.c_str() ) ) {
       GraphBase::GOTONode * aCoupledNode ;
       aCoupledNode = (GraphBase::GOTONode * ) Graph()->GetGraphNode( aNode.theName.c_str() ) ;
-      aCoupledNode->CoupledNode( (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ) ; 
+      GraphBase::GOTONode * aCoupledCoupledNode ;
+      aCoupledCoupledNode = (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ;
+      if ( aCoupledCoupledNode != NULL ) {
+        aCoupledNode->CoupledNode( aCoupledCoupledNode ) ;
+      }
+      else {
+        aCoupledNode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ;
+      }
+      aCoupledNode->SetGraphExecutor( (GraphExecutor::DataFlow * ) this ) ;
     }
   }
   return RetVal ;
 }
 
-bool GraphExecutor::OutNode::LoadLinks(const GraphBase::ListOfLinks &aListOfLinks ) {
+bool GraphExecutor::OutNode::LoadLinks(const GraphBase::ListOfSLinks &aListOfLinks ) {
   bool RetVal = true ;
   cdebug << "GraphExecutor::OutNode::LoadLinks " << aListOfLinks.size()
          << endl ;
@@ -351,16 +362,15 @@ bool GraphExecutor::OutNode::LoadLinks(const GraphBase::ListOfLinks &aListOfLink
     RetVal = Graph()->AddLink( aLink.FromNodeName.c_str() ,
                                aLink.FromServiceParameterName.c_str() ,
                                aLink.ToNodeName.c_str() ,
-                               aLink.ToServiceParameterName.c_str() ,
-                               aLink.aLinkValue ) ;
-//                      aLink.aLinkValue.Value , aLink.aLinkValue.Kind ) ;
+                               aLink.ToServiceParameterName.c_str() ) ;
+//                               , aLink.aLinkValue ) ;
     if ( !RetVal )
       break ;
   }
   return RetVal ;
 }
 
-bool GraphExecutor::OutNode::LoadDatas(const GraphBase::ListOfLinks &aListOfDatas ) {
+bool GraphExecutor::OutNode::LoadDatas(const GraphBase::ListOfSLinks &aListOfDatas ) {
   bool RetVal = true ;
   cdebug << "GraphExecutor::OutNode::LoadDatas " << aListOfDatas.size()
          << endl ;
@@ -371,15 +381,11 @@ bool GraphExecutor::OutNode::LoadDatas(const GraphBase::ListOfLinks &aListOfData
       RetVal = Graph()->AddInputData( aLink.ToNodeName.c_str() ,
                                       aLink.ToServiceParameterName.c_str() ,
                                       aLink.aLinkValue ) ;
-//                        aLink.aLinkValue.Value , aLink.aLinkValue.Kind ) ;
-    else if ( !strcmp( aLink.ToNodeName.c_str() , Graph()->Name() ) ) {
-      RetVal = Graph()->AddOutputData( aLink.FromNodeName.c_str() ,
-                                       aLink.FromServiceParameterName.c_str() ,
-                                       aLink.aLinkValue ) ;
-//                              aLink.aLinkValue.Value ,
-//                              aLink.aLinkValue.Kind ) ;
-      Graph()->AddLink( aLink.FromNodeName.c_str() , (GraphBase::ComputingNode *) this ) ;
-    }
+//    else if ( !strcmp( aLink.ToNodeName.c_str() , Graph()->Name() ) ) {
+//      RetVal = Graph()->AddOutputData( aLink.FromNodeName.c_str() ,
+//                                       aLink.FromServiceParameterName.c_str() ) ;
+//      Graph()->AddLink( aLink.FromNodeName.c_str() , (GraphBase::ComputingNode *) this ) ;
+//    }
     else {
       cdebug << "GraphExecutor::OutNode::LoadDatas Error " << aLink.FromNodeName
            << " and " << aLink.ToNodeName << " differents from " << Graph()->Name()
@@ -425,20 +431,6 @@ GraphExecutor::InNode *GraphExecutor::OutNode::AddNode(
 }
 
 
-bool GraphExecutor::OutNode::AddInputData( const char* ToNodeName1 ,
-                                           const char* ToParameterName1 ,
-                                           const char* ToNodeName2 ,
-                                           const char* ToParameterName2 ) {
-  cdebug_in << "GraphExecutor::OutNode::AddInputData" << endl;
-  bool RetVal = Graph()->AddInputData( ToNodeName1 ,
-                                       ToParameterName1 ,
-                                       ToNodeName2 ,
-                                       ToParameterName2 ) ;
-  cdebug_out << "GraphExecutor::OutNode::AddInputData" << endl;
-  _Valid = false ;
-  return RetVal ;
-}
-
 bool GraphExecutor::OutNode::Valid() {
   cdebug_in << "GraphExecutor::OutNode::Valid" << endl;
 
@@ -486,7 +478,7 @@ bool GraphExecutor::OutNode::Executable() {
     _Executable = false ;
   }
 
-  cdebug_out << "GraphExecutor::OutNode::Executable" << endl;
+  cdebug_out << "GraphExecutor::OutNode::Executable " << _Executable << endl;
   return _Executable ;
 }
 
@@ -521,8 +513,8 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
       GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
       if ( anInNode->IsOneOfInLineNodes() ) {
         if ( !anInNode->InitPythonFunctions( true ) ) {
-          anInNode->State( SUPERV::ErroredState ) ;
-          State( SUPERV::ErroredState ) ;
+          anInNode->State( GraphExecutor::ErroredState ) ;
+          State( GraphExecutor::ErroredState ) ;
           cdebug_out << "GraphExecutor::OutNode::Run InitPythonFunctions ERROR "
                      << anInNode->Name() << endl ;
           return false ;
@@ -530,69 +522,105 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
       }
     }
 
-    cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node "
-           << Graph()->Name() << endl ;
-
-    PushEvent( NULL , GraphExecutor::ReadyEvent ,
-               SUPERV::DataReadyState ) ; 
-    State( SUPERV::DataReadyState ) ;
-
-    for ( i = 0 ; i < Graph()->HeadNodesSize() ; i++ ) {
-      GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->HeadNodes( i )->GetInNode() ;
-      if ( anInNode->State() != SUPERV::DataReadyState ) {
-        cdebug << "GraphExecutor::OutNode::Run inconsistency State of Node "
-             << anInNode->Name() << " : " << anInNode->State() << endl ;
-        cdebug_out << "GraphExecutor::OutNode::Run State ERROR" << endl ;
-        return false ;
+    for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+      GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
+      if ( anInNode->IsMacroNode() ) {
+        GraphBase::Graph * aMacroGraph = anInNode->GraphMacroNode() ;
+        cdebug << "GraphExecutor::OutNode::Run " << anInNode << " MacroNode " << aMacroGraph
+               << aMacroGraph->Name() << endl ;
+        SUPERV::Graph_var iobject = anInNode->GraphMacroNode()->MacroObject() ;
+        if ( CORBA::is_nil( iobject ) ) {
+          cdebug << "MacroObject() is a nil object. Error" << endl ;
+       }
+        else {
+          cdebug << "MacroObject() is NOT a nil object." << endl ;
+       }
       }
-//      PushEvent( anInNode , GraphExecutor::ReadyEvent ,
-//                 SUPERV::DataReadyState ) ; 
-      anInNode->CreateNewThread( true ) ;
-      anInNode->DataFromNode( Graph()->Name() ) ;
-      if ( AndSuspend ) {
-        anInNode->State( SUPERV::DataWaitingState ) ;
-        anInNode->ControlState( SUPERV::ToSuspendStartState ) ;
-        if ( !anInNode->SendEvent( GraphExecutor::SomeDataReadyEvent ) ) {
-          cdebug << "InNode::SendEvent( SomeDataReadyEvent ) ERROR Node "
-                 << anInNode->Name() << endl ;
-          cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
+    }
+
+    if ( Graph()->GraphMacroLevel() != 0 ) {
+      cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node "
+             << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
+      PushEvent( NULL , GraphExecutor::NoDataReadyEvent ,
+                 GraphExecutor::DataUndefState ) ; 
+    }
+    else {
+      cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node "
+             << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
+      PushEvent( NULL , GraphExecutor::ReadyEvent ,
+                 GraphExecutor::DataReadyState ) ; 
+      State( GraphExecutor::DataReadyState ) ;
+
+      cdebug << pthread_self() << " GraphExecutor::OutNode::Run Start of the " << Graph()->HeadNodesSize()
+             << " HeadNodes" << endl ;
+      for ( i = 0 ; i < Graph()->HeadNodesSize() ; i++ ) {
+        GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->HeadNodes( i )->GetInNode() ;
+        cdebug << pthread_self() <<  "GraphExecutor::OutNode::Run Start of HeadNode " << i << " "
+               << anInNode->Name() << endl ;
+        if ( anInNode->State() != GraphExecutor::DataReadyState ) {
+          cdebug << "GraphExecutor::OutNode::Run inconsistency State of Node "
+                 << anInNode->Name() << " : " << anInNode->State() << endl ;
+          cdebug_out << "GraphExecutor::OutNode::Run State ERROR" << endl ;
           return false ;
         }
-        anInNode->SuspendedWait() ;
+//        PushEvent( anInNode , GraphExecutor::ReadyEvent ,
+//                   GraphExecutor::DataReadyState ) ; 
+        anInNode->CreateNewThread( true ) ;
+        anInNode->DataFromNode( Graph()->Name() ) ;
+        if ( AndSuspend ) {
+          anInNode->State( GraphExecutor::DataWaitingState ) ;
+          anInNode->ControlState( SUPERV::ToSuspendStartState ) ;
+          if ( !anInNode->SendEvent( GraphExecutor::SomeDataReadyEvent ) ) {
+            cdebug << "InNode::SendEvent( SomeDataReadyEvent ) ERROR Node "
+                   << anInNode->Name() << endl ;
+            cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
+            return false ;
+          }
+          anInNode->SuspendedWait() ;
+        }
+        else if ( anInNode->IsMacroNode() ) {
+          if ( !anInNode->SendEvent( GraphExecutor::SomeDataReadyEvent ) ) {
+            cdebug << "InNode::SendEvent( SomeDataReadyEvent ) ERROR Node "
+                   << anInNode->Name() << endl ;
+            cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
+            return false ;
+         }
+          cdebug << pthread_self() << " GraphExecutor::OutNode::Run " << anInNode->Name() << "->RunningWait"
+                 << endl ;
+          anInNode->RunningWait() ;
+          cdebug << pthread_self() << " GraphExecutor::OutNode::Run " << anInNode->Name() << "->RunningWaited"
+                 << endl ;
+       }
+        else if ( !anInNode->IsMacroNode() ) {
+          if ( !anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ) {
+            cdebug << "InNode::SendEvent( ExecuteEvent ) ERROR Node "
+                   << anInNode->Name() << endl ;
+            cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
+            return false ;
+         }
+          anInNode->RunningWait() ;
+        }
       }
-      else if ( !anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ) {
-        cdebug << "InNode::SendEvent( ExecuteEvent ) ERROR Node "
-               << anInNode->Name() << endl ;
-        cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
-        return false ;
+
+      if ( AndSuspend ) {
+        PushEvent( NULL , GraphExecutor::SuspendedReadyEvent ,
+                   GraphExecutor::SuspendedReadyState ) ; 
       }
       else {
-        anInNode->RunningWait() ;
+        PushEvent( NULL , GraphExecutor::ExecutingEvent ,
+                   GraphExecutor::ExecutingState ) ; 
+        if (AutomatonState() == GraphExecutor::DataReadyState) {
+            State( GraphExecutor::ExecutingState ) ;
+        };
       }
+//      ostringstream astr ;
+//      astr << "Graph " << Graph()->Name() << " is running" ;
+//      Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
+      RetVal = true ;
     }
-
-    if ( AndSuspend ) {
-      PushEvent( NULL , GraphExecutor::SuspendedReadyEvent ,
-                 SUPERV::SuspendedReadyState ) ; 
-    }
-    else {
-      PushEvent( NULL , GraphExecutor::ExecutingEvent ,
-                 SUPERV::ExecutingState ) ; 
-      if (AutomatonState() == SUPERV::DataReadyState) {
-          State( SUPERV::ExecutingState ) ;
-      };
-    }
-//    ostringstream astr ;
-//    astr << "Graph " << Graph()->Name() << " is running" ;
-//    Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
-    RetVal = true ;
-  }
-  else {
-    PushEvent( NULL , GraphExecutor::NoDataReadyEvent ,
-               SUPERV::DataUndefState ) ; 
   }
 
-  cdebug_out << "GraphExecutor::OutNode::Run" << endl ;
+  cdebug_out << "GraphExecutor::OutNode::Run GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
   return RetVal ;
 }
 
@@ -613,8 +641,8 @@ bool GraphExecutor::OutNode::Run( const char * aNodeName ,
 void GraphExecutor::OutNode::CheckAllDone() {
   int j ;
   cdebug_in << "GraphExecutor::OutNode::CheckAllDone " << endl;
-  SUPERV::AutomatonState OutNodeState = SUPERV::SuccessedState ;
-  SUPERV::AutomatonState InNodeState ;
+  GraphExecutor::AutomatonState OutNodeState = GraphExecutor::SuccessedState ;
+  GraphExecutor::AutomatonState InNodeState ;
   bool AllDone = true ;
   if ( !Done() ) {
     for ( j = 0 ; j < Graph()->QueueNodesSize() ; j++ ) {
@@ -622,21 +650,21 @@ void GraphExecutor::OutNode::CheckAllDone() {
       cdebug << j << ". "
              << ( (GraphExecutor::InNode * ) Graph()->QueueNodes( j )->GetInNode() )->Name()
              << " " << theAutomaton->StateName( InNodeState ) << endl ;
-      if ( InNodeState != SUPERV::SuccessedState &&
-           InNodeState != SUPERV::ErroredState &&
-           InNodeState != SUPERV::DataWaitingState ) {
+      if ( InNodeState != GraphExecutor::SuccessedState &&
+           InNodeState != GraphExecutor::ErroredState &&
+           InNodeState != GraphExecutor::DataWaitingState ) {
         AllDone = false ;
       }
-      if ( InNodeState != SUPERV::SuccessedState &&
-           InNodeState != SUPERV::DataWaitingState &&
-           InNodeState != SUPERV::DataReadyState ) {
+      if ( InNodeState != GraphExecutor::SuccessedState &&
+           InNodeState != GraphExecutor::DataWaitingState &&
+           InNodeState != GraphExecutor::DataReadyState ) {
         OutNodeState = InNodeState ;
       }
     }
     if ( AllDone ) {
       if( _Threads == 0 && _SuspendedThreads == 0 ) {
-        if ( OutNodeState != SUPERV::ErroredState ) {
-          OutNodeState = SUPERV::SuccessedState ;
+        if ( OutNodeState != GraphExecutor::ErroredState ) {
+          OutNodeState = GraphExecutor::SuccessedState ;
         }
       }
       else {
@@ -821,7 +849,7 @@ void GraphExecutor::OutNode::SuspendThread() {
     exit( 0 ) ;
   }
   if ( IsSuspended() ) {
-    PushEvent( NULL , GraphExecutor::SuspendEvent , SUPERV::SuspendedState ) ;
+    PushEvent( NULL , GraphExecutor::SuspendEvent , GraphExecutor::SuspendedState ) ;
   }
 }
 void GraphExecutor::OutNode::ResumeThread() {
@@ -1004,126 +1032,126 @@ SUPERV::GraphEvent GraphExecutor::OutNode::AutomatonGraphEvent(GraphExecutor::No
   return aGraphEvent ;
 }
 
-SUPERV::GraphState GraphExecutor::OutNode::AutomatonGraphState(SUPERV::AutomatonState aState ) {
+SUPERV::GraphState GraphExecutor::OutNode::AutomatonGraphState(GraphExecutor::AutomatonState aState ) {
   SUPERV::GraphState aGraphState ;
   switch ( aState ) {
-  case SUPERV::UnKnownState : {
+  case GraphExecutor::UnKnownState : {
     aGraphState = SUPERV::UndefinedState ;
     break ;
   }
-  case SUPERV::DataUndefState : {
+  case GraphExecutor::DataUndefState : {
     aGraphState = SUPERV::UndefinedState ;
     break ;
   }
-  case SUPERV::DataWaitingState : {
+  case GraphExecutor::DataWaitingState : {
     aGraphState = SUPERV::WaitingState ;
     break ;
   }
-  case SUPERV::DataReadyState : {
+  case GraphExecutor::DataReadyState : {
     aGraphState = SUPERV::ReadyState ;
     break ;
   }
-  case SUPERV::SuspendedReadyState : {
+  case GraphExecutor::SuspendedReadyState : {
     aGraphState = SUPERV::SuspendReadyState ;
     break ;
   }
-  case SUPERV::ResumedReadyState : {
+  case GraphExecutor::ResumedReadyState : {
     aGraphState = SUPERV::ReadyState ;
     break ;
   }
-  case SUPERV::KilledReadyState : {
+  case GraphExecutor::KilledReadyState : {
     aGraphState = SUPERV::KillState ;
     break ;
   }
-  case SUPERV::StoppedReadyState : {
+  case GraphExecutor::StoppedReadyState : {
     aGraphState = SUPERV::StopState ;
     break ;
   }
-  case SUPERV::ExecutingState : {
+  case GraphExecutor::ExecutingState : {
     aGraphState = SUPERV::RunningState ;
     break ;
   }
-  case SUPERV::SuspendedExecutingState : {
+  case GraphExecutor::SuspendedExecutingState : {
     aGraphState = SUPERV::SuspendState ;
     break ;
   }
-  case SUPERV::ResumedExecutingState : {
+  case GraphExecutor::ResumedExecutingState : {
     aGraphState = SUPERV::RunningState ;
     break ;
   }
-  case SUPERV::KilledExecutingState : {
+  case GraphExecutor::KilledExecutingState : {
     aGraphState = SUPERV::KillState ;
     break ;
   }
-  case SUPERV::StoppedExecutingState : {
+  case GraphExecutor::StoppedExecutingState : {
     aGraphState = SUPERV::StopState ;
     break ;
   }
-  case SUPERV::SuccessedExecutingState : {
+  case GraphExecutor::SuccessedExecutingState : {
     aGraphState = SUPERV::DoneState ;
     break ;
   }
-  case SUPERV::ErroredExecutingState : {
+  case GraphExecutor::ErroredExecutingState : {
     aGraphState = SUPERV::ErrorState ;
     break ;
   }
-  case SUPERV::SuspendedSuccessedState : {
+  case GraphExecutor::SuspendedSuccessedState : {
     aGraphState = SUPERV::SuspendDoneState ;
     break ;
   }
-  case SUPERV::SuspendedErroredState : {
+  case GraphExecutor::SuspendedErroredState : {
     aGraphState = SUPERV::SuspendErroredState ;
     break ;
   }
-  case SUPERV::ResumedSuccessedState : {
+  case GraphExecutor::ResumedSuccessedState : {
     aGraphState = SUPERV::DoneState ;
     break ;
   }
-  case SUPERV::ResumedErroredState : {
+  case GraphExecutor::ResumedErroredState : {
     aGraphState = SUPERV::ErrorState ;
     break ;
   }
-  case SUPERV::KilledSuccessedState : {
+  case GraphExecutor::KilledSuccessedState : {
     aGraphState = SUPERV::KillState ;
     break ;
   }
-  case SUPERV::KilledErroredState : {
+  case GraphExecutor::KilledErroredState : {
     aGraphState = SUPERV::KillState ;
     break ;
   }
-  case SUPERV::StoppedSuccessedState : {
+  case GraphExecutor::StoppedSuccessedState : {
     aGraphState = SUPERV::StopState ;
     break ;
   }
-  case SUPERV::StoppedErroredState : {
+  case GraphExecutor::StoppedErroredState : {
     aGraphState = SUPERV::StopState ;
     break ;
   }
-  case SUPERV::SuccessedState : {
+  case GraphExecutor::SuccessedState : {
     aGraphState = SUPERV::DoneState ;
     break ;
   }
-  case SUPERV::ErroredState : {
+  case GraphExecutor::ErroredState : {
     aGraphState = SUPERV::ErrorState ;
     break ;
   }
-  case SUPERV::SuspendedState : {
+  case GraphExecutor::SuspendedState : {
     aGraphState = SUPERV::SuspendState ;
     break ;
   }
-  case SUPERV::KilledState : {
+  case GraphExecutor::KilledState : {
     aGraphState = SUPERV::KillState ;
     break ;
   }
-  case SUPERV::StoppedState : {
+  case GraphExecutor::StoppedState : {
     aGraphState = SUPERV::StopState ;
     break ;
   }
-  case SUPERV::ReRunnedState : {
+  case GraphExecutor::ReRunnedState : {
     aGraphState = SUPERV::ReRunState ;
     break ;
   }
-  case SUPERV::ReStartedState : {
+  case GraphExecutor::ReStartedState : {
     aGraphState = SUPERV::ReStartState ;
     break ;
   }
@@ -1142,7 +1170,7 @@ int GraphExecutor::OutNode::GetListSize() {
 
 bool GraphExecutor::OutNode::PushEvent( GraphExecutor::InNode * aNode ,
                                         GraphExecutor::NodeEvent anEvent ,
-                                        SUPERV::AutomatonState aState ) {
+                                        GraphExecutor::AutomatonState aState ) {
 //  cdebug_in << "PushEvent Threads " << Threads() << " SuspendedThreads "
 //            << SuspendedThreads() << endl ;
   if ( pthread_mutex_lock( &_MutexWait ) ) {
@@ -1212,7 +1240,7 @@ bool GraphExecutor::OutNode::Event( char ** aNodeName ,
                 _EventNodes.size() > 0 ;
   char * NodeName = "" ;
   GraphExecutor::NodeEvent theEvent = GraphExecutor::UndefinedEvent ;
-  SUPERV::AutomatonState theState = SUPERV::UnKnownState ;
+  GraphExecutor::AutomatonState theState = GraphExecutor::UnKnownState ;
   anEvent = SUPERV::UndefinedEvent ;
   aState = SUPERV::UndefinedState ;
   if ( ( Done() || IsKilled() || IsStopped() ) && _EventNodes.size() == 0 ) {
@@ -1300,7 +1328,7 @@ bool GraphExecutor::OutNode::EventWait( char ** aNodeName ,
   cdebug << "--> EventW RetVal " << RetVal << endl ;
   char * NodeName = "" ;
   GraphExecutor::NodeEvent theEvent = GraphExecutor::UndefinedEvent ;
-  SUPERV::AutomatonState theState = SUPERV::UnKnownState ;
+  GraphExecutor::AutomatonState theState = GraphExecutor::UnKnownState ;
   anEvent = SUPERV::UndefinedEvent ;
   aState = SUPERV::UndefinedState ;
   if ( IsDone() && _EventNodes.size() == 0 ) {
@@ -1421,7 +1449,7 @@ void GraphExecutor::OutNode::EventList() {
   }
   list< char * >::iterator itEventNodes = _EventNodes.begin() ;
   list< GraphExecutor::NodeEvent >::iterator itEvents = _Events.begin() ;
-  list< SUPERV::AutomatonState >::iterator itStates = _States.begin() ;
+  list< GraphExecutor::AutomatonState >::iterator itStates = _States.begin() ;
   while ( itEventNodes != _EventNodes.end() ) {
     cdebug << pthread_self() << "EVENTSTACK "
            << *itEventNodes << " " << *itEvents << " "
@@ -1437,7 +1465,15 @@ void GraphExecutor::OutNode::EventList() {
   }
 }
 
-void GraphExecutor::OutNode::State(SUPERV::AutomatonState aState ) {
+void GraphExecutor::OutNode::SendSomeDataReady( const char * aNodeName ) {
+  cdebug_in << "GraphExecutor::OutNode::SendSomeDataReady " << aNodeName << "->SendSomeDataReady( "
+            << Graph()->Name() << " )" << endl;
+  int sts ;
+  sts = ((GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( aNodeName )->GetInNode())->SendSomeDataReady( Graph()->Name() ) ;
+  cdebug_out << "GraphExecutor::OutNode::SendSomeDataReady sts " << sts << endl ;
+}
+
+void GraphExecutor::OutNode::State(GraphExecutor::AutomatonState aState ) {
 //  cdebug << "GraphExecutor::OutNode::State " << Graph()->Name() << " "
 //         << theAutomaton->StateName( AutomatonGraphState( _State ) ) << " ---> "
 //         << theAutomaton->StateName( AutomatonGraphState( aState ) ) << endl ;
@@ -1454,7 +1490,7 @@ SUPERV::GraphState GraphExecutor::OutNode::State() {
 
 SUPERV::GraphState GraphExecutor::OutNode::State( const char * NodeName ) {
 //  cdebug_in << "GraphExecutor::OutNode::State " << NodeName << endl;
-  SUPERV::AutomatonState aret = SUPERV::UnKnownState ;
+  GraphExecutor::AutomatonState aret = GraphExecutor::UnKnownState ;
   const GraphBase::ComputingNode * aCNode =  Graph()->GetGraphNode( NodeName ) ;
   if ( aCNode ) {
     GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *)aCNode->GetInNode() ;
@@ -1477,15 +1513,15 @@ SUPERV::GraphState GraphExecutor::OutNode::State( const char * NodeName ,
   return aret ;
 }
 
-SUPERV::AutomatonState GraphExecutor::OutNode::AutomatonState() {
+GraphExecutor::AutomatonState GraphExecutor::OutNode::AutomatonState() {
 //  cdebug_in << "GraphExecutor::OutNode::AutomatonState" << endl;
 //  cdebug_out << "GraphExecutor::OutNode::AutomatonState" << endl ;
   return _State ;
 }
 
-SUPERV::AutomatonState GraphExecutor::OutNode::AutomatonState( const char * NodeName ) {
+GraphExecutor::AutomatonState GraphExecutor::OutNode::AutomatonState( const char * NodeName ) {
 //  cdebug_in << "GraphExecutor::OutNode::AutomatonState " << NodeName << endl;
-  SUPERV::AutomatonState aret = SUPERV::UnKnownState ;
+  GraphExecutor::AutomatonState aret = GraphExecutor::UnKnownState ;
   GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ;
   if ( anInNode )
     aret = anInNode->State() ;
@@ -1671,7 +1707,7 @@ bool GraphExecutor::OutNode::ContainerKill() {
     }
     RetVal = true ;
   }
-  State( SUPERV::KilledState ) ;
+  State( GraphExecutor::KilledState ) ;
   cdebug_out << "GraphExecutor::OutNode::ContainerKill" << endl ;
   return RetVal ;
 }
@@ -1699,7 +1735,7 @@ bool GraphExecutor::OutNode::Suspend() {
     }
   }
   if ( RetVal ) {
-    State( SUPERV::SuspendedState ) ;
+    State( GraphExecutor::SuspendedState ) ;
     MESSAGE("================================================================================") ;
     MESSAGE( Graph()->Name() << " IS SUSPENDED" ) ;
     MESSAGE("================================================================================") ;
@@ -1717,7 +1753,7 @@ bool GraphExecutor::OutNode::Resume() {
   int RetVal = 0 ;
   cdebug_in << "GraphExecutor::OutNode::Resume" << endl;
   if ( IsSuspended() ) {
-    State( SUPERV::ExecutingState ) ;
+    State( GraphExecutor::ExecutingState ) ;
     int i ;
     for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
       GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
@@ -1791,7 +1827,7 @@ bool GraphExecutor::OutNode::Kill() {
     }
     RetVal = true ;
   }
-  State( SUPERV::KilledState ) ;
+  State( GraphExecutor::KilledState ) ;
   if ( RetVal ) {
     MESSAGE("================================================================================") ;
     MESSAGE( Graph()->Name() << " IS KILLED" <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "