Holarch
课程章节

培训 · 课程 6. 迁移到 Holarch · 第 6.4 章,共 5 章

6.4 其他工具的模型 2:44

从 XMI 导入 SysML 模型:哪些内容会导入,哪些不会,以及如何重建视图。

演示 Holarch 2.21。

您将学到

  • 将 UML/SysML 模型(XMI 或 Cameo .mdzip 项目)导入已打开的项目
  • 说明从其他工具导入会带来什么、遗漏什么
  • 在数据库和“追溯”部分检查导入的条目和关系
  • 根据导入的关系重建视图

从 XMI 文件(SysML 工具导出的交换格式)导入 Plant Inspection Drone 的旧模型:其块、部件、带流程的活动和分配会作为 Asset、Action 和关系导入;图布局不会导入。在数据库和导入的 Action 图中检查结果,并用根据导入关系绘制的 Asset 图重建一个视图。

项目文件

  • 起始项目 (.holarch.json;管理项目 → 项目文件 ▾ → 导入项目 (.json)…)
  • 完成项目 (.holarch.json;管理项目 → 项目文件 ▾ → 导入项目 (.json)…)

视频从 holarch.app 播放;参见隐私政策。

练习

在 Holarch 中基于 CubeSat EO-1 演示项目亲自完成此操作。

  1. 打开您的 EO-1 演示项目(如果没有,请创建:管理项目 → 项目文件 ▾ → 新建演示项目 → CubeSat(引导式系统工程))。打开 需要与需求 → 导入和导出,在“导出”卡片上单击 导出 UML/SysML (XMI)…,将 格式 保持为 OMG XMI 2.5.1 (.xmi),然后单击 导出。该文件相当于从 Cameo 或 Enterprise Architect 等 SysML 工具导出的文件。
  2. 在 管理项目 中单击 + 新建项目,将其命名为 EO-1 Import Practice,然后单击 创建项目。打开 需要与需求 → 导入和导出,拖入 .xmi 文件,确认 格式 显示为 UML/SysML (.xmi, .uml, .mdzip),单击 继续 两次,阅读 审阅,然后单击 导入 N 个条目。
  3. 在 数据库 中搜索 class:Asset,选择 Payload Camera,并在 追溯 中确认它属于 EO-1 Spacecraft,以及它执行哪些 Action。
  4. 打开 图,单击 + 新建图,选择 Asset 图,在 图的对象 中选择 EO-1 Spacecraft,然后单击 创建。
  5. 打开 执行的 Action,列出各子系统的功能。

当新项目的 Asset 图显示航天器的各子系统及其执行的 Action 时,即完成练习。

自测

  1. Holarch 可以导入 SysML v1 工具的哪些文件,如何获得这些文件?
  2. 为什么导入后可以快速重建图?
  3. 您导入同一模型的较新导出文件。为什么不会产生副本?
显示答案
  1. Holarch 可以导入 SysML v1 工具的哪些文件,如何获得这些文件?

    带 SysML 1.x 配置文件的 XMI 2.x(来自 Cameo/MagicDraw、Enterprise Architect、Rhapsody 或 Papyrus,需从工具中导出)、Cameo 或 MagicDraw 的 .mdzip 项目(可直接导入)以及 Papyrus 的 .uml 文件。仅需求也可以通过 ReqIF 导入,表格可以通过 Excel 或 CSV 导入。

  2. 为什么导入后可以快速重建图?

    其他工具中的图布局不会导入,但关系会导入。Holarch 根据这些关系绘制 Asset 图、层级图和其他图。

  3. 您导入同一模型的较新导出文件。为什么不会产生副本?

    每个导入的条目都保留其 XMI ID,对于 XMI 文件,“匹配现有实体的依据”默认为 XMI ID,因此之后的导入会更新这些条目。已存在的关系不会重复添加。

延伸阅读

文字稿

显示文字稿 (旁白和屏幕内容)

Introduction

Chapter four: models from other tools. Teams that used another modeling tool usually have a model to bring along, not just requirements. Holarch reads UML and SysML models in XMI, the exchange format that SysML tools export.

We import an older model of the Plant Inspection Drone. The file was made for this course, in the form a SysML tool exports.

What comes across

Be clear about what comes across. Blocks become assets, and their parts become the decomposition. Activities become actions, with their flow, and allocations say which asset performs each action. Diagram layouts do not come across: you rebuild the views you need in Holarch.

On screen: Card: what comes across.

Import the file

Open Needs and Requirements, then Import and Export, and drop the file. Holarch detects the format from the file: UML and SysML.

On screen: Needs & Requirements → Import and Export → drop the .xmi file → Analyzed.

Click Continue, and Continue again. Review lists ten new items and eleven relationships, and one activity whose flow comes from the file. Click Import, and the items are merged into the open project. Each one keeps its XMI ID, so importing a later export of the same model updates them instead of adding copies.

On screen: Continue → Map → Continue → Review → Import 10 items.

Check the result

Open the Database, and filter to assets: type class, colon, Asset. The drone, its five subsystems and their descriptions are all here.

On screen: Database → class:Asset.

Select the flight controller, and open Trace in its inspector. It is part of the drone, and it performs Fly Inspection Route: the allocation from the old model.

On screen: Flight Controller → inspector Trace.

The activity came across with its flow. Open Inspect a Tank on the Diagrams page: its action diagram runs the three steps in order.

On screen: Diagrams → Inspect a Tank action diagram.

Rebuild the views

The block diagrams did not come across, but the relationships did, so views are quick to rebuild. On the Diagrams page, choose New Diagram, then Asset Diagram, with the drone as its root: its subsystems are drawn at once.

On screen: Diagrams → New Diagram → Asset Diagram → root Plant Inspection Drone → Create.

Turn on Performed Actions, and each subsystem shows the functions it performs.

On screen: Show Performed Actions.

Recap

Let's recap. An XMI file brings blocks, parts, activities with their flow, and allocations, as assets, actions and relationships. Diagram layouts are rebuilt in Holarch, and the imported relationships make that quick.

Next, cleaning up after all these imports.