String messageFormat = "";
String messageType = "";
String serviceName = "";
String arcKey = "";
boolean parentRecord = false;
SAPchild message = null;
for (int index = 0; index < messageIds.length; index++) {
// for a given messageId, there are multiple rows having
// different property keys & values.
// we are trying to accumulate all the keys/values belonging
// to a single message into a
// row model here. (for additional explanation on the
// problem
// see - http://markmail.org/thread/i24sllyzksw2cfho)
message = messageIds[index];
if (!messageId.equals(message.getMessageId())) {
if (!("".equals(messageId))) {
// dump the collected set of variables into XML
// format
dumpXML(result, messageDirection, messageUUID,
messageStatus, messageTimestamp,
activityType, applicationFailure,
technicalFailure, messageFormat,
messageType, serviceName, arcKey,
parentRecord, index, messageIds[index - 1]);
}
activityType = "";
applicationFailure = "";
technicalFailure = "";
messageFormat = "";
messageType = "";
arcKey = "";
parentRecord = false;
// repeated with same value for all the rows. So getting
// assigned from the values in the
// first row is sufficient
messageId = message.getMessageId();
messageDirection = message.getMessageDirection();
messageUUID = message.getMessageUUID();
messageStatus = message.getStatus();
messageTimestamp = message.getTimestamp();
serviceName = message.getServiceName();
}
if (("activity_type").equals(message.getKey())) {
activityType = message.getValue();
} else if ("application_failure".equals(message.getKey())) {
applicationFailure = message.getValue();
} else if ("technical_failure".equals(message.getKey())) {
technicalFailure = message.getValue();
} else if ("message_format".equals(message.getKey())) {
messageFormat = message.getValue();
} else if ("message_type".equals(message.getKey())) {
messageType = message.getValue();
} else if ("arc_key".equals(message.getKey())) {
arcKey = message.getValue();
} else if (message.getKey().contains("parent")) {
parentRecord = true;
}
// MessageForMessageID[] messages = bamDSClient
// .getMessageForMessageID(Integer
// .parseInt(messageId[index].getMessageId()));