Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id1476040892
Content column
id1476040912
Content block
id1476040902

To retrieve the Server Project Version in a Diagram


  1. Right-click the empty space on the diagram pane and open the Specification window.
  2. On the left side of the dialog, select TraceabilityCreate. Expression dialog opens.
  3. Select Create operation > Script.

    Note

    If you cannot see the Script operation under Operations, make sure the Expert mode is enabled.

  4. Specify the Name for the derived property.
  5. Set the Type as String.
  6. Specify the Operation Name.
  7. From the Language drop-down list, select JavaScript Rhino.
  8. Insert the following script as the Body

    Code Block
    titleJavaScript Rhino
    var prj = com.nomagic.magicdraw.core.Application.getInstance().getProject().getPrimaryProject();
    var ver = com.nomagic.magicdraw.core.ProjectUtilities.getVersion(prj);
    ver.getName();

  9. Click OK.


To display the Server Project Version in a Diagram


  1. Create the Note symbol in the diagram and anchor it to the diagram.
  2. Right-click the Note symbol and deselect Represent Diagram Context (Package).
  3. (Optional) Right-click the Note symbol and deselect Apply SysML Callout Style.
  4. Right-click the Note symbol and select Edit Compartments.
  5. In the Element Properties tab of the Compartment Edit dialog, select the name of the property you created.

  6. Click OK. You can see the property name and the server project version in the Note symbol.
Content block
id1361589025