Compare baseline using Layout DXL or DXL Attribute

Is there a way to have a layout dxl or a dxl attribute to compare the current module with the Baseline?

I can do it outside to create reports, but I can't find a way to reference the Baseline without having to load it.

Any comments or reference about this is welcome. Thanks.
SystemAdmin - Thu Jun 16 12:54:16 EDT 2011

Re: Compare baseline using Layout DXL or DXL Attribute
SystemAdmin - Thu Jun 16 13:04:15 EDT 2011

This is all i can figure out, but when I tried to use it with the layout dxl, every time it refreshes it loads the module

Module currMod = current
Object obj = current(currMod)
int objID = intOf(obj."Absolute Number""")
bool head = false
string val = null
Buffer oldVal = create
Buffer newVal = create
Buffer result = create
if(!null obj."Object Text"""){
    newVal= obj."Object Text"""
}
else if(!null obj."Object Heading"""){
                newVal= obj."Object Heading"""
        }
        else{
                newVal= "Contains OLE or Value is Null"
        }
Baseline latestBase = getMostRecentBaseline(currMod)
Module baseMod = load(latestBase, true)
Object baseObj = object(objID, baseMod)
if(!null baseObj){
        oldVal += baseObj."Object Heading"""
        oldVal += baseObj."Object Text"""
}
 
diff(result,oldVal, newVal)
print (stringOf(result))

Re: Compare baseline using Layout DXL or DXL Attribute
SystemAdmin - Thu Jun 16 13:20:17 EDT 2011

SystemAdmin - Thu Jun 16 13:04:15 EDT 2011

This is all i can figure out, but when I tried to use it with the layout dxl, every time it refreshes it loads the module

Module currMod = current
Object obj = current(currMod)
int objID = intOf(obj."Absolute Number""")
bool head = false
string val = null
Buffer oldVal = create
Buffer newVal = create
Buffer result = create
if(!null obj."Object Text"""){
    newVal= obj."Object Text"""
}
else if(!null obj."Object Heading"""){
                newVal= obj."Object Heading"""
        }
        else{
                newVal= "Contains OLE or Value is Null"
        }
Baseline latestBase = getMostRecentBaseline(currMod)
Module baseMod = load(latestBase, true)
Object baseObj = object(objID, baseMod)
if(!null baseObj){
        oldVal += baseObj."Object Heading"""
        oldVal += baseObj."Object Text"""
}
 
diff(result,oldVal, newVal)
print (stringOf(result))

Never Mind, I got it. I was worry about if the baseline was going to be close or not in the background. At least it did what I wanted in the first attempt, I will update the script, if i got any other issue, or if I improved the script.

Module currMod = current
int objID = intOf(obj."Absolute Number""")
Buffer oldVal = create
Buffer newVal = create
Buffer result = create
if(!null obj."Object Text"""){
    newVal= obj."Object Text"""
}
else if(!null obj."Object Heading"""){
                newVal= obj."Object Heading"""
        }
        else{
                newVal= "Contains OLE or Value is Null"
        }
Baseline latestBase = getMostRecentBaseline(currMod)
Module baseMod = load(latestBase, false)
Object baseObj = object(objID, baseMod)
if(!null baseObj){
        oldVal += baseObj."Object Heading"""
        oldVal += baseObj."Object Text"""
}
 
diff(result,oldVal, newVal)
displayRichWithColor(stringOf(result))
 
delete(newVal)
delete(oldVal)
delete(result)

Re: Compare baseline using Layout DXL or DXL Attribute
llandale - Thu Jun 16 15:01:16 EDT 2011

SystemAdmin - Thu Jun 16 13:20:17 EDT 2011

Never Mind, I got it. I was worry about if the baseline was going to be close or not in the background. At least it did what I wanted in the first attempt, I will update the script, if i got any other issue, or if I improved the script.

Module currMod = current
int objID = intOf(obj."Absolute Number""")
Buffer oldVal = create
Buffer newVal = create
Buffer result = create
if(!null obj."Object Text"""){
    newVal= obj."Object Text"""
}
else if(!null obj."Object Heading"""){
                newVal= obj."Object Heading"""
        }
        else{
                newVal= "Contains OLE or Value is Null"
        }
Baseline latestBase = getMostRecentBaseline(currMod)
Module baseMod = load(latestBase, false)
Object baseObj = object(objID, baseMod)
if(!null baseObj){
        oldVal += baseObj."Object Heading"""
        oldVal += baseObj."Object Text"""
}
 
diff(result,oldVal, newVal)
displayRichWithColor(stringOf(result))
 
delete(newVal)
delete(oldVal)
delete(result)

If you attempted to close the baseline in the code then performance will drastically reduce as each displayed value opens and closes the baseline. As it it, attempting to open an already open baseline take no time at all.

Object baseObj = object(objID, baseMod)

