[rt-users] how to read AT link information

Tomasz Wlodek tomw at bnl.gov
Thu Apr 26 15:00:14 EDT 2007

This is an AT question, but it touches RT as well, since the same problem, 
how to read links between tickets, exists in RT.

It is a very, very, very easy problem for an expert (at least I think so), 
but for a non expert like me it is baffling. I am struggling with it for 
some time.

Let us suppose that I have an AT asset object $Asset. I want to find 
another assed, let us call it $NewAsset which is connected to $Asset by 
one of the links (RunsOn, ComponentOf, DependsOn,... and so on, what you 
see on link page in AT asset).

My intuition, common sense and past experience suggests that the code 
should look like this (in general):

$Asset = ..                      # read the AT asset information
$Links = $Asset->RunsOn;         # links to objects on which Asset runs
for (my $Link=$Links->Next){     # loop over the links
 	$NewAsset=$Link->Target; # asset to which the $Link points to

So much my intuition how I THINK it SHOULD be. In reality it does not 
work this way.

$Asset object does have methods like Links, RunsOn, IsRunning, ComponentOf 
and so on, but the meaning of those fields puzzless me. for example when I 

$Links = $Asset->RunsOn;
while ( my ($key, $value) = each(%$Links) ) {
 	 print "\t $key => $value \n";

I get:

     _open_parens => HASH(0x9e435fc)
     alias_count => 0
     order_by => ARRAY(0x9e7b164)
     where_clause =>
     table => Links
     tables =>
     is_limited => 1
     order =>
     user => RT::CurrentUser=HASH(0x9d95b60)
     limit_clause =>
     DBIxHandle => RT::Handle=HASH(0x9b2bd3c)
     restrictions => HASH(0x9e7ba80)
     primary_key => id
     auxillary_tables =>
     must_redo_search => 1
     itemscount => 0
     show_rows => 0
     aliases => ARRAY(0x9e7ba44)
     first_row => 0

Hell, what does it mean?

How do I translate it into target Asset?

Did anyone deal with similar problem?

How to decode link information in AT?

What is the real meaning of fields like "Links,RunsOn,IsRunning,..." in 
Asset objects in AT?

Tom Wlodek

More information about the rt-users mailing list