comparison Core/JobsEngine/GenericJobUnserializer.cpp @ 2666:2540ac79ab6c jobs

SequenceOfOperationsJob serialization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 08 Jun 2018 15:05:32 +0200
parents a6d3e45eeff5
children d924f9bb61cc
comparison
equal deleted inserted replaced
2665:389d050a2e66 2666:2540ac79ab6c
38 #include "../OrthancException.h" 38 #include "../OrthancException.h"
39 #include "../SerializationToolbox.h" 39 #include "../SerializationToolbox.h"
40 40
41 #include "Operations/LogJobOperation.h" 41 #include "Operations/LogJobOperation.h"
42 #include "Operations/NullOperationValue.h" 42 #include "Operations/NullOperationValue.h"
43 #include "Operations/SequenceOfOperationsJob.h"
43 #include "Operations/StringOperationValue.h" 44 #include "Operations/StringOperationValue.h"
44 45
45 namespace Orthanc 46 namespace Orthanc
46 { 47 {
47 IJob* GenericJobUnserializer::UnserializeJob(const Json::Value& source) 48 IJob* GenericJobUnserializer::UnserializeJob(const Json::Value& source)
48 { 49 {
49 const std::string type = SerializationToolbox::ReadString(source, "Type"); 50 const std::string type = SerializationToolbox::ReadString(source, "Type");
50 51
51 LOG(ERROR) << "Cannot unserialize job of type: " << type; 52 if (type == "SequenceOfOperations")
52 throw OrthancException(ErrorCode_BadFileFormat); 53 {
54 return new SequenceOfOperationsJob(*this, source);
55 }
56 else
57 {
58 LOG(ERROR) << "Cannot unserialize job of type: " << type;
59 throw OrthancException(ErrorCode_BadFileFormat);
60 }
53 } 61 }
54 62
55 63
56 IJobOperation* GenericJobUnserializer::UnserializeOperation(const Json::Value& source) 64 IJobOperation* GenericJobUnserializer::UnserializeOperation(const Json::Value& source)
57 { 65 {