Filter Suspect Links

Hi,
I am trying to create a filter for all suspect links. What code should i use for this? I know that it has something do to with comparing "suspicions cleared forwards" and "suspicion cleared backwards", but I don't know how to call it.
Thanks!
josiah820 - Tue Jun 12 09:03:17 EDT 2012

Re: Filter Suspect Links
SystemAdmin - Tue Jun 12 23:20:37 EDT 2012

There are no specific functions in the DXL Reference manual to assist with filtering incoming and outgoing suspect links - well at least nothing obvious in the v9.2 DXL Manual.

There is however a Formal Module menu option to do this under Analysis > Suspect Links > Filter. I hunted down the DXL file that corresponds to this menu item and discovered that the DXL is not encrypted. In DOORS version 9.2, these DXL files for filtering suspect links are located under folder .....\IBM\Rational\DOORS\9.2\lib\dxl\standard\suspect\filter.

The code uses special undocumented functions. They work fine when copied into the DXL editor and run - so have a look at these files and maybe copy, re-use and modify the code to suit. An example of the code for filtering suspect in-links is shown below - taken from the file "filter_in_all.dxl"
 

pragma runLim, 0
 
Module mParent = current
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
 
        // only relevant if suspect in-links exist
        if (fnDetermineSuspectInLinks(o) == true)
        {
            accept o
        }
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
}
else
{
    // warn user
    warningBox(dbExplorer, LS_("String_You_must_have_a_formal_module_to_run_this_utility",NLSTEMP_("You must have a formal module to run this utility.")))
}

 

 


Paul Miller
Melbourne, Australia

 

 

Re: Filter Suspect Links
josiah820 - Wed Jun 13 09:37:09 EDT 2012

SystemAdmin - Tue Jun 12 23:20:37 EDT 2012

There are no specific functions in the DXL Reference manual to assist with filtering incoming and outgoing suspect links - well at least nothing obvious in the v9.2 DXL Manual.

There is however a Formal Module menu option to do this under Analysis > Suspect Links > Filter. I hunted down the DXL file that corresponds to this menu item and discovered that the DXL is not encrypted. In DOORS version 9.2, these DXL files for filtering suspect links are located under folder .....\IBM\Rational\DOORS\9.2\lib\dxl\standard\suspect\filter.

The code uses special undocumented functions. They work fine when copied into the DXL editor and run - so have a look at these files and maybe copy, re-use and modify the code to suit. An example of the code for filtering suspect in-links is shown below - taken from the file "filter_in_all.dxl"
 

pragma runLim, 0
 
Module mParent = current
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
 
        // only relevant if suspect in-links exist
        if (fnDetermineSuspectInLinks(o) == true)
        {
            accept o
        }
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
}
else
{
    // warn user
    warningBox(dbExplorer, LS_("String_You_must_have_a_formal_module_to_run_this_utility",NLSTEMP_("You must have a formal module to run this utility.")))
}

 

 


Paul Miller
Melbourne, Australia

 

 

Okay, thanks!
One more question: How do I go about creating suspect links so that I can test my program?

Re: Filter Suspect Links
PDU - Wed Jun 13 10:09:53 EDT 2012

josiah820 - Wed Jun 13 09:37:09 EDT 2012
Okay, thanks!
One more question: How do I go about creating suspect links so that I can test my program?

hi,

simple :
after creating links between objects,
modify target (for example) object.
--> for source object, link become suspect.

(if you modify source object, link is suspect for target object)

Pierre

Re: Filter Suspect Links
josiah820 - Wed Jun 13 10:24:54 EDT 2012

PDU - Wed Jun 13 10:09:53 EDT 2012
hi,

simple :
after creating links between objects,
modify target (for example) object.
--> for source object, link become suspect.

(if you modify source object, link is suspect for target object)

Pierre

Would either of you mind looking at this code and seeing if you think it would work, or if it would work?
Thanks
Attachments

