Author Topic: Populate Kanban using SQL  (Read 167 times)

aaron.ve

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Populate Kanban using SQL
« on: January 14, 2021, 03:26:12 am »
Hi,
We're using EA 15.1, focusing on the Archimate stereotypes. We have a capability map, and we want to use it to associate capabilities with application components.
The ask is to have the business capability map show different colours, depending on the number of applications mapped against the capability. E.g., a capability with zero applications linked would be white, 1..2 would be green, more than 2 would be red (too many applications).
So,
- I can create a legend against a custom tag against the capability, which shows number of applications mapped, which can then colour code the capability. But we don't want to fill in the tag manually, as well as creating graphical associations... The only way of automating a tag I can see is:
- I'm looking at using a capability Kanban, and bind the Kanban to the defined custom tag in each capability. Bit of a workaround, but it's tolerable
What I'm looking for is some way in which I can populate the Kanban using SQL. The script would need to:
1. Pick up all capabilities in a package
2. For each capability, find number of connectors of type 'association'
Just checking before getting into this - a) has anyone done something similar, b) am I on the right track in your opinion, and most important (if I'm on the roughly right track), c) any guidance on the SQL I'd use, please?
Any help would be great. I've done a number of searches, and could not find the above addressed yet, but if I'm missing a thread, please feel free to point me there.
Thanks in advance!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10705
  • Karma: +375/-32
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Populate Kanban using SQL
« Reply #1 on: January 14, 2021, 03:38:42 am »
I think you better look into writing a script for such a task.

You can use SQL to do the heavy lifting when it comes to selecting the elements you need, but for any change I would use the API rather then direct SQL updates.

I don't think you need the Kanban workaround. Scripts can create and fill in tagged values directly.

If you are looking for examples of scripts, look here: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

Geert

aaron.ve

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Populate Kanban using SQL
« Reply #2 on: January 14, 2021, 04:25:59 am »
Thanks, Geert. I felt this was a long-winded way, and I guess you've confirmed it. And thanks for the link.
Just so I'm clear, though: you're suggesting a script would be best to pick the associations, AND populate the tag, right?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10705
  • Karma: +375/-32
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Populate Kanban using SQL
« Reply #3 on: January 14, 2021, 05:21:09 am »
Thanks, Geert. I felt this was a long-winded way, and I guess you've confirmed it. And thanks for the link.
Just so I'm clear, though: you're suggesting a script would be best to pick the associations, AND populate the tag, right?
Yes, but it might be faster to count the associations using an SQL query (Repository.SQLQuery) than it is to loop over them using the EA.Element.Connectors collection.

Geert

aaron.ve

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Populate Kanban using SQL
« Reply #4 on: January 14, 2021, 07:53:56 pm »
OK.
Really appreciate the steer, thanks. I'll give it a try and let you know how it goes.  ;)