Search code examples
ibm-doors

Is it possible to get a module from a baseline object in DOORS?


I need to get the most recent baseline of a module in DOORS DXL. How do I store all of the objects from this version of the module in a skip list? Can I get the module objects from the baseline?

Chris


Solution

  • most recent baseline:

    Baseline getMostRecentBaseline(Module m [,bool lastbaseline])
    

    Returns the last baseline. If lastbaseline is set to true, it returns the version number of the last baseline even if it has been deleted. Otherwise, it returns the last baseline that still exists.

    module from baseline:

    Module load([Module m,] Baseline b, bool displ
    

    Loads baseline b of module m; and if the last argument is on or true, displays it. If the first argument is omitted, it uses the current module

    Objects to skip list: that depends on what you want to do with these objects, which information you need (structure, links, content of (all?) attributes etc.), whether you want to have information available even after you closed the module, etc.

    The first approach might be

    // key: type integer = absolute Number
    // value: type Object = complete object (valid only until the module is closed)
    Skip skObjects = create()
    Module mBaseline = load (m, getMostRecentBaseline(m, false), false)
    Object o
    for o in entire mBaseline do {
        int absNo = intOf(o."Absolute Number""")
        put (skObjects, absNo, o)
    }
    

    Another approach might be that your skip list contains some information about the object, that is valid after the module is closed:

    // key: type integer = absolute Number
    // value: type Skip =
    //     key: type string = property name
    //     value: type string = value of property
    // information is still valid when Module is closed
    ...
    Object o
    for o in entire mBaseline do {
        int absNo = intOf(o."Absolute Number""")
        Skip skProperties = createString()
        put (skProperties, "Object Heading", o."Object Heading""")
        put (skProperties, "Object Text", o."Object Text""")
        put (skProperties, "Priority", o."Priority""")
        put (skProperties, "Object number", number (o) "")
        put (skProperties, "Object level", level (o) "")
        put (skProperties, "Object Parent AbsNo", (parent (o))."Absolute Number" "")
        
        put (skObjects, absNo, skProperties)
    }
    

    Or may be you want to store that Skip List into another Skip List which contains Modules (key might be fullName m)