attachment_14837936_Suspect_Links.dxl

Re: Filter Suspect Links
josiah820 - Wed Jun 13 11:07:45 EDT 2012

josiah820 - Wed Jun 13 10:24:54 EDT 2012
Would either of you mind looking at this code and seeing if you think it would work, or if it would work?
Thanks

And yes, I realize that my code is slightly unorthodox with the amount of comments. The comments are necessary because I am an intern with a company who wants me to improve DOORS with some dxl programs, and they want to be able to troubleshoot the program after I am gone, even though there isn't anyone here who knows DXL.

Re: Filter Suspect Links
josiah820 - Wed Jun 13 11:36:21 EDT 2012

SystemAdmin - Tue Jun 12 23:20:37 EDT 2012

There are no specific functions in the DXL Reference manual to assist with filtering incoming and outgoing suspect links - well at least nothing obvious in the v9.2 DXL Manual.

There is however a Formal Module menu option to do this under Analysis > Suspect Links > Filter. I hunted down the DXL file that corresponds to this menu item and discovered that the DXL is not encrypted. In DOORS version 9.2, these DXL files for filtering suspect links are located under folder .....\IBM\Rational\DOORS\9.2\lib\dxl\standard\suspect\filter.

The code uses special undocumented functions. They work fine when copied into the DXL editor and run - so have a look at these files and maybe copy, re-use and modify the code to suit. An example of the code for filtering suspect in-links is shown below - taken from the file "filter_in_all.dxl"
 

pragma runLim, 0
 
Module mParent = current
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
 
        // only relevant if suspect in-links exist
        if (fnDetermineSuspectInLinks(o) == true)
        {
            accept o
        }
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
}
else
{
    // warn user
    warningBox(dbExplorer, LS_("String_You_must_have_a_formal_module_to_run_this_utility",NLSTEMP_("You must have a formal module to run this utility.")))
}

 

 


Paul Miller
Melbourne, Australia

 

 

This approach is not working for me for some reason.

Re: Filter Suspect Links
PDU - Wed Jun 13 12:01:36 EDT 2012

josiah820 - Wed Jun 13 10:24:54 EDT 2012
Would either of you mind looking at this code and seeing if you think it would work, or if it would work?
Thanks

perhaps DOORS version incompatibility, i have errors on line 53 :

-E- DXL: <Line:53> incorrect arguments for (&&)
-E- DXL: <Line:53> undeclared variable (NLS_)
-E- DXL: <Line:53> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrect arguments for function (warningBox)
-E- DXL: <Line:74> undeclared variable (NLSTEMP_)
-E- DXL: <Line:74> undeclared variable (LS_)
-E- DXL: <Line:53> incorrect arguments for (if)
-E- DXL: <Line:83> incorrect arguments for (&&)
-E- DXL: <Line:83> undeclared variable (NLS_)


Pierre

Re: Filter Suspect Links
josiah820 - Wed Jun 13 12:21:36 EDT 2012

PDU - Wed Jun 13 12:01:36 EDT 2012

perhaps DOORS version incompatibility, i have errors on line 53 :

-E- DXL: <Line:53> incorrect arguments for (&&)
-E- DXL: <Line:53> undeclared variable (NLS_)
-E- DXL: <Line:53> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrect arguments for function (warningBox)
-E- DXL: <Line:74> undeclared variable (NLSTEMP_)
-E- DXL: <Line:74> undeclared variable (LS_)
-E- DXL: <Line:53> incorrect arguments for (if)
-E- DXL: <Line:83> incorrect arguments for (&&)
-E- DXL: <Line:83> undeclared variable (NLS_)


Pierre

That's weird, it at least runs without errors for me. However, it does the first filter (it filters out whatever CR/CRG I want), and then fails to filter out the suspect links, instead appearing to filter out EVERYTHING. Not really sure why it's messing up at that point, because I'm using the same code that they're using to filter out the suspect links...

