I would like to call child dialog from JSON schema dialog:
Dialog 1
{
"References": [ "my .dll", "Newtonsoft.Json.dll" ],
"Imports": [ "my class", "Newtonsoft.Json.Linq" ],
"type": "object",
"required": [
"Question 1"
],
"Templates": {
"NotUnderstood": {
"Patterns": [ "I do not understand \"{0}\".", "Try again, I don't get \"{0}\"." ]
},
"EnumSelectOne": {
"Patterns": [ "Please let me know the {&}: {||}" ],
"ChoiceStyle": "PerLine"
}
},
"properties": {
"Question 1": {
"Prompt": {
"Patterns": [ "my Question 1 ? {||}" ]
},
"type": [
"string",
"null"
],
"enum": [
"Info",
"Submit an Issue",
"Track Cases",
"Finish"
]
},
"OnCompletion": "context.Call(FormDialog.FromForm<JObject>(()=>BuildJsonForm(\"another.json\"),FormOptions.PromptInStart), (con, res) =>CompletedQ1AndQ2(con, res));"
}
Dialog 2
{
"References": [ "my .dll", "Newtonsoft.Json.dll" ],
"Imports": [ "my class2", "Newtonsoft.Json.Linq" ],
"type": "object",
"required": [
"Question 1"
],
"Templates": {
"NotUnderstood": {
"Patterns": [ "I do not understand \"{0}\".", "Try again, I don't get \"{0}\"." ]
},
"EnumSelectOne": {
"Patterns": [ "Please let me know the {&}: {||}" ],
"ChoiceStyle": "PerLine"
}
},
"properties": {
"Question 2": {
"Prompt": {
"Patterns": [ "my Question 2 ? {||}" ]
},
"type": [
"string",
"null"
],
"enum": [
"support ",
"sales ",
"marketing"
]
},
"OnCompletion": "context.Done<bool>(true);"
}
c# code :
public async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
{
context.Call(
FormDialog.FromForm<JObject>(() => BuildJsonForm("Q1.json"),
FormOptions.PromptInStart), (con, res) => CompletedCaseSubmission(con, res));
}
The issue that CompletedCaseSubmission called after filling Q1 but Q2 dialog did not execute at all. I can call Dialog 2 from CompletedCaseSubmission , but I want do it from JSON. Second question is how to get details of both dialogs Q1 and Q2 in c#?