Book a Demo

Author Topic: Where does rectanglenotation property come from ??  (Read 6498 times)

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +8/-3
  • Am I supposed to say something here ... ?
    • View Profile
Where does rectanglenotation property come from ??
« on: May 29, 2018, 03:59:05 pm »
Ok - I can see shapescripts that use the rectanglenotation property to control appearance - hasproperty("rectanglenotation","0"))
But where is that property defined ... ?

There are some archimate shapes that support rectangle notation and some that don't, the ones that do presumably have this property and therefore get the "Use Rectangle Notation" menu option. But I can't find that property defined *anywhere*
- It doesn't show up in the Element Properties dialogue or pane
- I can't find it defined as an attribute or tagged value in the base class (eg Class, Activity)
- Some stereotypes which are based on Class have the property but others also based on Class don't (suggesting it is in the stereotype)
- But I can't find it defined as an attribute or tagged value in the Archimate 3 MDG stereotypes

So, does anyone know where this is defined? How I can add it to my shapes?

(and terminology - is there somewhere that clearly explains the difference between an element property, an element attribute and a tagged value they are used somewhat interchangable but are also very different things)

Thanks
Matthew James

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #1 on: May 29, 2018, 04:47:47 pm »
Ok - I can see shapescripts that use the rectanglenotation property to control appearance - hasproperty("rectanglenotation","0"))
But where is that property defined ... ?

There are some archimate shapes that support rectangle notation and some that don't, the ones that do presumably have this property and therefore get the "Use Rectangle Notation" menu option. But I can't find that property defined *anywhere*
- It doesn't show up in the Element Properties dialogue or pane
- I can't find it defined as an attribute or tagged value in the base class (eg Class, Activity)
- Some stereotypes which are based on Class have the property but others also based on Class don't (suggesting it is in the stereotype)
- But I can't find it defined as an attribute or tagged value in the Archimate 3 MDG stereotypes

So, does anyone know where this is defined? How I can add it to my shapes?

(and terminology - is there somewhere that clearly explains the difference between an element property, an element attribute and a tagged value they are used somewhat interchangeable but are also very different things)

Thanks
Matthew James
Psst...  Matthew,  It's a secret!  :) don't tell anyone! ;)

If your shapescript contains the test for rectangular notation
Code: [Select]
if(hasproperty("rectanglenotation","1")) //decoration only in Rectangular Form
, then the property is synthesised onto the context menu.  If you select/deselect the notation you will get an UCRect=0/1 entry in the t_diagramobjects.ObjectStyle column.

HTH,
Paolo

@qwerty - seems to be missing from your Inside EA book.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #2 on: May 29, 2018, 05:45:42 pm »
@qwerty - seems to be missing from your Inside EA book.
Well, it's in my Shapescript book :-)

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #3 on: May 30, 2018, 08:33:12 am »
@qwerty - seems to be missing from your Inside EA book.
Well, it's in my Shapescript book :-)

q.
Why would I look there?  ;)

@Matthew - get a copy!  (Of both books)

Paolo
PS: Still think there might be a reference to the value in the Inside EA book.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +8/-3
  • Am I supposed to say something here ... ?
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #4 on: May 30, 2018, 11:23:53 am »
If your shapescript contains the test for rectangular notation
Code: [Select]
if(hasproperty("rectanglenotation","1")) //decoration only in Rectangular Form
, then the property is synthesised onto the context menu.  If you select/deselect the notation you will get an UCRect=0/1 entry in the t_diagramobjects.ObjectStyle column.

 :o
... really ?

I did think of just trying to add the code to the shapescript to see what happened, then I talked myself out of it cos ... surely calling a method to test for the existence of a property on an element couldn't have the side effect of actually just 'magically' creating that property?  That would be madness (!)

Does this only work with "rectanglenotation", or is there a list of other magic properties? Where would I get such a list? (Shapescript book?)
Are these magic properties 'real' properties or do they only exist for the purposes of shapescripts? Are they materialised in the model? Can they be referenced from other scripts?

I kind of feel like of wandered into the Twilight ZoneTM somehow

Thanks

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #5 on: May 30, 2018, 11:36:26 am »
surely calling a method to test for the existence of a property on an element couldn't have the side effect of actually just 'magically' creating that property?  That would be madness (!)

It's more that the command "Use Rectangle Notation" is hidden if your shape script doesn't need or use it. That's not madness; that's just being considerate.
The Sparx Team
[email protected]

matthew.james

  • EA User
  • **
  • Posts: 155
  • Karma: +8/-3
  • Am I supposed to say something here ... ?
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #6 on: May 30, 2018, 02:42:39 pm »
It's more that the command "Use Rectangle Notation" is hidden if your shape script doesn't need or use it. That's not madness; that's just being considerate.

KP - my apologies if my use of language came across as harsh.

I do stand by my statement - in a general sense if calling a method to test for the existence of a property on an element did have the side effect of 'magically' creating that property, that would be madness (or at least very poor object and method design).

I was assuming that I had to add the property to enable this feature, but I had looked for the "rectanglenotation" property everywhere I could on base classes, stereotypes in attributes etc and couldn't find it so i didn't know where and how to add it.

However, in reading your comment, I suspect that I have made an invalid assumption. I suspect that this is a standard property on all elements, buried somewhere in the base classes but just not *visible* anywhere.  So I never needed to add it cause it was already there.  If that is correct then your comment on being considerate makes perfect sense - otherwise the option would always show but just not do anything most of the time (where not used in the shapescript).

In my defence, the above is not documented *anywhere* in the Sparx online material (or if it is it's so well hidden that the might of Google failed to find it), and the shapescript method is called *has*property() which strongly implies a test of existence of a property as opposed to (for example) getproperty().

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #7 on: May 30, 2018, 04:38:55 pm »
I do stand by my statement - in a general sense if calling a method to test for the existence of a property on an element did have the side effect of 'magically' creating that property, that would be madness (or at least very poor object and method design).
My madness radar is probably broken, but sounds to me like C++ array access operator overloading to define a map.

The following usually inserts an empty/default value into map and then returns it.
Code: [Select]
value = map["my key"];
However, in reading your comment, I suspect that I have made an invalid assumption. I suspect that this is a standard property on all elements, buried somewhere in the base classes but just not *visible* anywhere.

That's pretty much it. It's set in the Style field of any diagram object. Checking rectanglenotation in your shape script indicates to EA that the shape script does define a rectangle notation, so EA can provide the option to the user. Scripts that don't check it, can't have defined the two notations so the option shouldn't be displayed to the user.

However, I agree that the documentation is a bit sparse. The fact that the property exists could certainly be expanded to explain how it is used, or even with an example script.
« Last Edit: May 30, 2018, 04:45:11 pm by Simon M »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Where does rectanglenotation property come from ??
« Reply #8 on: May 30, 2018, 05:34:51 pm »
PS: Still think there might be a reference to the value in the Inside EA book.

I'll have a look...

q.