Re: Filter Suspect Links
josiah820 - Wed Jun 13 13:00:21 EDT 2012

PDU - Wed Jun 13 12:01:36 EDT 2012

perhaps DOORS version incompatibility, i have errors on line 53 :

-E- DXL: <Line:53> incorrect arguments for (&&)
-E- DXL: <Line:53> undeclared variable (NLS_)
-E- DXL: <Line:53> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrectly concatenated tokens
-E- DXL: <Line:74> incorrect arguments for function (warningBox)
-E- DXL: <Line:74> undeclared variable (NLSTEMP_)
-E- DXL: <Line:74> undeclared variable (LS_)
-E- DXL: <Line:53> incorrect arguments for (if)
-E- DXL: <Line:83> incorrect arguments for (&&)
-E- DXL: <Line:83> undeclared variable (NLS_)


Pierre

I have a new idea... What if I created new attributes for suspect in-links and out-links through:
Analysis -> Suspect Links-> Display Indicators (In-Links(all open modules) and Out Links(all open modules)). What should I call these attributes, as they have no title for the column? I'm assuming that I can filter through all objects that do not equal null in the two columns for the in-links and out-links, but I'm not sure how to call the attributes?
Thanks

Re: Filter Suspect Links
josiah820 - Wed Jun 13 14:12:59 EDT 2012

josiah820 - Wed Jun 13 13:00:21 EDT 2012
I have a new idea... What if I created new attributes for suspect in-links and out-links through:
Analysis -> Suspect Links-> Display Indicators (In-Links(all open modules) and Out Links(all open modules)). What should I call these attributes, as they have no title for the column? I'm assuming that I can filter through all objects that do not equal null in the two columns for the in-links and out-links, but I'm not sure how to call the attributes?
Thanks

The general idea for this method works. I created a Layout DXL Column called "Suspect In-Links" and "Suspect Out-Links". They work just fine when it comes to identifying suspect links. However, I'm struggling with figuring out what argument to search for within the columns. I tried looking for "null" and then negating the argument with the exclamation point, but it doesn't do anything. I also tried "!null", but I got an error message when I tried that. I can't figure out the argument to search for which stands for the arrow and question mark. What should I put?
Thanks

Re: Filter Suspect Links
SystemAdmin - Wed Jun 13 18:07:23 EDT 2012

josiah820 - Wed Jun 13 12:21:36 EDT 2012
That's weird, it at least runs without errors for me. However, it does the first filter (it filters out whatever CR/CRG I want), and then fails to filter out the suspect links, instead appearing to filter out EVERYTHING. Not really sure why it's messing up at that point, because I'm using the same code that they're using to filter out the suspect links...

The code that I reused from the file "filter_in_all.dxl" works fine for me (DOORS version 9.2).

