[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] Re: Query for not all elements of a model

Hi Gilbert

There were some problems with 'let' precedence that have been fixed in MDT-OCL 1.2.0. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=182201).

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.

---

As a general rule, you should try hard to write OCL that does not use allInstances.

	Regards

		Ed Willink

Gilbert Mirenque wrote:
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?