In DXL, when looking at an objects links, only out links will return a valid object unless the source module is open. This function takes an object and the full name of a link module. It iterates through the in links that use this link module and ensure that the source module is open.
//------------------------------------------------
// loadInLinkSourceModules()
//------------------------------------------------
/*
* Ensure the source modules for all in-links (through
* the specified link name) are loaded
*/
void loadInLinkSourceModules(Object o, string strLinkName) {
ModName_ modNameSource = null
ModuleVersion ModVerSource = null
Object oSource = null
Link l
LinkRef lr
string strLinkModName = ""
for lr in all (o <- strLinkName) do {
modNameSource = module( sourceVersion lr)
if (!null modNameSource) {
if ((!isDeleted modNameSource) && (null data(sourceVersion lr))) {
load((sourceVersion lr), false)
}
}
}
} // loadInLinkSourceModules()