Composition of multiple linked templates

Started by Mierk, September 02, 2020, 14:58:08 PM

Previous topic - Next topic

Mierk

Is there a way to create a model that is a composition of elements from templates that are live-linked?  Meaning if any of the base templates change, all models that include elements from those templates are updated also.

TIA

-Mierk

Phil Beauvoir

#1
You can import other Archi models into a model that have been updated but this is a manual process. There is no "live-linking" as there are no links between between model files.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Hervé

Hi Mierk,

This can be achieved using the database plugin I wrote (https://github.com/archi-contribs/database-plugin/tree/master/v2).

The basic aim of the plugin is to export and import back models into a relational database. It also includes the ability to share components between several models: when a component is updated in the database, all the models in which the component is present will see the update.

I know I need to rework the documentation, so if you fail to do it, please do not hesitate to open an issue on GitHub and I'll guide you.

Best regards
Hervé

nickbrown1968

#3
Hi Hervé,

I'm resurrecting this discussion because your aims for this plugin are exactly what I am looking for. Firstly, I want to be clear that I really appreciate the effort that you have put into it. However, I've been struggling to define a workflow using it because it doesn't appear to behave as I expected. (This is probably a "me" problem)

I did a bit of testing to try and understand it better:

- I started with my base model (both on file and in the database)
- I created a new empty model
- Imported a small number of components from the db into the new model

I noticed that this created a new version of those elements in the model table. This confused me. Why is this necessary? The element hadn't been modified and had the same checksum as the previous version. The model had been added to the models table and the elements_in_model table had new entries for the new model - referencing the new elements version. I'd assumed that elements in the db were shared amongst the models that used them. My two models are now referencing different element versions, despite the element being unmodified.

- I then modified an element/component in the new model and exported the change back to the db

This created another version of the element, which I expected as it had been modified and the checksum was different. But my original model hadn't been updated to use this version. I assumed that this was by design to allow updates back to the original model to be approved/gated - presumably via an import.

- Go back to original/base model and look to import any updated elements

What I really wanted to see was what elements I have in my model have been updated in the db (and ideally how they had been modified). But how? The import dialog will show me new components, but not updated ones. My updated component isn't visible unless I uncheck "Hide components already in model", but there is no indication which of those components has been updated.

If the intention that elements are not automatically updated across all models, then I'm struggling to see a workflow where I can approve their update into the primary model.

- I also went to perform an export from my original model to the db.

I noticed that it indicated there was an updated component in the db. This made sense because there was. But why is this indicated when exporting, but not when I was importing?

- I completed the export and was surprised to see that my updated component was now in my original model.

Why would an export to the db result in components in the model being updated from the db? This seems to be more of a sync operation than an export? Is there no way to approve this update or stop it from being automatically updated in my model?

Apologies for the long post but I'm really struggling to understand the best way to use this tool to manage shared components.

Regards, Nick.

nickbrown1968

Incidentally, the "Get History of " menu item offers me what I'm after for an individual component of my model. I could do with something similar across all components that have been updated in the db.