Writing ocl for Metaclass association [message #1001501] |
Wed, 16 January 2013 15:49  |
Eclipse User |
|
|
|
Hi,
I am creating a profile, and my profile has three stereotypes. FR, NFR and Relation. FR and NFR are the extension of metaclass Class and Relation is the extension of metaclass Association. How can i define OCL constraints that says the Relation must be between FR and NFR? (each instance of FR is in relation with 0..* instance(s)of NFR.
Thanks
|
|
|
|
|
|
|
Re: Writing ocl for Metaclass association [message #1430776 is a reply to message #1006337] |
Wed, 24 September 2014 16:10   |
Eclipse User |
|
|
|
Dear Ed,
I also have a similar metamodel and want to specify the member ends for an association metaclass. I am using Papyrus to create my profile. I have used these two constraints:
1- self.base_association.memberEnd->exists(getStereotypeApplication(FR) <> null)
in this case, it gives an error for getSetreotypeApplication as an unresolved operation.
2- I also tried the one in the attached file:
self.base_Association.memberEnd.class->exists(extionsion_NFR <> null)
this one does not check when if one of the member ends is not NFR.
I have another question. In the Papyrus, I noticed that there, I can createassociations between the stereotypes. just like the metamodel of UML that between the metaclass Association and metaclass Property there is an association which specify propery as member end.
I was thinking in this case, we may do the similar thing to specify member ends. we can create association between metaclass Association "HasNFR" and metaclass Class "NFR", and also another association between "HasNFR" and "FR".
I am not sure if this is a correct idea. However, In this case, It didn't check the violation too.
Thanks,
Mahin
|
|
|
Re: Writing ocl for Metaclass association [message #1431165 is a reply to message #1430776] |
Thu, 25 September 2014 05:36  |
Eclipse User |
|
|
|
Hi
See comments and debugged example in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=398333
Regards
Ed Willink
On 24/09/2014 21:10, Mahin Abbasipour wrote:
> Dear Ed,
>
> I also have a similar metamodel and want to specify the member ends for
> an association metaclass. I am using Papyrus to create my profile. I
> have used these two constraints:
> 1- self.base_association.memberEnd->exists(getStereotypeApplication(FR)
> <> null)
> in this case, it gives an error for getSetreotypeApplication as an
> unresolved operation.
>
> 2- I also tried the one in the attached file:
> self.base_Association.memberEnd.class->exists(extionsion_NFR <> null)
> this one does not check when if one of the member ends is not NFR.
>
> I have another question. In the Papyrus, I noticed that there, I can
> createassociations between the stereotypes. just like the metamodel of
> UML that between the metaclass Association and metaclass Property there
> is an association which specify propery as member end. I was thinking in
> this case, we may do the similar thing to specify member ends. we can
> create association between metaclass Association "HasNFR" and metaclass
> Class "NFR", and also another association between "HasNFR" and "FR". I
> am not sure if this is a correct idea. However, In this case, It didn't
> check the violation too.
>
> Thanks,
> Mahin
|
|
|
Powered by
FUDForum. Page generated in 0.04623 seconds