archimatetool / archi-scripting-plugin

jArchi - Scripting for Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
117 stars 33 forks source link

Diagram Model References show up as archimate-diagram-model #95

Open jcrum opened 2 years ago

jcrum commented 2 years ago

Version of jArchi, Operating System

Archi Version: 4.8.1 (tested on 4.7.# as well) jArchi Version: 1.10.202101121529 MacOS: 10.15

Expected Behavior

I'm making an assumption as to how this behave since the documentation around this area is a bit fuzzy but....

If a view contains References to other views/diagrams (i.e. dragging a view/diagram from the navigation tree onto a view) it should show up as type: diagram-model-reference.

Actual Behavior

Diagram Reference Objects show up as type: archimate-diagram-model. script_output

Steps to Reproduce the Behaviour (with attached test files/script)

  1. Create several views/diagrams in a model
  2. Drag said views/diagrams from the navigation tree onto a view
  3. Execute a script that displays the view/diagram children and type

archimate-diagram-model-defect.archimate.zip

diagram_ref_bug.ajs.zip

Phillipus commented 2 years ago

The underlying implementation of getType() returns the underlying referenced object or concept. So object.type on a diagram element or connection will return the concept (business-actor, for example) and the same is true for a view reference, it returns the referenced view.

Perhaps we should make this clearer in the wiki.

jcrum commented 2 years ago

Is there any way to get the type for these elements rather than their referenced type?

Phillipus commented 2 years ago

Is there any way to get the type for these elements rather than their referenced type?

I'll re-open this issue for discussion...

This would need some fundamental changes to return actual type rather than referenced type.

jcrum commented 2 years ago

Thank you for reopening although I'm not sure how much important this is if it hasn't been brought up before. I'll see if there is another way to get my script to work.