【发布时间】:2018-08-24 07:39:44
【问题描述】:
我正在处理一个包含或多或少 50 个模块和数千个模块对象的项目。
我需要修改每个模块的某些对象上的“从父级继承”字段。
我发现这样做的一种方法是打开每个模块并运行我所做的以下 dxl 脚本……显然,打开所有模块是一个疯狂的解决方案!!!
/*
** Set_Inherit_Attribute_FALSE ***
Remove flag from the attribute "Inherit from Parent"
on each object of each module of the project
*/
// Variable definition
Object o
Module m
string serr
// file name provided by DOORS containing the results
string filename = tempFileName
print "FILE CONTAINING RESULTS - " filename "\n"
// open file in write mode
Stream outputLog = write filename
// Set current project
Project prj = current Project
print "PROJECT - "(name prj) "\n"
outputLog << "-------------------- PROJECT " (name prj) " --------------------\n\n"
// Management of each module in the project
for m in prj do {
// write in outputLog the MODULE name
outputLog << "\n**************** MODULE " (name m) " ****************\n"
// set the "inherited" to false
for o in entire m do {
// The "Inherited" has to be updated just for NOT LEAF object
if (!leaf(o)){
// write in outputLog the obj id modified
outputLog << "OBJ ID " (identifier o) "\n"
serr = specific(o)
// Check if the set of "inherited" failed
if (!null serr){
// inform the user and stop the execution
outputLog << "OBJECT ERROR"
ack "ERROR INHERITED"
// close outputLog
close outputLog
halt
}
}
}
// save modificiation on module m
save m
}
// close outputLog
close outputLog
// Inform the user the execution is ended
ack "EXECTUTION COMPLETED"
有没有办法在不打开所有模块的情况下进行相同的修改?
谢谢。
【问题讨论】:
标签: ibm-doors