@Override
    public void addEveryState(StateEvent stateEvent) {
        lock.lock();
        try {
            StateEvent clonedEvent = stateEventCloner.copyStateEvent(stateEvent);
            clonedEvent.setType(ComplexEvent.Type.CURRENT);
            for (int i = stateId; i < clonedEvent.getStreamEvents().length; i++) {
                clonedEvent.setEvent(i, null);
            }
            StreamPreState state = stateHolder.getState();
            try {
                state.newAndEveryStateEventList.add(clonedEvent);
            } finally {
                stateHolder.returnState(state);
            }
        } finally {
            lock.unlock();
        }
    }
Set as the last element of the processor chain

@param processor Last processor in the chain
modules/siddhi-core/src/main/java/io/siddhi/core/query/input/stream/state/StreamPreStateProcessor.java