Book a Demo

Author Topic: How to tell reflexive relation in shapescript  (Read 7261 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
How to tell reflexive relation in shapescript
« on: July 20, 2015, 10:15:09 am »
Over the decades, because EAUI places the labels in different positions depending on whether the relationship is reflexive (points to self) or not, I've tried to figure out how to be able to tell if a particular instance youare "shaping" is reflexive or not - all to no avail.

Is it possible?  If not, then surely a new connector property is needed.

TIA,
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: How to tell reflexive relation in shapescript
« Reply #1 on: July 20, 2015, 11:40:32 am »
If my memory serves me correctly...

There used to be an issue with shape scripted labels because reflexive connectors combined the top and bottom labels for each position. As you state, a shape script couldn't detect this and some information wouldn't be shown.

However, in response to bug reports (possibly yours) EA was changed so that if a shape script overrode any label, a reflexive connector would revert to drawing all six.

So, it shouldn't be necessary to do anything special for reflexive connectors now.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to tell reflexive relation in shapescript
« Reply #2 on: July 20, 2015, 03:40:23 pm »
Quote
If my memory serves me correctly...

There used to be an issue with shape scripted labels because reflexive connectors combined the top and bottom labels for each position. As you state, a shape script couldn't detect this and some information wouldn't be shown.

However, in response to bug reports (possibly yours) EA was changed so that if a shape script overrode any label, a reflexive connector would revert to drawing all six.

So, it shouldn't be necessary to do anything special for reflexive connectors now.
Thanks Simon,

but I'm  not clear on the meaning[/iof your response...  

I want to suppress the stereotype <middlebottomlabel> on non-reflexive and <middletoplabel> on reflexive.

How do I do that?  Your response (as I understand it) would imply all the labels would be visible on reflexive form.

Are you saying that I should suppress both the <middlebottomlabel> and <middletoplabel> and then print the stereotype in one or the other regardless?

Paolo
« Last Edit: July 20, 2015, 05:49:16 pm by PaoloFCantoni »
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: How to tell reflexive relation in shapescript
« Reply #3 on: July 20, 2015, 05:00:20 pm »
How about this?

If you want to suppress <middlebottomlabel> on non-reflexive, that's the same thing you want to suppress for reflexive.

On a related note, the best/recommended way to suppress a label is to define an empty shape.

Quote
shape middlebottomlabel
{
}

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to tell reflexive relation in shapescript
« Reply #4 on: July 20, 2015, 06:08:33 pm »
Quote
How about this?

If you want to suppress <middlebottomlabel> on non-reflexive, that's the same thing you want to suppress for reflexive.

On a related note, the best/recommended way to suppress a label is to define an empty shape.

Quote
shape middlebottomlabel
{
}
NO, I don't want to suppress the middle bottom label, I want to suppress (the visibility of) the stereotype name on (say) the association.  I can't just say stereotype.visible=false, I have to say suppress <middlebottomlabel> (for non-reflexive) and suppress <middletoplabel> for reflexive.

If I suppress <middlebottomlabel> only, both reflexive and non-reflexive stereotypes are suppressed.  However, if I suppress  <middletoplabel> only - which should be logically equivalent, the <middlebottomlabel> is still visible!  EAUI!

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: How to tell reflexive relation in shapescript
« Reply #5 on: July 21, 2015, 08:22:54 am »
Apply a stereotype called nostereotype to a reflexive and non-reflexive association. Go into the stereotype editor and apply the shape script I provided (nothing more, nothing less.)

Then come back here and tell me what happened to the stereotype label.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to tell reflexive relation in shapescript
« Reply #6 on: July 21, 2015, 09:02:55 am »
Quote
Apply a stereotype called nostereotype to a reflexive and non-reflexive association. Go into the stereotype editor and apply the shape script I provided (nothing more, nothing less.)

Then come back here and tell me what happened to the stereotype label.
My last post WAS the result of doing (the equivalent of) JUST that!  The only element in the shapescript was the
shape MiddleTop/BottomLabel  //Name changed as required
{
}

That's why I said what I said.  It's the result of empirical evidence.

FWIW, I'm running build 1215.

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: How to tell reflexive relation in shapescript
« Reply #7 on: July 21, 2015, 10:28:35 am »
Then define "the equivalent of". My post was the result of doing "exactly" that.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to tell reflexive relation in shapescript
« Reply #8 on: July 21, 2015, 02:47:52 pm »
Quote
Then define "the equivalent of". My post was the result of doing "exactly" that.
The name of the stereotype was "XXXX" not "nostereotype". I was using an Association.

My point is that setting the shape to MiddleBottomLabel does as you said.  However, setting it to MiddleTopLabel doesn't - and in my view they should be equivalent - since we're suppressing labels, not stereotypes.

Unless I've missed something.

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: How to tell reflexive relation in shapescript
« Reply #9 on: July 21, 2015, 04:47:53 pm »
Quote
However, setting it to MiddleTopLabel doesn't
There's the difference I was looking for. I didn't try suppressing the top because your example was suppressing the stereotype.

It doesn't appear to separate the two labels unless the bottom one is overridden. My personal opinion is that it's a bug, but it won't get any kind of priority for a proper investigation unless it's reported.
« Last Edit: July 21, 2015, 04:49:38 pm by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to tell reflexive relation in shapescript
« Reply #10 on: July 21, 2015, 05:38:44 pm »
Quote
Quote
However, setting it to MiddleTopLabel doesn't
There's the difference I was looking for. I didn't try suppressing the top because your example was suppressing the stereotype.

It doesn't appear to separate the two labels unless the bottom one is overridden. My personal opinion is that it's a bug, but it won't get any kind of priority for a proper investigation unless it's reported.
No Probs - at least we're getting the same behaviour.  Had me worried for a minute!

I'll report the bug in due course - it's not that pressing for me either at this point.

Thanks again for your assistance.

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