Hi FME’ers,
A couple of year’s ago I wrote an article about ‘conditional processing’ in FME, and when to use the different filtering and mapping transformers. Looking back it seems a bit long-winded and complicated (sorry) and so I wanted to write this short post to simplify matters.
Basically I want to describe when to use the Tester, TestFilter, and AttributeFilter. I figure I can do that using some simple examples.
The Tester
The Tester transformer is for simple Yes/No decisions, for example:
- “Would you like a beer?”
- “Are you 18 years or older?”
- “Is that road a primary road?”
These tests can be combined as well, within a single Tester, for example:
- “Would you like a beer AND are you 18 years or older?”
They can be quite complex too, in what we call a composite test, for example:
- “Would you like a beer AND (are you 18 years or older OR (do you live in the US AND are you 21 years or older))”?
…but each component is still a simple Yes/No test. The order of the conditions is only important when you do a composite test (and not always then).
The AttributeFilter
The AttributeFilter is best for testing many values for a single attribute, for example:
- “Is your favourite beer Amber, Bitter, Lager, Pale, or Stout?”
- “Is that road a Primary Road, Secondary, Residential, Private, or Other?”
You wouldn’t do combination tests here (for example, a road can’t be both Primary and Secondary) and so the order of the tests is not important.
The TestFilter
The TestFilter is best for filtering a feature by a set of cascading conditions, for example:
To play in the FME golf tournament you must pass one of these conditions (similar to the Masters qualification rules):
- “Are you the current champion?”
- “Are you a previous champion?”
- “Have you won another tournament in the last 5 years?”
- “Were you in the top 16 in last year’s FME tournament?”
- “Are you in the top-30 worldwide rankings?”
It’s a set of cascading tests, because if you are the current FME golf champion, you qualify at the top of the list. You don’t need to be tested against any other criteria. So here the test order is important.
Like the Tester, each test can be a combination of conditions, for example:
- “Are you in the top-30 worldwide rankings OR are you in the top-10 national rankings”
If the above seems familiar, well it’s an expanded version of some info in the FME training course.
I hope you find this a useful reference,

Mark Ireland
Mark, aka iMark, is the FME Evangelist (est. 2004) and has a passion for FME Training. He likes being able to help people understand and use technology in new and interesting ways. One of his other passions is football (aka. Soccer). He likes both technology and soccer so much that he wrote an article about the two together! Who would’ve thought? (Answer: iMark)
I have set up an attribute filter. All filter outputs are green. Each is connected to a feature service writer. All writer connections are green. All fields show up (green) in both filter and writer. When I select “inspect” on the writer, the output is correct.
But when I run the workspace, the filter simply doesn’t go. No features pass through. There is no error. I get a “Translation Succeeded” message and a “Features Written: 0” message.
How do I find out why the filter is not working?
Thank you,
Randy McGregor
Hi Randy
I think the best method is to use the “Run with Breakpoints” option. So in Workbench select Run > Run with Breakpoints from the menubar to turn it on (also be sure to turn off any other run options). Then right-click the connection into the AttributeFilter and choose Add Breakpoint. Now run the workspace. The first feature to the AttributeFilter will cause it to pause, and a window open to inspect that feature. You’ll be able to see at a glance what its attribute value is and whether it matches an option in the AttributeFilter. If it looks like it should be OK, but fails, then try using an AttributeTrimmer transformer to trim off any hidden whitespace. That can often be a cause for such issues. Failing that I suggest that you post this question on our FME community Q+A (knowledge.safe.com) and we can take a closer look at it there.
Hope this helps
Mark