public void switchToLiveMode() {
        Map<String, Map<String, SchedulerState>> allStates = stateHolder.getAllStates();
        try {
            for (Map.Entry<String, Map<String, SchedulerState>> allStatesEntry : allStates.entrySet()) {
                for (Map.Entry<String, SchedulerState> stateEntry : allStatesEntry.getValue().entrySet()) {
                    Long toNotifyTime = stateEntry.getValue().toNotifyQueue.peek();
                    if (toNotifyTime != null) {
                        SiddhiAppContext.startPartitionFlow(allStatesEntry.getKey());
                        SiddhiAppContext.startGroupByFlow(stateEntry.getKey());
                        try {
                            schedule(toNotifyTime, stateEntry.getValue(), true);
                        } finally {
                            SiddhiAppContext.stopGroupByFlow();
                            SiddhiAppContext.stopPartitionFlow();
                        }
                    }
                }
            }
        } finally {
            stateHolder.returnAllStates(allStates);
        }
    }
Schedule events which are not scheduled in the queue when switching back from event time to system current time
modules/siddhi-core/src/main/java/io/siddhi/core/util/Scheduler.java