![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Compound filter Topic Summary: Dynamic creation of a filter from multilist Created On: 1-Oct-2008 09:19 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Thank you everyone for your fantastic guidance and assistance. This forum is a lifesaver for newbies like me where the DXL reference manual is less than useful in many cases. Through a combination of trial and error and great advice the dxl below seems to be doing what I need. I will of course have to add error trapping etc. But at least it works! Cheers Mark | |
![]() |
|
Hi,
I am trying to write a function which will create a filter using criteria from a multiList listView. I have it working successfully for a single selection but am unsure how to include the multiple selections. Could someone please point me in the right direction. I have thought about using a string array to save all the selections and also a skip. My current effort is attached below. Following application of the filter I then need to copy the object text of all obkects in view to another existing module, but that is another hill to climb! Thanks Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
Hi All,
I have managed to loop through the list and populate a buffer with any selected values but is it possible to populate the set (attribute) perm and OR (||) the selections in a filter? I also tried a skip but was only able to extract the key for the selected items. Thanks Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
Somewhere I have written (kludge?) code like this:
for o in (current Module) do { reject o for FilterValue in filterFieldDBE do { if (isMember(o.FILTER_ATTRIBUTE[0],FilterValue) || isMember(o.FILTER_ATTRIBUTES[1],FilterValue) || isMember(o.FILTER_ATTRIBUTES[2],FilterValue)) { accept o } } } Where filterFieldDBE is a multiList and the FILTER_ATTRIBUTE an array containing attribute names used in filtering. Then the DXL reject / accept functions are used to set up a (DXL) filter. ------------------------- Pekka.Makinen@softqa.fi SoftQA Oy -http://www.softqa.fi/ |
|
![]() |
|
![]() |
|
What kind of filter are you trying to do? Filter on objects where the value of the attribute represented by the multiList is equal to the selection(s) in the multiList?
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hi David,
The listView contains a list of attributes with an enumerated data type (1 - 5) My dialog needs to allow the user to select one or more attributes from the list and along with the enumerated value (1-5) from an additional choiceDBE set a filter on the ref module. I can then copy out the required objects to a new module. The set ((attribute "a" =="y") works a treat for a single selection. If I run set (attribute "a" =="y") ||set (attribute "b" =="y")) from within the dxl editor in the module, I get the desired result. However I need to be able to build the filter dynamically base upon the user selection. Does that make sense?? I've been going round in circles for a couple of days on this Thanks Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
If you want to create a filter which you want to save in a view, then you must use DOORS filters. Otherwise it is much easier to build complex filters using the reject / accept functions and if you do not need a filtered view to be saved, I would suggest to go this route.
------------------------- Pekka.Makinen@softqa.fi SoftQA Oy -http://www.softqa.fi/ |
|
![]() |
|
![]() |
|
Thanks Pekka,
I'm willing to try anything at this point. I'm just loooking at your earlier post now. Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
I've spent this afternoon trying to get the perm
if (isMember(o."my attribute","enum value")) { accept o } but get the dxl error "expected multi valued attribute" Am I missing something obvious?? Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
The obvious was that my enumerated data type was not multi value and does not need to be.
Is there an alternative to isMember for single value enums or will I have to amend all the data types to be multi value? Thank you everyone for all the help and advice. Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
If it is not multivalued then you should check it like any other attribute attribute value, i.e.
if (o."Attribute Name" "" == Value) ------------------------- Pekka.Makinen@softqa.fi SoftQA Oy -http://www.softqa.fi/ |
|
![]() |
|
![]() |
|
Assuming I'm understanding you right, something like this should build the filter you want.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Thank you everyone for your fantastic guidance and assistance. This forum is a lifesaver for newbies like me where the DXL reference manual is less than useful in many cases.
Through a combination of trial and error and great advice the dxl below seems to be doing what I need. I will of course have to add error trapping etc. But at least it works! Cheers Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
|
![]() |
|
I thought you wanted to save this filter in a view?
And I see a few things wrong with your code. The biggest one being that you are doing your object loop multiple times. Inside that problem, you are only looping through the current objects. Well as you accept and reject things, the current module changes. So the second time through the object loop, it will only loop through the objects accepted the first time. Finally, move your reject statement to be the else case of your accept if statement. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hi David,
I could of course save the filter in a view but I really only want to apply the filter temporarily and then do an object copy on the filtered objects. That function I knopw is going to be a nightmare but one step at a time. You are absolutely right in that I have restricted the objects in subsequent loops by prior acceptance. I will have to allow for that and recode. Thanks for your considered review. The learning curve is still steep. Mark ------------------------- mark_williamson@synthesys.co.uk http://www.synthesys.co.uk ---------------------------------------- |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Compound filter
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.