Book a Demo

Author Topic: Show Arc Label not working (for Associations)  (Read 4397 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Show Arc Label not working (for Associations)
« on: April 06, 2020, 11:54:11 am »
We have a shapescript that is applied to Association based metatypes (Association, Aggregation, Composition etc.)  It manages the "Crow's feet" rendering.  When a standard multiplicity is specified, the crow's foot only is displayed and the appropriate label is suppressed (LeftBottomLabel or RightBottomLabel - depending on origin or destination).  If a non-standard multiplicity is defined (such as 2..*), a special symbol is displayed and the appropriate label is shown.

Or, at least until this weekend, it was.  I noticed that the label wasn't being shown (even though the checkbox was marked as "visible" in the Label Visibility dialog).  I was going to ask if anybody else had seen this, but as I was typing this, and trying to find the name of the dialog, I noticed on this local machine, it was working!  Now that I have a "compare and contrast" situation, I was able to ascertain what was causing this difference.

If the Connector type for the diagram is set to [UML 2.1] then the labels are shown, if it is either of the other two (IE or IDEF1X) they aren't!  I can see why for non-shapescripted metatypes, this should be the default setting, but it seems to me that if I have a shapescript, I'm telling EA what I want to be displayed - and it is overruling me!

Should I report a bug?

Thoughts?
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Show Arc Label not working (for Associations)
« Reply #1 on: April 06, 2020, 12:12:10 pm »
If the Connector type for the diagram is set to [UML 2.1] then the labels are shown, if it is either of the other two (IE or IDEF1X) they aren't!  I can see why for non-shapescripted metatypes, this should be the default setting, but it seems to me that if I have a shapescript, I'm telling EA what I want to be displayed - and it is overruling me!
There are shape scripts being applied automatically when you use those alternate notations. Those shape scripts override the relevant label scripts to specify an empty value (which has long been the recommended way of hiding labels).

I haven't tried your situation, but I'm guessing your shape script is being run for the connector, but not the labels. As a result your code to show the label is showing an empty label.

Edit: The fact that the default label becomes empty is probably the only relevant thing here. The fact that there is a shape script shouldn't and probably isn't a factor.
« Last Edit: April 06, 2020, 01:10:45 pm by Eve »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Show Arc Label not working (for Associations)
« Reply #2 on: April 06, 2020, 03:15:32 pm »
Thanks, Eve,
If the Connector type for the diagram is set to [UML 2.1] then the labels are shown. If it is either of the other two (IE or IDEF1X) they aren't!  I can see why for non-shapescripted metatypes, this should be the default setting, but it seems to me that if I have a shapescript, I'm telling EA what I want to be displayed - and it is overruling me!
There are shape scripts being applied automatically when you use those alternate notations. Those shape scripts override the relevant label scripts to specify an empty value (which has long been the recommended way of hiding labels).
But my scripts are older!  ;)
Still, I'll see about converting them at an appropriate point.  In the meantime, I'll be aware of that.
Quote
I haven't tried your situation, but I'm guessing your shape script is being run for the connector, but not the labels. As a result, your code to show the label is showing an empty label.

Edit: The fact that the default label becomes empty is probably the only relevant thing here. The fact that there is a shape script shouldn't and probably isn't a factor.
Does that imply that if I change to specifying the contents of the label I'll get a different result?

So the question, as far as I can see, is whether a user shapescript should overrun a default diagram one.  My personal view is that it should.

Does this still indicate a defect that warrants a bug report?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Show Arc Label not working (for Associations)
« Reply #3 on: April 06, 2020, 04:48:04 pm »
So the question, as far as I can see, is whether a user shapescript should overrun a default diagram one.  My personal view is that it should.

Does this still indicate a defect that warrants a bug report?
Given your complaint isn't that shape scripts don't work at all if you apply those notations I assume that your shape script already is overriding the default one. You haven't overridden the label text, so you're still getting the normal label text for those labels. It just happens that the normal text is different depending on what connector notation you are using.

From your description I would say it's working correctly.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Show Arc Label not working (for Associations)
« Reply #4 on: April 07, 2020, 08:05:02 am »
So the question, as far as I can see, is whether a user shapescript should overrun a default diagram one.  My personal view is that it should.

Does this still indicate a defect that warrants a bug report?
Given your complaint isn't that shape scripts don't work at all if you apply those notations I assume that your shape script already is overriding the default one. You haven't overridden the label text, so you're still getting the normal label text for those labels. It just happens that the normal text is different depending on what connector notation you are using.

From your description, I would say it's working correctly.
Accepted.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!