Example usage for com.amazonaws.services.lexruntime.model PostTextResult getDialogState

List of usage examples for com.amazonaws.services.lexruntime.model PostTextResult getDialogState

Introduction

In this page you can find the example usage for com.amazonaws.services.lexruntime.model PostTextResult getDialogState.

Prototype


public String getDialogState() 

Source Link

Document

Identifies the current state of the user interaction.

Usage

From source file:lex.LexBotRelay.java

License:Apache License

@Override
public void onChatMessage(SymMessage message) {

    PostTextResult postTextResult = sendLexMessage(message);

    if (postTextResult.getDialogState().equals("ReadyForFulfillment")) {

        message.setMessageText("Completed appointment..");

    } else {/*from   w  w  w.j a v a 2s .c om*/

        message.setMessageText(lexBotDetail.getBotName() + ": " + postTextResult.getMessage());

    }

    try {
        symClient.getMessagesClient().sendMessage(message.getStream(), message);
    } catch (MessagesException e) {
        e.printStackTrace();
    }

}