Author Topic: Addin that "animates" a walk through of an activity diagram  (Read 9075 times)

Shegit Brahm

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Addin that "animates" a walk through of an activity diagram
« on: November 09, 2021, 02:34:36 am »
Hi there,

I'm sorry for a rather complex question instead of a single problem. I just hope my main problem lies only in the beginning.

What do I want to achieve?
  • an addin for my EA (13.5)
  • that has some meta stuff that finds me specific activity diagrams
  • and then I say "take this and start"
  • and then it highlights any connector/action/diagram element that is currently processed
  • and it - to some degree - moves the diagram so the current element is visible
  • once finished, the diagram looks  as before
  • the addin is not "overlaying" the EA like a modal dialog

So I click and thus decide which element to colourize, the EA does so and jumps around the diagram to show me this - and when I'm done all colour is gone.

What do I already have?
  • written in C#
  • use of tagged values to identify desired ADs
  • getting along any element and going through step by step (= decisions are regarded to control the flow by clicking inside the addin, also going to next action is a click inside addin)

Some alternatives/extras
  • Either highlighting only the current element or all visited one in this run (like in my example)
  • more important of avoiding a modal dialog would be the visibility of the shown element
  • exporting the changed diagram before closing the addin

So, I know how to read and set the colour of an element "in general" (explored the data model of .eap). I see that the EA jumps to an element in diagrams with e.g. "locate in current diagram" - and knows if the element is visible on my screen or not. The current addin is a modal dialog. Which is no problem to just relocate the addin on a second screen to see the diagram. Maybe that is even safer because the elements cannot be manipulated manually = diagram stays at is. Being unaware of existing "walk throughs" I also consider the "which AD to select in the first place" worth to create my own addin.

Starting questions
  • "is it possible?" ;-)
  • How to jump to an element of a diagram by the addin - and maybe only move the diagram if less then 20 pixel is from element to "next" visible border = how to determine the visible border?
  • Would this temporary colouring require to save and reload the current diagram? (If yes, I need to set a list of old element configuration and reapply them while closing the addin - otherwise just "discard changes and reload".)

Thanks,
Shegit

my example:
start -> -> -> ->
« Last Edit: November 09, 2021, 02:51:15 am by Shegit Brahm »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Addin that "animates" a walk through of an activity diagram
« Reply #1 on: November 09, 2021, 03:31:42 am »
I don't think you get that to an acceptable level. The problem I see is that you might run into having to reload diagrams quite often to make your changes visible. I doubt that placing a feature request for a life update of single elements has good chances. This is just my feeling about what you try. Maybe you find bypasses. But I really doubt that.

q.

P.S. Not sure if EA has already something like that in some upper licenses.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Addin that "animates" a walk through of an activity diagram
« Reply #2 on: November 09, 2021, 05:31:28 am »
You seem to want to recreate the simulation feature of EA in some kind of way.

I've never actually used the build in activity diagram simulation, but maybe that already solves your problem.

If not I'm afraid you are in for a rough ride.
Highlighting things on a diagram is not easily done using the API, and neither is scrolling a diagram. You can select an element, or a diagram, but that doesn't always work that reliable.

Another option might be to change the color/thickness of the borders of your elements an connectors, but you might need to reload the whole diagram to show that, which would not make it look fluid.

But there is support for the simulation. Maybe that can help.
https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/automation_simulation2.html

Geert

Shegit Brahm

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Re: Addin that "animates" a walk through of an activity diagram
« Reply #3 on: November 09, 2021, 10:27:07 pm »
Thank you for your hints.
While searching I somehow overlooked the buildin feature. Yet it does not fully meet my requirements - which is rooted in the meta stuff the addin is used for. (There the user has to make each step a decision how the current action worked out etc.)

And yes, I was considering to change only colour & thickness of the element's border as "highlighting". (Because I already found ways to do it and I wanted at least two colours anyway)

At first glance it might not need look fluid as it is clickwise anyway.

So I take home "save and refresh" is very likely needed - and maybe not always reliable. Especially the "show that element".
And once there is a decision to upgrad EA I for sure take a look at the new simulation feature.

Thanks for your time,
Shegit.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Addin that "animates" a walk through of an activity diagram
« Reply #4 on: November 10, 2021, 08:49:12 am »
There is Diagram.FilterElements which you can use. It will give you a highlight style effectively the same as the simulation.