Skip to content
This repository has been archived by the owner on May 23, 2018. It is now read-only.

Flow of the conversation #10

Closed
hlmaab opened this issue Nov 2, 2017 · 7 comments
Closed

Flow of the conversation #10

hlmaab opened this issue Nov 2, 2017 · 7 comments

Comments

@hlmaab
Copy link
Collaborator

hlmaab commented Nov 2, 2017

#2 Need to store the previous input of the user and decide the next action of the chatbot.

@b31n91337
Copy link
Collaborator

suggested flow:
database store: userID, menuTag
Store userID for each user
menu = {a,b,c,..}
menuTag defines the which menu option the user picked
go to the corresponding branch to handle the event according to the tag.

@kelvinsyleung
Copy link
Collaborator

Actually, a local variable can be used in the controller to indicate the operation jump between functions.
So database call is not required every time a user decides to change function.
Give the exit keyword to abort any logical steps in any operations.

@b31n91337
Copy link
Collaborator

@IniZio @hlmaab
I think the we only need to store the latest action and input in the database?
the current design of the main flow keep all input.
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_search
Ud332c012b25d536d03194a8d0845567a | kcc | exit_to_main
Ud332c012b25d536d03194a8d0845567a | e | room_input
Ud332c012b25d536d03194a8d0845567a | e | room_search
Ud332c012b25d536d03194a8d0845567a | 1232 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | sdf | exit_to_main
Ud332c012b25d536d03194a8d0845567a | b | openinghour_choose
Ud332c012b25d536d03194a8d0845567a | b | openinghour_search
Ud332c012b25d536d03194a8d0845567a | 2 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_search
Ud332c012b25d536d03194a8d0845567a | kccho | exit_to_main
Ud332c012b25d536d03194a8d0845567a | e | room_input
Ud332c012b25d536d03194a8d0845567a | e | room_search
Ud332c012b25d536d03194a8d0845567a | 1234 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | f | room_input
Ud332c012b25d536d03194a8d0845567a | f | room_search

@b31n91337
Copy link
Collaborator

The userid should make as candidate key to make sure it is unique and search the userid each time to load the latest input for that user.

@hlmaab
Copy link
Collaborator Author

hlmaab commented Nov 3, 2017

That means if the user inputs again (not the first time), we should find the userid and update userinput and action instead of just inserting them?

@b31n91337
Copy link
Collaborator

yes, so we dont need to loop through all the entry. we can just use select * where userid=id to get the user input. I am working on it now.

@IniZio
Copy link
Owner

IniZio commented Nov 21, 2017

Doesnt matter now 😏

@IniZio IniZio closed this as completed Nov 21, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants