Solved

FileNamePartExtractor does not recognize the 'DateTimeFormat' function.


Badge +2

Howdy,

Are there known errors/solutions related to the FileNamePartExtractor transformer's handling of 'DateTimeFormat' functions in a file name? I am experiencing this issue in both FME 2018.1.1.2 & FME 2019.0

I have a workspace that reads in information from FME Server on scheduled jobs (http://fme:8080/fmerest/v3/schedules?limit=1000&offset=0) and writes details about each scheduled Job and its destination tables to an Excel workbook.

I believe this workspace was working fine a few months back, however now I am encountering an error with a FileNamePartExtractor transformer's "Full File Name Attribute" parameter. The error is triggered where a Job has a parameter for the destination file name that includes @DateTimeFormat or @DateTimeNow . For example processing a destination file name like this triggers an error:

\RC Metrics_DailyUpdate_@DateTimeFormat(@DateTimeNow(),%Y%m%d).xlsx

The error message received is below:

2019-06-18 12:11:24|   0.7|  0.1|ERROR |FilenamePartExtractor_2 (TeeFactory): FilenamePartExtractor_2: This FME edition does not recognize the `DateTimeFormat' function. Please ensure that the current platform supports this function, the function name is spelled correctly, and that you have installed all required plug-ins

2019-06-18 12:11:24|   0.7|  0.0|ERROR |FilenamePartExtractor_2: This FME edition does not recognize the `DateTimeFormat' function. Please ensure that the current platform supports this function, the function name is spelled correctly, and that you have installed all required plug-ins

 

Attached is a .fmwt with an example of this error: 

Other's might find it useful to have a workspace that retrieves Scheduled Job info from FME Server so here's the template of what I have in development: 

Thank you!

icon

Best answer by markatsafe 19 June 2019, 18:52

View original

2 replies

Badge +2

@joshuadamron Thanks for including reproduction example as the workspace template. I reproduced the error and we'll try and address it. At this point I can't see a way around the issue, outside of using a regex to extract the filename:

.*\\\\(.*)\\..*

...but it won't have the datetime evaluated.

(regex credited to Starred MediaSoft)

Badge +2

@joshuadamron Thanks for including reproduction example as the workspace template. I reproduced the error and we'll try and address it. At this point I can't see a way around the issue, outside of using a regex to extract the filename:

.*\\\\(.*)\\..*

...but it won't have the datetime evaluated.

(regex credited to Starred MediaSoft)

@markatsafe thank you for digging into this, replacing the FileNamePartExtractor with a StringSearcher is a great call, I was stuck on the idea that the FileNamePartExtractor should work the way I wanted it to instead of just coming up with another way to do it.

 

 

I went with this expression for the StringSearcher: ([^\\\\|//]+)$ which captures everything after the last backslash or forward slash (or if there is no slash the RegEx will just capture everything which is fine for my purposes).

Thank you again for your assitance.

Reply