DXL DOORS从特定历史版本中检索红线

时间:2018-03-01 16:16:58

标签: module baseline ibm-doors

我想知道是否可以使用DXL检索DOORS中特定历史版本中特定修改的红线?

具体来说,我想要一个脚本来检索当前用户添加或删除的最新一组外链接。

Psuedo-code可能如下所示:

// Loop through all displayed objects in the current module
for o in m do {

    // Loop through all baseline histories (no need to display baseline)
    for currHistory in o do {

        // If out-links were added/removed in this history version
        // break the loop because we only want the most recent version
        if ( Out-Links Were Added/Removed )  break loop

    }

    // Loop through all modifications in the current history verision
    for modification in currHistory do {

        // True if this modification was made by the current user
        if (modification.Author == Current User) {

            // True if Out-Link was added
            if (modification == Added Out-Link) {
                print "Link Added: "  The_Link "\n"
            }

            // True if Out-Link was removed
            elseif (modification == Removed Out-Link) {
                print "Link Removed: "  The_Link "\n"
            }
        }

    }

}

这样的事情是否可能?如果是这样,我该怎么做呢?

1 个答案:

答案 0 :(得分:1)

让我确保理解您的问题 - 您想看看用户是否在模块的特定版本中添加或删除了链接 - 我假设“特定历史版本”您的意思是与基线相当的东西和/或当前版本的模块。

这是否可能 - 绝对。

我该怎么做:

// Loop Through Objects
Object o
Module m = current
User u = find()
string uName = u.name
for o in m do {
    // Loop through history records
    History hr
    for hr in o do {
        HistoryType ht = hr.type
        // Check if link creation / deletion and history record author matches current user
        if ( ( ( ht == createLink ) || ( ht == deleteLink ) ) && ( uName == hr.author ) ) {
            print goodStringOf ( ht ) ":\n"
            print "Source Object: " hr.sourceAbsNo "\n"
        }
    }
}

请注意!这只会处理外链接(链接创建的历史记录可以在相应的源模块中找到)

如果需要,您可以抓取其他历史记录(hr)属性,例如日期。

这有帮助吗?