Prev | Next |
Migrate SysML Model to Later SysML Version
Enterprise Architect provides a useful feature to migrate a model from one version of SysML to the next. A model (or part of a model) created in an older version of the SysML MDG Technology can be migrated to the next version using the automation interface. This function updates the Tagged Values and, if required, stereotypes to the later version for all elements, attributes, connectors and diagrams under the selected Package or element.
Example Script for Migrating SysML 1.1 to SysML 1.2
This VB script calls the Migrate() function to migrate the SysML 1.1 Package or element to SysML 1.2:
Sub MigrateElement (sGUID, lngPackageID)
Dim proj as EA.Project
set proj = Repository.GetProjectInterface
proj.Migrate sGUID, "SysML1.1", "SysML1.2"
'refresh the model
If lngPackageID<>0 Then
Repository.RefreshModelView (lngPackageID)
End If
End Sub
Sub MigrateSelectedItem
Dim selType
Dim selElement as EA.Element
Dim selPackage as EA.Package
selType = GetTreeSelectedItemType
If selType = 4 Then 'means Element
set selElement = GetTreeSelectedObject
MigrateElement selElement.ElementGUID, selElement.PackageID
MsgBox "Element Migration Completed",0,"SysML Migration"
ElseIf selType = 5 Then 'means Package
set selPackage = GetTreeSelectedObject
MigrateElement selPackage.PackageGUID, selPackage.PackageID
MsgBox "Package Migration Completed",0,"SysML Migration"
Else
MsgBox "Select a Package or Element in the Project Browser to initiate migration",0,"SysML Migration"
End If
End Sub
Sub Main
MigrateSelectedItem
End Sub
Main
Migrate SysML 1.1 to SysML 1.3
Migrate from SysML 1.1 to SysML 1.2, as explained earlier, then migrate from SysML 1.2 to SysML 1.3, as described in the next section.
Migrate SysML 1.2 to SysML 1.3
The MDG Technology for SysML 1.3 has a built-in script for migrating 1.2 models to 1.3. You must enable both the MDG Technology for SysML 1.2 and the MDG Technology for SysML 1.3. Firstly, you select the SysML 1.2 Package in the Project Browser, then you open the Scripting window and open the SysML 1.3 script group, and finally you execute the Migrate script.
Migrate SysML 1.3 to SysML 1.4
The MDG Technology for SysML 1.4 has a built-in script for migrating 1.3 models to 1.4. You must enable both the MDG Technology for SysML 1.3 and the MDG Technology for SysML 1.4. Firstly, you select the SysML 1.3 Package in the Project Browser, then you open the Scripting window and open the SysML 1.4 script group, and finally you execute the Migrate script.
Notes
- Stereotype dimension is changed to quantitykind
- Stereotype dataType is removed from SysML1.2
- Tagged Value dimension is migrated to quantitykind; this applies to stereotypes <<unit>>
and <<valueType>>
- Tagged Value isConjugated of stereotype <<flowport>> is migrated to custom properties
Learn more