Hello,
I am working with ATL and I would like to transform UML together with UML stereotypes to my custom metamodel. This transformation will trigger different rules depending of the assigned UML sterotype. I use the following code to detect if the stereotype exsist:
helper context UML!Element def: hasStereotype(stereotype : String) :
Boolean = self.getAppliedStereotypes() -> collect(st | st.name) -> includes(stereotype);
It works properly in the context of Eclipse, by running it with its ATL Configuration (e.g. Metamodels, Source Models...). However, when I execute this same ATL file from my java code, it works like UML stereotypes don't exist.
This is the launcher code together with the options:
public Object doC2PROV(IProgressMonitor monitor) throws ATLCoreException, IOException, ATLExecutionException {
ILauncher launcher = new EMFVMLauncher();
Map<String, Object> launcherOptions = getOptions();
launcher.initialize(launcherOptions);
launcher.addInModel(inModel, "IN", "UML");
launcher.addOutModel(outModel, "OUT", "PROV");
return launcher.launch("run", monitor, launcherOptions, (Object[]) getModulesList());
}
Options:
# ATL Launching options
supportUML2Stereotypes = true
OPTION_CONTENT_TYPE = false
step = false
allowInterModelReferences = true
printExecutionTime = false
[Updated on: Wed, 25 October 2017 18:18]
Report message to a moderator