How to Extract the "message-Text" and "Sender" from the Event "EventSessionInfo

Hi,
I am writting a customization for Interaction workspace (Chat Channel), which will make it capable of sending an automated chat message to the customer if the Agent doesn’t answer him for a centern timeout. With each message between Customer and Agent “EventSessionInfo” is broadcasted. All i am asking is that When “EventSessionInfo” is broadcasted, the “EventSessionInfo” contains the “Message-Text” and “Sender”. But i do not find a way to extract the “message-Text” and the “Sender” from the Event.

I want to know how, and need a code example of how.

Debug logs show this.

15-01-30 09:05:49.602 [ia.XmlProducer] DEBUG lMessageProducerImpl - XML Message:
offset = 4
length = 1024
content = <?xml version="1.0" encoding="UTF-16BE"?>Customer customer needs help :slight_smile:
15-01-30 09:05:49.602 [ia.XmlProducer] DEBUG lMessagePackagerImpl - New message #101
15-01-30 09:05:49.603 [ia.XmlProducer] DEBUG eceiver.QueueSupport - Enqueue object. Counter=[11]. Queue size =

15-01-30 09:05:49.603 [ia.XmlProducer] DEBUG 11-9b62-f6ab60167de2 - Completed handling psdkendpoint - tcp://vda1cs2010.qaoneadr.local:7022(Socket#4648) message…
‘EventSessionInfo’ (‘101’)
message attributes:
ReferenceId [int] = 0
OccurredAt [str] = “2015-01-30T08:05:49Z”
SessionStatus [str] = ALIVE
ChatTranscript = ComplexClass(ChatTranscript):
StartAt [str] = “2015-01-30T08:04:56Z”
SessionId [str] = “00091aABW2UQ017W”
ChatEventList [BasicChatList] =
{
element[0] = MessageInfo:
UserId [str] = “011B54CB3B2874F0”
EventId [int] = 13
TimeShift [int] = 53
Visibility [str] = ALL
MessageText = ComplexClass(MessageText):
Text [str] = “Customer customer needs help :)”

}

Modify message

Did you try to look into EventSessionInfo variables? If the message-text is not contained within them

I´m not sure if this translates to IWS but for BasicChat in psdk you can do the following:

ChatTranscript chatTranscript = eventSessionInfo.getChatTranscript();
for (int i = 0; i < chatTranscript.getChatEventList().size(); i++) {

		/* Try to read event as text */
		MessageInfo messageInfo = chatTranscript.getChatEventList().getAsMessageInfo(i);
		if (null != messageInfo && null != messageInfo.getMessageText()) {
			String message = messageInfo.getMessageText().getText(); //THE TEXT
                            String userId = messageInfo.getUserId(); //THE USER
                    }

}

Hi, and thanks, that did the trick… worked just fine :slight_smile: