Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » What is 'var' in resolveTemp(var, target_pattern_name) ?
What is 'var' in resolveTemp(var, target_pattern_name) ? [message #1809531] Wed, 17 July 2019 14:38 Go to next message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
I don't understand should be the 'var' in 'resolveTemp(var, target_pattern_name)'.

In the official documentation it is defined as :

The parameter var corresponds to an ATL variable that contains the source model element from which the searched target model element is produced. 


But this sentence is a bit confusing. What variable do we talk about ? How a source model element can produce a target element ?

Could you please explain that to me with basic words if possible

Regards
Re: What is 'var' in resolveTemp(var, target_pattern_name) ? [message #1809985 is a reply to message #1809531] Sat, 27 July 2019 10:26 Go to previous message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

'var' - a ("using" clause) variable, rule source element, helper attribute, or actually any expression in ATL that yields a model element from an input model, and for which you want to resolve a target element value. It is the "what" that you want resolved. Example:
s.children->select(c | c.attr.oclIsUndefined())->first()

in
thisModule.resolveTemp(s.children->select(c | c.attr.oclIsUndefined())->first(), ...)

'target_pattern_name' - the name of the output element in the matched rule of which you want the value. Example:
rule Parent2Container {
  from
    source : MMA!Parent
  to
    target : MMB!Container (
      children <- source.children->collect(c | thisModule.resolveTemp(c, 'second'))
    )
}

will return the value of the 'second' output element created by this rule:
rule Child2MetaClassAndElement {
  from
    s : MMA!Child
  to
    t : MMB!MetaClass (...),
    second : t : MMB!Element (...)
}


Cheers,
Dennis
Previous Topic:Use of refInvokeOperation
Next Topic:[solved] xmi:id and xmi:type tags in SysML
Goto Forum:
  


Current Time: Thu Apr 18 03:40:08 GMT 2024

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

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

Back to the top