@Override
    protected StateFactory<WindowState> init(ExpressionExecutor[] attributeExpressionExecutors,
                                             ConfigReader configReader,
                                             StreamEventClonerHolder streamEventClonerHolder,
                                             boolean outputExpectsExpiredEvents, boolean findToBeExecuted,
                                             SiddhiQueryContext siddhiQueryContext) {
        this.outputExpectsExpiredEvents = outputExpectsExpiredEvents;
        this.findToBeExecuted = findToBeExecuted;
        this.siddhiQueryContext = siddhiQueryContext;
        if (attributeExpressionExecutors.length == 1) {
            length = (Integer) (((ConstantExpressionExecutor) attributeExpressionExecutors[0]).getValue());
        } else if (attributeExpressionExecutors.length == 0) {
            length = 0;
        } else {
            throw new SiddhiAppValidationException("Batch window should have at most one parameter (<int> " +
                    "chunkLength), but found " + attributeExpressionExecutors.length + " input attributes");
        }
        if (length < 0) {
            throw new SiddhiAppValidationException("Batch window should have at most one parameter (<int> " +
                    "chunkLength) greater than zero. But found value 'chunkLength = " + length + " ' ");
        }
        return () -> new WindowState(streamEventClonerHolder, outputExpectsExpiredEvents, findToBeExecuted);
    }
Implementation of {@link WindowProcessor} which represent a Batch Window that aggregate batch of incoming events
together.
modules/siddhi-core/src/main/java/io/siddhi/core/query/processor/stream/window/BatchWindowProcessor.java