Handling repeated intents

How can we write repeated intents type questions in a single story. For example

story1

  • greet
    • utter_greet
  • balance
    • utter_ask_number
  • inform{“number”: “9644432730”}
    • action_send_otp
  • Resend
    • action_resend_otp
  • OTP{“otp”: “123654”}
    • action_validation

story2

  • greet
    • utter_greet
  • balance
    • utter_ask_number
  • inform{“number”: “9644432730”}
    • action_send_otp
  • Resend
    • action_resend_otp
  • Resend
    • action_resend_otp
  • OTP{“otp”: “123654”}
    • action_validation

In this case ,If the user click on Resend Button , For every resend we need to write extra story. Is there any solution to minimize this code.

Hi Chaitanya,

There is no way to indicate that an intent may be repeated a variable number of times but you use checkpoints to avoid some code duplication on both ends of the repetition.

E.g.

##story - send OTP
greet
    utter_greet
balance
    utter_ask_number
inform{“number”: “9644432730”}
    action_send_otp
> check_sent_otp

##story - after OTP sent
> check_sent_otp
OTP{“otp”: “123654”}
    action_validation

##story - after OTP resent
> check_resend_otp
OTP{“otp”: “123654”}
    action_validation

##story resend otp
> check_sent_otp
Resend
    action_resend_otp
> check_resend_otp