Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL] Exception met in applying stereotype(How is IllegalArgumentException in applying stereotype can be handled?)
[ETL] Exception met in applying stereotype [message #663653] Wed, 06 April 2011 05:10 Go to next message
Sungwook Moon is currently offline Sungwook MoonFriend
Messages: 2
Registered: April 2011
Junior Member
Hi? I'm newcomer to Epsilon to implement MDD.
I just started using ETL for a model transformation with UML model. For this, I specified a profile already. And I tried to apply the stereotypes I specified to the UML model element but to fail.
To apply stereotypes, I found a topic in this forum and followed the sample code but it didn't work for me.

My code snippet is as follows;
rule BCInterface2Component
	transform a_bc_if : UML_A!Interface
	to d_bc_comp : UML_D!Component {
	
		guard : a_bc_if.getAppliedStereotypes()->exists(s|s.name='BC')
		
		var a_st = a_bc_if.getAppliedStereotypes().selectOne(s|s.name='BC');
		var prop = a_st.ownedAttribute.selectOne(s|s.name='subType');
		
		-- BC Component mapping
		var st = MyProfile!Stereotype.all.selectOne(s|s.name='BC');
		d_bc_comp.applyStereotype(st);
		d_bc_comp.name = a_bc_if.name;
}


When running with this rule a model transformation, I go the following error messages.

Internal error: java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@139e05a [name: Focus, visibility: <unset>] [isLeaf: false, isAbstract: false] [isActive: false]
	at org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype[ElementOperations.java:1411]
	at org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype[ElementImpl.java:510]
	at sun.reflect.NativeMethodAccessorImpl.invoke0[Native Method]
	at sun.reflect.NativeMethodAccessorImpl.invoke[NativeMethodAccessorImpl.java:39]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke[DelegatingMethodAccessorImpl.java:25]
	at java.lang.reflect.Method.invoke[Method.java:597]


I didn't know what the problem is. Please help me.
Another thing I want to know is how to get and set values of stereotype properties. As I know in UML2 Java API there are methods for that purpose named "getValue" and "setValue" in Stereotype interface.

Thank you in advance.
Re: [ETL] Exception met in applying stereotype [message #663686 is a reply to message #663653] Wed, 06 April 2011 08:15 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi,

Could you please put together a minimal configuration (transformation, profile, input model etc) we can use to reproduce this and send it to us at epsilon.devs gmail com?

Cheers,
Dimitris
Re: [ETL] Exception met in applying stereotype [message #665040 is a reply to message #663686] Wed, 13 April 2011 02:43 Go to previous messageGo to next message
Sungwook Moon is currently offline Sungwook MoonFriend
Messages: 2
Registered: April 2011
Junior Member
Hi, Dimitris

I finally found how to apply stereotypes to UML elements.
The mistake I made is that I tried to apply stereotype an element before it
was added to its owner. So, I got an empty applicable stereotypes before
added to an owner.
I solved using in post block.
But I still wonder how can I apply stereotype along with transformation for
every equivalent element from source to target in transformation rules.

Best regards,
Sungwook.
Re: [ETL] Exception met in applying stereotype [message #665622 is a reply to message #663653] Fri, 15 April 2011 09:59 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi Sungwook,

Would it make sense to use a "pre" block instead to do any necessary preparations so that you can then apply stereotypes within the transformation rules?

Cheers,
Dimitris
Previous Topic:Epsilon Extensibility and Eugenia Extensibility
Next Topic:[Epsilon] Standalone
Goto Forum:
  


Current Time: Fri Apr 19 05:35:00 GMT 2024

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

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

Back to the top