Skip to main content

The directory starts fresh every time, files copied are and produced by other FME Workbenches, testing condition whether a directory contains a 1-1000 files. I'm found and filter for the required files via FeatureReader Path but having a hard time testing for specific condition, Tester before a ListBuilder or a ListBuilder then a ListSearcher ???

 

PASSED condition if the directory

Must find = const.dwg, exist.dwg, passed.kmz

MUST BE NOT FOUND = failed.kmz

 

FAILDED in all other conditions

Found = const.dwg

Found = const.dwg, existing.dwg

Found = const.dwg, existing.dwg, failed.kmz

Found = const.dwg, existing.dwg, failed.kmz, passed.kmz

...

..

.

 

Testing for files

There is a custom transformer to check for existing files. A couple of those might work fairly well.

 

https://hub.safe.com/publishers/safe-lab/transformers/fileexistencechecker


There are a couple of ways:

1. Join all the File Paths into one concantenated string, and run Tester "If ... AND ... AND ... AND ... AND" conditions over the concantenated value.

2. Use FME Transformers as Logic Gates. Eg. Sampler can be used for OR conditions, and FeatureJoiner can be used for AND conditions. In this case they are all AND or NOT AND conditions, so only FeatureJoiner is needed to find if TRUE or FALSE comes out, represented by either a single Feature on the Joined or Unjoined Ports

Both examples shown below:

 

First a "FAIL" with "failed.kmz" being present. No "PASS" features are produced

capture..and with the same workspace run, but this time with no "failed.kmz" present, this gives a "PASS" condition

capture2 


After getting a list of list of relevant file -> ListBuilder -> AttributeValidatorAttributeValidator


Reply