我需要在DOORS中添加一个traceability列,它可以显示来自三个不同对象的结果。
我的模块有两列用作引用列: BPMN Object Type和BPMN Object text。这三种BPMN对象类型是数据对象、活动和事件。
已经设置了三个模块,每个模块都有各自的详细信息。BPMN对象文本既存在于源模块中,也存在于目标模块中,其中有一列需要放入源模块中,即存在于目标模块中的元素描述。我可以创建DXL可追溯性列来提取每个列,但它们被提取到三个单独的列中。
这是一个工作示例中的DXL,由我的一个前辈创建(注意:这是由DOORS中的Traceability Wizard自动生成的):
// DXL generated by DOORS traceability wizard on 14 July 2015.
// Wizard version 2.0, DOORS version 9.5.2.1
pragma runLim, 0
void showOut(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
//Auto Translated: Item linkModItem = itemFromID("446ca74a57b60977-00031da0")
//Auto Translated: Item linkModItem = itemFromID("446ca74a57b60977-00031f80")
Item linkModItem = itemFromID("446ca74a57b60977-00032080")
if (null linkModItem) {
displayRich("\\pard " "<<Link module not found>>")
} else if (type(linkModItem) != "Link") {
displayRich("\\pard " "<<Invalid link module index for this database>>")
} else {
string linkModName = fullName(linkModItem)
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
doneOne = true
if (depth == 1) {
disp = ""
s = name(otherMod)
if (isBaseline(otherVersion)) {
s = s " [" versionString(otherVersion) "]"
}
s = probeRichAttr_(othero,"Element Description", true)
disp = disp s
displayRich("\\pard " disp)
}
}
}
}
showOut(obj,1)我需要traceability列的内容来根据BPMN Object Type显示BPMN对象文本的元素描述。
发布于 2019-09-16 21:27:39
假设这三行指向不同的linkModItem,表示链接到三种不同的模块类型。在本例中,您需要在所有linkModItem上创建一个循环,并为每个链接模块执行行Item linkModItem =...和以下行。
像这样的东西应该是有效的:
string linkModuleIDs[] = {"446ca74a57b60977-00031da0", "446ca74a57b60977-00031f80", "446ca74a57b60977-00032080"}
int i
for (i=0 ; i < sizeof linkModuleIDs ; i++) {
Item linkModItem = itemFromID(linkModuleIDs[i])
if (null linkModItem) .... the rest like above
}发布于 2019-09-17 01:07:46
// DXL generated by DOORS traceability wizard on 16 September 2019.
// Wizard version 2.0, DOORS version 9.6.1.11
pragma runLim, 0
string limitModules[] = {"446ca74a57b60977-0002ac00", "446ca74a57b60977-000320a0", "446ca74a57b60977-0002ac02"}
void showOut(Object o, int depth) {
int i
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
Item linkModItem = itemFromID("446ca74a57b60977-00020b09")
for (i=0 ; i < sizeof limitModules ; i++) {
if (null linkModItem) {
displayRich("\\pard " "<<Link module not found>>")
} else if (type(linkModItem) != "Link") {
displayRich("\\pard " "<<Invalid link module index for this database>>")
} else {
string linkModName = fullName(linkModItem)
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod, (itemFromID limitModules[i]))) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
doneOne = true
if (depth == 1) {
s = probeRichAttr_(othero,"Element Description", true)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
}
}
}
}
showOut(obj,1)https://stackoverflow.com/questions/57957208
复制相似问题