Query for not all elements of a model [message #486205] |
Wed, 16 September 2009 18:00 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hello,
my meta model defines a composition model which can contain normal
components containing events. Besides normal components it can contain
composite components which also can contain events. Now I have another
model element (ReferenceEventElement) which has to reference events. But
it mustn't reference those events which are contained in a composite
component. Is this query correct?
context ReferenceEventElement:
inv: self.event ->forAll(ev|
not MyMetaModel::CompositeComponent.allInstances()->forAll(comp|
comp.eContents()->select(tempEv|
tempEv.oclIsTypeOf(MyMetaModel::Event))-> includes(ev)
)
)
Or is there a better solution?
|
|
|
Re: Query for not all elements of a model [message #486207 is a reply to message #486205] |
Wed, 16 September 2009 18:12 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Besides this I want to check some more precisely that not only the
events are not contained in a composite component but also are of
special type. Therefore this expression with a let statement.
let contextEvents: Set(CRUISeMetaModel::Event) =
MyMetaModel::ContextComponent.allInstances().event->union(contextEvents)
in
self.event ->forAll(ev|
not MyMetaModel::CompositeComponent.allInstances()->forAll(comp|
comp.eContents()->select(tempEv|
tempEv.oclIsTypeOf(MyMetaModel::Event))-> includes(ev)
)
and
contextEvents->includes(ev)
)
But I get the result "Unrecognized variable: (contextEvents)". Is the
let statement wrong?
|
|
|
|
Re: Query for not all elements of a model [message #486331 is a reply to message #486240] |
Thu, 17 September 2009 09:51 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Ed,
> You need to identify the version of MDT-OCL that you are using and
> if 1.2 or 1.3 submit a Bugzilla containing your models.
I have two plugins (org.eclipse.emf.ocl, org.eclipse.emf.ocl.doc) in
version 1.1.* and all the other ocl plugins in version 1.3.*:
org.eclipse.ocl.doc
org.eclipse.emf.ocl.examples
org.eclipse.emf.ocl.examples.interpreter
org.eclipse.ocl
org.eclipse.ocl.ecore
org.eclipse.ocl.uml
I just just the Galileo Modeling Edition. Why are the versions mixed?
|
|
|
Powered by
FUDForum. Page generated in 0.01946 seconds