Skip to main content
Solved

Run part of FME Workspace based on day of the week or if date = X


dmerrick
Contributor
Forum|alt.badge.img+1

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

Best answer by daveatsafe

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
View original
Did this help you find an answer to your question?

3 replies

Forum|alt.badge.img+2

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:

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • December 5, 2018

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

dmerrick
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • March 3, 2020

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings