Book a Demo

Author Topic: Display OCL constraint instead of constraint name  (Read 3119 times)

Michael Lutz

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Display OCL constraint instead of constraint name
« on: June 27, 2008, 10:48:51 pm »
When adding an OCL constraint for a class (in the constraint tab), only the name of the constraint is displayed in a class diagram. Is there a way to display the constraint "value" (i.e. the OCL expression) instead?

On a related note, is there a way to connect the "note" representation of a constraint with a constraint defined on a class?

Cheers,
Michael

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Display OCL constraint instead of constraint n
« Reply #1 on: June 28, 2008, 06:39:21 am »
Hi Michael,

You can sort of do both...

That is, you can solve your first problem, but only by doing what you ask for in the second question.

Loop up Note | Link to element feature in the EA help. That should get you going.

David
No, you can't have it!

Michael Lutz

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Display OCL constraint instead of constraint n
« Reply #2 on: June 30, 2008, 10:22:05 pm »
Thanks a lot! That did the trick.  :)

For others having the same question, here's the help topic:

Help Topic: Link a Note to Internal Documentation
(...)

Procedure

To link a Note element to a feature of another design element, follow the steps below:

1. Insert the target element into a diagram.

2. Drag the Note icon from the Common page of the Toolbox onto the diagram, next to the target element.

The Notes dialog displays. Do not type any text, just click on the OK button.

3. Click on the Note Link icon from the Common page of the Toolbox, click on the Note, and drag across to the target element to create the connector.

4. Right-click on the Note Link to display the context menu.

5. Select the Link this Note to an Element Feature menu option. The Link note to element feature dialog displays.

Michael Lutz

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Display OCL constraint instead of constraint n
« Reply #3 on: June 30, 2008, 10:47:05 pm »
Now I tried to use the same for visualising a constraint on an association. And that doesn't seem to work. I can attach a note to the association (using "Attach Note or Constraint" in the context menu), but then I cannot select the note link or access its context menu. This seems very strange (and inconsistent).

Is there a trick to do this?

Cheers,
Michael

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Display OCL constraint instead of constraint n
« Reply #4 on: June 30, 2008, 10:50:27 pm »
There was a recent discussion on a 'missing' ability to attach feature notes to some link types, primarily (or perhaps only) relating to constraints.

You can search this out in the forum - go back a couple of months - if you like. I think Sparx was going to resolve some of these, but I cannot remember if they had a time frame in mind.

David
No, you can't have it!