Book a Demo

Author Topic: OCL constraints in class diagrams  (Read 2668 times)

rastoml

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
OCL constraints in class diagrams
« on: March 20, 2006, 09:05:55 am »
Hi,

I would like to know, why OCL constraints in newest version of EA arent working. (at least those in my example below)
First of all, I have OCL conformance checked, so it's not about that.
So, if i have 2 classes, A and B, with an association between them, and the class A has an attribute i: int = 10 (initial value set to 10). If I have constraint on class A, something like: "inv: self.i > 0", then the validation shows no warnings, which is ok and when the constraint is: "inv: self.i > 10", it shows a warning and this constraint being violated. So far so good.
But! When I try this simpliest type of constraint on other types, like string or boolean, it doesn't work. When I try to navigate from class B to class A and to the attribute i, with the same constraint (on class B): "inv: self.a.i > 0", it shows warning, but it shouldn't. I didn't try much more, but I also found, that EA seems not to know operations defined in OCL specification, for instance size() operation on string.
So please, if anybody knows, where the problem is, I'd be grateful. Any help appreciated!

R.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: OCL constraints in class diagrams
« Reply #1 on: March 20, 2006, 10:46:04 am »

OCL bug related with an incorrect initial value validation was reported several weeks ago (before 788 build) - till now, it still persists

I think, that I and others hoped too much of the EA OCL validation capabilities. Maybe in EA 6.5 or 7.0 this gonna change ;-)
registertm everything to SparX