Apply a filter of specified Absolute numbers using DXL

I have been asked if it is possible to filter in a module on certain absolute numbers.

 

For example,

I have a script that generates an output file that shows certain absolute numbers of each object in a module that match criteria.

Another person now would like to see if it is possible to filter on the output file, so that only the absolute numbers present in the output file are shown.

I have been looking in the DOORS 9.4 manual, and see that it is possible to filter on text, and columns, but do not see anything specific to absolute numbers.

 

Has anyone written a script that performs this? If not, is it possible?

 

Thanks


Gedinfo - Wed Oct 01 15:39:06 EDT 2014

Re: Apply a filter of specified Absolute numbers using DXL
Mathias Mamsch - Wed Oct 01 18:16:35 EDT 2014

You should be able to use filters like:

Filter f = (attribute "Absolute Number" > "20") && (attribute "Absolute Number" < "99")
set f
filtering on

However for complex ranges, e.g. 1000 different absolute numbers this will get quite some large filter that will probably blow up something. Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter.

Object o; for o in entire current Module do {
   int nr = o."Absolute Number"; 
   if (nr > 20 && nr < 99) accept o; else reject o; 
}

filtering on

Here you can have the list of objects to filter inside a skip list in DXL for fast execution, however the problem here is, that this way you cannot store the filter inside a view, because "accept/reject" is not a real filter. The last possibility you got is to make a DXL attribute or DXL layout column that will contain a value, that can be filtered on:

   int nr = obj."Absolute Number";
   if (nr > 20 && nr < 99) display "Filter me"

Then you make a filter "Column contains 'filter me'. This way you can store the filter also in a view.  Hope this gives you some ideas. Regards, Mathias

Re: Apply a filter of specified Absolute numbers using DXL
Wolfgang Uhr - Thu Oct 02 07:10:01 EDT 2014

Mathias Mamsch - Wed Oct 01 18:16:35 EDT 2014

You should be able to use filters like:

Filter f = (attribute "Absolute Number" > "20") && (attribute "Absolute Number" < "99")
set f
filtering on

However for complex ranges, e.g. 1000 different absolute numbers this will get quite some large filter that will probably blow up something. Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter.

Object o; for o in entire current Module do {
   int nr = o."Absolute Number"; 
   if (nr > 20 && nr < 99) accept o; else reject o; 
}

filtering on

Here you can have the list of objects to filter inside a skip list in DXL for fast execution, however the problem here is, that this way you cannot store the filter inside a view, because "accept/reject" is not a real filter. The last possibility you got is to make a DXL attribute or DXL layout column that will contain a value, that can be filtered on:

   int nr = obj."Absolute Number";
   if (nr > 20 && nr < 99) display "Filter me"

Then you make a filter "Column contains 'filter me'. This way you can store the filter also in a view.  Hope this gives you some ideas. Regards, Mathias

Hi Mathias

> Then you got the option to use "accept" and "reject" to specifically select single objects from the current module inside the filter.

Both, accept and reject are blowing up the filter too.

Best regards

Wolfgang

Re: Apply a filter of specified Absolute numbers using DXL
llandale - Thu Oct 02 12:12:50 EDT 2014

To clarify: You can

  • [1] Define a "filter" using a "Filter" variable of some filter expression.  These filters will save in a view.
  • [2] You can evaluate each object and either "accept" or "reject" it, then turn filtering on.  This kind of "filter" will not save in a view.

If you have somelist of the exact absolute numbers you CAN define a "Filter" "or"ing whether the Absolute Number matches.  I'm guessing however that your original script calculates whether an object qualifies for your original export, in which case you can use that criteria with accept/reject.

So maybe you can tweak your original script to look like this:

  • current = m
  • filtering off
  • for o in entire m do
  • {  reject(o)
  •    if (isDeleted(o))   then continue
  •    if (o is genericially ineligible) then continue
  •    if (o doesn't qualify for this export) then continue
  •    accept(o)
  •    export(o)
  • }
  • current = m
  • filtering on

-Louie

 

Re: Apply a filter of specified Absolute numbers using DXL
Gedinfo - Thu Oct 02 14:04:10 EDT 2014

I use the accept/reject method to perform the filtering.

 

Thanks for the suggestions!