That "object(AbsNo, Module)" perm only finds currently displayed objects which is a drag when the default view is filtered. You should search the baseline module for that exact absolute number:

baseObj = null, oBase = null
int  AbsNoBase
for oBase in entire baseMod do
{  AbsNoBase = oBase."Absolute Number"
   if (AbsNoBase == objID)
   {  baseObj = oBase
      break
   }
}

 

  • Louie

 

Re: Compare baseline using Layout DXL or DXL Attribute
Peter_Albert - Fri Jun 17 04:04:46 EDT 2011

SystemAdmin - Thu Jun 16 13:20:17 EDT 2011

Never Mind, I got it. I was worry about if the baseline was going to be close or not in the background. At least it did what I wanted in the first attempt, I will update the script, if i got any other issue, or if I improved the script.

Module currMod = current
int objID = intOf(obj."Absolute Number""")
Buffer oldVal = create
Buffer newVal = create
Buffer result = create
if(!null obj."Object Text"""){
    newVal= obj."Object Text"""
}
else if(!null obj."Object Heading"""){
                newVal= obj."Object Heading"""
        }
        else{
                newVal= "Contains OLE or Value is Null"
        }
Baseline latestBase = getMostRecentBaseline(currMod)
Module baseMod = load(latestBase, false)
Object baseObj = object(objID, baseMod)
if(!null baseObj){
        oldVal += baseObj."Object Heading"""
        oldVal += baseObj."Object Text"""
}
 
diff(result,oldVal, newVal)
displayRichWithColor(stringOf(result))
 
delete(newVal)
delete(oldVal)
delete(result)

I have attached a small layoutDXL script for baseline comparisons. In addition to what you posted, you can choose any baseline, the layoutDXL column will also report on newly created or (soft)deleted objects, and the comparison is not restricted to Object Heading and Text. In fact, the script will compare and display changes for all attributes, which are visible in the current View, so you can control which attributes are to be compared simply by adding / removing the respective column.

Additionally there is the option to simply show the baseline attribute value, instead of doing the comparison.

It cannot compare OLE objects.

Usage is e.g.

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, show_only_modifications,
int bmajor, bminor, string bsuffix
)

 


Or

 

 

 

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, 
show_only_modifications, 
string baseType
)



The different options are:



 

 

 

  • show_changes_inline:
    • true: show changes in form of underline / strikethrough
    • false: just show the attribute values from the respective baseline
  • show_only_modifications:
    • true: Only show modifications, hide creation and deletion of attributes
    • false: Show modifications as well as creation and deletion of attributes

 

 

  • baseType
    • "Major": Compare with last Major baseline (e.g. 1.0, 2.0, etc)
    • "Minor": Compare with last Minor baseline (e.g. 2.1, 2.2, etc)
    • "Any": Compare with most recent baseline (e.g. 1.2 test, 2.3 update, etc)


Regards,

Peter

 


Attachments

attachment_14629025_versionCompare.inc

Re: Compare baseline using Layout DXL or DXL Attribute
SystemAdmin - Fri Jul 01 08:40:14 EDT 2011

Peter_Albert - Fri Jun 17 04:04:46 EDT 2011

I have attached a small layoutDXL script for baseline comparisons. In addition to what you posted, you can choose any baseline, the layoutDXL column will also report on newly created or (soft)deleted objects, and the comparison is not restricted to Object Heading and Text. In fact, the script will compare and display changes for all attributes, which are visible in the current View, so you can control which attributes are to be compared simply by adding / removing the respective column.

Additionally there is the option to simply show the baseline attribute value, instead of doing the comparison.

It cannot compare OLE objects.

Usage is e.g.

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, show_only_modifications,
int bmajor, bminor, string bsuffix
)

 


Or

 

 

 

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, 
show_only_modifications, 
string baseType
)



The different options are:



 

 

 

  • show_changes_inline:
    • true: show changes in form of underline / strikethrough
    • false: just show the attribute values from the respective baseline
  • show_only_modifications:
    • true: Only show modifications, hide creation and deletion of attributes
    • false: Show modifications as well as creation and deletion of attributes

 

 

  • baseType
    • "Major": Compare with last Major baseline (e.g. 1.0, 2.0, etc)
    • "Minor": Compare with last Minor baseline (e.g. 2.1, 2.2, etc)
    • "Any": Compare with most recent baseline (e.g. 1.2 test, 2.3 update, etc)


Regards,

Peter

 

Hi, Peter.

Your DXL is very useful.

However, I got an error. Would you please help.

I defined an attribute with the following:
=================================================================
#include <C:/Program Files/IBM/Rational/DOORS/9.3/lib/dxl/addins/user/versionCompare.inc>
modifications(
bool false, false,
string "Any"
)
==================================================================
I got the following error:

