[ETL] Exception met in applying stereotype [message #663653] |
Wed, 06 April 2011 01:10  |
Eclipse User |
|
|
|
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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04898 seconds