Open and Load All Projects


#1

Hi guys,
As you probably know we can load the currently open project using this code :
IProject project=ApplicationManager.instance().getProjectManager().getProject();

And also we can show the opening project dialog using this:
boolean openProject=ApplicationManager.instance().getProjectManager().openProject();

But is there any way to open all project inside the work space at a time ? I want to load all model elements from all projects .I know i can show opening project dialog for each project separately but this is very annoying to open all projects (about 12 projects) one after another every time i run the plugin.
I want a way to load all projects (all model elements) at a time.

Thanks in advance


#2

Not really, keep in mind that you can have only one project open at the same time. The best you can do to get access to extra projects is to reference them (a feature provided by the Standard Edition and up).

But as far as I know this method is not fully supported by the API as of yet. The interface com.vp.plugin.RelationshipRetriever provides an option to get a list of all the currently referenced projects through the getAllRelationships() method, but it doesn’t allow us to create new references.


#3

The first question I’m gong to ask is, what is the purpose? What are you going to process or what do you intend to do with the model elements when opening the project?

I have a theory that technically you could achieve to meet your goal. You could create 12 separate workspaces and then have VP to boot up a new instance of itself by creating a new script. Obviously if you booted up 12 instances of VP you’re machine would probably die as VP consumes a lot of memory. We allocate around 8GB memory just for VP on our own individual machines and even then it can be temperamental and a little slow at times.

We have a script(s) which opens up a VP project one at a time, does some processing and then stores information into a MySQL table(s). The only problem with this is that it does take a couple of minutes just to open and then close a project at a time when running a script.