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: Filtering on part of a specific text attribute
Topic Summary:
Created On: 12-Feb-2003 15:33
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.
 12-Feb-2003 15:33
User is offline View Users Profile Print this message


Peter Seager

Posts: 32
Joined: 10-Feb-2003

I want to build a filter using DXL which selects all text attributes that include a certain string, eg Object Text which includes "shall". This is used to gather metrics so that several filters can be fired off sequentially and the metrics gathered.

The problem is if I use the attribute (value) function I seem to be limited to seaching for complete attribute strings. If I use the contents function, I can filter using part of the text but in any text attribute. What am I missing in order to search a specific attribute for those objects that contain a given text string? I can be done using the filter tool so why not in DXL?

Many Thanks.
Report this to a Moderator Report this to a Moderator
 12-Feb-2003 18:09
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Unfortunately, I haven't found a dxl command equivalent to the filtering on the contents of a single attribute using regular expressions functionality that is available from the user interface.

The attached code is an example of how it is usually done from DXL. If you are only searching a single specific attribute, you will need to uncomment the ( if ad.name "" == "My Attribute Name" ) check (including the trailing brace) and fill in the attribute name you are checking for.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
 12-Feb-2003 19:27
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Be advised that Sutherland's code does NOT "define" a filter, it just runs one (notice that it evaluates each object and either accepts or rejects it). You cannot save this filter as part of a View. You will need to execute his code everytime you want to see the filter results. Nothing wrong with that; all of my 15 or so filter DXLs work the same way.

- Louie
Report this to a Moderator Report this to a Moderator
 13-Feb-2003 08:59
User is offline View Users Profile Print this message


Peter Seager

Posts: 32
Joined: 10-Feb-2003

Michael Sutherlands approach is fine. I am only using the filter as a means to gather the metrics and so it might form a useful new approach to the whole problem.

Many thanks

Peter

Edited: 13-Feb-2003 at 09:01 by Peter Seager
Report this to a Moderator Report this to a Moderator
 6-Aug-2003 18:31
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

I was looking for providing similar functionality, but I needed to also save the filter definition into a view. A call to Telelogic tech support eventually provided an answer from which I inferred the following function definition:

Filter contains(attribute_handle attribute, string text[, bool caseSensitive])

As an example, running the following code from a module:

Module m=current
Filter f=contains(attribute "Object Text", "[sS]hall")
set(f)
print stringOf(m, f) "\n"


will print:

Object Text CONTAINS '[sH]hall' [with regexps]

By using the optional caseSensitive argument and modifying the search criteria so that it does not reference a regular expression, you will get

Object Text CONTAINS 'shall' (caseSensitive=false) or
Object Text Contains 'shall' (caseSensitive=true)

The net result is a filter which can be created via DXL and saved with any view.

-Dennis
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.