|Re: OCL related query [message #523667 is a reply to message #523267]
||Sun, 28 March 2010 08:26
| Ed Willink
Registered: July 2009
The paper you refer to is very old. Internally it refers to [OMG1997]
for OCL 1.1 and inaccurately using the same reference to an unspecified
version of UML.
Eclipse tools provide only accidental support for OCL 1.x or UML 1.x.
OCL 2.0 was a major revision.
There is no IsRoot() or isRoot() method in UML 2.x. You could define
an IsRoot query to access the parent/child properties appropriately.
The operation context preamble: "Class::DIT():Integer" is syntactically
incorrect for an OCL 2.x document. I would expect to see
The expression is a post-condition, which MDT/OCL will only check for
syntactic accuracy. The expression appears to be executable and so could
be changed to a body.
iterate() should not present problems. I suspect that you are being
misled by other issues.
You need to revise the paper's examples to accommodate language
evolution, perhaps building up from simpler queries as you gain
confidence in the languages and tooling.
On 25/03/2010 17:31, arise76 wrote:
> I am trying to run following query on OCL Interpreter Console basically
> it tries to calculate Depth of Inheritance tree. From the theoritical
> part it looks fine, I need to define this query for my work, but it is
> hard to redefine it on UML metamodel , and on M2 layer. I do not find
> iterate(), isRoot() in the current specifications. I will be very
> gratefull if some body share his thougts to run it on eclipse OCL
> interpreter console or any other method to find DIT on OCL interpreter.
> The source of this query is the following paper:
> source:http://ctp.di.fct.unl.pt/QUASAR/Resources/Papers/2002 /QUAOOSE2002FinalAline.pdf
> Class::DIT():Integer post: result = (if self.IsRoot() then 0 else 1 +
> self.Parents()->iterate(elem:Class; acc:Integer=0 | if elem.DIT() > acc
> then elem.DIT() else acc endif) endif)
> Thanks in advance,
Powered by FUDForum
. Page generated in 0.22094 seconds