Commit 50ac6f44 authored by Marco Konersmann's avatar Marco Konersmann

Adds a warning, when an ID could not be found

parent 56984f17
......@@ -231,7 +231,11 @@ public class HenshinTGGTransformation extends ModelTransformation {
"The initial element {0} has {1} result elements. Will only add the first initial element. Translations should not create correspondence objects that have multiple sources or multiple targets.",
initialObject, entry.getValue().size()), null);
idRegistry.addTranslationModelElement(targetObject, initialObject);
try {
idRegistry.addTranslationModelElement(targetObject, initialObject);
} catch (IllegalArgumentException e) {
log.warning("Could not add an translation model element to the id registry.", e);
}
}
}
}
......@@ -331,10 +335,8 @@ public class HenshinTGGTransformation extends ModelTransformation {
/**
* Imports model roots into henshin TGG runtime.
*
* @param modelRoot
* The model root elements
* @param henshinTggFileUri
* The URI to the Henshin TGG transformation file.
* @param modelRoot The model root elements
* @param henshinTggFileUri The URI to the Henshin TGG transformation file.
* @return An {@link ImportResult} containing the {@link TripleGraph}, a mapping
* between Henshin Nodes and eobjects, and a reference to a
* {@link TGGExecutor}.
......
......@@ -34,7 +34,7 @@ public class IDRegistry {
public HashMap<String, String[]> getRegistryEntries() {
return id2paths;
}
int i = 0;
private void updateEntry(String id, String codePath, String implementationModelPath, String translationModelPath) {
final String[] paths = id2paths.get(id);
if (paths == null) {
......@@ -77,6 +77,8 @@ public class IDRegistry {
*/
public void addTranslationModelElement(EObject translationModelElement, EObject implementationModelElement) {
final String id = getIDFromImplementationModelElement(implementationModelElement);
if(id==null)
throw new IllegalArgumentException("Could not find ID in registry for implementation model element "+implementationModelElement.toString());
final String ilPath = getPath(translationModelElement);
id2paths.get(id)[2] = ilPath;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment