summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshwin Karemore <akaremor@ford.com>2018-07-02 15:56:21 +0200
committerAKalinich-Luxoft <AKalinich@luxoft.com>2018-07-26 18:58:04 +0300
commit2b1b413d63ee94503d26d0acc039e7083730b5dd (patch)
tree56b52920106657dbccce3543c05d0b5d3c127fa4
parent604057538b085ec79b766bdf6bdf8a25c9258013 (diff)
downloadsdl_core-2b1b413d63ee94503d26d0acc039e7083730b5dd.tar.gz
create interaction choice set run method changes
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc35
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]);