blob: 9a4dbdec54f89b39b6f6ae30559dc1fe681f67c5 [file] [log] [blame]
-- Note: import ImportedMappingTest indiractly in relation the main transf.
import models.importedvirtuals.ImportedMappingTest;
modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
transformation Imported2(in modelIn : ecore, out model : ecore);
property LOCAL_PROP : String = 'Imported2::LOCAL_PROP';
property Imported2_PROP : String = 'Imported2::PROP';
main(in inModel : ecore::EPackage) {
}
/*
Tests that matching context-less query overrides imported ones
*/
query checkImported2LocalQuery() : String {
return localQuery();
}
query localQuery() : String {
return 'Imported2::localQuery'
}
/**
Test virtual operations defined fully here but accessed but importer
*/
query ENamedElement::remoteVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'ENamedElement::remoteVirtualQuery';
}
query EClass::remoteVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'EClass::remoteVirtualQuery';
}
query EClassifier::remoteVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'EClassifier::remoteVirtualQuery';
}
-- messup operation for remoteVirtual testing, ensuring exact signature match
query EClassifier::remoteVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Sequence(OclAny))) : String {
return 'please help!'
}
query EClass::remoteVirtualQuery(in arg1 : OclAny, in arg2 : Set(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'error';
}
query getImported2LocalProperty() : String {
return LOCAL_PROP;
}
----- virtual mapping exposed to indirectly imported ImportMappingTest
mapping EStructuralFeature::globalVirtualMapping(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : EClass {
name:='EStructuralFeature::globalVirtualMapping';
}
query EModelElement::globalVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'EModelElement::globalVirtualQuery';
}
query ETypedElement::globalVirtualQuery(in arg1 : OclAny, in arg2 : Collection(Real), in arg3: Tuple (val : Collection(OclAny))) : String {
return 'ETypedElement::globalVirtualQuery';
}