archimatetool / archi

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

[Feature request] Restrict relationships usage in viewpoints #941

Closed fredlegrain closed 11 months ago

fredlegrain commented 1 year ago

Nice feature to have better support of viewpoints : allow to restrict relathionships allowed per viewpoints

Phillipus commented 1 year ago

Does restricting relationships in a viewpoint make any sense if they are already constrained by the ArchiMate metamodel?

Not showing some relationships in the palette would also mean re-writing the magic connector so it doesn't suggest certain relationships.

jbsarrodie commented 1 year ago

Hi,

Does restricting relationships in a viewpoint make any sense if they are already constrained by the ArchiMate metamodel?

Yes it does in some non trivial cases. For example, if you define a Process viewpoint, you most certainly want to use trigger but not flow.

Not showing some relationships in the palette would also mean re-writing the magic connector so it doesn't suggest certain relationships.

Yes, makes sense. We might also want to filter suggested relationships when nesting an element.

But IMHO, just hiding relationships from the palette would already be a good step forward with enough added value (could be a MVP)

Phillipus commented 1 year ago

But IMHO, just hiding relationships from the palette would already be a good step forward with enough added value (could be a MVP)

I made a quick check in the code of what needs changing for this and there is some impact. I think I would rather wait until we do a complete make-over of viewpoints.

Phillipus commented 1 year ago

I implemented it in the viewpoints-relations branch supporting palette, magic connector and suggested relationships when nesting an element.

This implementation means you can limit relationships to those declared in the Viewpoint:

<concept>AssociationRelationship</concept>
<concept>FlowRelationship</concept>

And this to include all relationships:

<concept>$AllRelationships$</concept>

If neither of those declarations are present, no relationships will show. This will be a backward-compatibility problem for people who have already created their own viewpoints.

Phillipus commented 1 year ago

Actually I think a better way to do this that maintains backward compatibility and fits in with the current implementation for elements, is that if no relationships are declared in the viewpoint then assume all are present (and no need for $AllRelationships$). This is how it is currently in the layered viewpoint for elements:

<viewpoint id="layered">
    <name xml:lang="en">Layered</name>
    <!-- No concepts means that all concepts are allowed -->
</viewpoint>
jbsarrodie commented 1 year ago

Actually I think a better way to do this that maintains backward compatibility and fits in with the current implementation for elements, is that if no relationships are declared in the viewpoint then assume all are present (and no need for $AllRelationships$).

Yes, seems the best option.

Would it be possible to add the following options ?

Phillipus commented 1 year ago

Would it be possible to add the following options ?

Yes. :-)

fredlegrain commented 1 year ago

Would it be possible to specify allowed relationships apply per elements?

Phillipus commented 1 year ago

Would it be possible to specify allowed relationships apply per elements?

Not sure what you mean? Please explain.

fredlegrain commented 1 year ago

I mean, not define the allowed relationships in general for the viewpoint, but define down to the relationships allowed betweens specified elements. Like an actual subset of the the whole elements/relashionships table.

More complex, but matches the actual principle of viewpoints, right?

Phillipus commented 1 year ago

No, that's not planned for viewpoints as it would be too complex to implement.