![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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!
|
|
![]() |
|
![]() |
|
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!
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Filtering in Analysis Wizard
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.