From 2b1b413d63ee94503d26d0acc039e7083730b5dd Mon Sep 17 00:00:00 2001 From: Ashwin Karemore Date: Mon, 2 Jul 2018 15:56:21 +0200 Subject: create interaction choice set run method changes --- .../create_interaction_choice_set_request.cc | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src') 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]); -- cgit v1.2.1