Finding a model in jArchi

Started by DaveVint, November 15, 2019, 14:53:38 PM

Previous topic - Next topic

DaveVint

Hi,

I have a model that I want to use as an ABB template for an adapted copy/clone run by a script. For the initial load I would prompt the user to find and load it using the window.promptOpenFile and model.load functions. However I can't figure out how to tell if the model is already loaded and if so, find it. Probably just my lack of JQuery/Javascript experience, but I would be grateful for any pointers!

Cheers,

Dave

Phil Beauvoir

The model#load(path) method will simply return the reference to the model if it is already loaded (i.e. in the Models Tree) but there's currently no way to know what is loaded.

We could implement:

$.model.getLoadedModels()

and:

$.model.isModelLoaded(model)

In fact I've just written the code to do this. @JB what do you think?
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Jean-Baptiste Sarrodie

Hi,

This might be useful in some occasion. If you've implemented it, let's test it ;-)

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.

DaveVint

Thanks for the quick response both! I've been offline for a while, so couldn't reply. Look forward to getting access to this.

DaveVint

Hi Guys,

Downloaded jArchi 0.7.0 with this included and works a dream. Thanks!

Dave