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

问题描述 投票:1回答:1

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

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

伪代码可能如下所示:

// 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"
            }
        }

    }

}

这样的事情甚至可能吗?如果是这样,我该怎么办呢?

module baseline ibm-doors
1个回答
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)属性,例如日期。

这有帮助吗?

© www.soinside.com 2019 - 2024. All rights reserved.