private static OnDemandQueryRuntime constructOnDemandQueryRuntime(
            Window window, OnDemandQuery onDemandQuery,
            Map<String, Table> tableMap, Map<String, Window> windowMap,
            int metaPosition, Expression onCondition, MetaStreamEvent metaStreamEvent,
            List<VariableExpressionExecutor> variableExpressionExecutors, LockWrapper lockWrapper,
            SiddhiQueryContext siddhiQueryContext) {
        metaStreamEvent.setEventType(EventType.WINDOW);
        initMetaStreamEvent(metaStreamEvent, window.getWindowDefinition());
        MatchingMetaInfoHolder metaStreamInfoHolder = generateMatchingMetaInfoHolder(metaStreamEvent,
                window.getWindowDefinition());
        CompiledCondition compiledCondition = window.compileCondition(onCondition,
                generateMatchingMetaInfoHolder(metaStreamEvent, window.getWindowDefinition()),
                variableExpressionExecutors, tableMap, siddhiQueryContext);
        FindOnDemandQueryRuntime findOnDemandQueryRuntime = new FindOnDemandQueryRuntime(window, compiledCondition,
                siddhiQueryContext.getName(), metaStreamEvent);
        populateFindOnDemandQueryRuntime(findOnDemandQueryRuntime, metaStreamInfoHolder, onDemandQuery.getSelector(),
                variableExpressionExecutors, tableMap, windowMap, metaPosition,
                !onDemandQuery.getSelector().getGroupByList().isEmpty(), lockWrapper, siddhiQueryContext);
        return findOnDemandQueryRuntime;
    }
Parse a onDemandQuery and return corresponding OnDemandQueryRuntime.

@param onDemandQuery       onDemandQuery to be parsed.
@param siddhiQueryContext associated Siddhi query context.
@param tableMap         keyvalue containing tables.
@param windowMap        keyvalue containing windows.
@param aggregationMap   keyvalue containing aggregation runtimes.
@return OnDemandQueryRuntime
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/OnDemandQueryParser.java