protected PublishEventTO createPublishEventTO(
     SubscriptionContext subsContext,
     Long dialogElementsResourceableId,
     Identity identity,
     DialogElement dialogElement,
     EventType eventType) {
   if (EventType.NO_PUBLISH.equals(eventType) || subsContext == null) {
     return PublishEventTO.getNoPublishInstance();
   }
   ContextInfo contextInfo =
       notificationSubscriptionContextFactory.createContextInfoFrom(subsContext);
   PublishEventTO publishEventTO =
       PublishEventTO.getValidInstance(
           contextInfo.getContextType(),
           contextInfo.contextId(),
           subsContext.getContextTitle(),
           contextInfo.subContextId(),
           DialogElementsNotificationTypeHandler.DIALOGELEMENTS_SOURCE_TYPE,
           dialogElementsResourceableId,
           subsContext.getSourceTitle(),
           dialogElement.getFilename(),
           identity,
           eventType);
   publishEventTO.setSourceEntryId(dialogElement.getFilename());
   return publishEventTO;
 }
  private void publishEvents() {
    for (ActionEntry action : actions.values()) {

      PublishEventTO publishEventTO =
          PublishEventTO.getValidInstance(
              publishers.get(action.publisherId).publisher.getContextType(),
              publishers.get(action.publisherId).publisher.getContextId(),
              publishers.get(action.publisherId).contextTitle,
              publishers.get(action.publisherId).publisher.getSubcontextId(),
              publishers.get(action.publisherId).publisher.getSourceType(),
              publishers.get(action.publisherId).publisher.getSourceId(),
              publishers.get(action.publisherId).sourceTitle,
              action.title,
              subscribers.get(action.subscriberId).subscriber.getIdentity(),
              getEventType(action.eventType));
      publishEventTO.setSourceEntryId(action.messageId);
      notificationServiceImpl.publishEvent(publishEventTO);
    }
  }