Author Topic: Requirement element - shape script  (Read 5544 times)

L.Krobot

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Requirement element - shape script
« on: August 04, 2015, 11:43:09 pm »
Hi,
does anyone have the shapescript for "Requirement" element ?
or, does anyone have shapecripts for: displaying Notes and Parent Package in the same way as EA is doing for the Requirement element ?
thx

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Requirement element - shape script
« Reply #1 on: August 05, 2015, 08:07:24 am »
The EA requirement is native. It does not use any shape script.

Actually I don't know what you're after. Can you post a picture?

q.
« Last Edit: August 05, 2015, 08:08:17 am by qwerty »

L.Krobot

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Requirement element - shape script
« Reply #2 on: August 05, 2015, 05:55:14 pm »

Hi querty,
here is the image (second shape) ...



basically, i'd like to create my own shape that has the same (similar) behavior as "Requirement" element ...
- be able to show/hide Notes (including formating and autosizing of the shape)
- be able to show the parent package (namespace) in the case that element is not in the same package as diagram

thx & rgrds,
ljk

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Requirement element - shape script
« Reply #3 on: August 05, 2015, 07:31:20 pm »
I just see the notes compartment which can be turned on in the diagram/Elements properties page. The name space can also be turned on in the diagram/General settings.

If you want to mimic the layout note that shape script does not allow to draw fixed size elements. The stripe at the left will always resize with the whole shape unlike Requirements where they are fixed in size.

q.
« Last Edit: August 05, 2015, 07:32:20 pm by qwerty »

L.Krobot

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Requirement element - shape script
« Reply #4 on: August 05, 2015, 07:44:31 pm »
thx querty,

the real reason why we need this, is that we are developing MDG technology that will extend Archimate,
and we need to create (extend, modify) standard Archimate element shapes in order to mimic the "Requirement" element (shape) behavior ...

BUT, with Archimate (or any shape that we would like to create) this is simple not possible (at least we do not know how, we was not able to do this with any script that we try to develop);

even more, i.e. if you take the original Archimate "Business Process" element, and you want to show Notes or Namespace on any diagram, this does not work !

so, our idea was to take "Requirement" element (shape) and replicate its behavior (shapescript) to either our MDG elements or directly to the Archimate elements ...

any idea (maybe shape script example) on how to achieve this ?

thx & rgrds,
ljk

L.Krobot

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Requirement element - shape script
« Reply #5 on: August 05, 2015, 07:54:55 pm »
basically, once you add shapescript to an element and you do not call  DrawNativeShape(), and you cannot do this if you need your own shape, the original behavior (Notes & Namespace) is lost ...

we would like keep this behavior (get it back or replicate in some way), as we need it, as well as we need also different shape, but we do not know how to do this ...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Requirement element - shape script
« Reply #6 on: August 05, 2015, 08:16:36 pm »
The notes can be printed with PrintWrapped("#NOTES#"). I don't know of a direct method to retrieve the name space. Likely you have to write an add-in so you can retrieve it like Print("#addin:myAddIn,param#").

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Requirement element - shape script
« Reply #7 on: August 06, 2015, 01:52:52 am »
You can reverse engineer the shape script from the mdg technology file.
It is stored as a zipped, base64 encoded string.

Decode and unzip and you have the shape script in clear text.

Geert

L.Krobot

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Requirement element - shape script
« Reply #8 on: August 06, 2015, 03:44:03 am »
Hi Geert,
I did this with Archimate and basically with all MDGs that I have found in "C:\Program Files (x86)\Sparx Systems\EA\MDGTechnologies" directory, but unfortunately I did not find anything that has the behavior we need.
the suggestion from querty (addins) would work, but we cannot use it, as many people are using only viewer, and we want to deploy only MDG inside of the model (without the need for any addin).
btw, we'll try to find something different or survive without ...
rgrds,
ljk

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Requirement element - shape script
« Reply #9 on: August 06, 2015, 10:03:57 am »
Quote
thx querty,

the real reason why we need this, is that we are developing MDG technology that will extend Archimate,
and we need to create (extend, modify) standard Archimate element shapes in order to mimic the "Requirement" element (shape) behavior
 [size=14][SNIP][/size]
thx & rgrds,
ljk
Hi ljk,

We are doing something very similar (extending ArchiMate).  I can't see the diagram you posted, so I'm "flying blind", but from your discussion you seem to want to mimic the Sparx Requirement element.  Out of curiosity, why aren't you using the ArchiMate Requirement shape from ArchiMate 2 - Motivational Aspect?

We will be shortly expanding the Requirement methodology - using the ArchiMate Requirement shape.  As you've found, you can use the Sparx version of the shape as a "Starting point" for your version.

Paolo
« Last Edit: August 06, 2015, 10:04:27 am 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: 8085
  • Karma: +118/-20
    • View Profile
Re: Requirement element - shape script
« Reply #10 on: August 06, 2015, 12:38:35 pm »
Quote
I don't know of a direct method to retrieve the name space. Likely you have to write an add-in so you can retrieve it like Print("#addin:myAddIn,param#").
Fair enough, it was only recently added. You have a couple of options in v12.

printwrapped("#qualifiedname#");
Prints a qualified name much like a class does.

if(hasproperty("packagepath",""))
{
}
else
{
      printwrapped("(from #packagepath#)");
}

Emulates the behavior of other objects, showing the source package if being shown in a different package. I believe it also obeys the display option for showing fully qualified package paths. Just put it under the element to match default behavior.