diff OrthancServer/ServerContext.cpp @ 2808:37583cd183ed

primitives to create jobs from plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Sep 2018 17:57:06 +0200
parents 3a55b77339ff
children 925d8dc03a23
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp	Tue Sep 04 15:58:26 2018 +0200
+++ b/OrthancServer/ServerContext.cpp	Wed Sep 05 17:57:06 2018 +0200
@@ -165,11 +165,24 @@
       if (index_.LookupGlobalProperty(serialized, GlobalProperty_JobsRegistry))
       {
         LOG(WARNING) << "Reloading the jobs from the last execution of Orthanc";
-        OrthancJobUnserializer unserializer(*this);
 
         try
         {
-          jobsEngine_.LoadRegistryFromString(unserializer, serialized);
+          bool plugin = false;
+        
+#if ORTHANC_ENABLE_PLUGINS == 1
+          if (HasPlugins() &&
+              plugins_->UnserializeJob(serialized))
+          {
+            plugin = true;
+          }
+#endif
+
+          if (!plugin)
+          {
+            OrthancJobUnserializer unserializer(*this);
+            jobsEngine_.LoadRegistryFromString(unserializer, serialized);
+          }
         }
         catch (OrthancException& e)
         {