Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Check for duplicate target objects.(Making sure that target metamodel (HOT) has unique classes.)
[ATL] Check for duplicate target objects. [message #721153] Thu, 01 September 2011 03:28 Go to next message
Subhav Pradhan is currently offline Subhav PradhanFriend
Messages: 8
Registered: July 2011
Location: Nashville, Tennessee
Junior Member

I have two questions . First, I was wondering if it is at all possible in ATL to make transformation rules such that it creates target objects if those objects are not already in the target model. This will involve traversing of the target model and from what I read in the ATL Wiki, it is not possible. Second, is it possible to create target objects without using any rules. I know this sounds stupid but I am trying to create a target model which will always have two objects regardless of anything else in the source model.

To further describe my questions, I have created a constraint specification metamodel which basically has one class named constraintSpecification. This class has two simple attributes, type of the constraintSpecification and the actual constraint. The actual constraint is a string which consist of information regarding classes that has to be created in the target model of my transformation code. So I have a model that confirms to the constraint specification metamodel and I am using that model as input to my transformation (HOT) code. Now the first problem is that I do not want to create duplicated classes in my target model. The second problem is that I want to create a sourcePattern and targetPattern class in my target model regardless of anything in the source model.

Any help/suggestions would be highly appreciated!

Regards,
Subhav Pradhan
Re: [ATL] Check for duplicate target objects. [message #721203 is a reply to message #721153] Thu, 01 September 2011 07:29 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
For your two objets you can use an entrypoint or an endpoint rule. Those type of rule always execute no matter what the input model is.
It's also here that you could explicitly call a lazy rule or a called rule only for a set of desired object.
Re: [ATL] Check for duplicate target objects. [message #721212 is a reply to message #721203] Thu, 01 September 2011 07:42 Go to previous messageGo to next message
Salvador Martínez is currently offline Salvador MartínezFriend
Messages: 3
Registered: November 2010
Junior Member
As Sylvain has said, for the second problem, creating objects without matching anything in the source you can use called rules or its specializations, entrypoint and endpoint rules. For the first problem, preventing duplicates in the target model you can use unique lazy rules. The first time you use an unique lazy rule for a given input it will create a target object, the next time it will just return a reference to that object instead of creating it.

Cheers,

Salva
Re: [ATL] Check for duplicate target objects. [message #721217 is a reply to message #721153] Thu, 01 September 2011 07:56 Go to previous message
Subhav Pradhan is currently offline Subhav PradhanFriend
Messages: 8
Registered: July 2011
Location: Nashville, Tennessee
Junior Member

Thanks so much for pointing me to correct directions. Will work on it and let you know about the results!

Cheers,
Subhav
Previous Topic:java.lang.IllegalArgumentException: The feature 'lass' is not a valid feature
Next Topic:[QVTo] How models from QVT conforms to models from EMF ?
Goto Forum:
  


Current Time: Sat Apr 20 03:10:14 GMT 2024

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

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

Back to the top