Author Topic: Autonumbering on stereotype level  (Read 2814 times)

mrblack12

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Autonumbering on stereotype level
« on: June 23, 2017, 12:36:48 am »
Hi,

I posted this question a few moonths ago: "I was wondering if there's a way to use auto-numbering on a stereotype level. The default function is to set auto-numbering on Type level, e.g. Requirement. In my project we distinguish functional requirements and business rules as two dffierent stereotypes of a requirement type.

We would like to have the functional requirements and business rules automatically numbered on creation, both with a dfferent prefix, let's say "FR-" for a functional requirement and "BR-" for a business rule.

Any suggestions whether this is possible?".

The only reply I got then was that this could only be done through (writing my own) add-on. By now I'm wondering if anyone else has come across this issue since and already had a working solution for it. If not, how does one go about writing their one add-on?

Thanx,
Rick

Thanx in advance,
Rick

qwerty

  • EA Guru
  • *****
  • Posts: 11319
  • Karma: +287/-259
  • I'm no guru at all
    • View Profile
Re: Autonumbering on stereotype level
« Reply #1 on: June 23, 2017, 05:18:02 am »
I guess you can't except you invest a bit in scripting it. The auto counters only list basic meta types and non from MDGs. Might be worth a feature request - if you can wait a few years to see it realized.

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 937
  • Karma: +40/-1
    • View Profile
Re: Autonumbering on stereotype level
« Reply #2 on: June 23, 2017, 07:58:15 am »
Hi mrblack12,

here are a lot of people who want their special solution - for a thank you - maybe.

Here are also a lot of engaged persons who invest their leisure time to answer questions, share their knowledge, develop scripts and presents useful Add-Ins. For nothing!

I think you are working for a company which will profit. If your company is really interested in a solution, get some money and make a little open source project.

In this Forum you'll find people to realize your dreams. Be aware: A general solution beyond "FR-" is some work and not just 10 lines of code.

Please appreciate the great help you get here for nothing. Personally, I don't like remarks like 'The only reply I got..'.

Helmut







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

Sunshine

  • EA User
  • **
  • Posts: 951
  • Karma: +83/-7
  • Its the results that count
    • View Profile
Re: Autonumbering on stereotype level
« Reply #3 on: June 23, 2017, 08:24:35 am »
Looks like if you want something you will have to roll up you sleeves and do it your self via a script.
There are some examples of vbscript and jscript provided in the scripting window that should help you get started.
Put your new script into a project browser group so you and select it from the context menu of the browser so you easily invoke it from the UI.
If you can't write scripts then find someone in your organisation to do so. It would only take a day of less for someone will programming experience to pick it up and learn how to do create it and maintain it for you.

Good luck and if you think it might be useful to others once its been created then please share.
Happy to help
:)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1756
  • Karma: +120/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Autonumbering on stereotype level
« Reply #4 on: June 26, 2017, 05:39:00 pm »
Just a quick note on scripts and Add-Ins. This applies to EA out of the box, without any third-party additions.

Scripts have access to what's called the "object model" in the EA API. Add-Ins have that plus the "Add-In model". In terms of what they can do to the contents of an EA project, there's no difference. Scripts can even pop up their own dialogs and things.

What an Add-In can do that a script can't is receive events fired by the EA client (also integrate windows into the EA GUI). So if you want something that can apply numbering to a model after the fact, you can get by with a scripted solution. If you want to automatically apply numbering when an element is created, you have to write an Add-In.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Helmut Ortmann

  • EA User
  • **
  • Posts: 937
  • Karma: +40/-1
    • View Profile
Re: Autonumbering on stereotype level
« Reply #5 on: June 26, 2017, 06:37:36 pm »
Hi,

in principle it's simple: Just override the EA Broadcast Event  'EA_OnPostNewElement'.

The drawback is:
EA currently has a bug that it doesn't support the Broadcast Event 'EA_OnPostNewElement' with the Specification Manager.

The other thing is that there are a lot of Use Case. Just for example:
- Make the created number unique for stereotype in the whole model
- Unique in package or package branch
- Handle initial applying the numbers to existing Elements (e.g. use creation date to give a reasonable sequence).

I have implemented a basic approach in the open source 'hoTools'. It's not released yet but you can explore or contribute to code and ideas.

You can configure with JSON:
- Stereotype
- Start value
- Format to build like 'myRequirement_0.00.00_fun'
- ..

Currently, I'm thinking about applying the rules to existing Elements (based on e.g. creation date).

If you like to contribute or have ideas just contact me.

Best regards,

Helmut




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

Helmut Ortmann

  • EA User
  • **
  • Posts: 937
  • Karma: +40/-1
    • View Profile
Re: Autonumbering on stereotype level
« Reply #6 on: June 30, 2017, 04:03:58 pm »
Hi,

I'm working on integrating Auto Counter on Stereotype level in Open Source hoTools. Soon, I'll release it

If you are interested or have ideas, read the WiKi and contact me. The basic ideas are:
- Auto numbering on Stereotype level (Type, Stereotype)
- For Name and Alias
- Configure by format string like 'My0.00.0.0_Best'  (0=placeholder for numerical value)
- Support Diagram with Drag and Drop, the usual way
- New Auto Numbering for the whole model and choosen Type/Stereotype
- Configurable in Settings.json

WiKi:
- https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools/wiki/AutoNumber

Kind regards,

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