@Override
    public void process(ComplexEventChunk complexEventChunk) {
        LogicalStreamPreState state = (LogicalStreamPreState) stateHolder.getState();
        try {
            if (!state.active) {
                // Every keyword is not used and already a pattern is processed
                return;
            }
            boolean notProcessed = true;
            long currentTime = complexEventChunk.getFirst().getTimestamp();
            ComplexEventChunk<StateEvent> retEventChunk = new ComplexEventChunk<>();
            lock.lock();
            try {
                // If the process method is called, it is guaranteed that the waitingTime is passed
                boolean initialize = isStartState && state.getNewAndEveryStateEventList().isEmpty()
                        && state.getPendingStateEventList().isEmpty();
                if (initialize && stateType == StateInputStream.Type.SEQUENCE &&
                        thisStatePostProcessor.nextEveryStatePreProcessor == null && state.lastScheduledTime > 0) {
                    // Sequence with no every but an event arrived
                    initialize = false;
                }

                if (initialize) {
                    // This is the first processor and no events received so far
                    StateEvent stateEvent = stateEventFactory.newInstance();
                    addState(stateEvent);
                } else if (stateType == StateInputStream.Type.SEQUENCE &&
                        !state.getNewAndEveryStateEventList().isEmpty()) {
                    this.resetState();
                }
                this.updateState();

                Iterator<StateEvent> iterator = state.getPendingStateEventList().iterator();
                while (iterator.hasNext()) {
                    StateEvent event = iterator.next();
                    // Remove expired events based on within
                    if (isExpired(event, currentTime)) {
                        iterator.remove();
                        if (withinEveryPreStateProcessor != null
                                && thisStatePostProcessor.nextEveryStatePreProcessor != this) {
                            thisStatePostProcessor.nextEveryStatePreProcessor.addEveryState(event);
                        }
                        continue;
                    }
                    // Collect the events that came before the waiting time
                    if (event.getTimestamp() == -1 && currentTime >= state.lastScheduledTime ||
                            event.getTimestamp() != -1 && currentTime >= event.getTimestamp() + waitingTime) {
                        iterator.remove();
                        event.setTimestamp(currentTime);
                        retEventChunk.add(event);
                    }
                }
                if (withinEveryPreStateProcessor != null) {
                    withinEveryPreStateProcessor.updateState();
                }
            } finally {
                lock.unlock();
            }

            notProcessed = retEventChunk.getFirst() == null;
            while (retEventChunk.hasNext()) {
                StateEvent stateEvent = retEventChunk.next();
                retEventChunk.remove();
                sendEvent(stateEvent, state);
            }

            long actualCurrentTime = siddhiQueryContext.getSiddhiAppContext().getTimestampGenerator().currentTime();
            if (actualCurrentTime > waitingTime + currentTime) {
                state.lastScheduledTime = actualCurrentTime + waitingTime;
            }
            if (notProcessed && state.lastScheduledTime < currentTime) {
                state.lastScheduledTime = currentTime + waitingTime;
                this.scheduler.notifyAt(state.lastScheduledTime);
            }
        } finally {
            stateHolder.returnState(state);
        }
    }
Construct an AbsentStreamPreStateProcessor object.

@param stateType   PATTERN or SEQUENCE
@param waitingTime the waiting time defined by 'for' keyword
modules/siddhi-core/src/main/java/io/siddhi/core/query/input/stream/state/AbsentStreamPreStateProcessor.java