diff options
author | Ashwin Karemore <akaremor@ford.com> | 2018-07-02 15:56:21 +0200 |
---|---|---|
committer | AKalinich-Luxoft <AKalinich@luxoft.com> | 2018-07-26 18:58:04 +0300 |
commit | 2b1b413d63ee94503d26d0acc039e7083730b5dd (patch) | |
tree | 56b52920106657dbccce3543c05d0b5d3c127fa4 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src | |
parent | 604057538b085ec79b766bdf6bdf8a25c9258013 (diff) | |
download | sdl_core-2b1b413d63ee94503d26d0acc039e7083730b5dd.tar.gz |
create interaction choice set run method changes
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index d36eda18e1..0612daa3e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -79,25 +79,6 @@ void CreateInteractionChoiceSetRequest::Run() { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } - - choice_set_id_ = - (*message_)[strings::msg_params][strings::interaction_choice_set_id] - .asInt(); - - if (app->FindChoiceSet(choice_set_id_)) { - LOG4CXX_ERROR(logger_, - "Choice set with id " << choice_set_id_ << " is not found."); - SendResponse(false, Result::INVALID_ID); - return; - } - - Result::eType result = CheckChoiceSet(app); - if (Result::SUCCESS != result) { - SendResponse(false, result); - return; - } - - should_send_warnings = false; for (uint32_t i = 0; i < (*message_)[strings::msg_params][strings::choice_set].length(); @@ -132,6 +113,22 @@ void CreateInteractionChoiceSetRequest::Run() { } } + choice_set_id_ = + (*message_)[strings::msg_params][strings::interaction_choice_set_id] + .asInt(); + + if (app->FindChoiceSet(choice_set_id_)) { + LOG4CXX_ERROR(logger_, + "Choice set with id " << choice_set_id_ << " is not found."); + SendResponse(false, Result::INVALID_ID); + return; + } + + Result::eType result = CheckChoiceSet(app); + if (Result::SUCCESS != result) { + SendResponse(false, result); + return; + } uint32_t grammar_id = application_manager_.GenerateGrammarID(); (*message_)[strings::msg_params][strings::grammar_id] = grammar_id; app->AddChoiceSet(choice_set_id_, (*message_)[strings::msg_params]); |