@@ -82,7 +82,7 @@ EuropaReactor::EuropaReactor(TeleoReactor::xml_arg_type arg)
8282 "relation_gv")),
8383 m_full_log(parse_attr<bool >(false , xml_factory::node(arg),
8484 "all_plans")) {
85- bool found;
85+ bool found, is_file ;
8686 std::string nddl;
8787
8888
@@ -93,15 +93,29 @@ EuropaReactor::EuropaReactor(TeleoReactor::xml_arg_type arg)
9393 if ( m_full_log )
9494 syslog (warn)<<" I will log all my plans as they are produced."
9595 <<" \n\t This can be very costful in term of disk space." ;
96+
97+ // std::string content = cfg.second.data();
98+ // if( !content.empty() )
99+ // std::cout<<"content:\n"<<content<<std::endl;
100+
96101
97102 // Load the specified model
98103 if ( model ) {
104+ is_file = true ;
99105 if ( model->empty () )
100106 throw XmlError (cfg, " Attribute \" model\" is empty." );
101107 nddl = *model;
102108 if ( !locate_nddl (nddl) )
103109 throw XmlError (cfg, " Unable to locate model file \" " +(*model)+" \" " );
104110 } else {
111+ std::string content = cfg.second .data ();
112+ syslog (null, info)<<" No model file; parsing xml text data instead:\n "
113+ <<content
114+ <<" \n -----------------------------------------------------" ;
115+ is_file = false ;
116+ nddl = content;
117+
118+ /*
105119 std::string short_nddl = getName().str()+".nddl",
106120 long_nddl = getGraphName().str()+"."+short_nddl;
107121
@@ -114,9 +128,10 @@ EuropaReactor::EuropaReactor(TeleoReactor::xml_arg_type arg)
114128 if( !locate_nddl(nddl) )
115129 throw ReactorException(*this, "Unable to locate "+long_nddl+" or "+short_nddl);
116130 }
131+ */
117132 }
118133 // Load the nddl model
119- if ( !playTransaction (nddl) ) {
134+ if ( !playTransaction (nddl, is_file ) ) {
120135 syslog (null,error)<<" Model is inconsistent." ;
121136 throw ReactorException (*this , " model in " +nddl+" is inconsistent." );
122137 }
0 commit comments