isFiltered for every view of a module

Hi,
I have actually a DXL that exports all the objects of a given module in XML format.
I would like for each exported object, to export the result of the isFiltered function but for each view.
For example, my module M1 has 3 views V1, V2 and V3. Each view has a filter.
I would like for each object of a given module to retreive the result of isFiltered function for the filter of V1, V2 and V3.
I could be something like that:

<module name="M1">
<object absno="12" objnumber="1.0">
<view name="v1" isfiltered="true"/>
<view name="v2" isfiltered="false"/>
<view name="v3" isfiltered="true"/>
</object>
<object absno="15" objnumber="1.1">
<view name="v1" isfiltered="false"/>
<view name="v2" isfiltered="true"/>
<view name="v3" isfiltered="true"/>
</object>
...
</module>

Actually the only way is to open the module and apply the first view V1, retreive the objects isFiltered function result ans then redo the same thing with V2 and V3.
I would like to run through all objects only one time.
Some has a possible solution?
Thanks
SystemAdmin - Thu Mar 17 06:56:52 EDT 2011

Re: isFiltered for every view of a module
Mathias Mamsch - Thu Mar 17 10:53:17 EDT 2011

Why would you want to run through the objects only one time? This is a real quick operation for a normal 3000 objects module it takes like 30ms on my computer ...

There are the next(Object, Filter) and previous(Object, Filter) variants that take a filter as an argument but I am not sure that those will help you with running only once through the objects...

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: isFiltered for every view of a module
llandale - Thu Mar 17 10:58:40 EDT 2011

Usually exports only export what is currently displayed, and if so then every objects you export is indeed not filtered out.

If your exporter exports current columns, then it would be simple enough to add a column including the IsFiltered value. This is one case where a Layout is better than an Attr-DXL because you indeed want it to recalcuate often. Perhaps the following layout code would suffice:

bool  IsFilterd = isFiltered(obj)
bool  IsVisible = isVisible(obj)
if     ( IsVisible and  IsFilterd) display "Visible"
elseif ( IsVislble and !IsFilterd) display "Visible, but not Filtered"
elseif (!IsVislble and  IsFilterd) display "InVisible, but Filtered"
elseif (!IsVisible and !IsFilterd) display "InVisible"
else{}           // all cases covered


It's possible to see objects that are rejected (case 2 above) depending on advanced filtered criteria (such as seeing ancestors). It's possible to not see objects that are indeed filtered (case 3 above) for a variety of reasons, such as deleted or leveling or it's a table header.

If you don't like the column approach, The above code could be adapted for insert into your exporter, replace the "display" commands with what you want to do.

 

 

  • Louie