Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Is this an ATL bug?
Is this an ATL bug? [message #1852887] Thu, 09 June 2022 14:48 Go to next message
M M is currently offline M MFriend
Messages: 4
Registered: February 2022
Junior Member
Hi,

I have a simple transformation:
module Transformation;
create OUT : TargetMM from IN : SourceMM;

rule Source2Target {
	from
		source : SourceMM!Source
	to
		target : TargetMM!Target (
			source <- source,
			target <- target
		)
}

When I run this on some sample model, I get some strange behaviour that does not match up with the transformation. For example, a sample output may look like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<target:Target xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:target="target" target="/" source="/"/>


You can see that target="/", and also source="/". This means that both of those properties are referencing the same element. To me, this looks like the source property is completely incorrect. I would expect the source property points to the original value in the input model with the use of an inter-model reference. Instead, it simply points to an element in the output model.

This doesn't just happen in this toy example. I have a more complex project where the output is a third model containing links between source/target elements. However both the source and target element also always reference the target element. This makes the traces effectively useless because there's no way to store a reference to the source element.

I've enabled inter-model references. Is this an ATL bug?
Re: Is this an ATL bug? [message #1852892 is a reply to message #1852887] Thu, 09 June 2022 15:57 Go to previous messageGo to next message
Burak Karaduman is currently offline Burak KaradumanFriend
Messages: 84
Registered: July 2018
Member
Hi,

I have a similar issue. Could you help us with this?

Thank you all.
Re: Is this an ATL bug? [message #1852893 is a reply to message #1852892] Thu, 09 June 2022 17:04 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

The binding operator '<-' performs implicit tracing from source to target elements. Therefore, when you bind a transformed source element to some property, it is replaced by its target counterpart when assigning it.

If you want to prevent this behaviour, you can use the assignment operator '<:='.


Cheers,
Dennis
Re: Is this an ATL bug? [message #1852895 is a reply to message #1852893] Thu, 09 June 2022 17:21 Go to previous messageGo to next message
M M is currently offline M MFriend
Messages: 4
Registered: February 2022
Junior Member
Hi Dennis,

Thanks for the reply. When using the assignment operator <:=, I get the exact same erroneous result. Here's the transformation with the applied change, though it doesn't make a difference:

module Transformation;
create OUT : TargetMM from IN : SourceMM;

rule Source2Target {
	from
		source : SourceMM!Source
	to
		target : TargetMM!Target (
			source <:= source,
			target <- target
		)
}
Re: Is this an ATL bug? [message #1852950 is a reply to message #1852895] Sun, 12 June 2022 16:03 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

Make sure you're using EMFTVM; I've added the https://github.com/dwagelaar/atl.examples/tree/main/ATLTracingBypass example project to illustrate how it works.

Cheers,
Dennis
Re: Is this an ATL bug? [message #1853231 is a reply to message #1852950] Thu, 23 June 2022 13:34 Go to previous message
M M is currently offline M MFriend
Messages: 4
Registered: February 2022
Junior Member
Thanks Dennis, this fixed the issue for me. I appreciate the help.
Previous Topic:How to reference external modules?
Next Topic:Accessing referring elements?
Goto Forum:
  


Current Time: Sat Nov 11 08:17:04 GMT 2023

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

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

Back to the top