Index: XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp	(revision 1671)
+++ XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp	(revision 1677)
@@ -54,17 +54,4 @@
       {
         filter->connectOutput(firstFilter, 0);
-        if (buildWorkflowGraph)
-        {
-          if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>;
-          if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >;
-          int filterOut = (std::static_pointer_cast<COutputPin>(filter))->getFilterId();
-          int filterIn = (std::static_pointer_cast<COutputPin>(firstFilter))->getFilterId();
-          // PASS field's id here
-          (*CWorkflowGraph::mapFieldToFilters_ptr)["XXX"].push_back(filterOut);
-          (*CWorkflowGraph::mapFieldToFilters_ptr)["XXX"].push_back(filterIn);
-          (*CWorkflowGraph::mapFilters_ptr)[filterOut] = "Spatial transform filter";
-          (*CWorkflowGraph::mapFilters_ptr)[filterIn] = "Spatial transform filter";
-          std::cout<<"CSpatialTransformFilter::CSpatialTransformFilter CWorkflowGraph::mapFieldToFilters_ptr->size = "<<CWorkflowGraph::mapFieldToFilters_ptr->size()<<std::endl;
-        }
       }
 
@@ -86,8 +73,13 @@
   void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data)
   {
+    // if(CXios::isClient) std::cout<<"CSpatialTransformFilter onInputReady"<<std::endl;
+
     CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
+    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->output_field_id);
     if (outputPacket)
+    {
+      // std::cout<<"Spatial Transform Filter onOutputReady"<<std::endl;
       onOutputReady(outputPacket);
+    } 
   }
 
@@ -120,6 +112,8 @@
   void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data)
   {
+    if(CXios::isClient) std::cout<<"CSpatialTemporalFilter onInputReady"<<std::endl;
+
     CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
+    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->output_field_id);
 
     if (outputPacket)
@@ -146,4 +140,5 @@
         packet->data.resize(tmpData.numElements());
         packet->data = tmpData;
+        std::cout<<"Spatial temporal filter onOutputReady"<<std::endl;
         onOutputReady(packet);
         tmpData.resize(0) ;
@@ -187,6 +182,25 @@
   }
 
-  CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue)
-  {
+  CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, StdString fieldID)
+  {
+    if(tag)
+    {
+      this->filterID = InvalidableObject::filterIdGenerator++;
+    
+      std::cout<<"CSpatialTransformFilter::apply filter tag = "<<tag<<std::endl;
+    
+
+      if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>;
+
+      (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Spatial Transform Filter";
+
+      if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >;
+
+      StdString str = data[0]->fieldID + " ts=" + to_string(data[0]->timestamp);
+      (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID);
+      (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID);
+    }
+
+
     CDataPacketPtr packet(new CDataPacket);
     packet->date = data[0]->date;
@@ -207,4 +221,7 @@
       apply(data[0]->data, packet->data);
     }
+
+    if(tag) packet->src_filterID=this->filterID;
+    packet->fieldID=fieldID;
 
     return packet;
