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

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

Introduction

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

Prototype


public String getMessage() 

Source Link

Document

The message to convey to the user.

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 {//  w w  w .ja va  2s  . c  o m

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

    }

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

}