Commit 40e078b8 authored by Marco Konersmann's avatar Marco Konersmann

Refactoring: renames more il to tm etc.

parent f1bc3739
......@@ -27,7 +27,7 @@ public class HenshinTGGBasedLanguageDefinitionHelperTest {
.createPlatformPluginURI(FrameworkUtil.getBundle(getClass()).getSymbolicName()
+ "/src/test/resources/dummy/dummySourceLanguageTransformation.henshin", true);
final List<String> profiles = new HenshinTGGBasedLanguageDefinitionHelper()
.getSelectedModules(transformationFileURI);
.getSelectedProfiles(transformationFileURI);
assertEquals(expected.length, profiles.size());
for (final String e : expected) {
assertTrue(String.format("Profile '%s' is missing in the result.", e), profiles.contains(e));
......@@ -48,7 +48,7 @@ public class HenshinTGGBasedLanguageDefinitionHelperTest {
.createPlatformPluginURI(FrameworkUtil.getBundle(getClass()).getSymbolicName()
+ "/src/test/resources/dummy/dummyTargetLanguageTransformation.henshin", true);
final List<String> profiles = new HenshinTGGBasedLanguageDefinitionHelper()
.getSelectedModules(transformationFileURI);
.getSelectedProfiles(transformationFileURI);
assertEquals(expected.length, profiles.size());
for (final String e : expected) {
assertTrue(String.format("Profile '%s' is missing in the result.", e), profiles.contains(e));
......
......@@ -57,7 +57,7 @@ public class InterProfileTransformation implements IInterprofileTransformation {
public List<String> loadProfilesOf(LanguageDefinition language, SubMonitor monitor) {
monitor.setTaskName("Loading profiles used by language [" + language.getName() + "]");
List<String> profiles = language.getSelectedModules();
List<String> profiles = language.getSelectedProfiles();
monitor.worked(2);
return profiles;
}
......
......@@ -17,20 +17,20 @@ public class HenshinTGGBasedLanguageDefinition extends SpecificationLanguageDefi
this.henshinTGGFileURI = henshinTGGFileURI;
}
public TransformationResult transformToSM(List<EObject> ilRoots, IDRegistry idRegistry, IProgressMonitor monitor) {
return new HenshinTGGBasedLanguageDefinitionHelper().transformILToADL(this, henshinTGGFileURI, ilRoots,
public TransformationResult transformToSM(List<EObject> tmRoots, IDRegistry idRegistry, IProgressMonitor monitor) {
return new HenshinTGGBasedLanguageDefinitionHelper().transformTMToSM(this, henshinTGGFileURI, tmRoots,
idRegistry, monitor);
}
public TransformationResult transformToTM(List<EObject> adlModelRoots, List<EObject> preChangeILRoots,
public TransformationResult transformToTM(List<EObject> smRoots, List<EObject> preChangeTMRoots,
IDRegistry idRegistry, IProgressMonitor monitor) {
return new HenshinTGGBasedLanguageDefinitionHelper().transformADLToIL(this, henshinTGGFileURI, adlModelRoots,
preChangeILRoots, idRegistry, monitor);
return new HenshinTGGBasedLanguageDefinitionHelper().transformSMToTM(this, henshinTGGFileURI, smRoots,
preChangeTMRoots, idRegistry, monitor);
}
@Override
public List<String> getSelectedModules() {
return new HenshinTGGBasedLanguageDefinitionHelper().getSelectedModules(henshinTGGFileURI);
public List<String> getSelectedProfiles() {
return new HenshinTGGBasedLanguageDefinitionHelper().getSelectedProfiles(henshinTGGFileURI);
}
}
......@@ -31,7 +31,7 @@ public class HenshinTGGBasedLanguageDefinitionHelper {
public TransformationResult transformCMToIL(LanguageDefinition languageDefinition, URI henshinTGGFileURI,
List<EObject> cmRoots, IDRegistry idregistry, IProgressMonitor monitor) throws CodelingException {
final HenshinTGGTransformation task = new HenshinTGGTransformation(languageDefinition, henshinTGGFileURI,
"Transforming IL to ADL", TGGDirection.FORWARD, idregistry, cmRoots);
"Transforming Implementation Model to Implementation Model", TGGDirection.FORWARD, idregistry, cmRoots);
TransformationResult result = task.execute(monitor);
task.addIntermediateLanguageElementsToRegistry();
return result;
......@@ -40,47 +40,47 @@ public class HenshinTGGBasedLanguageDefinitionHelper {
public TransformationResult transformILToCM(LanguageDefinition languageDefinition, URI henshinTGGFileURI,
List<EObject> ilRoots, IDRegistry idRegistry, IProgressMonitor monitor) throws CodelingException {
final HenshinTGGTransformation task = new HenshinTGGTransformation(languageDefinition, henshinTGGFileURI,
"Transforming IL to ADL", TGGDirection.BACKWARD, idRegistry, ilRoots);
"Transforming Translation Model to Implementation Model", TGGDirection.BACKWARD, idRegistry, ilRoots);
TransformationResult result = task.execute(monitor);
task.propagateIDsFromIL2CMInRegistry();
return result;
}
public TransformationResult transformILToADL(HenshinTGGBasedLanguageDefinition henshinTGGBasedLanguageDefinition,
URI henshinTGGFileURI, List<EObject> ilRoots, IDRegistry idRegistry, IProgressMonitor monitor) {
public TransformationResult transformTMToSM(HenshinTGGBasedLanguageDefinition henshinTGGBasedLanguageDefinition,
URI henshinTGGFileURI, List<EObject> tmRoots, IDRegistry idRegistry, IProgressMonitor monitor) {
final HenshinTGGTransformation task = new HenshinTGGTransformation(henshinTGGBasedLanguageDefinition,
henshinTGGFileURI, "Transforming IL to ADL", TGGDirection.FORWARD, idRegistry, ilRoots);
henshinTGGFileURI, "Transforming Translation Model to Specification Model", TGGDirection.FORWARD,
idRegistry, tmRoots);
TransformationResult result = task.execute(monitor);
task.propagateIDsFromRegistryToModel();
return result;
}
public TransformationResult transformADLToIL(HenshinTGGBasedLanguageDefinition henshinTGGBasedLanguageDefinition,
URI henshinTGGFileURI, List<EObject> adlRoots, List<EObject> preChangeILRoots, IDRegistry idRegistry,
public TransformationResult transformSMToTM(HenshinTGGBasedLanguageDefinition henshinTGGBasedLanguageDefinition,
URI henshinTGGFileURI, List<EObject> tmRoots, List<EObject> preChangeTMRoots, IDRegistry idRegistry,
IProgressMonitor monitor) {
// Execute =Backwards Propagation=
monitor.subTask(String.format("Executing TGG Task =BWPPG="));
final HenshinTGGTransformation bwppgTask = new HenshinTGGTransformation(henshinTGGBasedLanguageDefinition,
henshinTGGFileURI, "BWPPG Rules ADL to IL", TGGDirection.BACKWARD_PROPAGATION, idRegistry, adlRoots);
henshinTGGFileURI, "Executing Backwards Propagation Rules for Specification Model to Translation Model",
TGGDirection.BACKWARD_PROPAGATION, idRegistry, tmRoots);
final TransformationResult result = bwppgTask.execute(monitor);
// Delete the id registry entries of deleted elements
// Recover elements lost during the translation
Models.store(result.getModelRoots(), CodelingConfiguration.DEBUG_MODELDIR_PATH + "tmp-recover-TM.xmi");
new RecoverPriorModelElements().recoverAll(preChangeTMRoots, result.getModelRoots(),
henshinTGGBasedLanguageDefinition, result.getIdRegistry(), idRegistry);
// Update the id registry
List<String> updatedIDs = bwppgTask.propagateIDsFromModelToRegistry();
Set<String> deletedIDs = idRegistry.getAllIds();
deletedIDs.removeAll(updatedIDs);
idRegistry.deleteEntries(deletedIDs);
// Recover elements lost during the translation
// TODO file name coupled with ADL2ILHandler. Decouple somehow
Models.store(result.getModelRoots(), CodelingConfiguration.DEBUG_MODELDIR_PATH + "6_adl2il.xmi");
new RecoverPriorModelElements().recoverAll(preChangeILRoots, result.getModelRoots(),
henshinTGGBasedLanguageDefinition, result.getIdRegistry(), idRegistry);
return result;
}
public List<String> getSelectedModules(URI transformationFileURI) {
public List<String> getSelectedProfiles(URI transformationFileURI) {
final ResourceSet rset = new ResourceSetImpl();
final Resource resource = rset.getResource(transformationFileURI, true);
final Module module = (Module) resource.getContents().get(0);
......
......@@ -44,7 +44,7 @@ public class RecoverPriorModelElements {
}
private boolean isProfileActive(LanguageDefinition adl, String nsURI) {
final List<String> selectedModules = adl.getSelectedModules();
final List<String> selectedModules = adl.getSelectedProfiles();
return selectedModules.contains(nsURI);
}
......
......@@ -28,7 +28,7 @@ public abstract class LanguageDefinition extends MayHaveIssues {
* returns the nsURIs of all packages that start with
* "http://mkonersmann.de/il/profiles/" in the henshin tgg transformation file.
*/
public abstract List<String> getSelectedModules();
public abstract List<String> getSelectedProfiles();
/**
* The language's name.
......
......@@ -22,7 +22,7 @@ public class EmptySpecificationLanguage extends SpecificationLanguageDefinition
}
@Override
public List<String> getSelectedModules() {
public List<String> getSelectedProfiles() {
return Collections.emptyList();
}
......
......@@ -66,7 +66,7 @@ public class CoCoMELanguageDefinition extends JavaBasedImplementationLanguageDef
}
@Override
public List<String> getSelectedModules() {
public List<String> getSelectedProfiles() {
return Arrays.asList(Profiles.COMPONENTS_HIERARCHY_SCOPED.getNsURI(),
Profiles.INTERFACES_TYPE_OPERATIONS.getNsURI(), Profiles.INTERFACES_TYPE_EVENTS.getNsURI(),
Profiles.DATATYPES_COMMON.getNsURI(), Profiles.BEHAVIOUR_STATEMACHINE.getNsURI(),
......
......@@ -82,7 +82,7 @@ public class JEE7LanguageDefinition extends JavaBasedImplementationLanguageDefin
}
@Override
public List<String> getSelectedModules() {
public List<String> getSelectedProfiles() {
return Arrays.asList(Profiles.COMPONENTS_HIERARCHY_FLAT.getNsURI(), Profiles.CONNECTORS.getNsURI(),
Profiles.CONNECTORS_PROCEDURE_CALLS_SYNCHRONOUS_1TO1.getNsURI(), Profiles.INTERFACES_SHARED.getNsURI(),
Profiles.INTERFACES_TYPE_OPERATIONS.getNsURI(), Profiles.COMPONENTS_INSTANTIATION_FIXED.getNsURI(),
......
......@@ -45,7 +45,7 @@ public class JEE7UMLLanguageDefinition extends HenshinTGGBasedLanguageDefinition
}
@Override
public List<String> getSelectedModules() {
public List<String> getSelectedProfiles() {
return Arrays.asList(Profiles.COMPONENTS_HIERARCHY_SCOPED.getNsURI(), Profiles.CONNECTORS.getNsURI(),
Profiles.CONNECTORS_PROCEDURE_CALLS_SYNCHRONOUS_1TO1.getNsURI(), Profiles.INTERFACES_SCOPED.getNsURI(),
Profiles.INTERFACES_TYPE_OPERATIONS.getNsURI());
......
......@@ -44,7 +44,7 @@ public class UMLLanguageDefinition extends HenshinTGGBasedLanguageDefinition {
}
@Override
public List<String> getSelectedModules() {
public List<String> getSelectedProfiles() {
return Arrays.asList(Profiles.COMPONENTS_HIERARCHY_SCOPED.getNsURI(), Profiles.CONNECTORS.getNsURI(),
Profiles.CONNECTORS_PROCEDURE_CALLS_SYNCHRONOUS_1TO1.getNsURI(), Profiles.INTERFACES_SCOPED.getNsURI(),
Profiles.INTERFACES_TYPE_OPERATIONS.getNsURI());
......
......@@ -77,8 +77,8 @@ public class EjbWithStateMachineLanguage extends JavaBasedImplementationLanguage
}
@Override
public List<String> getSelectedModules() {
return new HenshinTGGBasedLanguageDefinitionHelper().getSelectedModules(henshinTGGFileURI);
public List<String> getSelectedProfiles() {
return new HenshinTGGBasedLanguageDefinitionHelper().getSelectedProfiles(henshinTGGFileURI);
}
}
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