Skip to main content



      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] Wed, 31 August 2011 23:28 Go to next message
Eclipse UserFriend
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 03:29 Go to previous messageGo to next message
Eclipse UserFriend
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 03:42 Go to previous messageGo to next message
Eclipse UserFriend
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 03:56 Go to previous message
Eclipse UserFriend
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: Thu Mar 20 22:06:04 EDT 2025

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

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

Back to the top