static BrokerEvent convertToBrokerEvent(String iDataKey, IData iDataValue) throws Exception { BrokerEvent brokerEvent = null; if (iDataValue != null) { brokerEvent = new BrokerEvent(null, iDataKey, null); IDataCursor currentIdataCursor = iDataValue.getCursor(); currentIdataCursor.first(); do { String currentKey = currentIdataCursor.getKey(); Object currentValue = currentIdataCursor.getValue(); if (currentValue instanceof IData) { BrokerEvent be1 = convertToBrokerEvent(currentKey, (IData) currentValue); brokerEvent.setStructFieldFromEvent(currentKey, be1); } else if (currentValue instanceof IData[]) { IData[] childIdataArray = (IData[]) currentValue; BrokerEvent[] childBrokerEvent = new BrokerEvent[childIdataArray.length]; for (int idataValueIndex = 0; idataValueIndex < childIdataArray.length; idataValueIndex++) { childBrokerEvent[idataValueIndex] = convertToBrokerEvent(currentKey, childIdataArray[idataValueIndex]); } brokerEvent.setStructSeqFieldFromEvents(currentKey, 0, BrokerEvent.ENTIRE_SEQUENCE, BrokerEvent.AUTO_SIZE, childBrokerEvent); } else if (currentValue instanceof String) brokerEvent.setUCStringField(currentKey, currentValue.toString()); else if (currentValue instanceof String[]) brokerEvent.setUCStringSeqField(currentKey, 0, BrokerEvent.ENTIRE_SEQUENCE, BrokerEvent.AUTO_SIZE, (String[]) currentValue); else { //throw new ServiceException("Unhandled Object Type While converting IData to Broker Event"); } } while (currentIdataCursor.next()); } return brokerEvent; }