public Map<String, Object> toMap(Event event) {
        if (event != null) {
            Map<String, Object> mapEvent = new HashMap<>();
            Object[] data = event.getData();
            List<Attribute> attributeList = streamDefinition.getAttributeList();
            mapEvent.put("_timestamp", event.getTimestamp());
            for (int i = 0; i < data.length; i++) {
                mapEvent.put(attributeList.get(i).getName(), data[i]);
            }
            return mapEvent;
        }
        return null;
    }
StreamCallback is used to receive events from {@link StreamJunction}. This class should be extended if one intends
to get events from a Siddhi Stream.
modules/siddhi-core/src/main/java/io/siddhi/core/stream/output/StreamCallback.java