diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-01-21 14:33:32 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-01-21 14:33:32 (GMT) |
commit | 948fbc12c1b4e48a24b18a84878bd560cbaf91a7 (patch) | |
tree | 23976fb5eedfedaeadd8fed8da60aa1159f3d286 /src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | |
parent | 08eff21dfbdbf7d20e1b96ff2f00882ec0a87b08 (diff) | |
download | uscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.zip uscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.tar.gz uscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.tar.bz2 |
SMTP Invoker and "invoke.success.<INV_ID>" events when an invoker was started
Diffstat (limited to 'src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 9a4b528..de94088 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -627,20 +627,19 @@ std::string SWIDataModel::evalAsString(const std::string& expr) { PlQuery query(compound.name(), termv); std::stringstream ss; - const char* separator = ""; + std::string solSeparator = ""; while (query.next_solution()) { + ss << solSeparator; std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - if (vars.size() == 1) { - ss << separator << (char *)vars.begin()->second; - separator = "\n"; - } else { - std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); - while(varIter != vars.end()) { - ss << separator << (char *)varIter->second; - separator = ", "; - varIter++; - } + std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); + + std::string varSeparator = ""; + while(varIter != vars.end()) { + ss << varSeparator << (char *)varIter->second; + varSeparator = ", "; + varIter++; } + solSeparator = "\n"; } return ss.str(); } @@ -684,6 +683,8 @@ std::map<std::string, PlTerm> SWIDataModel::resolveAtoms(PlTerm& term, PlTerm& o atoms.insert(result.begin(), result.end()); } break; + default: + LOG(ERROR) << "Resolving variable of unknown type in query solution"; } return atoms; } RETHROW_PLEX_AS_EVENT |