Search code examples
ibm-doors

How do I delete multiple rows at once in DOORS?


Background

I am trimming outdated rows of information from a DOORS file. The way I know how to delete rows is to do them one at a time by the following procedure:

  1. Select the row I want to delete
  2. Open the Table menu
  3. Wave over the Delete option
  4. Click on the Row option
  5. Repeat for each row.

Question

Is there a way to do a bulk delete of multiple rows at once in DOORS?


Solution

  • So- this is a bit trickier than it appears, mostly because DOORS does not allow for non-sequential selection of items without DXL scripting.

    If I were doing this, I would do the following:

    First, set the first element of each row that is going to be deleted to something recognizable- for example, "||DELETED||"

    Next, I would run the following code:

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

    This may not be the best way to go about this- I've always wanted to take a crack at non-sequential selection in the GUI. But it should accomplish what you are looking to do.