Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMFTVM Refining Mode
EMFTVM Refining Mode [message #1063594] Thu, 13 June 2013 13:18 Go to next message
Stefan L is currently offline Stefan LFriend
Messages: 13
Registered: July 2012
Junior Member
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 13:19]

Report message to a moderator

Re: EMFTVM Refining Mode [message #1063686 is a reply to message #1063594] Thu, 13 June 2013 18:11 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

ATL refining mode compiles to an in-place transformation in EMFTVM. In-place
transformations do not operate on an input model and an output model, but one
unified in/out model. This is a slight mismatch between how ATL represents the
models and how EMFTVM implements them.

In your specific case, the IN and OUT model are one and the same model. They
are mapped to an EMFTVM in/out model named IN. The OUT model does not exist in
EMFTVM. Make sure your launch configuration lists only the IN model, as an
in/out model. The in/out models can have two URIs: the left URI is the loading
URI and the right URI is the saving URI. This way, you don't end up
overwriting the input model all the time.

Cheers,
Dennis


Cheers,
Dennis
Re: EMFTVM Refining Mode [message #1063713 is a reply to message #1063686] Thu, 13 June 2013 20:00 Go to previous message
Stefan L is currently offline Stefan LFriend
Messages: 13
Registered: July 2012
Junior Member
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 20:02]

Report message to a moderator

Previous Topic:ANT Task VMException (Could not find model)
Next Topic:Identify leaf classes
Goto Forum:
  


Current Time: Thu Apr 25 07:29:26 GMT 2024

Powered by FUDForum. Page generated in 0.03115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top