Dineshkumar
Dineshkumar

Reputation: 1558

How to find DOORS modules which meets filter criteria in a folder?

Am trying to find all the formal modules in DOORS folder which meets specific attribute values. For example,Object Text is equal to Example.

I've utilized the script(http://www.smartdxl.com/content/?p=442) to navigating to all sub folders and modules. I also opened the modules used the read function and closed successfully, normal filtering didn't work. How to perform operation on opened modules (Changing focus to opened modules)?

void processFormal(string mName)
{
    Module m = read(mName, true)        
    Object curObj = current

    descendants(false)
    ancestors(false)
    set (current Module, attribute("Object Text") = "Example", iAccepted, iRejected)
    filtering(true)

    if(iAccepted > 0)
    {
        print("Formal Module: " mName "\n")
        save view "Example items View"
    }
    close m
}

void scanFolder(Folder f)
{
    Item itm        
    for itm in f do
    {   
        if (null itm) continue
        if (isDeleted(itm)) continue
        if (type (itm) == "Formal")
        {
            string fileName = fullName(itm)
            processFormal(fileName)             
        } else continue
    }
}

scanFolder(current Folder)

Upvotes: 0

Views: 346

Answers (2)

Mike
Mike

Reputation: 2346

I think that it might also have worked by stating the module that you opened in the set function

set (m, attribute("Object Text") = "Example", iAccepted, iRejected)

Upvotes: 0

Dineshkumar
Dineshkumar

Reputation: 1558

Finally, It worked with setFocus(Module m) function.

Declaration: void setFocus(Module m)

Operation: Sets the windows focus on the module m.

Upvotes: 1

Related Questions