【发布时间】:2018-09-25 08:33:39
【问题描述】:
我想计算 IBM Doors 项目中所有模块中所有对象的所有链接。 (使用 DXL)
所以我就是这样做的(主要是调用函数goThroughFolders(current Folder)):
-
遍历项目中的每个文件夹,检查是否有模块,如果有模块调用函数“checkLinks(Module m)”
void goThroughFolders(Folder f) { Item itm if (null f) return for itm in f do{ print("\nScanning folder...") if (null itm) continue if (isDeleted(itm)) continue else if ((type (itm) == "Project") || (type (itm) == "Folder")) { goThroughFolders(folder(itm)) } else if (type (itm) == "Formal") { print("\nFound Module") checkLinks(module(itm)) } } }-
检查模块的链接
void checkLinks(Module m) { string objType = "" Object o = null Link anyLink for o in m do { objType = o."Object Type" "" // Check if the type is right if ( ( objType == "Req" ) || ( objType == "Obj" ) ) { // Check for any outlinks at all for anyLink in o <- "*" do{ LinkCount++ }} } }
-
所以我的问题是goThroughFolders(Folder f) 中的函数调用checkLinks(module(itm)) 似乎交出了null 对象。
Error:
-R-E- DXL: <Line:11> null Module do loop parameter was passed
Backtrace:
<Line:69>
<Line:78>
-I- DXL: execution halted
但我不知道为什么?你能帮帮我吗?
【问题讨论】:
-
在 checkLinks() 中发现我的错误必须是 m = read (fullName(itm), false, true) //打开模块 checkLinks(m)
标签: ibm-doors