private static void initMetaStreamEvent(SingleInputStream inputStream,
                                            Map<String, AbstractDefinition> streamDefinitionMap,
                                            Map<String, AbstractDefinition> tableDefinitionMap,
                                            Map<String, AbstractDefinition> windowDefinitionMap,
                                            Map<String, AbstractDefinition> aggregationDefinitionMap,
                                            boolean multiValue, MetaStreamEvent metaStreamEvent) {
        String streamId = inputStream.getStreamId();

        if (!inputStream.isInnerStream() && windowDefinitionMap != null && windowDefinitionMap.containsKey(streamId)) {
            AbstractDefinition inputDefinition = windowDefinitionMap.get(streamId);
            if (!metaStreamEvent.getInputDefinitions().contains(inputDefinition)) {
                metaStreamEvent.addInputDefinition(inputDefinition);
            }
        } else if (streamDefinitionMap != null && streamDefinitionMap.containsKey(streamId)) {
            AbstractDefinition inputDefinition = streamDefinitionMap.get(streamId);
            metaStreamEvent.addInputDefinition(inputDefinition);
        } else if (!inputStream.isInnerStream() && tableDefinitionMap != null &&
                tableDefinitionMap.containsKey(streamId)) {
            AbstractDefinition inputDefinition = tableDefinitionMap.get(streamId);
            metaStreamEvent.addInputDefinition(inputDefinition);
        } else if (!inputStream.isInnerStream() && aggregationDefinitionMap != null &&
                aggregationDefinitionMap.containsKey(streamId)) {
            AbstractDefinition inputDefinition = aggregationDefinitionMap.get(streamId);
            metaStreamEvent.addInputDefinition(inputDefinition);
        } else {
            throw new SiddhiAppCreationException("Stream/table/window/aggregation definition with ID '" +
                    inputStream.getStreamId() + "' has not been defined", inputStream.getQueryContextStartIndex(),
                    inputStream.getQueryContextEndIndex());
        }

        if ((inputStream.getStreamReferenceId() != null) &&
                !(inputStream.getStreamId()).equals(inputStream.getStreamReferenceId())) { //if ref id is provided
            metaStreamEvent.setInputReferenceId(inputStream.getStreamReferenceId());
        }
        metaStreamEvent.setMultiValue(multiValue);
    }
Method to generate MetaStreamEvent reagent to the given input stream. Empty definition will be created and
definition and reference is will be set accordingly in this method.

@param inputStream              InputStream
@param streamDefinitionMap      StreamDefinition Map
@param tableDefinitionMap       TableDefinition Map
@param aggregationDefinitionMap AggregationDefinition Map
@param multiValue               Event has the possibility to produce multiple values
@param metaStreamEvent          MetaStreamEvent
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/SingleInputStreamParser.java