Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » question about ATL
question about ATL [message #1847817] Tue, 09 November 2021 08:17 Go to next message
Yanhong Dong is currently offline Yanhong DongFriend
Messages: 25
Registered: September 2021
Junior Member
rule A2B{
from
s : A!element
to
t : B!element(
name <- s.own.name
if(not s.Behavior..oclIsUndefined) then
tm <- s.Behavior.re.tr -> select(e | not e.oclIsUndefined()),
a <- s.Behavior.re.sub -> select(e | not e.do.oclIsUndefined()),
)
}
rule E2T{
from
s : A!tr
to
t : B!Tran(
e <- s.name
)
}
rule E2A{
from
s : A!sub(not s.do.oclIsUndefined())
to
t : B!In(
ex <- s.name + s.do.name
)
}
I think this rule is right, but it also tell me Unable to access re on OclUndefined
so, can you tell me how to establish example
  • Attachment: file.xml
    (Size: 0.25KB, Downloaded 66 times)
Re: question about ATL [message #1847863 is a reply to message #1847817] Wed, 10 November 2021 18:09 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Your code has syntax errors. I don't understand how you're able to compile and run it (see attachment).

Your syntax error is caused by embedding imperative ATL code in the "to" part of an ATL rule, which is not supported. There are two ways to solve this:

1. Declarative - create a new rule that inherits from A2B, and includes "not s.Behavior..oclIsUndefined" in the "from filter expression. Move the bindings of "tm" and "a" into the new rule.

2. Imperative - add a "do" section to the A2B rule and move the "if" block into that section.


Cheers,
Dennis
Re: question about ATL [message #1848007 is a reply to message #1847863] Wed, 17 November 2021 11:13 Go to previous message
Yanhong Dong is currently offline Yanhong DongFriend
Messages: 25
Registered: September 2021
Junior Member
Thank you for your answer, I don't know why my code does not show errors, I suspect it is because of my editor problem (I use eclipse)
Your answer helped me a lot, I will try this method to solve my problem, thank you
Previous Topic:ATL automatic transformation of multiple input models into multiple output models at the same time
Next Topic:enabling "inter-model references" when running ATL emftvm transformations
Goto Forum:
  


Current Time: Fri Apr 19 23:36:34 GMT 2024

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

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

Back to the top