Restart and erase existing dialog
After user A finishes (aka)
.AddRemainingFields() .Message("Thanks {FullName}!") .Build();
is there a way for me to delete the history so it goes back to Hi! I'm dummybot. Say "hi" if you'd like to chat? so user B can start from the beginning? Currently I have to refresh the server.
Are you sending messages to your bot using the emulator? If you change the UserId and ConversationId for the user B, your bot should start from a fresh state for the new user.
@msft-shahins what about when I deploy it to https://webchat.botframework.com/bots/TestBot ? How can I delete existing dialogue and start a fresh session? Also what is the code to change the userid and conversationid? and where do I put it?
@bluekite2000 refresh of the webchat control will cause connector to generate a new conversationId and userId. When a message comes to your bot through connector, connector will manage the UserId and ConversationId for you. Also connector provides contextual data stores that your bot can use for state management. A new conversationId will be assigned to a session when a user starts a new conversation to your bot. You can test your bot by changing the conversationId and userId in the emulator.

@msft-shahins But this doesnt solve my problem. I have a checkin bot that checks in a line of users. So after A checks in, then B walks up to the kiosk and starts checking in. I need a way to programmatically restart a new session when A finishes and walks away.
@bluekite2000 Then it is your implementation that should determine the reset of the session when a new user talks to your bot. Bot builder uses message.BotPerUserInConversationData for dialog stack management and since connector isolates that storage for each user/conversation, your bot will start from its root dialog (fresh state) for each user. For your check in bot, you can have a global queue, add the result of each form dialog to the queue upon the completion.
@msft-shahins Sorry can you clarify more on have a global queue, add the result of each form dialog to the queue upon the completion. ? How does this accomplish what I want ( reset session for next user to check in) ?
@bluekite2000 I am suggesting 'a way' to implement your check in bot. What I'm trying to say is that connector will assign a new conversationId to each new user talking to your bot and as a result your bot (if implemented correctly) will start from a fresh state for each user (unless you want to have some state sharing between each user).
@msft-shahins I dont want any state sharing between user. I just dont know where I can find the code to assign a new conversationId to each new user
@bluekite2000 What I am trying to say is that connector will assign a new conversationId to the message for each new user based on the channel behavior. for example, on sms, each message from a new phone number (new user) will be assigned a new conversationId by connector and that conversationId will remain stable for that phone number over different messages.
@msft-shahins so is there a way for me to programmatically reset the session for the next user (after user A) or not?
@bluekite2000 I am not sure what is the session that you are referring to. I highly recommend reading about tracking bot state in the connector's documentation. That might help you understand the state management that connector provides better.
@msft-shahins I read it but it doesnt help. Here is my problem. I have a bot that checks people in. When person A checks in, my bot replies with "thanks" and he walks away. Currently I have to refresh the browser so B can check in. How can I programmatically refresh the browser (and give B a new session)?
@bluekite2000 the default web chat control doesn't provide a mechanism for you to refresh the session programmatically (It is not designed for the purpose you want to use it for. It is designed for websites loaded by different users on different machines and browsers). You can use direct line rest api to implement a web chat control that implement your behavior (refreshing the session by monitoring the responses from your bot on the client side).
@bluekite2000 call /deleteprofile to reset the user session profile
This does not reset dialog/form data!