Invariant disallowing element usage [message #22140] |
Wed, 09 May 2007 08:15  |
Eclipse User |
|
|
|
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 08:38  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02951 seconds