This is an open source skeleton project for MagicDraw plugin development. It contains (i) the definition of a two actions that uses VIATRA queries and transformations, (ii) Gradle-based building infrastructure and (iii) Jenkins-based CI configuration.
- Run menu "Examples" > "Correct all port types", it should run a transformation to add types to Ports that have no type specified, but are connected to a typed port.
- Run menu "Examples" > "Generate Python code", it should run a transformation to generate python code from the model. User has to select the top-level package from the transformation will start and the target folder to store the generated files.
This skeleton project uses gradle-based building infrastructure. Gradle jobs are defined in com.incquerylabs.magicdraw.plugin.example/build.gradle
including the extraction of dependencies and building an installable plugin.
For more details check the related wiki page
This repository is connected to a Jenkins build job to provide automated build and deployment of the source code. The presented badge shows the status of the jenkins job running on the IncQuery Labs' infrastructure. The actual job is accessible from here.
For more details check the related wiki page
- Ensure you have Java 8 (newer Java is only supported in Gradle 5+, but our current build script requires Gradle 4.3).
- Install product: Eclipse IDE for Eclipse Committers, version: latest (tested with up to 2020-03)
- Install VIATRA SDK 2.3.0 http://download.eclipse.org/viatra/updates/release/latest
- Install UML 2.5.1 metamodel:
- Check section Install UML Metamodel to Eclipse describing the workflow of this process
- Users on the internal IncQueryLabs network can use http://albert.internal.incquerylabs.com:10080/magicdraw.metamodel/
- Clone this repo
- Import the projects in it
- Right click project com.incquerylabs.magicdraw.plugin.example > "Configure" > "Add Gradle Nature"
- (If nature is automatically recognized and added, right click project > "Gradle" > "Refresh" instead)
- This will synchronize it (loads tasks, and downloads dependencies from maven)
- run 'extractDependencies' task (downloads and sets up MagicDraw)
- Show View: Gradle Tasks
- In the view toolbar, click Refresh Tasks for All Projects
- In the view menu, check Show All Tasks
- Run com.incquerylabs.magicdraw.plugin.example > other > extractDependencies
- Right click project com.incquerylabs.magicdraw.plugin.example > Gradle > Refresh Gradle Project
- This will synchronize it again (loads MD dependencies)
- run 'runJava' task (this will start MagicDraw)
- Create or open a project
- Run menu "Examples" > "Correct all port types", it should run a transformation to add types to Ports that have no type specified, but are connected to a typed port.
To define and compile queries in the VQL language, VIATRA requires the UML Metamodel to be installed. Here is a generic workflow to install UML Metamodel as a p2 repository.
- Start Eclipse
- File > Import > Existing project into workspace > Select archive file >
$Your MagicDraw installation$/openapi/ide/eclipse.zip
> check onlyMagicDraw (MagicDraw/)
> click on "Finish". - In the "Package Explorer", right click on
MAGIC_DRAW_INSTALL_DIRECTORY
under the newly imported project > Select "Properties" > Click on "Edit" > Set the value to$Your MagicDraw installation$
> Click on "Ok". - Open "MagicDraw bundles.target" > Click on "Set as Active Target Platform".
- File > New > Feature Project
- Project Name:
com.magicdraw.uml.metamodel
- Feature ID:
com.magicdraw.uml.metamodel
- Feature Name:
UML Metamodel
- Feature Version: 1.0.0.*
- Project Name:
- Click on "Next" to select the referenced plugins
- Select "com.nomagic.magicdraw.uml2" and its dependencies (check this wiki page for the current list)
- Right click on the project and select "Export" > "Deployable Feature" > "Finish"
- Destination: Directory - Select the destination where p2 repository will be hosted
$UML p2 repository$
- Options: "Package as individual JAR archives" and "Generate p2 repository"
- Destination: Directory - Select the destination where p2 repository will be hosted
- Window > Preferences > Plug-in Development > Target Platform > Select "Running Platform"
- Help > Install New Software... > Add... > Local... > Select
$UML p2 repository$
- Uncheck "Group items by category" to see the installable feature
- Check "UML Metamodel" and click on "Next" then click on "Finish"
- MagicDraw does not start, saying
Unable to create the actorSystem
- Try to start it again
- Installation of the UML Metamodel fails:
Cannot complete the install because one or more required items could not be found
- There are missing dependencies of "com.nomagic.magicdraw.uml2" in the feature: check this wiki page for the current list.
- Installation of the UML Metamodel fails:
Could not find the exported unit with id: [feature name].feature.group version: 1.0.0.[current date]
- Restart Eclipse
- Gradle task shows error but nothing appears on the console.
- Remove the Gradle nature and builder from project (you can do that by editing
.project
file). Then add the Gradle nature to the project (Right click on project -> Configure -> Add Gradle nature...)
- Remove the Gradle nature and builder from project (you can do that by editing
- Eclipse cannot resolve (import) dependencies
- Refresh the project by Gradle: right click on the project > Gradle > Refresh Gradle Project
- Receiving the following error when MagicDraw tries to download a model from Teamwork Cloud:
Reply message has unexpected type: com.nomagic.esi.core.msg.LoginReply
- OpenAPI related jars appear twice on the classpath, hence you should temporarily exclude
lib/bundles/com.nomagic.esi*.jar
files from the gradle script.
- OpenAPI related jars appear twice on the classpath, hence you should temporarily exclude
- Gradle synchronization error when trying to build:
Could not determine java version from '13.X.Y'.
- Install Eclipse with jdk 8 selected for VM.