Papyrus 1.12: Does OCL validation on models really work? [message #601974] |
Tue, 11 May 2010 18:19  |
Eclipse User |
|
|
|
Hi,
I have downloaded and installed Papyrus 1.12. I am following the OCL constraint tutorial, and I can not validate my stereotypes against OCL constraints I have defined. It says validation succesful even when that is not the case. Does not matter in what context the classifier is, be it M1 or M2. It's as if the validation is not performed at all. What happened? Why it not workiing? Plan to updat 1.12 to a working one? Or do we need to wait for version 2 of the tool?
By the way, how did you solve the issue of which classifier (stereotype vs stereotype meta-class) to use in the context when validating against OCL constraints?
Thanks in advance.
|
|
|
|
Re: Papyrus 1.12: Does OCL validation on models really work? [message #601983 is a reply to message #601977] |
Wed, 12 May 2010 06:02   |
Eclipse User |
|
|
|
Hi Rafael,
Thanks a lot for the information! Now everything makes sense! That other project looked abandoned considering documents did not align with what the product offered and no word about progress.
I believe I am more interested in the Papyrus MDT component, and I have taken a look at the source code, in particular OCL validation. If it is ok, I want to ask a question regarding it.
I have read and tried that piece od code, and there is one issue that is confusing me. In order to validate against an OCL constraint, you need to set the classifier context and then do the validation. In the code, the validation is allways done on M1 level it seems. If the OCL constraint as a method (example self.allOwnedElements()) or attribute defined in the UML meta model, then the context is on M2. With the current code, you'll get an exception if you try to do validate against such a constraint. An easy but maybe not elegant solution is to first try to create the invariant on M1 level, if fails, try in M2 level. How are you solving this issue? i.e. how to know in what context the constraint is defined in.
Thanks in advance!
|
|
|
Re: Papyrus 1.12: Does OCL validation on models really work? [message #602123 is a reply to message #601983] |
Fri, 25 June 2010 08:46  |
Eclipse User |
|
|
|
Hi Shaman
I'm not familiar with Papyrus; I first downloaded it an hour ago. But I
am very interested in smoothing off the rough edges that make use of OCL
much harder than it should be.
It would be very helpful to see how you are trying to use Papyrus and to
have a newbie-oriented description of the problems you are encountering.
Regards
Ed Willink (MDT/OCL committer)
On 12/05/2010 11:02, Shaman_Mahmoudi wrote:
> Hi Rafael,
>
> Thanks a lot for the information! Now everything makes sense! That other
> project looked abandoned considering documents did not align with what
> the product offered and no word about progress.
>
> I believe I am more interested in the Papyrus MDT component, and I have
> taken a look at the source code, in particular OCL validation. If it is
> ok, I want to ask a question regarding it.
>
> I have read and tried that piece od code, and there is one issue that is
> confusing me. In order to validate against an OCL constraint, you need
> to set the classifier context and then do the validation. In the code,
> the validation is allways done on M1 level it seems. If the OCL
> constraint as a method (example self.allOwnedElements()) or attribute
> defined in the UML meta model, then the context is on M2. With the
> current code, you'll get an exception if you try to do validate against
> such a constraint. An easy but maybe not elegant solution is to first
> try to create the invariant on M1 level, if fails, try in M2 level. How
> are you solving this issue? i.e. how to know in what context the
> constraint is defined in.
>
> Thanks in advance!
|
|
|
Powered by
FUDForum. Page generated in 0.04577 seconds