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 01:10 Go to next message
Sungwook Moon is currently offline Sungwook Moon
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 04:15 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 704
Registered: July 2009
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] Tue, 12 April 2011 22:43 Go to previous messageGo to next message
Sungwook Moon is currently offline Sungwook Moon
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 05:59 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 704
Registered: July 2009
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: Thu Apr 24 11:20:36 EDT 2014

Powered by FUDForum. Page generated in 0.14718 seconds