EventScopeInstanceState { public boolean triggerEvent( final long eventScopeKey, final long eventKey, final DirectBuffer elementId, final DirectBuffer variables) { this.eventScopeKey.wrapLong(eventScopeKey); final EventScopeInstance instance = eventScopeInstanceColumnFamily.get(this.eventScopeKey); if (instance != null && instance.isAccepting()) { if (instance.isInterrupting(elementId)) { instance.setAccepting(false); eventScopeInstanceColumnFamily.put(this.eventScopeKey, instance); } createTrigger(eventScopeKey, eventKey, elementId, variables); return true; } else { return false; } } EventScopeInstanceState(
      final ZeebeDb<ZbColumnFamilies> zeebeDb, final DbContext dbContext); void shutdownInstance(final long eventScopeKey); boolean createIfNotExists(
      final long eventScopeKey, final Collection<DirectBuffer> interruptingIds); void createInstance(
      final long eventScopeKey, final Collection<DirectBuffer> interruptingIds); EventScopeInstance getInstance(final long eventScopeKey); void deleteInstance(final long eventScopeKey); boolean triggerEvent(
      final long eventScopeKey,
      final long eventKey,
      final DirectBuffer elementId,
      final DirectBuffer variables); EventTrigger peekEventTrigger(final long eventScopeKey); EventTrigger pollEventTrigger(final long eventScopeKey); void deleteTrigger(final long eventScopeKey, final long eventKey);  }
@Test public void shouldNotTriggerOnNonExistingEventScope() { final EventTrigger eventTrigger = createEventTrigger(); final boolean triggered = triggerEvent(123, 456, eventTrigger); assertThat(triggered).isFalse(); }