ATL 转换:包括第三个元模型
我想检查 ATL 转换中某个元素是否是另一个元模型的类型,该元模型既不是源元模型也不是目标元模型。 (在本例中为 JavaModelMM)。
这是错误消息: org.eclipse.m2m.atl.engine.emfvm.VMException:找不到参考模型 JavaModelMM
有谁如何“包含”其他模型?
多谢
-- @nsURI JavaModelMM=http://www.eclipse.org/MoDisco/Java/0.2.incubation/java
-- @nsURI Javapp=http://www.eclipse.org/MoDisco/Java/Composition/0.1.incubation /javaApplication
-- @nsURI SMM=http://www.eclipse.org/MoDisco/SMM/1.0.Beta2/smm
module JavaApp2LOC;
create Metrics: SMM from JavaApplication: Javapp;
rule name {
from
region: Javapp!JavaNodeSourceRegion (
region.javaNode.isMethodDeclaration()
)
to
loc: SMM!NamedMeasure (
name <- region.javaNode.toString()
)
}
helper context OclAny def: isMethodDeclaration() : Boolean =
if self.oclIsTypeOf(JavaModelMM!MethodDeclaration.oclType()) then true
else false
endif;
i want to check in an ATL transformation if an element is a type of another metamodel, that is neither the source nor the target metamodel. (In this case JavaModelMM).
This is the error message:
org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find reference model JavaModelMM
Does anyone how to "include" other models?
Thanks a lot
-- @nsURI JavaModelMM=http://www.eclipse.org/MoDisco/Java/0.2.incubation/java
-- @nsURI Javapp=http://www.eclipse.org/MoDisco/Java/Composition/0.1.incubation /javaApplication
-- @nsURI SMM=http://www.eclipse.org/MoDisco/SMM/1.0.Beta2/smm
module JavaApp2LOC;
create Metrics: SMM from JavaApplication: Javapp;
rule name {
from
region: Javapp!JavaNodeSourceRegion (
region.javaNode.isMethodDeclaration()
)
to
loc: SMM!NamedMeasure (
name <- region.javaNode.toString()
)
}
helper context OclAny def: isMethodDeclaration() : Boolean =
if self.oclIsTypeOf(JavaModelMM!MethodDeclaration.oclType()) then true
else false
endif;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需在 create 语句的 from 子句中列出第三个即可。
请注意,您还可以指定多个目标模型。
You just need to list the third one in the from clause of the create statement.
Note that you can also specify multiple target models.