The simple test that I applied was to use Analysis -> Suspect Links-> Display Indicators (In-Links(all modules) so that I could see which objects had suspect incoming link flags against them, then ran the code to check that only those objects were displayed.

I see that you used Display Indicators (In-Links(open modules only) - are you aware that this will only work if the source module of the incoming links is open? Some modules can be open but not displayed - the Tools > Manage Open Modules feature in the DOORS Explorer menu shows what is displayed and what is hidden.

Also, just be aware that the Suspect Links feature can be a curse - it will be sensitive to changes made to any attribute where the "Last Modified On" property has been enabled. If most of your attributes have enabled this property, then you will be swamped with suspect link flags. Only use this feature if your schema has explicitly reserved the enabling of the "Last Modified On" property only for important attributes that can have a serious change impact on other linked requirements.

Once upon a time you had to initialise a module for Suspect Links - I recall that this added some attributes to link modules that recorded when suspects were cleared etc - this menu option disappeared sometime after DOORS 7.1 - does anyone know how DOORS now manages suspect links now?
Paul Miller
Melbourne, Australia

Re: Filter Suspect Links
josiah820 - Thu Jun 14 08:02:20 EDT 2012

SystemAdmin - Wed Jun 13 18:07:23 EDT 2012
The code that I reused from the file "filter_in_all.dxl" works fine for me (DOORS version 9.2).

The simple test that I applied was to use Analysis -> Suspect Links-> Display Indicators (In-Links(all modules) so that I could see which objects had suspect incoming link flags against them, then ran the code to check that only those objects were displayed.

I see that you used Display Indicators (In-Links(open modules only) - are you aware that this will only work if the source module of the incoming links is open? Some modules can be open but not displayed - the Tools > Manage Open Modules feature in the DOORS Explorer menu shows what is displayed and what is hidden.

Also, just be aware that the Suspect Links feature can be a curse - it will be sensitive to changes made to any attribute where the "Last Modified On" property has been enabled. If most of your attributes have enabled this property, then you will be swamped with suspect link flags. Only use this feature if your schema has explicitly reserved the enabling of the "Last Modified On" property only for important attributes that can have a serious change impact on other linked requirements.

Once upon a time you had to initialise a module for Suspect Links - I recall that this added some attributes to link modules that recorded when suspects were cleared etc - this menu option disappeared sometime after DOORS 7.1 - does anyone know how DOORS now manages suspect links now?


Paul Miller
Melbourne, Australia

But wouldn't I want to do the filter_in_all and filter_out_all programs if I want to see all of the suspect links?

Re: Filter Suspect Links
josiah820 - Thu Jun 14 09:47:17 EDT 2012

josiah820 - Thu Jun 14 08:02:20 EDT 2012
But wouldn't I want to do the filter_in_all and filter_out_all programs if I want to see all of the suspect links?

Also, is there any way to filter my results? I can't figure out how to make that happen. Either it filters by the CR number, or it filters by if it has suspect in-links. So my two questions are: how do I make it filter by suspect in-links AND out-links? And how do I apply a filter to these results?
Thanks!

Re: Filter Suspect Links
SystemAdmin - Thu Jun 14 23:47:04 EDT 2012

josiah820 - Thu Jun 14 09:47:17 EDT 2012
Also, is there any way to filter my results? I can't figure out how to make that happen. Either it filters by the CR number, or it filters by if it has suspect in-links. So my two questions are: how do I make it filter by suspect in-links AND out-links? And how do I apply a filter to these results?
Thanks!

"....how do I make it filter by suspect in-links AND out-links...."

In order to see all suspect links, I think you mean logical OR, you want to see objects if they have either a suspect in-Link OR a suspect out-link. Can be simply done by adding in code from both the "filter_in_all.dxl" and "filter_out_all.dxl" scripts that are used by the Analysis > Suspect Links > Filter menu options (See my earlier post in this thread)

To include the existence of a CR Number as part of the filter rules, just add it as another piece of conditional logic where a buffer can be used to capture the contents of the attribute that has the CR numbers and then see if it contains a specific CR number that you're after - see the code below.

BTW - there is some weird context stuff going on here - I could only get the buffer to work if I declared it within the object loop - maybe Louie or Mathias or any other can explain.

 

 

pragma runLim, 0
 
Module mParent = current
string CR = "CR098"
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        Buffer buff = create
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
        fnOpenAllOutLinkedModules(o, g_skpSuspectOutLinkModulesOpened)
 
        buff = o."Approved CCP ECR%"""
 
        // Accept objects that have Suspect In-Links OR Suspect OutLinks
        if ((fnDetermineSuspectInLinks(o) == true) || (fnDetermineSuspectOutLinks(o) == true) || (contains(buff, CR, 0) != -1))
        {
            accept o
        }
        delete(buff)
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
    fnCloseModules(g_skpSuspectOutLinkModulesOpened)
}

 

 

 

 


Paul Miller
Melbourne, Australia

 

 

Re: Filter Suspect Links
josiah820 - Fri Jun 15 12:01:34 EDT 2012

SystemAdmin - Thu Jun 14 23:47:04 EDT 2012

"....how do I make it filter by suspect in-links AND out-links...."

In order to see all suspect links, I think you mean logical OR, you want to see objects if they have either a suspect in-Link OR a suspect out-link. Can be simply done by adding in code from both the "filter_in_all.dxl" and "filter_out_all.dxl" scripts that are used by the Analysis > Suspect Links > Filter menu options (See my earlier post in this thread)

To include the existence of a CR Number as part of the filter rules, just add it as another piece of conditional logic where a buffer can be used to capture the contents of the attribute that has the CR numbers and then see if it contains a specific CR number that you're after - see the code below.

BTW - there is some weird context stuff going on here - I could only get the buffer to work if I declared it within the object loop - maybe Louie or Mathias or any other can explain.

 

 

pragma runLim, 0
 
Module mParent = current
string CR = "CR098"
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        Buffer buff = create
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
        fnOpenAllOutLinkedModules(o, g_skpSuspectOutLinkModulesOpened)
 
        buff = o."Approved CCP ECR%"""
 
        // Accept objects that have Suspect In-Links OR Suspect OutLinks
        if ((fnDetermineSuspectInLinks(o) == true) || (fnDetermineSuspectOutLinks(o) == true) || (contains(buff, CR, 0) != -1))
        {
            accept o
        }
        delete(buff)
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
    fnCloseModules(g_skpSuspectOutLinkModulesOpened)
}

 

 

 

 


Paul Miller
Melbourne, Australia

 

 

I got that working! thanks!
Now I'm just trying to clear all of that afterwards. I thought about loading a new view, but that's not working for some reason... Any suggestions on how to clear the filters and buffer so that I can go back to viewing the full module upon completion of the program?
Thanks

Re: Filter Suspect Links
josiah820 - Fri Jun 15 14:59:51 EDT 2012

josiah820 - Fri Jun 15 12:01:34 EDT 2012
I got that working! thanks!
Now I'm just trying to clear all of that afterwards. I thought about loading a new view, but that's not working for some reason... Any suggestions on how to clear the filters and buffer so that I can go back to viewing the full module upon completion of the program?
Thanks

Never mind, I got it! Thank you!

Re: Filter Suspect Links
josiah820 - Tue Jul 10 08:43:43 EDT 2012

SystemAdmin - Thu Jun 14 23:47:04 EDT 2012

"....how do I make it filter by suspect in-links AND out-links...."

In order to see all suspect links, I think you mean logical OR, you want to see objects if they have either a suspect in-Link OR a suspect out-link. Can be simply done by adding in code from both the "filter_in_all.dxl" and "filter_out_all.dxl" scripts that are used by the Analysis > Suspect Links > Filter menu options (See my earlier post in this thread)

To include the existence of a CR Number as part of the filter rules, just add it as another piece of conditional logic where a buffer can be used to capture the contents of the attribute that has the CR numbers and then see if it contains a specific CR number that you're after - see the code below.

BTW - there is some weird context stuff going on here - I could only get the buffer to work if I declared it within the object loop - maybe Louie or Mathias or any other can explain.

 

 

pragma runLim, 0
 
Module mParent = current
string CR = "CR098"
 
if (mParent != null && type(mParent) == (NLS_("Formal")))
{
    Object o
    fnFiltersOff(mParent)
 
    for o in entire mParent do
    {
        Buffer buff = create
        reject o
        fnOpenAllInLinkedModules(o, g_skpSuspectInLinkModulesOpened)
        fnOpenAllOutLinkedModules(o, g_skpSuspectOutLinkModulesOpened)
 
        buff = o."Approved CCP ECR%"""
 
        // Accept objects that have Suspect In-Links OR Suspect OutLinks
        if ((fnDetermineSuspectInLinks(o) == true) || (fnDetermineSuspectOutLinks(o) == true) || (contains(buff, CR, 0) != -1))
        {
            accept o
        }
        delete(buff)
    }
    fnFiltersOn(mParent)
    fnCloseModules(g_skpSuspectInLinkModulesOpened)
    fnCloseModules(g_skpSuspectOutLinkModulesOpened)
}

 

 

 

 


Paul Miller
Melbourne, Australia

 

 

Hi again, I know it's been a long time since I said the question was answered, but my office was robbed, and I lost all of my DXL programs. This is what I have so far, but I'm getting an "Unknown Object Attribute" error every time I run it. How do I make this work?
Thanks!
Attachments

attachment_14853900_Suspect_Links.dxl

Re: Filter Suspect Links
josiah820 - Tue Jul 10 08:47:40 EDT 2012

josiah820 - Tue Jul 10 08:43:43 EDT 2012
Hi again, I know it's been a long time since I said the question was answered, but my office was robbed, and I lost all of my DXL programs. This is what I have so far, but I'm getting an "Unknown Object Attribute" error every time I run it. How do I make this work?
Thanks!

The error is for the Attribute "Approved CCP ECR%". I don't even know what that attribute does?

Re: Filter Suspect Links
josiah820 - Tue Jul 10 13:58:48 EDT 2012

josiah820 - Tue Jul 10 08:47:40 EDT 2012
The error is for the Attribute "Approved CCP ECR%". I don't even know what that attribute does?

Never Mind, I figured it out on my own.

Re: Filter Suspect Links
SystemAdmin - Thu Oct 25 11:58:15 EDT 2012

Hi i need a simple answer. How can i detect if a link is suspicious?

Re: Filter Suspect Links
josiah820 - Mon Dec 17 11:51:12 EST 2012

SystemAdmin - Thu Oct 25 11:58:15 EDT 2012
Hi i need a simple answer. How can i detect if a link is suspicious?

This is fairly simple. Open the "Analysis" Menu in the toolbar, and then highlight "Suspect Links". Highlight "Display Indicators" and then select "In-links (all modules)". Then repeat the above process, but end by selecting "Out-links (all modules)" instead of In-Links. This process will create two more attribute columns which will hold a "Suspect Links Indicator" (which basically looks like a "links" image (an arrow, either red or yellow, depending if it is an in-link or an out-link) pointing to a question mark. The objects which have the image in either of the last two columns contain suspect links. Hope this helps, and sorry it took me so long to get back to you.

Re: Filter Suspect Links
kayvee1313 - Thu Jul 25 16:53:05 EDT 2013

SystemAdmin - Thu Oct 25 11:58:15 EDT 2012
Hi i need a simple answer. How can i detect if a link is suspicious?

Did you ever find out how to display suspicious links via dxl? I only know how to view regular menu toolbar options...

Re: Filter Suspect Links
Bob3 - Tue Mar 08 00:08:13 EST 2016

Nearly three years and several versions of DOORS have passed since this thread was updated. I just encountered this issue so I thought I'd share the results with the community. I am using DOORS 9.6.1.0 x64 build 96113 on Windows 7.

The question at hand: How do I create a suspect links view that shows only objects with suspect links?

The natural approach: In a DOORS module, select Analysis > Suspect Links > Filter > (select one of the four options). It seems to have worked! However, this "filter" that has been applied is somewhat of a "ghost filter" in that it cannot be modified through Filter Properties nor saved in a view. Seriously, IBM?

The workaround:

  1. In a DOORS module, select Analysis > Suspect Links > Display All Changes > (select one of the four options). 
  2. Select the new layout DXL column and convert it to attribute DXL using Tools > Support Tools > Convert Layout DXL to Attribute DXL
  3. Create a filter that filters on the newly created attribute DXL not being empty
  4. Save the view as "Suspect Links View" (can leave attribute DXL in view or not - no effect on outcome)
  5. The view operates normally and can be updated by refreshing the attribute DXL (Tools > Refresh DXL Attributes) and then refreshing the view (View > Refresh)