[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] Re: How to check the types of containment?

Sorry Christian,
I don't understand what you mean.
> Update the interpreter example code to set the "implicit root class"
> parser option to EcorePackage.Literals.EObject in the initialization of
> the M1 environment.  This is required to access the EObject features in
> models that do not explicitly extend EObject.
I meant that I found the posted link and wanted to create some ocl
expressions with at least a little kind of editor. I don't use the
example described in the link. What is the "implicit root class" parser
option? I have a meta model based on ecore. What do I have to change
that I can invent some ocl expressions?
Another question: Under [1] I found in the last snippet the following line:

self.allOwnedElements()

But allOwnedElements() can't be found here. Is this an old snippet? I
want to check if all referenced events of a model element are contained
in its own hierarchy are and not events of model elements outside its
own hierarchy. That means the referenced events mustn't be events of
sibling model elements. So I tried to do something like this:

self.exportedEvents ->forAll(ev| 	
	self.allOwnedElements()
	->select(x|
	x.oclIsTypeOf(MyMetaModel::Event))
	->includes(ev)
)

Sorry for the annoying questions but for a novice it's just an ocl
jungle. A central documentation with what is possible in MDT OCL and how
would be nice. Hope you can help.

best regards,
Gilbert

[http://wiki.eclipse.org/OCLSnippets#Finding_all_classifiers_that_specialize_an_arbitrary_classifier_named_.27foo::Bar.27]