1 #include "otsdaq/CoreSupervisors/CoreSupervisorBase.h"
9 const std::string CoreSupervisorBase::WORK_LOOP_DONE =
"Done";
10 const std::string CoreSupervisorBase::WORK_LOOP_WORKING =
"Working";
13 CoreSupervisorBase::CoreSupervisorBase(xdaq::ApplicationStub* stub)
14 : xdaq::Application(stub)
23 , stateMachineWorkLoopManager_(toolbox::task::bind(
25 , stateMachineSemaphore_(toolbox::BSem::FULL)
26 , theRemoteWebUsers_(this)
28 __SUP_COUT__ <<
"Constructor." << __E__;
30 INIT_MF(
"CoreSupervisorBase");
32 xgi::bind(
this, &CoreSupervisorBase::defaultPageWrapper,
"Default");
33 xgi::bind(
this, &CoreSupervisorBase::requestWrapper,
"Request");
36 this, &CoreSupervisorBase::stateMachineXgiHandler,
"StateMachineXgiHandler");
39 &CoreSupervisorBase::stateMachineStateRequest,
40 "StateMachineStateRequest",
43 &CoreSupervisorBase::stateMachineErrorMessageRequest,
44 "StateMachineErrorMessageRequest",
47 &CoreSupervisorBase::workLoopStatusRequestWrapper,
48 "WorkLoopStatusRequest",
51 &CoreSupervisorBase::applicationStatusRequest,
52 "ApplicationStatusRequest",
55 __SUP_COUT__ <<
"Constructed." << __E__;
59 CoreSupervisorBase::~CoreSupervisorBase(
void)
61 __SUP_COUT__ <<
"Destructor." << __E__;
63 __SUP_COUT__ <<
"Destructed." << __E__;
67 void CoreSupervisorBase::destroy(
void)
69 __SUP_COUT__ <<
"Destroying..." << __E__;
70 for(
auto& it : theStateMachineImplementation_)
72 theStateMachineImplementation_.clear();
77 void CoreSupervisorBase::defaultPageWrapper(xgi::Input* in, xgi::Output* out)
79 return defaultPage(in, out);
83 void CoreSupervisorBase::defaultPage(xgi::Input* in, xgi::Output* out)
85 __SUP_COUT__ <<
"Supervisor class " << supervisorClass_ << __E__;
87 std::stringstream pagess;
88 pagess <<
"/WebPath/html/" << supervisorClassNoNamespace_
89 <<
".html?urn=" << this->getApplicationDescriptor()->getLocalId();
91 __SUP_COUT__ <<
"Default page = " << pagess.str() << __E__;
93 *out <<
"<!DOCTYPE HTML><html lang='en'><frameset col='100%' row='100%'><frame src='"
94 << pagess.str() <<
"'></frameset></html>";
100 void CoreSupervisorBase::requestWrapper(xgi::Input* in, xgi::Output* out)
104 cgicc::Cgicc cgiIn(in);
105 std::string requestType = CgiDataUtilities::getData(cgiIn,
"RequestType");
112 requestType, CgiDataUtilities::getOrPostData(cgiIn,
"CookieCode"));
114 CorePropertySupervisorBase::getRequestUserInfo(userInfo);
116 if(!theRemoteWebUsers_.xmlRequestToGateway(
117 cgiIn, out, &xmlOut, CorePropertySupervisorBase::allSupervisorInfo_, userInfo))
124 if(!userInfo.automatedCommand_)
125 __SUP_COUT__ <<
"requestType: " << requestType << __E__;
127 if(userInfo.NonXMLRequestType_)
131 nonXmlRequest(requestType, cgiIn, *out, userInfo);
133 catch(
const std::runtime_error& e)
135 __SUP_SS__ <<
"An error was encountered handling requestType '" << requestType
136 <<
"':" << e.what() << __E__;
137 __SUP_COUT_ERR__ <<
"\n" << ss.str();
138 __SUP_MOUT_ERR__ <<
"\n" << ss.str();
142 __SUP_SS__ <<
"An unknown error was encountered handling requestType '"
143 << requestType <<
".' "
144 <<
"Please check the printouts to debug." << __E__;
145 __SUP_COUT_ERR__ <<
"\n" << ss.str();
146 __SUP_MOUT_ERR__ <<
"\n" << ss.str();
155 request(requestType, cgiIn, xmlOut, userInfo);
157 catch(
const std::runtime_error& e)
159 __SUP_SS__ <<
"An error was encountered handling requestType '" << requestType
160 <<
"':" << e.what() << __E__;
161 __SUP_COUT_ERR__ <<
"\n" << ss.str();
162 xmlOut.addTextElementToData(
"Error", ss.str());
166 __SUP_SS__ <<
"An unknown error was encountered handling requestType '"
167 << requestType <<
".' "
168 <<
"Please check the printouts to debug." << __E__;
169 __SUP_COUT_ERR__ <<
"\n" << ss.str();
170 xmlOut.addTextElementToData(
"Error", ss.str());
175 unsigned int occurance = 0;
176 std::string err = xmlOut.getMatchingValue(
"Error", occurance++);
179 __SUP_COUT_ERR__ <<
"'" << requestType <<
"' ERROR encountered: " << err
181 __SUP_MOUT_ERR__ <<
"'" << requestType <<
"' ERROR encountered: " << err
183 err = xmlOut.getMatchingValue(
"Error", occurance++);
188 xmlOut.outputXmlDocument((std::ostringstream*)out,
190 !userInfo.NoXmlWhiteSpace_ );
199 void CoreSupervisorBase::request(
const std::string& requestType,
204 __SUP_SS__ <<
"This is the empty Core Supervisor request. Supervisors should "
205 "override this function."
207 __SUP_COUT__ << ss.str();
208 xmlOut.addTextElementToData(
"Error", ss.str());
265 void CoreSupervisorBase::nonXmlRequest(
const std::string& requestType,
270 __SUP_COUT__ <<
"This is the empty Core Supervisor non-xml request. Supervisors "
271 "should override this function."
273 out <<
"This is the empty Core Supervisor non-xml request. Supervisors should "
274 "override this function."
279 void CoreSupervisorBase::stateMachineXgiHandler(xgi::Input* in, xgi::Output* out) {}
282 void CoreSupervisorBase::stateMachineResultXgiHandler(xgi::Input* in, xgi::Output* out) {}
285 xoap::MessageReference CoreSupervisorBase::stateMachineXoapHandler(
286 xoap::MessageReference message)
289 __SUP_COUT__ <<
"Soap Handler!" << __E__;
290 stateMachineWorkLoopManager_.removeProcessedRequests();
291 stateMachineWorkLoopManager_.processRequest(message);
292 __SUP_COUT__ <<
"Done - Soap Handler!" << __E__;
297 xoap::MessageReference CoreSupervisorBase::stateMachineResultXoapHandler(
298 xoap::MessageReference message)
301 __SUP_COUT__ <<
"Soap Handler!" << __E__;
304 __SUP_COUT__ <<
"Done - Soap Handler!" << __E__;
310 xoap::MessageReference CoreSupervisorBase::workLoopStatusRequestWrapper(
311 xoap::MessageReference message)
315 return workLoopStatusRequest(message);
319 xoap::MessageReference CoreSupervisorBase::workLoopStatusRequest(
320 xoap::MessageReference message)
324 return SOAPUtilities::makeSOAPMessageReference(CoreSupervisorBase::WORK_LOOP_DONE);
328 xoap::MessageReference CoreSupervisorBase::applicationStatusRequest(
329 xoap::MessageReference message)
333 std::string status = theStateMachine_.getCurrentStateName();
334 std::string progress = RunControlStateMachine::theProgressBar_.readPercentageString();
336 if(theStateMachine_.isInTransition())
339 status = theStateMachine_.getProvenanceStateName();
349 status = theStateMachine_.getCurrentStateName();
353 retParameters.addParameter(
"Status", status);
354 retParameters.addParameter(
"Progress", progress);
356 return SOAPUtilities::makeSOAPMessageReference(
"applicationStatusRequestReply",
361 bool CoreSupervisorBase::stateMachineThread(toolbox::task::WorkLoop* workLoop)
363 stateMachineSemaphore_.take();
364 __SUP_COUT__ <<
"Re-sending message..."
365 << SOAPUtilities::translate(
366 stateMachineWorkLoopManager_.getMessage(workLoop))
369 std::string reply = send(this->getApplicationDescriptor(),
370 stateMachineWorkLoopManager_.getMessage(workLoop));
371 stateMachineWorkLoopManager_.report(workLoop, reply, 100,
true);
372 __SUP_COUT__ <<
"Done with message" << __E__;
373 stateMachineSemaphore_.give();
381 xoap::MessageReference CoreSupervisorBase::stateMachineStateRequest(
382 xoap::MessageReference message)
385 __SUP_COUT__ <<
"theStateMachine_.getCurrentStateName() = "
386 << theStateMachine_.getCurrentStateName() << __E__;
387 return SOAPUtilities::makeSOAPMessageReference(
388 theStateMachine_.getCurrentStateName());
392 xoap::MessageReference CoreSupervisorBase::stateMachineErrorMessageRequest(
393 xoap::MessageReference message)
396 __SUP_COUT__ <<
"theStateMachine_.getErrorMessage() = "
397 << theStateMachine_.getErrorMessage() << __E__;
400 retParameters.addParameter(
"ErrorMessage", theStateMachine_.getErrorMessage());
401 return SOAPUtilities::makeSOAPMessageReference(
"stateMachineErrorMessageRequestReply",
406 void CoreSupervisorBase::stateInitial(toolbox::fsm::FiniteStateMachine& fsm)
409 __SUP_COUT__ <<
"CoreSupervisorBase::stateInitial" << __E__;
413 void CoreSupervisorBase::stateHalted(toolbox::fsm::FiniteStateMachine& fsm)
416 __SUP_COUT__ <<
"CoreSupervisorBase::stateHalted" << __E__;
420 void CoreSupervisorBase::stateRunning(toolbox::fsm::FiniteStateMachine& fsm)
423 __SUP_COUT__ <<
"CoreSupervisorBase::stateRunning" << __E__;
427 void CoreSupervisorBase::stateConfigured(toolbox::fsm::FiniteStateMachine& fsm)
430 __SUP_COUT__ <<
"CoreSupervisorBase::stateConfigured" << __E__;
434 void CoreSupervisorBase::statePaused(toolbox::fsm::FiniteStateMachine& fsm)
437 __SUP_COUT__ <<
"CoreSupervisorBase::statePaused" << __E__;
441 void CoreSupervisorBase::inError(toolbox::fsm::FiniteStateMachine& fsm)
444 __SUP_COUT__ <<
"Fsm current state: " << theStateMachine_.getCurrentStateName()
450 void CoreSupervisorBase::enteringError(toolbox::Event::Reference event)
456 toolbox::fsm::FailedEvent& failedEvent =
dynamic_cast<toolbox::fsm::FailedEvent&
>(*event);
457 std::ostringstream error;
458 error <<
"Failure performing transition from " << failedEvent.getFromState() <<
" to "
459 << failedEvent.getToState()
460 <<
" exception: " << failedEvent.getException().what();
461 __SUP_COUT_ERR__ << error.str() << __E__;
466 void CoreSupervisorBase::preStateMachineExecutionLoop(
void)
468 RunControlStateMachine::clearIterationWork();
469 RunControlStateMachine::clearSubIterationWork();
471 stateMachinesIterationWorkCount_ = 0;
473 if(RunControlStateMachine::getIterationIndex() == 0 &&
474 RunControlStateMachine::getSubIterationIndex() == 0)
478 subIterationWorkStateMachineIndex_ = -1;
480 stateMachinesIterationDone_.resize(theStateMachineImplementation_.size());
481 for(
unsigned int i = 0; i < stateMachinesIterationDone_.size(); ++i)
482 stateMachinesIterationDone_[i] =
false;
485 __SUP_COUT__ <<
"Iteration " << RunControlStateMachine::getIterationIndex() <<
"."
486 << RunControlStateMachine::getSubIterationIndex() <<
"("
487 << subIterationWorkStateMachineIndex_ <<
")" << __E__;
491 void CoreSupervisorBase::preStateMachineExecution(
unsigned int i)
493 if(i >= theStateMachineImplementation_.size())
495 __SUP_SS__ <<
"State Machine " << i <<
" not found!" << __E__;
499 theStateMachineImplementation_[i]->VStateMachine::setIterationIndex(
500 RunControlStateMachine::getIterationIndex());
501 theStateMachineImplementation_[i]->VStateMachine::setSubIterationIndex(
502 RunControlStateMachine::getSubIterationIndex());
504 theStateMachineImplementation_[i]->VStateMachine::clearIterationWork();
505 theStateMachineImplementation_[i]->VStateMachine::clearSubIterationWork();
508 <<
"theStateMachineImplementation Iteration "
509 << theStateMachineImplementation_[i]->VStateMachine::getIterationIndex() <<
"."
510 << theStateMachineImplementation_[i]->VStateMachine::getSubIterationIndex()
515 void CoreSupervisorBase::postStateMachineExecution(
unsigned int i)
517 if(i >= theStateMachineImplementation_.size())
519 __SUP_SS__ <<
"State Machine " << i <<
" not found!" << __E__;
524 if(theStateMachineImplementation_[i]->VStateMachine::getSubIterationWork())
526 subIterationWorkStateMachineIndex_ = i;
527 RunControlStateMachine::indicateSubIterationWork();
529 __SUP_COUT__ <<
"State machine " << i
530 <<
" is flagged for another sub-iteration..." << __E__;
534 stateMachinesIterationDone_[i] =
535 !theStateMachineImplementation_[i]->VStateMachine::getIterationWork();
537 if(!stateMachinesIterationDone_[i])
539 __SUP_COUT__ <<
"State machine " << i
540 <<
" is flagged for another iteration..." << __E__;
541 RunControlStateMachine::indicateIterationWork();
543 ++stateMachinesIterationWorkCount_;
549 void CoreSupervisorBase::postStateMachineExecutionLoop(
void)
551 if(RunControlStateMachine::subIterationWorkFlag_)
552 __SUP_COUT__ <<
"State machine implementation "
553 << subIterationWorkStateMachineIndex_
554 <<
" is flagged for another sub-iteration..." << __E__;
555 else if(RunControlStateMachine::iterationWorkFlag_)
557 << stateMachinesIterationWorkCount_
558 <<
" state machine implementation(s) flagged for another iteration..."
561 __SUP_COUT__ <<
"Done configuration all state machine implementations..."
566 void CoreSupervisorBase::transitionConfiguring(toolbox::Event::Reference event)
568 __SUP_COUT__ <<
"transitionConfiguring" << __E__;
571 if(RunControlStateMachine::getIterationIndex() == 0 &&
572 RunControlStateMachine::getSubIterationIndex() == 0)
575 SOAPUtilities::translate(theStateMachine_.getCurrentMessage())
577 .getValue(
"ConfigurationTableGroupName"),
578 TableGroupKey(SOAPUtilities::translate(theStateMachine_.getCurrentMessage())
580 .getValue(
"ConfigurationTableGroupKey")));
582 __SUP_COUT__ <<
"Configuration table group name: " << theGroup.first
583 <<
" key: " << theGroup.second << __E__;
585 theConfigurationManager_->loadTableGroup(
586 theGroup.first, theGroup.second,
true );
594 __SUP_COUT__ <<
"Configuring all state machine implementations..." << __E__;
595 preStateMachineExecutionLoop();
596 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
599 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
600 i != subIterationWorkStateMachineIndex_)
603 if(stateMachinesIterationDone_[i])
606 preStateMachineExecution(i);
607 theStateMachineImplementation_[i]->parentSupervisor_ =
609 theStateMachineImplementation_[i]->configure();
612 postStateMachineExecution(i);
614 postStateMachineExecutionLoop();
616 catch(
const std::runtime_error& e)
618 __SUP_SS__ <<
"Error was caught while configuring: " << e.what() << __E__;
619 __SUP_COUT_ERR__ <<
"\n" << ss.str();
620 theStateMachine_.setErrorMessage(ss.str());
621 throw toolbox::fsm::exception::Exception(
624 "CoreSupervisorBase::transitionConfiguring" ,
632 <<
"Unknown error was caught while configuring. Please checked the logs."
634 __SUP_COUT_ERR__ <<
"\n" << ss.str();
635 theStateMachine_.setErrorMessage(ss.str());
636 throw toolbox::fsm::exception::Exception(
639 "CoreSupervisorBase::transitionConfiguring" ,
649 void CoreSupervisorBase::transitionHalting(toolbox::Event::Reference event)
651 const std::string transitionName =
"Halting";
654 __SUP_COUT__ << transitionName <<
" all state machine implementations..."
656 preStateMachineExecutionLoop();
657 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
660 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
661 i != subIterationWorkStateMachineIndex_)
664 if(stateMachinesIterationDone_[i])
667 preStateMachineExecution(i);
668 theStateMachineImplementation_[i]->halt();
671 postStateMachineExecution(i);
673 postStateMachineExecutionLoop();
675 catch(
const std::runtime_error& e)
678 if(theStateMachine_.getProvenanceStateName() ==
679 RunControlStateMachine::FAILED_STATE_NAME)
681 __SUP_COUT_INFO__ <<
"Error was caught while halting (but ignoring because "
682 "previous state was '"
683 << RunControlStateMachine::FAILED_STATE_NAME
684 <<
"'): " << e.what() << __E__;
688 __SUP_SS__ <<
"Error was caught while " << transitionName <<
": " << e.what()
690 __SUP_COUT_ERR__ <<
"\n" << ss.str();
691 theStateMachine_.setErrorMessage(ss.str());
692 throw toolbox::fsm::exception::Exception(
695 "CoreSupervisorBase::transition" + transitionName ,
704 if(theStateMachine_.getProvenanceStateName() ==
705 RunControlStateMachine::FAILED_STATE_NAME)
707 __SUP_COUT_INFO__ <<
"Unknown error was caught while halting (but ignoring "
708 "because previous state was '"
709 << RunControlStateMachine::FAILED_STATE_NAME <<
"')."
714 __SUP_SS__ <<
"Unknown error was caught while " << transitionName
715 <<
". Please checked the logs." << __E__;
716 __SUP_COUT_ERR__ <<
"\n" << ss.str();
717 theStateMachine_.setErrorMessage(ss.str());
718 throw toolbox::fsm::exception::Exception(
721 "CoreSupervisorBase::transition" + transitionName ,
732 void CoreSupervisorBase::transitionInitializing(toolbox::Event::Reference event)
734 __SUP_COUT__ <<
"transitionInitializing" << __E__;
736 CorePropertySupervisorBase::resetPropertiesAreSetup();
747 void CoreSupervisorBase::transitionPausing(toolbox::Event::Reference event)
749 const std::string transitionName =
"Pausing";
752 __SUP_COUT__ <<
"Configuring all state machine implementations..." << __E__;
753 preStateMachineExecutionLoop();
754 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
757 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
758 i != subIterationWorkStateMachineIndex_)
761 if(stateMachinesIterationDone_[i])
764 preStateMachineExecution(i);
765 theStateMachineImplementation_[i]->pause();
768 postStateMachineExecution(i);
770 postStateMachineExecutionLoop();
772 catch(
const std::runtime_error& e)
774 __SUP_SS__ <<
"Error was caught while " << transitionName <<
": " << e.what()
776 __SUP_COUT_ERR__ <<
"\n" << ss.str();
777 theStateMachine_.setErrorMessage(ss.str());
778 throw toolbox::fsm::exception::Exception(
781 "CoreSupervisorBase::transition" + transitionName ,
788 __SUP_SS__ <<
"Unknown error was caught while " << transitionName
789 <<
". Please checked the logs." << __E__;
790 __SUP_COUT_ERR__ <<
"\n" << ss.str();
791 theStateMachine_.setErrorMessage(ss.str());
792 throw toolbox::fsm::exception::Exception(
795 "CoreSupervisorBase::transition" + transitionName ,
803 void CoreSupervisorBase::transitionResuming(toolbox::Event::Reference event)
805 const std::string transitionName =
"Resuming";
808 __SUP_COUT__ <<
"Configuring all state machine implementations..." << __E__;
809 preStateMachineExecutionLoop();
810 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
813 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
814 i != subIterationWorkStateMachineIndex_)
817 if(stateMachinesIterationDone_[i])
820 preStateMachineExecution(i);
821 theStateMachineImplementation_[i]->resume();
824 postStateMachineExecution(i);
826 postStateMachineExecutionLoop();
828 catch(
const std::runtime_error& e)
830 __SUP_SS__ <<
"Error was caught while " << transitionName <<
": " << e.what()
832 __SUP_COUT_ERR__ <<
"\n" << ss.str();
833 theStateMachine_.setErrorMessage(ss.str());
834 throw toolbox::fsm::exception::Exception(
837 "CoreSupervisorBase::transition" + transitionName ,
844 __SUP_SS__ <<
"Unknown error was caught while " << transitionName
845 <<
". Please checked the logs." << __E__;
846 __SUP_COUT_ERR__ <<
"\n" << ss.str();
847 theStateMachine_.setErrorMessage(ss.str());
848 throw toolbox::fsm::exception::Exception(
851 "CoreSupervisorBase::transition" + transitionName ,
859 void CoreSupervisorBase::transitionStarting(toolbox::Event::Reference event)
861 const std::string transitionName =
"Starting";
862 const std::string runNumber =
863 SOAPUtilities::translate(theStateMachine_.getCurrentMessage())
865 .getValue(
"RunNumber");
868 __SUP_COUT__ <<
"Configuring all state machine implementations..." << __E__;
869 preStateMachineExecutionLoop();
870 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
873 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
874 i != subIterationWorkStateMachineIndex_)
877 if(stateMachinesIterationDone_[i])
880 preStateMachineExecution(i);
881 theStateMachineImplementation_[i]->start(runNumber);
885 postStateMachineExecution(i);
887 postStateMachineExecutionLoop();
889 catch(
const std::runtime_error& e)
891 __SUP_SS__ <<
"Error was caught while " << transitionName <<
": " << e.what()
893 __SUP_COUT_ERR__ <<
"\n" << ss.str();
894 theStateMachine_.setErrorMessage(ss.str());
895 throw toolbox::fsm::exception::Exception(
898 "CoreSupervisorBase::transition" + transitionName ,
905 __SUP_SS__ <<
"Unknown error was caught while " << transitionName
906 <<
". Please checked the logs." << __E__;
907 __SUP_COUT_ERR__ <<
"\n" << ss.str();
908 theStateMachine_.setErrorMessage(ss.str());
909 throw toolbox::fsm::exception::Exception(
912 "CoreSupervisorBase::transition" + transitionName ,
920 void CoreSupervisorBase::transitionStopping(toolbox::Event::Reference event)
922 const std::string transitionName =
"Stopping";
925 __SUP_COUT__ <<
"Configuring all state machine implementations..." << __E__;
926 preStateMachineExecutionLoop();
927 for(
unsigned int i = 0; i < theStateMachineImplementation_.size(); ++i)
930 if(subIterationWorkStateMachineIndex_ != (
unsigned int)-1 &&
931 i != subIterationWorkStateMachineIndex_)
934 if(stateMachinesIterationDone_[i])
937 preStateMachineExecution(i);
938 theStateMachineImplementation_[i]->stop();
941 postStateMachineExecution(i);
943 postStateMachineExecutionLoop();
945 catch(
const std::runtime_error& e)
947 __SUP_SS__ <<
"Error was caught while " << transitionName <<
": " << e.what()
949 __SUP_COUT_ERR__ <<
"\n" << ss.str();
950 theStateMachine_.setErrorMessage(ss.str());
951 throw toolbox::fsm::exception::Exception(
954 "CoreSupervisorBase::transition" + transitionName ,
961 __SUP_SS__ <<
"Unknown error was caught while " << transitionName
962 <<
". Please checked the logs." << __E__;
963 __SUP_COUT_ERR__ <<
"\n" << ss.str();
964 theStateMachine_.setErrorMessage(ss.str());
965 throw toolbox::fsm::exception::Exception(
968 "CoreSupervisorBase::transition" + transitionName ,
980 void CoreSupervisorBase::sendAsyncErrorToGateway(
const std::string& errorMessage,
981 bool isSoftError)
try
984 __SUP_COUT_ERR__ <<
"Sending Supervisor Async SOFT Running Error... \n"
985 << errorMessage << __E__;
987 __SUP_COUT_ERR__ <<
"Sending Supervisor Async Running Error... \n"
988 << errorMessage << __E__;
990 theStateMachine_.setErrorMessage(errorMessage);
992 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* gatewaySupervisor =
993 allSupervisorInfo_.getGatewayInfo().getDescriptor();
996 parameters.addParameter(
"ErrorMessage", errorMessage);
998 xoap::MessageReference replyMessage = SOAPMessenger::sendWithSOAPReply(
999 gatewaySupervisor, isSoftError ?
"AsyncSoftError" :
"AsyncError", parameters);
1001 std::stringstream replyMessageSStream;
1002 replyMessageSStream << SOAPUtilities::translate(replyMessage);
1003 __SUP_COUT__ <<
"Received... " << replyMessageSStream.str() << std::endl;
1005 if(replyMessageSStream.str().find(
"Fault") != std::string::npos)
1007 __SUP_COUT_ERR__ <<
"Failure to indicate fault to Gateway..." << __E__;
1011 catch(
const xdaq::exception::Exception& e)
1015 <<
"SOAP message failure indicating Supervisor asynchronous running SOFT "
1016 "error back to Gateway: "
1017 << e.what() << __E__;
1019 __SUP_COUT__ <<
"SOAP message failure indicating Supervisor asynchronous running "
1020 "error back to Gateway: "
1021 << e.what() << __E__;
1028 <<
"Unknown error encounter indicating Supervisor asynchronous running "
1029 "SOFT error back to Gateway."
1033 <<
"Unknown error encounter indicating Supervisor asynchronous running "
1034 "error back to Gateway."