Collect content of different attributes in one DXL column.

I've written a small DXL to collect the content (a test status) of several attributes together in one DXL column. The attributes from witch I want to collect the content do have the same name and just a counter (1, 2, 3, 4,….) which was created by the  Test-Run-Tool from DOORS.

 

The problem I have: The DXL column is displaying the result from the chosen object in all objects. If I click on another object, the result for all object is updated according the value from the new chosen object. I guess it is because I've used <Object o = current > and "current" is always leading the script use the values of the chosen object, but I have no idea how to fix this.

 

So, is there anybody out there who can help? The script and a result see below.

 

// User Function


//

/*
  This user function can be used as a Layout DXL in a column.
The script is collecting all test status from different test runs from the attribute "Test Status X"
"X" must be a counter, normally created by the test run tool from DOORS
*/

/*    Modification history:

    Date:        Who:    Description:
    02/02/2015    T.Becker        Creating the script
*/

string ad = "Test Status "
int i = 4            // counter to count the number of test runs
string no = null        // converting intager "i" into string "no"
string act = ""        // actual value of the object attribute
string done = "never"    // summary of this test of all test runs. Presetting is test "never" done
Object o = current
bool ex= true


// ************** loop to go through all test runs from 1..xx) **************
while (i<=10) {
no = null
no =  i no
ad = null
ad = "Test Status "
ad = ad no
act = o.ad
display ""ad"" ": " ""o.ad""      // display the testrun number and the status

i = i +1
ex = exists attribute ad
if (act == ("Pass")){        // adjust the final result of this test to "ok" if test status is "pass"
done = "i.O."

}
if (act == ("Fail")){        // adjust the final result of this test to "nok" if test status is "fail"
done =  "nok"

}
}

 


thomas2603 - Wed Jun 03 04:24:25 EDT 2015

Re: Collect content of different attributes in one DXL column.
Rolan - Wed Jun 03 11:46:08 EDT 2015

Try Object o = obj;

Re: Collect content of different attributes in one DXL column.
llandale - Wed Jun 03 15:38:56 EDT 2015

Rolan - Wed Jun 03 11:46:08 EDT 2015

Try Object o = obj;

Yes.
Better would be to remove the declaration for "o" and use the standard variable "obj" for use in attr-DXL and layouts.  Further down you would say "act = obj.ad"

I notice you have a Layout attribute column, not an Attribute DXL.

The "current" object is the one right now selected by the user.  Attr-DXL (and Layouts) have the natural context of a single object which I'll call "this" object which is represented by pre-declared variable "obj".

-Louie

Re: Collect content of different attributes in one DXL column.
thomas2603 - Mon Jun 08 05:00:00 EDT 2015

Thanks a lot! Now it works…

I was expecting such a small issue, but I didn't found the solution by myself.