Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL duplicate instances(generate model with duplicate instances)
ATL duplicate instances [message #1760659] Sun, 30 April 2017 18:07 Go to next message
joe fridik is currently offline joe fridikFriend
Messages: 15
Registered: April 2017
Junior Member
Hello ,

I am trying to test a transformation that works, with a single rule that works but with duplicates.
Inpout model I have two instances (2 tasks) but as a result it gives me 4 instances (4tasks).

How I can group many elements into one


Here is a file that will give you more information about my model

Any help would be very useful to me

rule taskss{

from e:MM!task , t: MM!A
to
r:MM1!task( id <- e.name, text <-t.text1)

}

  • Attachment: rule rrr.docx
    (Size: 68.15KB, Downloaded 161 times)
Re: ATL duplicate instances [message #1760662 is a reply to message #1760659] Sun, 30 April 2017 20:42 Go to previous messageGo to next message
joe fridik is currently offline joe fridikFriend
Messages: 15
Registered: April 2017
Junior Member
In other words a task contains a description, the latter contains an Action element that inherits three elements A, B and C.

How from a Task element access to an attribute of an element A
When I try this syntax does not give me anything :

Task.Description.Action.A.text1
Re: ATL duplicate instances [message #1760679 is a reply to message #1760662] Mon, 01 May 2017 15:45 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Your rule matches the Cartesian product (i.e. all combinations of) 'e' and 't', without any guard on the relationship between 'e' and 't'. If you just mean to trigger the rule for all 'e', you should specify 't' in the "using" section of the rule instead:
rule taskss{
  from e:MM!task (
    not e.description.oclIsUndefined() and
    e.description.action.oclIsKindOf(MM!A))
  using {
    t: MM!A = e.description.action;
  }
  to r:MM1!task (
    id <- e.name,
    text <- t.text1)
}


Cheers,
Dennis

[Updated on: Mon, 01 May 2017 18:15]

Report message to a moderator

Re: ATL duplicate instances [message #1760681 is a reply to message #1760679] Mon, 01 May 2017 17:09 Go to previous messageGo to next message
im hello world is currently offline im hello worldFriend
Messages: 44
Registered: February 2017
Member
Hi Dennis,
I had the same problem as Joe and i tried the solution proposed by you.
I had an error after closing ' }' related to the clause "using"
using { ........ }
"mismatched input '}' expecting SEMI"
I don't understand where does the problem come from.
Any help please?
Thanks
Re: ATL duplicate instances [message #1760685 is a reply to message #1760681] Mon, 01 May 2017 18:14 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Oops! I made a syntax error, and forgot a ';' (SEMIcolon). I'll fix it in the original comment.

Cheers,
Dennis
Re: ATL duplicate instances [message #1760688 is a reply to message #1760685] Mon, 01 May 2017 20:54 Go to previous message
joe fridik is currently offline joe fridikFriend
Messages: 15
Registered: April 2017
Junior Member
Hi Dennis,

Thanks very much. now its ok



[Updated on: Mon, 01 May 2017 22:35]

Report message to a moderator

Previous Topic:'atl metamodel.ecore'
Next Topic:ATL installation with GIT repository
Goto Forum:
  


Current Time: Fri Apr 19 14:50:43 GMT 2024

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

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

Back to the top