How do I display links from all modules (opened or closed) in DOORS DXL? -
i'm writing dxl script following links through multiple levels. i've noticed script correctly iterates through these links when modules open. however, there approximately 20 modules iterate through , don't want open of these modules. how view these links without having manually open linked modules?
here's example of code:
// checks see if object exists or not. if not returns null. // adapted make sure object // specific set of modules, we're checking ability // retrieve object getobject(link obj_link) { moduleversion other_ver = null modname_ other_mod = null object other_obj other_ver = sourceversion obj_link other_mod = module(other_ver) if (null other_mod || isdeleted other_mod) return null other_obj = source obj_link if (null other_obj) load(other_ver, true) other_obj = source obj_link if (isdeleted other_obj) return null return other_obj } // displays object specific link module if it's found void showout(object o) { link l_obj_link string s = null item linkmoditem = itemfromid(module_id) string linkmodname = fullname(linkmoditem) l_obj_link in all(o <- linkmodname) { object test_obj display("test") test_obj = getobject(l_obj_link) if (null test_obj){ display("null object found") } else { s = proberichattr_(test_obj, "object identifier", false) displayrich(s) } } } // call showout object showout(obj)
again, using layout dxl script can see object id if , if linked module opened.
first of all, recommend using analysis -> wizard
, sure select option all modules
instead of all open modules
generate code instead, modify code display want if doesn't give need.
however, if want update existing code need change getobject
function include opening each module silently (to information module must open, doesn't need visible).
object getobject(link obj_link) { moduleversion other_ver = null modname_ other_mod = null object other_obj other_ver = sourceversion obj_link other_mod = module(other_ver) module m = read(fullname(other_ver), false) // false, tells open silently. if (null other_mod || isdeleted other_mod) return null other_obj = source obj_link if (null other_obj) load(other_ver, true) other_obj = source obj_link if (isdeleted other_obj) return null return other_obj }
this should work still recommend starting analysis wizard instead because cleaner.
Comments
Post a Comment