Exercise 25.1 - SysML XML Reference Connection (Local File System)
Objectives
The new learning objectives of this exercise are
to browse and expand XML files in a Local File System,
to create a reference connection between an existing SysML element in MagicDraw and an existing XML element,
to compare across the connection to see whether a later version of the XML element is available,
to sync a connection to the latest version of the in XML element.
Preparation
This exercise assumes the student has
Cameo System Modeler (or MagicDraw with SysML plug-in) supported version installed correctly on his or her machine with a valid license for use, and
Syndeia installed as a plugin for Cameo/MagicDraw with a valid license for use
A Local File System repository connection in the Syndeia Repository Manager
The user can any local file system repository containing at least one XML file.
Exercise
The Syndeia 3.3 interface allows the user to expand an XML file and create a Reference Connection between an element in another repository such as MagicDraw and any element in an XML file.
Figure 1 Syndeia dashboard, Connection Manager tab, for creating Reference connection to XML elements
Open a test model in MagicDraw. Open the Syndeia dashboard by right-clicking a package in the containment tree and selecting Syndeia → Dashboard. Select a Syndeia Cloud project for the exercise, if necessary.
Switch to the Connection Manager tab, open the SysML model (or other repository) in the left column and your local repository in the right. Expand an XML file in your local repository to view the element structure. The final result should look something like Figure 1.
Create a Reference connection between a SysML element such as a block (or another repository element) and an XML element by selecting Reference Connection in the center panel and dragging the block (or other element) onto the desired XML element (or vice versa). For example drag the block XML Connect onto the first catalog_item element in the catalog.XML file.
Check the connection created in the Connection Browser or Connection Search tab (be sure to Refresh/Get All to see the latest). See Figure 2.
Figure 2 Syndeia dashboard, Connection Browser tab, showing SysML repository after completing reference connection
Right-click it and select Compare Source & Target (see Figure 5).
Figure 3 Syndeia dashboard, Connection Browser tab, showing Compare command
The Comparison Result tab should show something like Figure 4. The result is green, showing the connected version of the XML file is the latest. The Compare Source & Target operation in the case of a Reference connection does not look at the contents of the two models, only whether there is a later version of the same target element in a configuration-managed repository.
Figure 4 Syndeia dashboard, Comparison Results tab, after completing Compare operation
In the Connection Browser, right-click the connection and select Syndeia → Open Target as shown in Figure 5. This should open the XML file in the system default text editing program. Save the file to create a new version and then return to the Connection Browser and compare again as shown before in Figure 3.
Figure 5 Syndeia dashboard, Connection Browser tab, showing Open Target command
The Comparison Result tab should show the result in red, indicating a difference. The Compare Source & Target operation in the case of a Reference connection does not look at the contents of the two models, only whether there is a later version of the same target element in a configuration-managed repository or local file system.
To change the Reference connection to the latest version of the file on the same branch, go to the Syndeia dashboard, Connection Browser, right-click the connection, and select Sync Source → Target. Now use Compare Source & Target to check that the SysML block is connected to the latest version of the file.