IBM Doors DXL: Be resistent against hard coded module paths and names with uniqueID and itemFromID / Vorbeugung von DXL Fehlern durch Verschiebung von Modulen anhand der uniqueID

Problem

In the source code, you can find modulenames with full qualified path+name, what leads to DXL errors in case of a module movement.
Im DXL Code werden Module oft mit ihrem vollem Pfad und Namen hart codiert. Wird das Modul später verschoben, kommt es zu DXL Fehlern.

Ansatz – Approach

– Find out the uniqueID of the Module (here a fictive ALM and UIT Module) / Ermitteln Sie die uniqueID des Moduls
– get the full qualified name of the module / Vollständigen Modulnamen mit Pfad mit itemFromID ( uniqueID ) ermitteln
– open module / Modul laden

Solution – Lösung

Ermittlung der unique ID eines Moduls:

  • Öffnen des Moduls / Open module
  • Öffnen des DXL Fensters / Open DXL window (Menu — Tools — Edit DXL)

Von Modul zu Item ID:

Module m = current;
print uniqueID(m) "";

Von Item ID zu Modul

Item i= itemFromID("4a8aa49d0b7c007e-000424e6");
print fullName i;

Loading of the module / Laden des Modules

// UIT Module ID: 00005771
// ALM Module ID: 0000576e
string moduleID="00005771"; // Es soll das UIT Module geladen werden
string modulePath = fullName itemFromID(moduleID) "";
Module selectedModule=read(modulePath, true, true);

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.