|
|
|
Re: OCL Parser Problem [message #69397 is a reply to message #69359] |
Mon, 30 March 2009 21:01 |
Adolfo Sanchez-Barbudo Herrera Messages: 260 Registered: July 2009 |
Senior Member |
|
|
Hi Marcellus,
The problem you mention is that you haven't specified the type of the
Set. When you don't know the type or you don't want a Set of a specific
type, you can define 'Set(OclAny)', however, you will problem have more
problems in the inner expression.
I'm not quite sure what are you trying to do....because it seems that
you want access to your metamodel inside of your model constraints....If
you want add an invariant to check that a model element is an instance
of some metaclass, what about doing the following ?
context Element inv:
self.oclIsKindOf(StructuralElement) or
self.oclIsKindOf(StructuralBehavioralElement) or
self.oclIsKindOf(ConstraintElement) or
self.oclIsKindOf(BehavioralElement)
Cheers,
Adolfo.
Marcellus Castro escribió:
> The expression is:
>
> context Element
> inv:letkindAllowed:Set = Set{StructuralElement,StructuralBehavioralElement
> ConstraintElement, BehavioralElement}
> in(kindAllowed->exists(e:Element | self.oclIsKindOf(e))
>
> In my metamodel I have a metaclass Element with 4 submetaclasses:
> StructuralElement,StructuralBehavioralElement, ConstraintElement and
> BehavioralElement.
>
> When I try to parse the expression the parser says that token "Set" is
> invalid.
> Why this is happening?
>
> thx
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03744 seconds