In Watson-conversation one of the first things I do is asking the user an Id. I receive that in python and check in a simple db I have if the id exists there (it is quite a simple logic).
Now, what I want is to jump to Node 1 if the user does not exist in my db. So I was looking for something in python to do so, as Watson cannot check my db.
I have been looking at several info. this was the most usefull, but I searched for more.
It also looked interesting to me to look for slots and handlers, but again, that cannot check in my simple database.
I was expecting something like this:
I have made a simple function so as to understand what I want to do:
def checkingId(bot, update):
message=update.message.text #let's suppose it is already parsed, to make it simpler
result=cursor.execute("select name from users where id=message")
if(result!=None): #so if the id exists in the table
#no problem here, keep it going like normal watson would do
whatever()
else:
jumpToNode1InWatson (???)
I have also seen that there might be this parameter dialog_node": "node1 or whatever it is"
in the json(?), so I may access this via python, but I have not found anything relevant about it.
Thanks in advance. If you think the question can be edited to improve it, comment it and I'll try my best to do so.
This IBM Cloud solution tutorial for a database-driven chatbot has code to interact with a DB from Watson Assistant. The related GitHub repo shows it for Db2 and PostgreSQL. It is done via an IBM Cloud Functions action. The other option is to use a client-side dialog action.
Now, once you checked for the ID you would set a variable. In a dialog tree you could then have the condition that the ID is present or has a certain value to process a dialog node or switch into that branch of the dialog tree. Thus, you would force Watson Assistant into your intended processing.