Salome HOME
Copyright update 2021
[modules/jobmanager.git] / src / engine / BL_JobsManager.cxx
index eeb9e2f5153c7f5bf8867aa532ba7b5c3539cb94..8fdf7c2f0912cfcbc20d4f53ed18d3978656e5fc 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -297,7 +297,20 @@ BL::JobsManager::refresh_jobs_thread(void * object_ptr)
           else if (result_job != "")
           {
             if (object->_observer)
+                       {
               object->_observer->sendEvent("refresh_job", "Ok", job->getName(), result_job);
+
+                         // get assigned hostnames when the job will start
+                         if (result_job == "RUNNING")
+                         {
+                               std::string assigned_hostnames = object->_salome_services->get_assigned_hostnames(job);
+                               if (assigned_hostnames != "")
+                               {
+                                       // sent event "get_assigned_hostnames"
+                                       object->_observer->sendEvent("get_assigned_hostnames", "Ok", job->getName(), assigned_hostnames);
+                               }
+                         }
+                       }
           }
         }
       }