protected internal virtual void ProcessEventSync(IEventSubscriptionEntity eventSubscriptionEntity, object payload) { // A compensate event needs to be deleted before the handlers are called if (eventSubscriptionEntity.EventType == CompensateEventSubscriptionEntityFields.EVENT_TYPE) { Delete(eventSubscriptionEntity); } IEventHandler eventHandler = ProcessEngineConfiguration.GetEventHandler(eventSubscriptionEntity.EventType); if (eventHandler == null) { throw new ActivitiException("Could not find eventhandler for event of type '" + eventSubscriptionEntity.EventType + "'."); } eventHandler.HandleEvent(eventSubscriptionEntity, payload, CommandContext); }