首页 > 解决方案 > 如何在 DOORS 中一次删除多行?

问题描述

背景

我正在从 DOORS 文件中删除过时的信息行。我知道如何删除行的方法是通过以下过程一次执行一个:

  1. 选择我要删除的行
  2. 打开表格菜单
  3. 挥动删除选项
  4. 点击选项
  5. 对每一行重复。

问题

有没有办法在 DOORS 中一次批量删除多行?

标签: ibm-doors

解决方案


所以 - 这比看起来要复杂一些,主要是因为 DOORS 不允许在没有 DXL 脚本的情况下非顺序选择项目。

如果我这样做,我会执行以下操作:

首先,将要删除的每一行的第一个元素设置为可识别的内容 - 例如,“||DELETED||”

接下来,我将运行以下代码:

// Use the current module
Module m = current
// Grab the first object
Object o = first ( m )
// Loop through the objects in the module - using a deletion in the loop, so no for o in m
while ( !null o ) {
    // Check for our deletion flag
    if ( o."Object Text" "" == "||DELETED||" ) {
        // Grab the parent object - this will actually be the 'row object'
        Object oP = parent ( o )
        // Set 'o' to point to the object right before the deletion (to allow loop to continue)
        o = previous ( parent ( o ) )
        // Softdelete that row object
        softDelete ( oP )
    }
    // Go to the next object (on the last object, will set equal to null)
    o = next ( o )
}

这可能不是解决这个问题的最佳方法——我一直想尝试一下 GUI 中的非顺序选择。但它应该完成你想要做的事情。


推荐阅读