首页 > 解决方案 > 如何使用 M2DOC 访问图表(感兴趣的元素)的 DAnnotation eoi

问题描述

在 CAPELLA 工作台中将 M2DOC 与 Sirius 服务一起使用,我想在图表(仅那些不是上下文的)中识别哪些与 CAPELLA 模型的其他元素相关。

为此,我想在使用 Sirius 服务时访问 DAnnotation eoi(感兴趣的元素):“representationByDescriptionName”。

我应该如何进行?天狼星服务有可能吗?

提前致谢。

标签: m2doc

解决方案


注释似乎被添加到 DReprestationDescriptor 而不是 DRepresentation 本身。

您将需要创建一个 Java 服务:

public DRepresentationDescriptor getDescriptor(DRepresentation representation) {
  return new DRepresentationQuery(representation)getRepresentationDescriptor();
}

然后您可以在模板中以这种方式使用它:

{m:myDiagram.getDescriptor().eAnnotations->select(a | a.source = 'http://www.polarsys.org/capella/dannotation/ContextualElements').references}

您必须更改 URI 以选择“感兴趣的元素”。


推荐阅读