Problem with Stereotype application [message #1097191] |
Thu, 29 August 2013 06:57  |
Eclipse User |
|
|
|
I am trying to applay a stereotype in a qvto transformation, but the the method applystereotype does not do anything.
I am using 3.3.0 version of QVTO on Kepler:
QVT Operational SDK 3.3.0.v20130521-0837
This is the code of the transformation:
modeltype UML uses uml('http://www.eclipse.org/uml2/4.0.0/UML');
transformation MarteTransformation(in MarteProfile : UML, out model : UML);
main() {
var prof : Profile := MarteProfile.objectsOfType(Profile)![name = "GCM"];
var stereo : Stereotype = MarteProfile.objectsOfType(Stereotype)![name = "FlowProperty"];
log("profile: ", prof);
log("stereo: ", stereo);
assert fatal (prof = stereo.profile);
var model : Model := object Model {name := 'model'};
var cls : Class := object Class {name := 'class'};
model.ownedType += cls;
var prop : Property := object Port {name := 'prop'};
log("list of applicable stereotype:");
prop.getApplicableStereotypes()-> forEach(stereotype){
log("applicable stereotype:", stereotype.name);
};
cls.ownedAttribute += prop;
model.applyProfile(stereo.profile);
prop.applyStereotype(stereo);
log ("this is the applied stereotype: ",prop.getAppliedStereotype("FlowProperty"));
}
And this is the console displayed messages:
profile: , data: org.eclipse.uml2.uml.internal.impl.ProfileImpl@1add57d9 (name: GCM, visibility: <unset>) (URI: null)
stereo: , data: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@7d0d936b (name: FlowProperty, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false)
list of applicable stereotype:
this is the applied stereotype:
|
|
|
|
Re: Problem with Stereotype application [message #1097857 is a reply to message #1097191] |
Fri, 30 August 2013 04:51   |
Eclipse User |
|
|
|
Hi
When stuck and no one can help, the debugger is your friend.
- did the stereotype really get applied?
- was it applied to the right object?
- was the right object saved to XMI?
- did the serialization corrupt the sterotype?
My understanding of QVTo stereotypes is very limited. Deep within the
specification 8.4.3 (3) is a * operator. I don't know whether this is
relevant to your problem or not.
Regards
Ed Willink
On 29/08/2013 11:57, saadia dhouib wrote:
> I am trying to applay a stereotype in a qvto transformation, but the
> the method applystereotype does not do anything.
>
> I am using 3.3.0 version of QVTO on Kepler:
> QVT Operational SDK 3.3.0.v20130521-0837
>
> This is the code of the transformation:
> modeltype UML uses uml('http://www.eclipse.org/uml2/4.0.0/UML');
>
> transformation MarteTransformation(in MarteProfile : UML, out model :
> UML);
>
> main() {
> var prof : Profile := MarteProfile.objectsOfType(Profile)![name =
> "GCM"];
> var stereo : Stereotype =
> MarteProfile.objectsOfType(Stereotype)![name = "FlowProperty"];
> log("profile: ", prof);
> log("stereo: ", stereo);
> assert fatal (prof = stereo.profile);
>
> var model : Model := object Model {name := 'model'};
> var cls : Class := object Class {name := 'class'};
> model.ownedType += cls;
> var prop : Property := object Port {name := 'prop'};
> log("list of applicable stereotype:");
> prop.getApplicableStereotypes()-> forEach(stereotype){
> log("applicable stereotype:", stereotype.name);
> };
> cls.ownedAttribute += prop;
>
> model.applyProfile(stereo.profile);
> prop.applyStereotype(stereo);
> log ("this is the applied stereotype:
> ",prop.getAppliedStereotype("FlowProperty"));
>
> }
>
>
>
> And this is the console displayed messages:
> profile: , data:
> mailto:org.eclipse.uml2.uml.internal.impl.ProfileImpl@1add57d9 (name:
> GCM, visibility: <unset>) (URI: null)
> stereo: , data:
> mailto:org.eclipse.uml2.uml.internal.impl.StereotypeImpl@7d0d936b
> (name: FlowProperty, visibility: <unset>) (isLeaf: false, isAbstract:
> false, isFinalSpecialization: false) (isActive: false)
> list of applicable stereotype:
> this is the applied stereotype:
>
|
|
|
|
Re: Problem with Stereotype application [message #1099854 is a reply to message #1099843] |
Mon, 02 September 2013 05:59  |
Eclipse User |
|
|
|
Hi
On 02/09/2013 10:44, saadia dhouib wrote:
> Caused by: java.lang.UnsupportedClassVersionError:
> org/eclipse/papyrus/MARTE/MARTE_DesignModel/GCM/GCMPackage :
> Unsupported major.minor version 51.0
I'm puzzled by the numbers but not by the error. You clearly have a
mismatch of installed versions.
Make sure you have done at least two clean and rebuild alls since your
last configuration change.
Make sure everything you use comes from the same Eclipse release cycle.
If using recent releases see if eliminating Java 5 from all class paths
helps.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.13535 seconds