@Override
    protected void process(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor,
                           StreamEventCloner streamEventCloner, WindowState state) {

        if (expressionStringExecutor == null && !init) {
            MetaStateEvent metaStateEvent = new MetaStateEvent(
                    new MetaStreamEvent[]{metaStreamEvent, metaStreamEvent, metaStreamEvent});
            QueryParserHelper.updateVariablePosition(metaStateEvent, variableExpressionExecutors);
            init = true;
        }
        List<ComplexEventChunk<StreamEvent>> streamEventChunks = new ArrayList<>();
        synchronized (state) {
            long currentTime = siddhiQueryContext.getSiddhiAppContext().getTimestampGenerator().currentTime();
            while (streamEventChunk.hasNext()) {
                StreamEvent streamEvent = streamEventChunk.next();
                streamEventChunk.remove();
                if (expressionStringExecutor != null) {
                    String expressionStringNew = (String) expressionStringExecutor.execute(streamEvent);
                    if (!expressionStringNew.equals(expressionString)) {
                        expressionString = expressionStringNew;
                        processAllExpiredEvents(streamEventCloner, state, currentTime, streamEventChunks);
                    }
                }
                if (!streamInputEvents) {
                    processStreamEvent(state, currentTime, streamEvent, streamEventCloner, streamEventChunks);
                } else {
                    processStreamEventAsStream(state, currentTime, streamEvent, streamEventCloner, streamEventChunks,
                            true);
                }
            }
        }
        for (ComplexEventChunk<StreamEvent> outputStreamEventChunk : streamEventChunks) {
            nextProcessor.process(outputStreamEventChunk);
        }
    }
Implementation of {@link WindowProcessor} which represent a Window operating based on a expression.
modules/siddhi-core/src/main/java/io/siddhi/core/query/processor/stream/window/ExpressionBatchWindowProcessor.java