Discard task and any parent tasks (exceptions)

Imagine you have 2 dialog tasks:

  • Task A
  • Task B

Task A calls Task B.

Task A -> Task B

It does this using a dialog task node.

Task B has a bunch of logic, and there’s the potential for something to go wrong. Sometimes something goes so wrong that you want to discard the task and any parent that called it.

Think of it like throwing an exception in a general-purpose programming language.

Is there a way to do that?

Hello @eeskildsen ,

We have a system command to help developers in case they want to reset the conversation or handle it as “exception” .

The system command in question is – “discard” or “discard all” . You may find the details of what it does through our documentation here - https://developer.kore.ai/docs/bots/bot-builder-tool/system-commands-2/

NOTE: Do note that it is usually only for the use of developers and not end users.

If you want to achieve this behavior for a user, then we will have to manipulate it with the dialog flow. We may create a separate dialog with script to clear/delete context and prompt user to start a fresh conversation and map it to Task execution failure event.

Hope this helps!!

1 Like