-E- DXL: <Line:4> syntax error
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.
============================================================
Is there anything wrong with the attribute definition?
Pls help.

Re: Compare baseline using Layout DXL or DXL Attribute
Peter_Albert - Fri Jul 01 12:34:05 EDT 2011

SystemAdmin - Fri Jul 01 08:40:14 EDT 2011
Hi, Peter.

Your DXL is very useful.

However, I got an error. Would you please help.

I defined an attribute with the following:
=================================================================
#include <C:/Program Files/IBM/Rational/DOORS/9.3/lib/dxl/addins/user/versionCompare.inc>
modifications(
bool false, false,
string "Any"
)
==================================================================
I got the following error:

-E- DXL: <Line:4> syntax error
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.
============================================================
Is there anything wrong with the attribute definition?
Pls help.

Well, first of all, I never used the script for attribute DXL so far, so either you have to modify the code and replace the "display" calls with calls à la "obj.AttrDXLName = ...", or you overload the "display" perm in the same style like DOORS does when you let it transform a layout DXL into attribute DXL.

Secondly, the code you posted is wrong, as in a function call you don't explicitly write down the variable type, so in your example, the code must look something like this

modifications(fals, false, "Any")

without the "bool" and "string"

Regards,

Peter

Re: Compare baseline using Layout DXL or DXL Attribute
SystemAdmin - Fri Jul 01 21:21:59 EDT 2011

Peter_Albert - Fri Jul 01 12:34:05 EDT 2011
Well, first of all, I never used the script for attribute DXL so far, so either you have to modify the code and replace the "display" calls with calls à la "obj.AttrDXLName = ...", or you overload the "display" perm in the same style like DOORS does when you let it transform a layout DXL into attribute DXL.

Secondly, the code you posted is wrong, as in a function call you don't explicitly write down the variable type, so in your example, the code must look something like this

modifications(fals, false, "Any")

without the "bool" and "string"

Regards,

Peter

Hi,Peter.

I am new to DOORS and DXL.

Would you please advise how can I apply your code.
Thanks.

Re: Compare baseline using Layout DXL or DXL Attribute
SystemAdmin - Sat Jul 02 06:29:31 EDT 2011

SystemAdmin - Fri Jul 01 21:21:59 EDT 2011
Hi,Peter.

I am new to DOORS and DXL.

Would you please advise how can I apply your code.
Thanks.

Hi, Peter.

I got it worked now as layout DXL.

Thanks.

Re: Compare baseline using Layout DXL or DXL Attribute
GianlucaPisano - Tue Mar 19 11:39:22 EDT 2019

Peter_Albert - Fri Jun 17 04:04:46 EDT 2011

I have attached a small layoutDXL script for baseline comparisons. In addition to what you posted, you can choose any baseline, the layoutDXL column will also report on newly created or (soft)deleted objects, and the comparison is not restricted to Object Heading and Text. In fact, the script will compare and display changes for all attributes, which are visible in the current View, so you can control which attributes are to be compared simply by adding / removing the respective column.

Additionally there is the option to simply show the baseline attribute value, instead of doing the comparison.

It cannot compare OLE objects.

Usage is e.g.

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, show_only_modifications,
int bmajor, bminor, string bsuffix
)

 


Or

 

 

 

#include <[add correct path]/versionCompare.inc>
modifications(
bool show_changes_inline, 
show_only_modifications, 
string baseType
)



The different options are:



 

 

 

  • show_changes_inline:
    • true: show changes in form of underline / strikethrough
    • false: just show the attribute values from the respective baseline
  • show_only_modifications:
    • true: Only show modifications, hide creation and deletion of attributes
    • false: Show modifications as well as creation and deletion of attributes

 

 

  • baseType
    • "Major": Compare with last Major baseline (e.g. 1.0, 2.0, etc)
    • "Minor": Compare with last Minor baseline (e.g. 2.1, 2.2, etc)
    • "Any": Compare with most recent baseline (e.g. 1.2 test, 2.3 update, etc)


Regards,

Peter

 

Hello Peter,

 

I am trying to use your code as it could be very useful for the task I have to do. I am calling the script with the following line in layout DXL:

 

#include <C:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl\addins\user\versionCompare.inc>
modifications(true, false, "Any")

 

but I get the following error:

 

-E- DXL: <Line:2> syntax error
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

Could you help me with understanding this?

Re: Compare baseline using Layout DXL or DXL Attribute
Peter_Albert - Wed Mar 20 05:19:31 EDT 2019

GianlucaPisano - Tue Mar 19 11:39:22 EDT 2019

Hello Peter,

 

I am trying to use your code as it could be very useful for the task I have to do. I am calling the script with the following line in layout DXL:

 

#include <C:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl\addins\user\versionCompare.inc>
modifications(true, false, "Any")

 

but I get the following error:

 

