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 in Analysis Wizard
Topic Summary: Compound filters not working
Created On: 14-Jan-2008 15:42
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.
 14-Jan-2008 15:42
User is offline View Users Profile Print this message


Corey Carroll

Posts: 48
Joined: 25-May-2006

I am using the Analysis Wizard to run a report on links. I usually use it to filter out links based on one attribute. Now I am trying to filter out links based on two attributes, but cannot get it to work (fist bit of code attached). I was able to get it to work when we used 7.1, but it is not working in 8.2. I have also used another filter in 7.1 that won't work in 8.2 (second bit of code attached).

What am I doing wrong? I am not a coder, so some of this is not absolutely clear to me!

Thanks,
Corey
Report this to a Moderator Report this to a Moderator
 14-Jan-2008 20:02
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Your first 'display' should display an empty line when 's' doesn't match '[CDCS'. Regardless, the 2nd match is considered and possibly display s. I suspect you intend the 2nd matches to be used only when the first succeeds, that is:
s = probeRichAttr_(othero,"AttrsInOne", false)
if (!matches("[CDCS",s)) display ""
else
{ string s1 = probeRichAttr_(othero,"Allocation to Projects", false)
if (matches("P-06-0016",s1)) displayRich s
}

In english, the above code "displays the value of AttrsInOne when it contains [CDCS and when Allocation to Projects includes 'P-06-0016'".

You really don't need the 1st display, unless for some reason you want the EOL that display always puts at the end.

- Louie
Report this to a Moderator Report this to a Moderator
 15-Jan-2008 08:53
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

When you say it doesn't work, do you mean that is throws errors or displays the wrong results.

Regular expressions were fixed in DOORS 8.0, so "dodgy" regular expressions that worked in 7.x no longer work in 8.x.

The first code snippet throws an exception because the regexp is not legal.
If you are trying to match the left bracket then you need to escape it thus:
"\\[CDCS"

The second code snippet looks ok, but I haven't tested it.

Try out your regexps in a simple DXL before adding to layout dxl.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 15-Jan-2008 14:11
User is offline View Users Profile Print this message


Corey Carroll

Posts: 48
Joined: 25-May-2006

Louie, I did notice one error I made through your interpretation....I actually intended not to show anything that contains "[CDCS". So the filter is to show anything that matches given the "Allocation to Projects" value, but does not contain the "[CDCS" value in AttrsInOne. I corrected my error in your script and it worked. Thanks!
Report this to a Moderator Report this to a Moderator
 15-Jan-2008 14:15
User is offline View Users Profile Print this message


Corey Carroll

Posts: 48
Joined: 25-May-2006

Tony, thanks. I did forget to mention to Louie that I had to use "\\[CDCS" in order for it to work. I didn't even think about that, I just figured since the bracket was in quotation marks that it would not throw anything off. Thanks for the help!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.