Go to the documentation of this file.
14 auto prepareScript = [](
const std::string& script,
auto& executor) {
22 executor = result.value();
32 if(_test_config.async_delay <= std::chrono::milliseconds(0))
39 _timer.add(std::chrono::milliseconds(_test_config.async_delay), [
this](
bool aborted) {
42 _completed.store(true);
43 this->emitWakeUpSignal();
47 _completed.store(false);
71 auto status = _test_config.complete_func();
74 _success_executor(env);
78 _failure_executor(env);
std::string failure_script
script to execute when complete_func() returns FAILURE
Expected< ScriptFunction > ParseScript(const std::string &script)
virtual void onHalted() override
ScriptFunction _success_executor
NodeStatus return_status
status to return when the action is completed.
void setRegistrationID(StringView ID)
std::string success_script
script to execute when complete_func() returns SUCCESS
TestNodeConfig _test_config
ScriptFunction _post_executor
std::string post_script
script to execute when actions is completed
ScriptFunction _failure_executor
virtual NodeStatus onRunning() override
method invoked when the action is already in the RUNNING state.
TestNode(const std::string &name, const NodeConfig &config, TestNodeConfig test_config)
The StatefulActionNode is the preferred way to implement asynchronous Actions. It is actually easier ...
virtual NodeStatus onStart() override
The Environment class is used to encapsulate the information and states needed by the scripting langu...