Home » Modeling » OCL » OCL queries on UML / M1 level
OCL queries on UML / M1 level [message #33838] |
Tue, 24 July 2007 12:47 |
Eclipse User |
|
|
|
Originally posted by: wah.zurich.ibm.com
Hi,
I have written a little UML model and created one instance of it using
InstanceSpecifications. Using the OCL interpreter, I have performed some
M2 level queries. For instance, evaluating `self' on one of my instance
specification results in
Instance Specification c1
However, evaluating 'self' as M1 level expression on the same instance
specification does not return a result (the expected result would be
`Class1 c1', since Class1 is the classifier specified for c1).
Am I doing the right thing? How would I get the expected result?
Thanks,
Michael
|
|
|
Re: OCL queries on UML / M1 level [message #33869 is a reply to message #33838] |
Tue, 24 July 2007 14:35 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Michael,
At the M1 level, you would expect the same result as M2, because the
evaluation of M1 expressions on instance models treats the instance
specification as "self" and its Slots as the values of its classifier's
properties. Evaluating "self" definitely should not return null.
There are, currently, some problems in working with ValueSpecifications and
InstanceSpecifications, where the UML environment gets confused between
M-levels. See, for example,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194390
Probably, in the next release, the UML environment API will have to make a
more definitive distinction between whether it is working on M2 or M1
level.
Cheers,
Christian
Michael Wahler wrote:
> Hi,
>
> I have written a little UML model and created one instance of it using
> InstanceSpecifications. Using the OCL interpreter, I have performed some
> M2 level queries. For instance, evaluating `self' on one of my instance
> specification results in
>
> Instance Specification c1
>
> However, evaluating 'self' as M1 level expression on the same instance
> specification does not return a result (the expected result would be
> `Class1 c1', since Class1 is the classifier specified for c1).
>
> Am I doing the right thing? How would I get the expected result?
>
> Thanks,
>
> Michael
|
|
|
Re: OCL queries on UML / M1 level [message #34256 is a reply to message #33869] |
Thu, 26 July 2007 15:57 |
Eclipse User |
|
|
|
Originally posted by: wah.zurich.ibm.com
Hi Christian,
thanks for your reply.
Just to make sure I have understood you correctly: once the bugs you
mentioned are fixed, will the result of my M1 level query be "Class c1"
instead of "Instance Specification c1"?
Michael
Christian W. Damus wrote:
> Hi, Michael,
>
> At the M1 level, you would expect the same result as M2, because the
> evaluation of M1 expressions on instance models treats the instance
> specification as "self" and its Slots as the values of its classifier's
> properties. Evaluating "self" definitely should not return null.
>
> There are, currently, some problems in working with ValueSpecifications and
> InstanceSpecifications, where the UML environment gets confused between
> M-levels. See, for example,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=194390
>
> Probably, in the next release, the UML environment API will have to make a
> more definitive distinction between whether it is working on M2 or M1
> level.
>
> Cheers,
>
> Christian
>
>
> Michael Wahler wrote:
>
>> Hi,
>>
>> I have written a little UML model and created one instance of it using
>> InstanceSpecifications. Using the OCL interpreter, I have performed some
>> M2 level queries. For instance, evaluating `self' on one of my instance
>> specification results in
>>
>> Instance Specification c1
>>
>> However, evaluating 'self' as M1 level expression on the same instance
>> specification does not return a result (the expected result would be
>> `Class1 c1', since Class1 is the classifier specified for c1).
>>
>> Am I doing the right thing? How would I get the expected result?
>>
>> Thanks,
>>
>> Michael
>
|
|
|
Re: OCL queries on UML / M1 level [message #34290 is a reply to message #34256] |
Thu, 26 July 2007 18:23 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Michael,
The result of
self
should look like
Instance Specification c1
which is what the UML2 label provider produces for the label of an
InstanceSpecification.
To get "Class1 c1", you would need to override this default label provider
implementation. That could be done in the console example, but it's just
an example.
I misunderstood your question, before, as asking whether the result should
be "Class Class1", which had me confused because that would be very odd
(being the *type* of "self"). Sorry about that.
Cheers,
Christian
Michael Wahler wrote:
> Hi Christian,
>
> thanks for your reply.
>
> Just to make sure I have understood you correctly: once the bugs you
> mentioned are fixed, will the result of my M1 level query be "Class c1"
> instead of "Instance Specification c1"?
>
> Michael
>
<snip>
|
|
|
Goto Forum:
Current Time: Thu Apr 25 17:24:48 GMT 2024
Powered by FUDForum. Page generated in 0.03881 seconds
|