Multiple Dialog Task using same context


(Neha Sheikh) #1

Hi @Subrahmanyam and @andy.heydon ,

We are trying to invoke a new Dialog task from currently running Dialog task and want to use the context variables of already running Dialog task for both tasks.

For example:
If there are two dialog tasks like Dialog1 & Dialog2. We are invoking Dialog2 from Dialog1 task.
Is it possible to run both the dialog with the same context i.e. with Dialog1 task’s context.

Please suggest if we can achieve this.

Thanks,
Neha Sheik


(swathi vadlamani) #2

Hi @nehamsheikh It all depends on how you define the Dialog2. If you are calling the Dialog 2 as an intent from wthin Dialog1, then yes the context variables stored/defined are available. But in case, if you initialise Dialog2 as another Dialog from within Dialog1 then context variables stored/defined in Dialog1 are not available.


(swathi vadlamani) #3

Hi @nehamsheikh It all depends on how you have defined the Dialog2. If you are calling the Dialog 2 as an intent from wthin Dialog1, then yes the context variables stored/defined are available. But in case, if you initialise Dialog2 as another Dialog from within Dialog1 then context variables stored/defined in Dialog1 are not available.


(Neha Sheikh) #4

Hi,

Can you please explain how to differentiate this invocation?

Regards,
Neha Sheikh


(swathi vadlamani) #5

@nehamsheikh Please refer the screenshots below.
In first screenshot, we are using a Dialog task as a sub dialog within the main dialog


In second screenshot, we are using dialog task as an intent within the main dialog.

Refer https://developer.kore.ai/docs/bots/bot-builder/defining-bot-tasks/dialog-tasks/creating-dialog-task-flows/ and https://developer.kore.ai/docs/bots/bot-builder/defining-bot-tasks/dialog-tasks/ for more information


(Neha Sheikh) #6

Hi @swathi.vadlamani,

We are trying to get the value of an entity defined inside a separate dialog task from running dialog task.

For example:
There are two dialog tasks, Dialog1 task with ‘entity_test1’ entity & Dialog2 task with ‘entity_test2’ entity receptively. Let the value for ‘entity_test1’ is ‘abc’ and for ‘entity_test2’ is ‘xyz’. We want to fetch the values from both entities to show them in a single response.

i.e. {{context.entities.entity_test1}} + {{context.entities.entity_test2}}

Please suggest if we can achieve this.

Thanks,
Neha Sheik