Skip to main content

Hi,

I am trying to set up within an FME workspace a way to run select transformers within the workspace based on the day of the week, and other parts based on the month.

I have various external datasets I want to refresh internally (SDE) by pulling them externally; some datasets are to be pulled every Tuesday, while others are on a quarterly basis (2/1,5/1,8/1,11/1). I would be running the workspace from FME server on a daily basis but have the coding within the workspace to refresh based on preset conditions.

I am running FME 2018.1 build 18547

Hi @dmerrick

 

 

You could create an attribute using python that would be able to tell you the day of the week as an integer (0=Monday...) and then use a TestFilter to route the features depending on what you want to do.

 

 

To do this, I set the PythonCaller up like this:

 


Hi @dmerrick,

You can do this with a few transformers:

  • DateTimeStamper to generate a datestamp on each feature
  • DateTimeConverters to convert the datestamp to day of week (%w) and day of month (%e)
  • Testers to test if day of week == 2 (Tuesday) or day of month == 1

as a follow up/expand upon @daveatsafe comment. To create Quarterly/Annual filter within a workspace that runs only during the week use a testfilter to filter to the first day of the week (Monday = 1) and then the day (Day<=7), then add another testfilter for select months. This allows for a workspace on FME Server running M-F to "catch" quarterly events on weekends (2/1/2020, 3/1/2020 etc) to be run on the first Monday of the month as a workaround.


Reply