Book a Demo

Author Topic: Add new tagged values to the elements automatically after creation.  (Read 4755 times)

Martin P.

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hello.
I would like to add new tagged values to the elements and attributes automatically after element creation. 
In the forums I have read that it is possible using broadcast functions only, specifically using the EA_OnPreNewElement / EA_OnPostNewElement.
Please help how to implement these broadcast functions. I have read that I can implement a workflow script or an Add-in. Neither way has worked for me so far.
Workflow scripts:
I have created my vbscript workflow script using the scripting window. How do I register this script in EA? Respectively, how EA knows that it should call my functions in this vbscript after creating an element?
Ad-ins:
I tried to create an ad in. I did not find any applicable documentation for this. How to do it? How do I connect my Visual Studio with EA? Specifically, how the visual studio knows what is the API for EA?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add new tagged values to the elements automatically after creation.
« Reply #1 on: August 23, 2019, 05:15:10 pm »
Martin,

The "proper" way would be to create your own UML profile with stereotypes and use those stereotypes in your modelling.
Your elements would automatically have the tagged values they need. This is how it's done for things like BPMN, ArchiMate, etc..

But if you really want to you can indeed use the broadcast "event's" to add you own tagged values.

The options are:
- (from V15) Model add-ins. See https://sparxsystems.com/enterprise_architect_user_guide/15.0/automation/modeladdins.html
- EA-Matic scripts. See https://bellekens.com/ea-matic/
- An add-in. I wrote a few articles about that on my website: https://bellekens.com/writing-ea-add-ins/

Geert

Martin P.

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Add new tagged values to the elements automatically after creation.
« Reply #2 on: September 09, 2019, 03:55:45 pm »
Thanks You wery much.
EA-Matic seems like a good solution to me. I watched a https://www.youtube.com/watch?v=-BKJxCilD6c "How to make an EA add in in 1 minute with EA Matic".
I followed the instructions exactly, but the function didn't call the doubleclick.
Does the diagram or package have to be of a special type or have any parameter set to respond to events?
I have EA version 14.1.1429.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add new tagged values to the elements automatically after creation.
« Reply #3 on: September 09, 2019, 04:46:05 pm »
If you post the script code I can check if it works for me.

Geert