Book a Demo

Author Topic: Anyone offer an add-in that does this: get parent properties?  (Read 10384 times)

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
(EA 13, w7 64-bit)

As now confirmed by Sparx, shapescripts don't work with BPMN2.0 stereotyped elements.

My workaround: script the addition of object nodes to a BPMN Activity and put info in them (e.g. name of objectnode as a piece of info, e.g. name = "Never on Tuesdays!")

Problem: obviously easy to set on creation, but it would be better if I could label the objectnode with the taggedvalue of the objectnode's parent, which actually provides the info required, so that when it changes, the objectnode automatically updates.

I've looked through the list of 3rd party addins at Sparx and there's no obvious candidate.

One final caveat - addin would need to be free as I work at a large institution and it would be faster to write a compiler for an addin than to get a purchase order...

Suggestions?

Julian


Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #1 on: July 20, 2017, 03:42:53 pm »
Hi Mr. Stuff,

I haven't got the whole picture of what an Addin or Script should do for you. May be you write a little specification and try to generalize your issue at hand. A small example would be helpful. If you find something of general interest, there might be someone who can help you.

If you want to get information from a Diagram Node EA offers some possibilities out of the box and by scripting with just a few lines of code. E.g.:
- You can visualize arbitrary information in the document view
- Make a note and assign Element property/feature/tagged values to this note (powerful and easy)
- Hyperlink to show other Diagrams, Elements,
- etc.

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #2 on: July 20, 2017, 04:39:37 pm »
Hi Helmut

Thanks for the support...

A shapescript can print values of things such as #NAME# of the element to which the script applies. Shapescripts can also make use of add-in calls.

This old forum post gives examples of coding and calling http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1326759082/1#1 and I'd do it myself but I don't have a dev. environment.

What I would like to get from an add-in call in a shapescript for an embedded element such as an objectNode is the value of a named taggedvalue of the parent element (obviously a general purpose getter that did properties as well would be v. useful, but I'm primarily interested in taggedvalues).

Please let me know if any further clarification is required.

Julian


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #3 on: July 20, 2017, 05:35:54 pm »
Why are you asking for the code of an add-in to do something if you don't have a development environment?

q.

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #4 on: July 20, 2017, 05:56:28 pm »
Because I am hoping for a compiled add-in that I just, "add in". That is how it works, isn't it?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #5 on: July 20, 2017, 10:27:14 pm »
That's how it should work. When add-ins became popular many years ago I already asked why Sparx did not create a sort of Add-In-Shop. There are a couple of add-ins from different vendors now, but I don't know of any place where you get an overview. What should I say?

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #6 on: July 21, 2017, 07:11:16 am »
Hi Julian,

one issue is that there are thousands of things to do with Add-Ins. Only rarely matches Add-Ins the need of others.

I know a lot of projects who want to publish libraries of functions. In the end, it mostly don't work

If I have understood you right you want to visualize a tagged value of a parent element with an Add-In used by a shape script.

Maybe, if I like to spend some time I'll make a little demo Add-In which exposes this feature. Just to see how it works.

If an Addin does some accesses in a shape script it probably will slow down rendering diagrams which use this feature a lot.

Think, if my specification is correct and maybe I'll do it for fun.

Kind regards,

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #7 on: July 21, 2017, 07:28:59 am »
Or maybe Julian can rise some funds to pay you for programming it?

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #8 on: July 23, 2017, 07:01:14 am »
Hi Julian,

The free Open Source hoTools now contains AddiÍnSimple. AddInSimple is a basic Add-In which:
- Shows how to develop an Add-In in C#
- Demonstrates how to implement Shape Script print methods
- Ready to use sample to print parent properties like Tags, Name,
- Easy to adapt to other needs

You find it:
- Documentation https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools/wiki/addinshapescript
- Download https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools

I based the implementation on:
- Geert Bellekens AddIn
- Aaron Bell http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1326759082/1#1

Additional you find the method:
- public string GetParentProperty(EA.Repository repository, string eaGuid, object theParams) {..}
- Print properties of the parent object like Name, Alias, Tagged Values,
- Details in the implementation https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools/blob/master/AddInSimple/AddinSimple.cs

With this sample application, it should be easy to implement other needed features.

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Anyone offer an add-in that does this: get parent properties?
« Reply #9 on: July 24, 2017, 06:14:40 pm »
@qwerty "anyone offer..." was more of a "Does anyone have an existing...": why reinvent the wheel?

@Helmut - thank you very much; I've passed all the information to a colleague who has a development environment...

And yes to, "If I have understood you right you want to visualize a tagged value of a parent element with an Add-In used by a shape script." One can't use shapescripts on BPMN2.0 elements, but my placeholder objecnodes will not be BPMN2.0 (they'll have a custom stereotype just to trigger the shapescript to call the function to display the returned value)

Thanks for the input everyone,

Julian