Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Unable to validate OCL
Unable to validate OCL [message #1591770] Thu, 29 January 2015 18:39 Go to next message
Rishi Kanth is currently offline Rishi KanthFriend
Messages: 18
Registered: October 2014
Junior Member
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 139 times)
Re: Unable to validate OCL [message #1592978 is a reply to message #1591770] Fri, 30 January 2015 10:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5438
Registered: July 2009
Senior Member
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: Mon Oct 23 22:40:09 GMT 2017

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

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