Finding if a View is embedded in another View?

Started by Alberto, November 04, 2021, 16:38:43 PM

Previous topic - Next topic

Alberto

The advantage of having a View within another View is that it allows the viewer to navigate the model, both within Archi and in within the HTML report.  Now I'm finding myself looking how to trace what Views are embedded into what other Views, so I'm missing the Analysis and Visualizer tools that we have for Elements, but for the View itself.

So, since is not in the Archi UI, I figured I could do it with jArchi, "Find Current View in other Views"
but can't quite figure out how to do it so any help would be appreciated.

Jean-Baptiste Sarrodie

Hi,

Here's a way to do it:
var currentView = selection.first();
console.log('Looking for view "' + currentView.name + '" with id "' + currentView.id + '"');

$('view').find('diagram-model-reference').each(function(o) {
  if(o.refView.id == currentView.id) {
    console.log('Found in view "' + o.view.name + '"');
  }
})

Regards,

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Phil Beauvoir

Damn JB! I was just typing this when you ninja'd me:

$("view").find("diagram-model-reference").forEach(ref => {
    console.log(ref);
});

 ;D
If you value and use Archi please consider making a donation. :-)
https://www.archimatetool.com/donate

Jean-Baptiste Sarrodie

QuoteDamn JB! I was just typing this when you ninja'd me:

$("view").find("diagram-model-reference").forEach(ref => {
    console.log(ref);
});

 ;D

And in the meantime I even figured out to fix some typos on our wiki  ;D
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Alberto

Thank you both!  This is perfect for what I needed it.

BTW, I also noticed that I cannot add Views to the filter in the model tree.