【问题标题】:DOORS - Traceability ColumnDOORS - 可追溯性专栏
【发布时间】:2019-09-16 12:46:25
【问题描述】:

我需要在 DOORS 中添加一个可追溯性列,可以显示来自三个不同对象的结果。

我的模块有两列用作参考列:BPMN 对象类型和 BPMN 对象文本。 三种 BPMN 对象类型是数据对象、活动和事件。
已经设置了三个模块,它们分别具有每个模块的详细信息。 BPMN 对象文本既存在于源模块中,也存在于目标模块中,我需要将列引入源模块,即元素描述,存在于目标模块中。 我可以创建 DXL 可追溯性列来拉入每个列,但它们会被拉入三个单独的列。

这是一个工作示例中的 DXL,由我的一位前辈创建(注意:这是由 DOORS 中的 Traceability Wizard 自动生成的):

    // DXL generated by DOORS traceability wizard on 14 July 2015.
    // Wizard version 2.0, DOORS version 9.5.2.1
    pragma runLim, 0
    void showOut(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    //Auto Translated:     Item linkModItem = itemFromID("446ca74a57b60977-00031da0")
    //Auto Translated:     Item linkModItem = itemFromID("446ca74a57b60977-00031f80")
    Item linkModItem = itemFromID("446ca74a57b60977-00032080")
    if (null linkModItem) {
        displayRich("\\pard " "<<Link module not found>>")
    } else if (type(linkModItem) != "Link") {
        displayRich("\\pard " "<<Invalid link module index for this database>>")
    } else {
        string linkModName = fullName(linkModItem)
        for l in all(o->linkModName) do {
            otherVersion = targetVersion l
            otherMod = module(otherVersion)
            if (null otherMod || isDeleted otherMod) continue
            othero = target l
            if (null othero) {
                load(otherVersion,false)
            }
            othero = target l
            if (null othero) continue
            if (isDeleted othero) continue
            doneOne = true
            if (depth == 1) {
                disp = ""
                s = name(otherMod)
                if (isBaseline(otherVersion)) {
                    s = s " [" versionString(otherVersion) "]"
                }

                s = probeRichAttr_(othero,"Element Description", true)
                disp = disp  s
                displayRich("\\pard " disp)
            }
        }
    }
}
showOut(obj,1)

我需要可追溯性列的内容来根据 BPMN 对象类型显示 BPMN 对象文本的元素描述。

【问题讨论】:

  • 澄清 - 我需要在 DOORS 中添加一个可追溯性列,可以显示来自三个不同模块的结果。
  • 解决方案取决于您的设置。您是否使用不同的链接模块链接到数据对象、活动和事件? (你应该这样做,因为指向数据对象的链接与指向事件的链接具有不同的含义)
  • 有 3 个链接模块,连接到三个不同的正式模块(事件、活动、数据对象)。
  • 那么下面的解决方案应该可以工作

标签: ibm-doors


【解决方案1】:

假设指向不同linkModItems 的三行表示指向您的三种不同模块类型的链接。在这种情况下,您需要在所有linkModItems 上创建一个循环,并为每个链接模块执行Item linkModItem =... 和以下行。

这样的事情应该可以工作:

string linkModuleIDs[] = {"446ca74a57b60977-00031da0", "446ca74a57b60977-00031f80", "446ca74a57b60977-00032080"}
int i
for (i=0 ; i < sizeof linkModuleIDs ; i++) {
  Item linkModItem = itemFromID(linkModuleIDs[i])
  if (null linkModItem) .... the rest like above
}

【讨论】:

  • 我能够采用您建议的解决方案的变体并使其与我当前的可追溯性列一起使用:
【解决方案2】:
// DXL generated by DOORS traceability wizard on 16 September 2019.
// Wizard version 2.0, DOORS version 9.6.1.11
pragma runLim, 0
string limitModules[] = {"446ca74a57b60977-0002ac00", "446ca74a57b60977-000320a0", "446ca74a57b60977-0002ac02"}
void showOut(Object o, int depth) {
int i
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    Item linkModItem = itemFromID("446ca74a57b60977-00020b09")
for (i=0 ; i < sizeof limitModules ; i++) {
    if (null linkModItem) {
        displayRich("\\pard " "<<Link module not found>>")
    } else if (type(linkModItem) != "Link") {
        displayRich("\\pard " "<<Invalid link module index for this database>>")
    } else {
        string linkModName = fullName(linkModItem)
        for l in all(o->linkModName) do {
            otherVersion = targetVersion l
            otherMod = module(otherVersion)
            if (null otherMod || isDeleted otherMod) continue
            if (!equal(getItem otherMod, (itemFromID limitModules[i]))) continue
            othero = target l
            if (null othero) {
                load(otherVersion,false)
            }
            othero = target l
            if (null othero) continue
            if (isDeleted othero) continue
            doneOne = true
            if (depth == 1) {
                s = probeRichAttr_(othero,"Element Description", true)
                if (s == "") 
                displayRich("\\pard " " ")
                else
                displayRich("\\pard " s)
            }
        }
    }
}
}
showOut(obj,1)

【讨论】:

  • 这是您问题的答案,还是您要编辑问题?
猜你喜欢
  • 2021-01-07
  • 1970-01-01
  • 2018-12-20
  • 1970-01-01
  • 1970-01-01
  • 2021-07-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多