【发布时间】:2019-10-17 13:25:20
【问题描述】:
所以,我现在正在尝试制作一个正式的模块合并工具,到目前为止一切正常,除了链接复制。以下是我们的复制方式
- 我们清空已经基线化的接收正式模块
- 我们复制具有正确层次结构的对象
- 那我们应该复制链接
(是的,它更像是一个销毁和重建工具,而不是合并,但最终结果是一样的)
问题是,对于传入链接,我被告知链接的源对象不可访问,即使加载了正式模块,我也可以访问并使用它做任何我想做的事情。这是复制传入链接的代码
for o in entire PRBaseline do
{
//Once current PBS has been emptied, start recovering objects from baseline
print "Inside Object : " o."IE PUID" "\n" ""
//Once current PBS is emptied & reconstructed to this PBS baseline, do links.
Link incomingLink
Link outLink
Object sourceObject
Object targetObject
for incomingLink in all(o <- "*") do //Iterate on all incoming baselined links, and load source module
{
ModName_ srcModRef = source(incomingLink)
Module temp = edit(fullName(srcModRef),true)
sourceObject = source(incomingLink)
Object oPRCurr
print name srcModRef
print sourceObject."IE PUID" ""
for oPRCurr in modOldPR do
{
print "Currently on Object : " oPRCurr."IE PUID" " and object : " o."IE PUID" "\n" ""
if (oPRCurr."IE PUID" "" == o."IE PUID" "")
{
createLinkset(fullName(srcModRef), fullName(modOldPR), "Test")
print sourceObject."IE PUID" "\n" ""
sourceObject -> "/Test_Access/Test" -> oPRCurr
print "Creating link between source object : " sourceObject."IE PUID" " & target object : " oPRCurr."IE PUID" " from" name srcModRef "\n" ""
}
}
}
}
至于传出链接,我什至无法恢复链接的目标对象,即使我已经在编辑模式下加载了目标模块
// Continuation of preceding code block
for outLink in all(o -> "*") do
{
ModName_ srcModRef = target(outLink)
print name srcModRef " est la cible \n" ""
Module temp = read(fullName(srcModRef),true)
targetObject = target(outLink)
Object oPRCurr
print name srcModRef
for oPRCurr in modOldPR do
{
print "Currently on Object : " oPRCurr."IE PUID" " and object : " o."IE PUID" "\n" ""
if (oPRCurr."IE PUID" "" == o."IE PUID" "")
{
createLinkset(fullName(srcModRef), fullName(modOldPR), "Test")
oPRCurr -> "/Test_Access/Test" -> targetObject
print "Creating link between target object : " " " " & source object : " oPRCurr."IE PUID" " from" name srcModRef "\n" ""
}
}
}
很抱歉,如果我已经在问一个以前有人问过的问题,但我不知道为什么它不起作用,而且我已经尝试了很多解决方案。
【问题讨论】:
标签: ibm-doors