Skip to main content



      Home
Home » Modeling » ATL » question about ATL
question about ATL [message #1847817] Tue, 09 November 2021 03:17 Go to next message
Eclipse UserFriend
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 110 times)
Re: question about ATL [message #1847863 is a reply to message #1847817] Wed, 10 November 2021 13:09 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: question about ATL [message #1848007 is a reply to message #1847863] Wed, 17 November 2021 06:13 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 13:25:45 EDT 2025

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

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

Back to the top