I was wondering if it is possible to have multiple instances of projects open at the same time. I would like to have a main instance of a project open, but would like to open various projects in the background to retrieve info from. I would like to perform these operations without the user being prompted(ie old file compatibility issue, etc). After these operations are performed I would like to dispose of any instances of background projects and their objects currently in memory. I have looked through com.vp.plugin.ProjectManager but can’t seem to find anything similar to that functionality.
The reason why I ask is because I would like to have this interaction performed after a modal dialog option is selected by a user.
I’m sorry that we do not support opening multiple instance of the project at the same time, and I don’t think it will be supported in the near future. In fact, you should define dependency between your projects so that you can access those model elements in run-time using Open API. Feel free to contact me if you require any further information.
I’ll have to investigate this further before I can confirm whether this will work. I want to reference Model Elements in another project which may contain the same ID and possibly the exact same info/properties as a Model Element in the current vpp project. In order for my comparison to work I would need the exact same ID of a dependent Model Element ID as it was if you were to open the dependent project. I’m not sure how this will work when iterating through all Model Elements in a project but I would assume that a new ID would be generated for the dependent Model Element otherwise I would think a unique constraint violation would happen somewhere within the Visual Paradigm Project file.
Another concern would be referencing diagrams and diagram elements. I’m not sure if this would be possible but I will confirm once I have had time to properly test this functionality.
If opening multiple project instances is not possible, would it be possible to add functionality in the ProjectManager to open a VPP project without being prompted for compatibility issues, if the user would like to save, etc? Those prompts might confuse the user based on what I am attempting to do via the OpenAPI. What I would like to do would (hopefully) require no user intervention, prompts, etc.
It seems open another VPP is not really a solution in this case. Open another VPP is a very complex action. As you are look for doing some comparison, I suggest you export the project into other format (i.e. XML) from both project and do the comparison. This seems more easy to achieve.
I could create a XML parsing algorithm that could read the data, but since I already have established a working comparison algorithm through the open api without using XML I’m not sure how this could be more beneficial than my current comparison algorithm. Unfortunately I would think that to export each project to XML I would first have to open the project I wish to export. This would lead me into having to open another project instance which would cause the same problem I’m currently trying to overcome.
Since my main objective is to prevent as much user interaction as possible I would think suppressing prompts when opening a vpp file programmatically would be ideal. I currently can open other vpp files through the OpenAPI but if a older version of a vpp file is opened, or a change is made in the file I will be prompted. Although I can see valid points where this may be needed what I’m currently trying to achieve doesn’t requires the user’s confirmation. I would like to have a version of the ProjectManager’s open file method where any prompts can be suppressed.
The main prompt that usually interrupts my process is a compatibility issue prompt (when opening older vpp files). I have been able to workaround the saving file prompt by issuing a save for the current file via the ProjectManager class.
If exporting a VPP file can be done via the OpenAPI without actually having to open the VPP file first that might be ideal as well. If this can be done, would you be able to demonstrate some sample code.
I’m not sure what you would like to compare. But suppose not using Open API and we do it manually within the application, did our Visual Diff provide what you want to do?
My algorithm currently compares one or multiple project’s Model Elements, Diagrams, and Diagram Elements. The end result is to provide helpful version tracking and analysis using Git as a version tracking tool.
My comparison algorithm fully works, but what I am trying to do is prevent as much user interaction as possible. It’s funny that you mention Visual Diff as a solution, because my algorithm currently imitates the Visual Diff functionality to an extent. I initially looked at Visual Diff as a solution but it was limited and I couldn’t expand upon the framework to fit my user’s personal needs. My goal is to expand and customize it to be somewhat automated. A Manual comparison wouldn’t work for what I’m trying to achieve. What I am curious about is the fact that Visual Diff can have multiple project instances within a modal dialog box. I would like to use a similar approach to extract info from multiple projects and present a user with a helpful GUI. Concept (Almost).png
I regret that after a discussion with our developers, we decided not to support opening another project file using plugin due to the consideration of potential risks. If we change our mind in the future, I will post here. Sorry about this. For now, please consider to export the project to XML (File > Export > XML) and perform the comparison.