Use case 1: Model server and MPS

This use case shows how model data can be synced between an MPS instance and a model server. This makes model data, previously accessible only in a running MPS or via files, available through a server.

The synchronization needs to be initialized from MPS using the model-server-sync-plugin.

Demonstration

use case 1
Figure 1. Initiating synchronization and synchronizing change
Static
Figure 2. Initiating synchronization and synchronizing change (sequence diagram)

Instructions

Get the code

Clone or download the code from the samples repository.

Setup MPS

Execute the following command to set up the MPS project under mps/project-mps-backend. It installs the model-server-sync-plugin and its dependencies.

Command to set up the MPS project
./gradlew mps:project-mps-backend:build

Start a model server

Command to start a model server
docker-compose --profile useCase1 up

This command starts a model server under http://localhost:28101/

Start MPS

Open the mps/project-mps-backend in MPS 2021.2.6.

Connect to the model server

  • In the 'Cloud' tool window, right-click on Cloud and select Add Model Server

    use case 1 step 1
    Figure 3. Adding a model server
  • Enter http://localhost:28101/ as the model servers URL

    use case 1 step 2
    Figure 4. Entering the address of the model server
  • In the Cloud tool window, right-click on the added server and select Add Repository

    use case 1 step 3
    Figure 5. Adding a repository
  • Enter courses as the repository name

    use case 1 step 4
    Figure 6. Entering repository name
  • Right-click the University.Schedule.mps.backend.sandbox solution and select Cloud Actions > Copy on Cloud and Sync → http://localhost:28101/courses

    use case 1 step 5
    Figure 7. Synchronizing solution
  • Explore synchronized data in the Cloud tool window

    use case 1 step 6
    Figure 8. Exploring synchronized data