2

I am facing one problem, I have created the dialogue in watson conversation workspace, and I know how to jump to another node in the dialogue. My question is how to jump in java procedure. For example, I have 5 nodes in my dialogue, they are sequence, node1->node2->node3->node4->node5, under specific condition(e.g. if input invalid date in node3), I want it to jump to node5 from node3, skipping node4, how to implement it in back end procedure(java)? does anyone have simple demo? thanks you.

george jiang
  • 105
  • 9
  • Why do you want to do that in java?The conversation tool is done with JSON so you should convert the java code to JSON and do if you are doing the back end in java – Athif Shaffy Jan 18 '17 at 08:44
  • @Athif, I need to implement some complicated business logic in back end procedure – george jiang Jan 18 '17 at 09:28
  • You can use context variable and even call a REST api from the conversation tool.[Check this out](https://www.ibm.com/watson/developercloud/doc/conversation/dialog-build.html) for context variable.Mentioning the `complicated business logic` would help – Athif Shaffy Jan 18 '17 at 09:30
  • The best thing is to return from your businesss logic a context variable. And have a condition saying if context variable is true continue from node 3 – Dudi Jan 18 '17 at 13:22
  • @Dudi, I agree with you, I have tried it. I added one variable in the context of node3 like this: "isInputValid" : false, then I update it to true in my back end app, then return the response. In the dialogue node4 condition, I will check $isInputValid, if it is true, will go to node5, or else will go to node6 or others node. My question is: after got returned node3 response, I need to input something, then it will trigger node4 condition ($isInputValid), or else, the dialogue will be blocked. How to resolve it? any idea? thanks – george jiang Jan 19 '17 at 01:53
  • use skip_user_input. see http://stackoverflow.com/questions/40263747/how-to-make-watson-conversation-api-invoke-a-web-application-url-when-user-enter – Dudi Jan 19 '17 at 07:33
  • I have work it out, thank you all. – george jiang Jan 25 '17 at 05:36
  • @george jiang : can you help me out about how to create dialogue node using Watson conversation SDK ? – Sazzad Jun 08 '17 at 03:51

0 Answers0