Przeglądaj źródła

Merge pull request #5378 from richardkchapman/roxie-notify

HPCC-10629 NOTIFY not supported in Roxie

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 11 lat temu
rodzic
commit
6af3829d69
2 zmienionych plików z 20 dodań i 2 usunięć
  1. 2 0
      roxie/ccd/CMakeLists.txt
  2. 18 2
      roxie/ccd/ccdcontext.cpp

+ 2 - 0
roxie/ccd/CMakeLists.txt

@@ -68,6 +68,7 @@ include_directories (
          ./../../roxie/roxie 
          ./../../common/environment 
          ./../../ecl/hthor 
+         ./../../ecl/schedulectrl
          ./../../rtl/nbcd 
          ./../../common/deftype 
          ./../../system/include 
@@ -106,6 +107,7 @@ target_link_libraries ( ccd
          thorhelper 
          jhtree 
          environment 
+         schedulectrl
          dllserver 
          workunit 
     )

+ 18 - 2
roxie/ccd/ccdcontext.cpp

@@ -24,6 +24,7 @@
 #include "thorplugin.hpp"
 #include "thorxmlread.hpp"
 #include "roxiemem.hpp"
+#include "eventqueue.hpp"
 
 #include "ccd.hpp"
 #include "ccdcontext.hpp"
@@ -3190,8 +3191,23 @@ public:
 
     virtual unsigned getWorkflowId() { return workflow->queryCurrentWfid(); }
 
-    virtual void doNotify(char const * code, char const * extra) { UNIMPLEMENTED; }
-    virtual void doNotify(char const * code, char const * extra, const char * target) { UNIMPLEMENTED; }
+    void doNotify(char const * name, char const * text)
+    {
+        doNotify(name, text, NULL);
+    }
+
+    void doNotify(char const * name, char const * text, const char * target)
+    {
+        Owned<IRoxieDaliHelper> daliHelper = connectToDali();
+        if (daliHelper && daliHelper->connected())
+        {
+            Owned<IScheduleEventPusher> pusher(getScheduleEventPusher());
+            pusher->push(name, text, target);
+        }
+        else
+            throw MakeStringException(ROXIE_DALI_ERROR, "doNotify: no dali connection available");
+    }
+
     virtual void doWait(unsigned code, char const * extra) { UNIMPLEMENTED; }
     virtual void doWaitCond(unsigned code, char const * extra, int sequence, char const * alias, unsigned wfid) { UNIMPLEMENTED; }