Question

Scan folder before starting workbench traitment


Badge
Hi,

 

I use schedules to launch my workbench every x minute. my workbench starts by reading shp files into my folder. I have a problem if there are no file in folder, the job starts and i get errors with no files. I look for a solution to test if my folder contains files and continuous traitment of workbench. 

 

I try with python script but i can't.

 

Any help?

 

Thanks

6 replies

Userlevel 4
Hi,

 

 

have you tried setting "Ignore failred readers: yes" under the Workspace parameters / Advanced?

 

 

David
Badge
Hi,

 

i try it but no change. i get each x minutes the FME_FAILURE in FME SERVER_jobs.

 

Other ideas? 

 

Thanks,

 

 

 

 

Userlevel 4
Hi,

 

 

another option could be to use the "Directory and File Pathnames" reader to count the files in the directory.

 

 

If count > 0, then pass it on to either a FeatureReader or a second workspace (WorkspaceRunner / FMEServerJobSubmitter). If count = 0, terminate.

 

 

David
Badge
Hi,

 

its a good idea, but how could i retrieve count files? 

 

Thanks an advance.

 

 

 

Userlevel 4
Badge +13
Hi,

 

 

Each file or directory (according to how you set the reader) is a feature, so you can count the features, or use one of the features attributes.
Badge
Hi,

 

David, Itay, thank you for your help.

 

I use Directory and File Pathnames readers and FeatureTypeFilter to retrieve path of files is are exist into the directory.

 

 

Farfar

 

Reply