protected void addState(StateEvent stateEvent, StreamPreState state) {
        lock.lock();
        try {
            if (stateType == StateInputStream.Type.SEQUENCE) {
                if (state.newAndEveryStateEventList.isEmpty()) {
                    state.newAndEveryStateEventList.add(stateEvent);
                }
            } else {
                state.newAndEveryStateEventList.add(stateEvent);
            }
        } 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