Hi, This is the first time I post in this forum after found it yesterday and spending days trying to figure out how to concatenate module name and object heading.
I am trying to create a column in a view which will display the module name and all its parent object headings before I export it to Excel for me to import it into Quality Center.
The reason I am doing this manually instead of relying on the Quality Center Integration(QCI) module is because QCI will occasionally starts to act up and stop updating the requirement data in Quality Center when performing the synchronization task. Performing the upload manually will be my fall back plan should the synchronization task stop functioning as intended.
The content in the column should be able to display all the object headings(parent) so that the requirements is able to retain the requirement structure when I import the data into Quality Center. For instance, Module Name: XXX Requirement Object Heading Object Text Desire Output Section 1 XXX Requirement requirement 1 XXX Requirement\Section 1 requirement 2 XXX Requirement\Section 1 Section 1.1 XXX Requirement\Section 1 requirement 3 XXX Requirement\Section 1\Section 1.1 Section 1.1.1 XXX Requirement\Section 1\Section 1.1 requirement 4 XXX Requirement\Section 1\Section 1.1\Section 1.1.1 Section 1.2 XXX Requirement\Section 1 requirement 5 XXX Requirement\Section 1\Section 1.2
After browsing this forum and found two closest post. I am only managed to come up with the script below.
Object GetParent(Object in_obj)
{
if (null in_obj)
return(Object null)
string Head = probeAttr_(in_obj, "Object Heading")
if (!null Head) then
return(in_obj)
else
return(GetParent(parent(in_obj)))
}
Object obj = current
if (null obj) then halt
else {
Module m = current
Object oParent = GetParent(parent(obj))
Object oGrandParent = GetParent(parent(oParent))
string HeadParent = probeAttr_(oParent, "Object Heading")
if (!null HeadParent)
display (m."Name" "\\" HeadParent)
}
The issues that I am facing now are:
Does anyone has any experience or success in performing the concatenation successfully?
Thanks & Best Regards, Ee Tze eetze - Tue Jul 09 22:22:51 EDT 2013 |
Re: Using Layout DXL to display module name and all its parent object headingss in a column Hello Ee Tze, two remarks about the code above:
Code that should do want you want might look like:
- Michael |
Re: Using Layout DXL to display module name and all its parent object headingss in a column MichaelGeorg - Fri Jul 12 03:37:40 EDT 2013 Hello Ee Tze, two remarks about the code above:
Code that should do want you want might look like:
- Michael Michael's script is almost perfect for the task. The only issue I ran into when I tested it was that the "while" loop doesn't require "do". In other words, that line should read:
while (!null ancestorObj) { If you remove "do" from the line, then the script works perfectly. |
Re: Using Layout DXL to display module name and all its parent object headingss in a column ChrisAnnal - Fri Jul 12 12:58:29 EDT 2013 Michael's script is almost perfect for the task. The only issue I ran into when I tested it was that the "while" loop doesn't require "do". In other words, that line should read:
while (!null ancestorObj) { If you remove "do" from the line, then the script works perfectly. Hi Michael & Chris,
Thank very much for providing me with the pointers.
I tried the above script and I noticed it only work when the requirements up to 2nd levels. Anything beyond that will display the object heading in reverse order. I am not sure if it is caused by setting the obj = current. Output Level 1 Module Name Requirement 1.1 Module Name\Level 1 Level 2 Module Name\Level 1 Level 2.1 Module Name\Level 2\Level 1 Requirement 2.1 Module Name\Level 2.1\Level 2\Level 1
Next, may I know if there is a way to prevent the data in the column from refreshing by the script whenever I navigate to different row in the view? The reason I asked this is because the current script will always refreshes the data display in the column with the same value whenever I select a different record. This will not work if I will need to value to persist. For instance, selecting record 'Level 2' will cause the data in the entire column to refresh as 'Module Name\Level 1'
Regards, Ee Tze |
Re: Using Layout DXL to display module name and all its parent object headingss in a column eetze - Mon Jul 15 23:40:15 EDT 2013 Hi Michael & Chris,
Thank very much for providing me with the pointers.
I tried the above script and I noticed it only work when the requirements up to 2nd levels. Anything beyond that will display the object heading in reverse order. I am not sure if it is caused by setting the obj = current. Output Level 1 Module Name Requirement 1.1 Module Name\Level 1 Level 2 Module Name\Level 1 Level 2.1 Module Name\Level 2\Level 1 Requirement 2.1 Module Name\Level 2.1\Level 2\Level 1
Next, may I know if there is a way to prevent the data in the column from refreshing by the script whenever I navigate to different row in the view? The reason I asked this is because the current script will always refreshes the data display in the column with the same value whenever I select a different record. This will not work if I will need to value to persist. For instance, selecting record 'Level 2' will cause the data in the entire column to refresh as 'Module Name\Level 1'
Regards, Ee Tze Hi,
sorry, the script I've posted above is neither compiling nor correct. Seems like I copied some intermediate version of the script to the forum @Ee Tze: You are absolutely correct about "object = current" and the order of the headings. Actually a statement that uses the current object is typically not a good idea for Layout DXL Columns and because the scripts starts with the lowest level of heading the resultStr must be extended to the front instead of the end. So correct (and this time tested) code is:
Regards, Michael
|
Re: Using Layout DXL to display module name and all its parent object headingss in a column Let me scribble a recursive function; maybe it will get you going.
-Louie The view containing this layout should specifically turn showing deleted objects off. the paragraph "number" of an object can change when deletions are showing. Will someone please tell me how to "block" code? had no luck so far. |
Re: Using Layout DXL to display module name and all its parent object headingss in a column MichaelGeorg - Tue Jul 16 06:52:00 EDT 2013 Hi,
sorry, the script I've posted above is neither compiling nor correct. Seems like I copied some intermediate version of the script to the forum @Ee Tze: You are absolutely correct about "object = current" and the order of the headings. Actually a statement that uses the current object is typically not a good idea for Layout DXL Columns and because the scripts starts with the lowest level of heading the resultStr must be extended to the front instead of the end. So correct (and this time tested) code is:
Regards, Michael
Hi Michael,
Thanks for the prompt reply. Your updated script works like a charm.
Regards, Ee Tze |