Aborting and retrying slot filling

I am having a hard time writing rules and stories to abort and retry slot filling. I have a form to fill in 2 slots. The intended behavior is twofold:

  1. The user should be able to abort filling any of the 2 slots and quitting the form. For that I use a button that triggers an /abort intent, which sets the requested slot to None (i.e., using slot mapping from_intent).
  2. If the user provides a value for the slot and the value is incorrect, an “Invalid value. Do you want to retry?” message with two buttons (/abort and /retry) is uttered. To achieve this I have defined custom validation functions for the slots:
async def validate_X(...) -> Dict[Text, Any]:
    if self.is_correct(slot_value):
             return {"X": slot_value}
             return {"X": None} `

I have tried defining some stories in different ways to achieve the above behavior, but I do not get it to work 100% as intended. What rules or stories should I specify to achieve the intended behavior? Thanks!

I think you’re on the right track doing this in a form. Alternatively, you could use featurized slots.

There are some similar examples in the 2.0 branch of the financial-demo bot. Take a look at the stories here which show context switching out of a form.