Details
Description
Currently, EventJournalProcessor gets the current runtime configuration model as one of the first instructions in EventJournalProcessor#processEvents:
this.currentModel = configurationService.getRuntimeConfigurationModel();
This currentModel is passed into DefinitionMergeService, which modifies that model in for instance DefinitionMergeService#mergeConfigDefinitionNode:
new ConfigurationTreeBuilder(model.getConfigurationRootNode())
.markNodeAsDeletedBy(incomingConfigNode,
deleteDef).pruneDeletedItems(incomingConfigNode);
The problem is that in case of exceptions in DefinitionMergeService the changes in the model are not reset.
While fixing this, also look into the following code in EventJournalProcessor#checkAddEventPath:
final ConfigurationItemCategory category = autoExportConfig.getCategoryForItem(eventPath, propertyPath,
configurationService.getRuntimeConfigurationModel());