Your expertise has now reached the point where the OCL specification,
and consequently Eclipse OCL is broken.
The status of OclType, OclElement and OclAny::oclType have varied from
version to version as each inadequacy is revealed.
The ability to use types as Literal expressions is missing from the
OCL specification, even though there are many oclAsType(xx) expressions
in which xx is clearly a type literal. OCL 2.3 defines a TypeLiteralExp
to resolve this.
I anticipate that OMG OCL 2.4 and Eclipse OCL 3.1 Examples will finally
endorse what you are trying to do by defining a uniform ability to
I'm afraid that doesn't help you today.
On 19/12/2010 06:27, glenviewjeff wrote:
> I'm guessing I'm making a simple mistake but can't figure out how to
> pass an OclType as parameter to a query.
> This works:
> [query public test() : Boolean =
> aThing.widgets->exists(oclIsTypeOf(ConcreteType)) /]
> But passing it as a parameter doesn't:
> [query public test(aType : OclType ) : Boolean =
> aThing.widgets->exists(oclIsTypeOf(aType)) /]
> I'd appreciate help very much. Thanks!
Thanks so much Ed for the quick response and detailed explanation. I found it more than a bit funny that you mentioned that "at this level of expertise," as I only started reading the OCL specification for the first time for about 10 minutes last night to try to get the syntax right.
I have had a pretty good experience so far with the Eclipse/Acceleo/MTL path, but I had heard several somewhat negative remarks on the OMG's output on Software Engineering Radio. I wonder if this one of those sources of criticism.
I'll keep working on this path until I find that it becomes objectionable enough to switch or the language is fixed.