archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
970 stars 270 forks source link

[XMLExchange] Object placed in wrong folder on import #550

Open markbacker opened 5 years ago

markbacker commented 5 years ago

Archi 4.6.0 Build 201910010742 on Windows 10

Expected Behaviour

Imported objects in one folder (from BiZZdesign) all end up in one folder in Archi

Actual Behaviour

Imported objects with child objects end up in the parent folder. The child objects end up in an unnamed subfolder. See the screenshots for better understanding.

Steps to Reproduce the Behaviour

  1. Create an export file with BiZZdesign ES

    1. in BiZZdesign you can create a hierarchi of objects. Not with folders, but by dragging an object in the model tree 'over' another object.
    2. in the model tree the object is now a child of the other object. See the business functions in the screenshot

image

  1. Import the BiZZdesign export with Archi

    1. Objects without child-objects are all placed in their respective folders
    2. Objects with child-objects are placed in their parent folder.
    3. The child-objects are placed in an unnamed subfolder. See the screenshot

image

The BiZZdesing Archimate export XML file objects and folders hierarchi.zip

Suggested behavior

As Archi doesn't support parent-child objects in the model tree, I think it's best to ignore this. My suggested sollution is to place parent and child objects all in the same folder.

The current behavior is to place the child-objects in an unnamed folders. When there are many parent-child objects in one folder, this results in many unnamed subfolders. Hard to find the right subfolder ..

Phillipus commented 5 years ago

The import algorithm could probably do with some refining in cases like this. I don't have time to do this before Archi 4.6 final release.

For reference, this is the code https://github.com/archimatetool/archi/blob/c1615b72e9e112ce5756c54e29909251b8d8fcad/org.opengroup.archimate.xmlexchange/src/org/opengroup/archimate/xmlexchange/XMLModelImporter.java#L373

markbacker commented 5 years ago

Ok, thanks for looking into this so quick.

Phillipus commented 5 years ago

It's an awkward use case. I think the algorithm determines the parent item to be a folder because it has a child item and ignores the id-reference to the element. The algorithm needs to catch this case.