Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Filters using a string to define a filter
Topic Summary:
Created On: 7-Sep-2004 09:49
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 7-Sep-2004 09:49
User is offline View Users Profile Print this message


Anthony Ridding

Posts: 5
Joined: 22-Jun-2004

Having a bit of a problem with DXl this morning I loop through a table producing a list of IDs that I want to filter another table on


I can create the string with no problems however i cant seem to find a way to convert a string to a Filter.

if i do

Filter f2
string FilterString = "(attribute \"Object Text\" == 1802) || (attribute \"Object Text\" == 1803) "
f2 = FilterString

Dxl wont compile

if there a way to use a legit constructed filter string to set a Filter ? or I am barking up the wrong tree

Thanks

Report this to a Moderator Report this to a Moderator
 7-Sep-2004 10:06
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Hi,
I also haven't succeded with whole definition as parameter, but it can be done this way:

string attName = "Object Text"
string val1 = "1802"
string val2 = "1802"

Filter f = (attribute attName == val1) || (attribute attName == val2)

Well, it is not exaclty what you wanted, but maybe it helps...
Report this to a Moderator Report this to a Moderator
 7-Sep-2004 10:13
User is offline View Users Profile Print this message


Anthony Ridding

Posts: 5
Joined: 22-Jun-2004

That would work with small lists, however and I should have posted this the first time, my lists can be failry long , one example list is 95 entries long
Having to create a filter manually like that would make my fingers bleed

just seemed strange to me that Telelogic provide a way of getting a current filter as a string, but dont seem to have the reverse function
Report this to a Moderator Report this to a Moderator
 7-Sep-2004 13:24
User is offline View Users Profile Print this message


Lenka Koskova-Triskova

Posts: 10
Joined: 17-Dec-2003

Well, to save your fingers, than there is another possibility: generate your DXL code automatically parsing your table by another script.

This is just an example of such code generation:
-----
Stream batchDXL = write "filters.dxl"

int id=1

for element in table do {

FilterString = your_code_to_get_it
id++
batchDXL << "Filter f" id "= " FilterString "\n"
}
------
in the filters.dxl you have all the f1....fn you want to.
Report this to a Moderator Report this to a Moderator
 7-Sep-2004 22:29
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

This one is off the wall, but if you get REALLY stuck, try something like this:
Manually create a filter similar to the one you want create with DXL. Apply it.
Run the following code:

Filter fltCurr = current
string Summary

if (!null fltCurr)
Summary = stringOf(current Module, fltCurr)
else Summary = "<no filter defined>"
print "Current filter = [" Summary "]\n"

Presumably you'd type in something like the result in your DXL.

- Louie
Report this to a Moderator Report this to a Moderator
 8-Sep-2004 14:43
User is offline View Users Profile Print this message


Anthony Ridding

Posts: 5
Joined: 22-Jun-2004

I can create the Search string with no problem, All I seem unable to do is apply this string as a filter. Lenka's idea would work I think but what I really want is to be able to set a filter to a legitimate Filter String.

I semi solved the problem by using a Skip list but this doesnt seem as elegant a solution as using a filter.

Edited: 8-Sep-2004 at 14:44 by Anthony Ridding
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.