Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Problem whe using "Support UML2 Stereotypes application" in the run configuration's advanc
Problem whe using "Support UML2 Stereotypes application" in the run configuration's advanc [message #1111498] Wed, 18 September 2013 05:49 Go to next message
Javier García is currently offline Javier García
Messages: 112
Registered: April 2013
Senior Member
Hi all,
I'm having some problems when using the option mentioned in the title, this problems disappear when I uncheck it but anyways I wondered why does it show the error.

In my program I apply stereotypes which have tagged values, so first I apply the stereotype and then I apply the tagged values. Some of my tagged values are of the type of other stereotypes, so then before applying these tagged values I need to be sure that the stereotype has been applied, so to be sure I was applying the tagged values in an endpoint rule.
The problem is that in order to do this I was pointing to the classes from the output model (which I know is not recommended) and I used a code similar to this (simplified here to ease understanding):
for (src in UML2!Class.allInstancesFrom('OUT')) {
			
			if (not src.getAppliedStereotype('RCP::View').oclIsUndefined()){
                        src.setValue(src.getAppliedStereotypes().first(), 'viewActions', 
					 	thisModule.elementSet);
}
}

So with the "Support UML2 stereotypes application" option checked this didn't work, as the transformation didn't detect any stereotyped class I checked it further and there were no stereotyped classes until the transformation was actually finished, meaning that once the transformation was finished the classes had stereotypes, but during the transformation not even in the endpoint rule the classes where stereotyped.

Then if I do this same transformation with that option unchecked it can properly see all the stereotyped classes from the output model and therefore it's able to set the values of the stereotype's properties without any problem.

So my question is: why does this happen? and is it intended to work this way?
Because I don't understand why this option changes this so much, and wondered if maybe it was a bug or if maybe as mentioned before I shouldn't be checking the output model like this.

Thanks in advance,
regards,
Javier
Re: Problem whe using "Support UML2 Stereotypes application" in the run configuration's ad [message #1111565 is a reply to message #1111498] Wed, 18 September 2013 07:51 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 100
Registered: September 2012
Senior Member
Looks like you just discovered what "Support UML2 stereotypes application" does Wink. It postpones all calls to applyStereotype() until after the transformation. This is done to work around the problem that the UML2 metamodel implementation checks that a model element is contained within a UML Model that has the corresponding Profiles applied. This condition only holds after all elements are transformed.
Re: Problem whe using "Support UML2 Stereotypes application" in the run configuration's ad [message #1112123 is a reply to message #1111565] Thu, 19 September 2013 02:40 Go to previous message
Javier García is currently offline Javier García
Messages: 112
Registered: April 2013
Senior Member
Thanks Dennis!
I thought that without checking that option the transformation of Stereotypes would just not work or be really problematic, I really understand the use of it now as I have actually had that problem several times, it's really good to finally understand it, thanks a lot!

Also, it would be nice if there was a tooltip or something like that on the option that would let you know exactly what it does.

[Updated on: Thu, 19 September 2013 06:26]

Report message to a moderator

Previous Topic:Extract ATL transformation (.atl) from ATL Model (.xmi) with Java
Next Topic:Problem assigning in a target the source element of an emftvm rule
Goto Forum:
  


Current Time: Mon Oct 07 07:18:37 EDT 2013

Powered by FUDForum. Page generated in 0.01490 seconds