Skip to main content



      Home
Home » Modeling » OCL » Unable to validate OCL
Unable to validate OCL [message #1591770] Thu, 29 January 2015 13:39 Go to next message
Eclipse UserFriend
Hi Group,

I have attached the model I am working with. I am unable to validate the OCL constraints defined in the profile when they are applied on UML Class diagram.

As defined in the model,
Stereotypes : ST1, ST2, ST3 - extend Metaclass Class - ST2 and ST3 are derived from ST1

Stereotypes : Link1, Link2, Link3- extend Metaclass Association - Link2 and Link3 are derived from Link1

I am have define the following OCL on Link1
self.base_Association.memberEnd.class->excluding(null)->exists(extension_ST1->selectByKind(profile::Master::Classes::ST3)<>null)

When I validate OCL (right click on the model, OCL->Validate).
Result - Validate Complete
Expected - Fail, as Link1 is applied between Stereotypes ST1

Please let me know where I am going wrong !

  • Attachment: TestOCL.rar
    (Size: 11.02KB, Downloaded 246 times)
Re: Unable to validate OCL [message #1592978 is a reply to message #1591770] Fri, 30 January 2015 05:40 Go to previous message
Eclipse UserFriend
Hi

Just attempting to validate your profile gives warnings that I have not
seen before, but I suspect they are to do with triple level nesting of
Profiles. Use of a Profile with warnings is unlikely to be successful.

None of your profiles have URIs. OCL uses the URIs as the preferred
basis for package merging and in current released code fails when a
parent Package has a null URI.

Regards

Ed Willink




On 29/01/2015 18:39, Rishi Kanth wrote:
> Hi Group,
>
> I have attached the model I am working with. I am unable to validate the OCL constraints defined in the profile when they are applied on UML Class diagram.
>
> As defined in the model,
> Stereotypes : ST1, ST2, ST3 - extend Metaclass Class - ST2 and ST3 are derived from ST1
>
> Stereotypes : Link1, Link2, Link3- extend Metaclass Association - Link2 and Link3 are derived from Link1
>
> I am have define the following OCL on Link1
>
> self.base_Association.memberEnd.class->excluding(null)->exists(extension_ST1->selectByKind(profile::Master::Classes::ST3)<>null)
>
> When I validate OCL (right click on the model, OCL->Validate).
> Result - Validate Complete
> Expected - Fail, as Link1 is applied between Stereotypes ST1
>
> Please let me know where I am going wrong !
>
>
Previous Topic:Reusing OCL in a profile
Next Topic:Enumeration Bug in OCL for profiles and inconsistency between Xtext OCL console and OCLs in a profil
Goto Forum:
  


Current Time: Wed Jul 23 15:58:42 EDT 2025

Powered by FUDForum. Page generated in 0.23124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top