I use this loop at end of my script to detect if I have still modules open :
for module_in_database in database do
{
logResult = logResult "INFO: open modules at the end the script are " fullName(module_in_database) "\n"
}
Then at the end of my (quite complex script), I still have those module open :
INFO: open modules at the end the script are /spec_fpga/spec_fpga
INFO: open modules at the end the script are /spec produit/spec_produit
INFO: open modules at the end the script are /spec produit/spec_produit
INFO: open modules at the end the script are /spec_fpga/_conf/OBJ_satisfies_OBJ
INFO: open modules at the end the script are /spec_fpga/_conf/OBJ_satisfies_OBJ
What could I do to close those and even better to understand why there are still open (identify the name of variable that are linked to them ?) Is it normal to have a link module open ? I don't open such link module. Are they open automatically with the downstream module ? I don't even know if it is a module that is open or a baseline of a module.
I am unsure why spec_produit and OBJ_satisfies_OBJ appear twice, one of spec_produit (formal module?) might be separate baselines, but for link modules like OBJ_satisfies_OBj, it is rare to have baselines. You might get to know when your modules are opened by starting "Tools→Manage open modules" and regarding the list while your script runs. Perhaps you want to use a DXL Debugger for this. Generally, link modules are opened automatically when a formal module that contains out links is opened, but usually they are closed again automatically when the formal module closes. Formal modules can be opened when they contain in links and an out link to this module is opened. You might have one module with a (default) view that follows all its out links. Or there might be a trigger or DXL attribute in a module that does something similar.
You might want to check isBaseline moduleVersion module_in_database
and versionString moduleVersion module_in_database
to get more information.
To close them, just use close module_in_database
.
on a side note: in DXL it is never a good idea to close something that you currently loop over, so you want to use a temporary skip list like this:
Skip closeMe = create
for module_in_database in database do {
logResult = logResult "INFO: currently open: " (fullName module_in_database) ((isBaseline (moduleVersion module_in_database)) ? " Baseline " (versionString moduleVersion module_in_database) : " (current version)") "\n"
put (closeMe, module_in_database, module_in_database)
}
Module m
for m in closeMe do {
if open (module m) then {
logResult = logResult "INFO: closing " fullName m "\n"
close m
} }
delete closeMe