@Override
    protected void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor,
                                     StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater,
                                     S state) {
        while (streamEventChunk.hasNext()) {
            ComplexEvent complexEvent = streamEventChunk.next();
            Object[] outputData;
            switch (attributeExpressionLength) {
                case 0:
                    outputData = process((Object) null);
                    complexEventPopulater.populateComplexEvent(complexEvent, outputData);
                    break;
                case 1:
                    outputData = process(attributeExpressionExecutors[0].execute(complexEvent));
                    complexEventPopulater.populateComplexEvent(complexEvent, outputData);
                    break;
                default:
                    Object[] inputData = new Object[attributeExpressionLength];
                    for (int i = 0; i < attributeExpressionLength; i++) {
                        inputData[i] = attributeExpressionExecutors[i].execute(complexEvent);
                    }
                    outputData = process(inputData);
                    complexEventPopulater.populateComplexEvent(complexEvent, outputData);
            }
        }
        nextProcessor.process(streamEventChunk);

    }
Stream Processor to handle Stream Functions.

@param <S> current state of the processor
modules/siddhi-core/src/main/java/io/siddhi/core/query/processor/stream/function/StreamFunctionProcessor.java