Skip to main content
Hi there,

 

 

I've been struggling with what seems like a very menial task for quite a while now. This is FME 2013 SP2.

 

 

 

Well, I have a directory of shape files I do some basic calculations on with a dynamic schema, such as counts, length, etc. These calculations are then written to a csv file, and split into line, polygon, or point features, with a GeometryFilter.

 

This all works Dandy.

 

Currently, there is a fourth tab I have created, that functions based on a parameter (Called Summarize_FRC) that allows you to optionally select a specific file. A tester I added then checks if that parameter is present, and if the test is passed, it writes out to the fourth tab.

 

 

 

In short, in addition to the line, polygon, and point feature tabs my workspace creates, I want to be able to specify a specific file, were that file and that file alone continues to my fourth tab writer.

 

 

 

The main things I struggle with is that in the parameter options, when choosing Type “Filename (Existing)”, there doesn’t seem to be any documentation on what the configuration tab requires. For now, I just added a “*”, seeing as that tab requires something in order for the parameter to be accepted.

 

 

 

What I have now is a FilenameExtractor transformer, then a Tester that reads (among a million other combinations I’ve tried_:

 

_filename           Contains              $(Summarize_FRC)

 

 

 

This, however, makes all shape files of type Line write to the fourth tab, instead of just the file specified.

 

 

 

I’m very new to FME in general, and I wouldn’t be surprised if none of what I’ve done so far is even close to what needs to be done. J

 

 

 

Any kind of help will be greatly appreciated!

 

 

 

 

 

Thanks!
Hi,

 

 

to configure a published parameter of type "Filename (existing)", you can use the following syntax:

 

 

Shapefile|*.shp

 

 

This will allow you to select any file with the extension "*.shp", and the user will be presented with the description "Shapefile" in the file selection dialog.

 

 

There is a small button with an ellipsis to the far right of the configuration field that will help you enter these values as well:

 

 

 

 

David
Thanks David, this helps a lot.

 

 

However, I still can't seem to seperate the defined Parameter to write to a differant tab.

 

 

Any idea as to what kind of expression my Tester requires to check for the file specified in this parameter?

 

 

Regards,
Hi,

 

 

A Tester with "Contains" works fine for me. I'd recommend that you examine closely the values that enter the Tester to see that they contain.

 

 

"However, I still can't seem to seperate the defined Parameter to write to a differant tab." -> I don't understand what you mean here, could you please elaborate?

 

 

David
When I use "Contains", all files pass through the tester, instead of just the file specified in the parameter.

 

 

What I mean with: "However, I still can't seem to seperate the defined Parameter to write to a differant tab." Is that I cant get my tester to recognize only the features that match my paramater, aka the specific file I chose.

 

 

Using "contains" does not currently seperate the feature defined in the paramater from all the other features that do not match the paramater.

 

 

Kind Regards,
Ok, I see.

 

 

Could you perhaps give a couple of specific examples (copy/paste, preferably) from your data, so that we can see exactly what happens?

 

 

Be sure to include both the left and the right side value that enters the Tester. Example:

 

 

"c:\\mydir\\myshape.shp" contains "shap"

 

"c:\\mydir\\mypolygons.shp" contains "poly"

 

etc.

 

 

David

Reply