public static void addEventTrigger(TriggerDefinition triggerDefinition,
                                       ConcurrentMap<String, Trigger> eventTriggerMap,
                                       ConcurrentMap<String, StreamJunction> streamJunctionMap,
                                       SiddhiAppContext siddhiAppContext) {
        if (!eventTriggerMap.containsKey(triggerDefinition.getId())) {
            AbstractTrigger trigger;
            if (triggerDefinition.getAtEvery() != null) {
                trigger = new PeriodicTrigger();
            } else if (triggerDefinition.getAt().trim().equalsIgnoreCase(SiddhiConstants.TRIGGER_START)) {
                trigger = new StartTrigger();
            } else {
                trigger = new CronTrigger();
            }
            StreamJunction streamJunction = streamJunctionMap.get(triggerDefinition.getId());
            trigger.init(triggerDefinition, siddhiAppContext, streamJunction);
            siddhiAppContext.addTrigger(trigger);
            eventTriggerMap.putIfAbsent(trigger.getId(), trigger);
        }
    }
Utility class for queryParser to help with QueryRuntime
generation.
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/helper/DefinitionParserHelper.java