IBM Doors DXL: How to get the next major and minor baseline number in a copied module, that is not containing baselines

Problem

Copied modules do not have any baselines that can be read with the standard method getMostRecentBaseline(module m), although the last baseline number is copied. The method returns NULL when the module is copied because the baseline list in the module is empty, although the next major wouldn’t be 1.0 and the next minor wouldn’t be 0.1.

Example:

Ansatz – Approach

In this example a radioBox is populated with the next Major and next Minor Baseline number using the suffix(„“) method that returns a usable baseline instance for the use with the major- and minor function.

Solution – Lösung

pragma runLim, 0;

Module m=current;

DB mainDialog;
DBE radioBoxDBE;

string comboBoxAuswahl[2];
Baseline b = getMostRecentBaseline(m);

// Trick: Wenn b null ist probiere es nochmal 
// mit suffix("")
if(null b) b = suffix("");
		
// war keine Baseline vorhanden liefert major b und 
// minor b jew. 0 zurück
comboBoxAuswahl[0]= (major b) "." ((minor b)+1) "";
comboBoxAuswahl[1]= ((major b)+1) ".0";	

mainDialog = create("Baseline Change History");	
radioBoxDBE=radioBox (mainDialog, "Version", comboBoxAuswahl, -1);

realize(mainDialog);		
show(mainDialog);

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.