Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Invariant disallowing element usage
Invariant disallowing element usage [message #22140] Wed, 09 May 2007 12:15 Go to next message
Florian Georg is currently offline Florian GeorgFriend
Messages: 27
Registered: July 2009
Junior Member
Hi,

I want to write an OCL constraint that validates an Activity and
disallows "ForkNode" instances (e.g. no parallelism is allowed).

Basically I don't know how to "filter" a collection (e.g.
self.ownedMember) based on some criteria - type in this case.

Any ideas? Thanks for your help in advance,

regards,
Florian
Re: Invariant disallowing element usage [message #22306 is a reply to message #22140] Wed, 09 May 2007 12:38 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Florian,

You could try something like this:

context Activity
inv: self.node->forAll(not oclIsKindOf(ForkNode))

or, more in the style of filtering:

context Activity
inv: self.node->select(oclIsKindOf(ForkNode))->isEmpty()

HTH,

Christian


Florian Georg wrote:

> Hi,
>
> I want to write an OCL constraint that validates an Activity and
> disallows "ForkNode" instances (e.g. no parallelism is allowed).
>
> Basically I don't know how to "filter" a collection (e.g.
> self.ownedMember) based on some criteria - type in this case.
>
> Any ideas? Thanks for your help in advance,
>
> regards,
> Florian
Previous Topic:Re: integrating ocl with emf
Next Topic:three entries so far, and growing
Goto Forum:
  


Current Time: Mon Jul 29 20:50:28 GMT 2024

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

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

Back to the top