EMFTVM Refining Mode [message #1063594] |
Thu, 13 June 2013 09:18  |
Eclipse User |
|
|
|
Hi again,
At first let me explain my problem. Basically I would like to change, add or delete a few UML objects in an UML file. Therefore I call the transformation programmatically and defined my ATL-EMFTVM transformation for a simple test as followed:
module Test;
create OUT: UML2 refining IN: UML2;
rule Class {
from
s: UML2!"uml::Class"
to
t: UML2!"uml::Class",
u: UML2!"uml::Class" (
name <- 'adsf'
)
}
I tried to get the EMFTVM Refining Mode working, but somehow get errors like
Exception in thread "main" java.lang.IllegalArgumentException: Model IN not found
at org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.resolveRuleElementModels(ExecEnvImpl.java:1541)
at org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.resolveRuleModels(ExecEnvImpl.java:1523)
at org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.run(ExecEnvImpl.java:2011)
at at.jku.uml2uml.launcher.EMFTVMLauncher.launch(EMFTVMLauncher.java:170)
at at.jku.uml2uml.testbench.EMFTVMLauncherTest.main(EMFTVMLauncherTest.java:24)
or when using a different rule
module Test;
create OUT: UML2 refining IN: UML2;
rule Class {
from
s: UML2!"uml::Class"
to
t: UML2!"uml::Class"(
name <- 'adsf'
)
}
this one:
Exception in thread "main" org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.IllegalArgumentException: Cannot set properties of Switch:UML2!Class, as it is contained in an input model
at rule Class@applier#3(../AtlTransform/inplace/SeqClassState.atl#[15:4-15:18])
Local variables: [__trace__: TRACE!TraceLink = 6ade8e8b:TRACE!TraceLink, s: UML2!uml::Class = Switch:UML2!Class]
at static EMFTVM!ExecEnv::main() : Object(../AtlTransform/inplace/SeqClassState.atl)
Local variables: []
at org.eclipse.m2m.atl.emftvm.impl.CodeBlockImpl.internalExecute(CodeBlockImpl.java:989)
at org.eclipse.m2m.atl.emftvm.impl.CodeBlockImpl.execute(CodeBlockImpl.java:728)
at org.eclipse.m2m.atl.emftvm.impl.RuleImpl$WithApplierWithoutPostApplyCbState.applyFor(RuleImpl.java:1204)
at org.eclipse.m2m.atl.emftvm.impl.RuleImpl$IsNotAbstractState.apply(RuleImpl.java:983)
at org.eclipse.m2m.atl.emftvm.impl.RuleImpl.apply(RuleImpl.java:2199)
at org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.matchAllSingle(ExecEnvImpl.java:2172)
at org.eclipse.m2m.atl.emftvm.impl.ExecEnvImpl.run(ExecEnvImpl.java:2020)
Both the source and the target UML file have the same UML metamodel, but they are actually different files. Sometime I also would like to use the same file as input and output as well. Also when I use a complete empty module for the transformation, my output in the target file is simply empty.
I do not have enabled any refining mode when launching the configuration, as I thought that it is not necessary with EMFTVM anymore. I interpreted the refining mode, to actually copy unmatched elements from the source to the target model. Only if a rule is actually matched by an element in the from section, these element can be altered or even deleted. I guess I misunderstood something here, any clarification would be nice.
Thank you.
Stefan
[Updated on: Thu, 13 June 2013 09:19] by Moderator
|
|
|
|
Re: EMFTVM Refining Mode [message #1063713 is a reply to message #1063686] |
Thu, 13 June 2013 16:00  |
Eclipse User |
|
|
|
Hi Dennis,
thanks for clearing this up for me. I followed your steps, and the transformation worked fine. As I actually launch the transformations programmatically, I changed the URI of the inout model after the transformation is done. Then I just saved it under a newly created URI.
Now it works as I thought of from the beginning, thanks again. Additionally I appreciate your and the other moderators work here in the forums as well as on the ATL project itself.
Cheers
Stefan
[Updated on: Thu, 13 June 2013 16:02] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05593 seconds