-E- DXL: <Line:2> syntax error
-I- DXL: All done. Errors reported: 1. Warnings reported: 0.

Could you help me with understanding this?

Has it really been 8 years???

 

Anyhow, I think it's just the backslashes, either escape the backslashes like #include <C:\\Program Files\\IBM\\Ratio ... or use forward slashes like #include <C:/Program Files/IBM/Ratio...

Cheers,

 

     Peter

Re: Compare baseline using Layout DXL or DXL Attribute
GianlucaPisano - Wed Mar 20 05:47:56 EDT 2019

Peter_Albert - Wed Mar 20 05:19:31 EDT 2019

Has it really been 8 years???

 

Anyhow, I think it's just the backslashes, either escape the backslashes like #include <C:\\Program Files\\IBM\\Ratio ... or use forward slashes like #include <C:/Program Files/IBM/Ratio...

Cheers,

 

     Peter

Yes, and the problems in requirements management are still the same! Laughing

 

Thanks for your answer, I've just tried your solution but it doesn't work. Maybe it's something regarding the Doors version I'm using?

 

For the process I have to follow, using the layout DXL column would be the best solution; alternatively I could consider an export of the comparison in a csv file to be easily analysed. As I am very new to Doors and DXL, can you address me towards tutorials to make such scripts? 

Thank you again

Regards,

Gianluca

 

EDIT: I managed to make it working, the problem was that the last line of the versionCompare.inc file wasn't commented

Re: Compare baseline using Layout DXL or DXL Attribute
Peter_Albert - Wed Mar 20 08:49:24 EDT 2019

GianlucaPisano - Wed Mar 20 05:47:56 EDT 2019

Yes, and the problems in requirements management are still the same! Laughing

 

Thanks for your answer, I've just tried your solution but it doesn't work. Maybe it's something regarding the Doors version I'm using?

 

For the process I have to follow, using the layout DXL column would be the best solution; alternatively I could consider an export of the comparison in a csv file to be easily analysed. As I am very new to Doors and DXL, can you address me towards tutorials to make such scripts? 

Thank you again

Regards,

Gianluca

 

EDIT: I managed to make it working, the problem was that the last line of the versionCompare.inc file wasn't commented

Hm, which DOORS version are you using?

The error is indeed in line 2, the function call, so that's strange. Did you try just to call 

modifications()

?

Do you maybe have strangely encoded quotation marks?

 

As for tutorials, as far as I know, they don't exist. Everyone I know learned it the hard way. Reading the DXL manual, although it sucks. Trying things out, again and again. Looking at code provided in this forum. Asking the forum for feedback. Etc ...

But it can be fun!

Good luck!

Cheers,

     Peter

Re: Compare baseline using Layout DXL or DXL Attribute
GianlucaPisano - Wed Mar 20 09:53:37 EDT 2019

Peter_Albert - Wed Mar 20 08:49:24 EDT 2019

Hm, which DOORS version are you using?

The error is indeed in line 2, the function call, so that's strange. Did you try just to call 

modifications()

?

Do you maybe have strangely encoded quotation marks?

 

As for tutorials, as far as I know, they don't exist. Everyone I know learned it the hard way. Reading the DXL manual, although it sucks. Trying things out, again and again. Looking at code provided in this forum. Asking the forum for feedback. Etc ...

But it can be fun!

Good luck!

Cheers,

     Peter

I am using Doors 9.6, but I've already figured out what the problem was, just last line of the file that needed to be commented.

Thank you again for your useful help, it will be fun for sure!

Ciao

Gianluca

 

Re: Compare baseline using Layout DXL or DXL Attribute
Peter_Albert - Wed Mar 20 10:16:31 EDT 2019

GianlucaPisano - Wed Mar 20 09:53:37 EDT 2019

I am using Doors 9.6, but I've already figured out what the problem was, just last line of the file that needed to be commented.

Thank you again for your useful help, it will be fun for sure!

Ciao

Gianluca

 

OK, good to know. Just for curiosity, what was in that last line?

Re: Compare baseline using Layout DXL or DXL Attribute
GianlucaPisano - Wed Mar 20 11:40:09 EDT 2019

Peter_Albert - Wed Mar 20 10:16:31 EDT 2019

OK, good to know. Just for curiosity, what was in that last line?

Just dashed lines, nothing big! But I had to debug all the script to find it.

It works perfectly, thank you.

 

Gianluca

Re: Compare baseline using Layout DXL or DXL Attribute
GianlucaPisano - Fri Mar 29 06:38:05 EDT 2019

Hi guys, 

 

I have a question. Is there a simple scripting way to make the creation of the layout DXL column in which versionCompare is running automatic (i.e. by selecting the baselines from a shell)?

I'm using it in read-only modules, as I'm not the owner and I cannot modify them using  attribute DXL (which was the first thing I thought).

 

Thanks

 

Gianluca