private void processAllExpiredEvents(StreamEventCloner streamEventCloner, WindowState state,
                                         long currentTime, List<ComplexEventChunk<StreamEvent>> streamEventChunks) {
        MetaStateEvent metaStateEvent = constructExpression(metaStreamEvent, siddhiQueryContext);
        QueryParserHelper.updateVariablePosition(metaStateEvent, variableExpressionExecutors);
        if (!streamInputEvents) {
            StreamEvent expiredEvent = state.currentEventQueue.getFirst();
            state.currentEventQueue.clear();
            while (expiredEvent != null) {
                StreamEvent aExpiredEvent = expiredEvent;
                expiredEvent = expiredEvent.getNext();
                aExpiredEvent.setNext(null);
                processStreamEvent(state, currentTime, aExpiredEvent, streamEventCloner, streamEventChunks);
            }
            state.currentEventQueue.reset();
        } else {
            StreamEvent expiredEvent = state.expiredEventQueue.getFirst();
            state.expiredEventQueue.clear();
            while (expiredEvent != null) {
                StreamEvent aExpiredEvent = expiredEvent;
                expiredEvent = expiredEvent.getNext();
                aExpiredEvent.setNext(null);
                processStreamEventAsStream(state, currentTime, aExpiredEvent, streamEventCloner, streamEventChunks,
                        false);
            }
            state.expiredEventQueue.reset();
        }
    }
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