Solved

Run FME desktop automatically (scheduled)


Badge

Hi all,

I would like to run FME Desktop automatically. After seeing some posts, the only method that I have found is using FME Server, however, I have not understood how it exactly works. Could anyone please help? Is there any other way?

Many Thanks

icon

Best answer by f.kemminje 21 March 2018, 15:06

View original

16 replies

Userlevel 4
Badge +30

Hello @claraosuna,

There is a interesting video and Tutorial about this Schedule method:

https://knowledge.safe.com/articles/22724/schedule-a-workspace-to-run-with-fme-server.html

Thanks,

Danilo

Userlevel 1
Badge +17

You can also schedule a workspace with the windows scheduler. You don't need Server for that. Just copy the first lines of the logging and paste them in to a .bat or .cmd file. After each new line you have to paste the ^ character to tell windows that the next line is a parameter of the first line.

So if I take this example the command file would look like:

D:\\FME\\fme-desktop-2018.0-b18284-win-x64\\fme.exe C:\\Users\\stalknechtw\\Desktop\\demo.fmw^

--SourceDataset_ESRISHAPE "D:\\OneDrive\\DemoData\\GWB2016\\Uitvoer_shape\\gem_2016.shp"^

--DestDataset_PDF2D "C:\\Temp\\result.pdf"

this command file can be scheduled in the windows scheduler.

Badge

How FME Server works?

 

You basically put your workspace on a server. Anyone with acces to that webpage can fill in the user parameters (the same as in workbench). It will then run the same process. You can get your output where you defined it or download it in a download package.

 

 

Major advantages: 1) you don't need FME Workbench on your machine to run data translations. 2) People who have no idea about FME/GIS can do transformations. 3) You could use windows scheduler, but if the number of processes increases it will get messy very quickly.

 

 

Without getting into technical details and the other possibilites, I think that sums up what FME Server is about.
Badge +3

for desktop ,

use bat file(normal text file)

batch file looks like this

c:\\fme\\fme.exe c:\\temp\\abc.fmw --publishedparameter1 --publishedparameter12

c:\\fme\\fme.exe c:\\temp\\abq.fmw --publishedparameter1 --publishedparameter12

--------------------------------------------------------------------------------------------------

fme.exe where your fme software is installed

fmw name : path and filename of your fmww file

--parameter names

then run this batch file from windows scheduler

 

 

And for fme server

 

upload your existing fmw to fme server

click on schedules

add new

type all the field like

name

fmw name

start run date

time

interval etc...

 

thats it . very easy

fme server will take care your job

Badge

Hi all (@danilo_fme @stalknecht @jneujens fkemminje)

Thank you very much for your help, it has been very useful. I already have created the schedule.

However, once I have completed this stage, I find another issue int he next one: is there any method to have the data recorded and keep adding the new one each time the workflow is refreshed?

Thank you very much indeed.

Userlevel 1
Badge +17

Hi all (@danilo_fme @stalknecht @jneujens fkemminje)

Thank you very much for your help, it has been very useful. I already have created the schedule.

However, once I have completed this stage, I find another issue int he next one: is there any method to have the data recorded and keep adding the new one each time the workflow is refreshed?

Thank you very much indeed.

You have to configure the writer to prevent this. Which writer do you use?

 

 

Badge
You have to configure the writer to prevent this. Which writer do you use?

 

 

.csv/xlsx

 

Is not possible to set it in the same workflow?

 

Thanks

 

 

Badge

for desktop ,

use bat file(normal text file)

batch file looks like this

c:\\fme\\fme.exe c:\\temp\\abc.fmw --publishedparameter1 --publishedparameter12

c:\\fme\\fme.exe c:\\temp\\abq.fmw --publishedparameter1 --publishedparameter12

--------------------------------------------------------------------------------------------------

fme.exe where your fme software is installed

fmw name : path and filename of your fmww file

--parameter names

then run this batch file from windows scheduler

 

 

And for fme server

 

upload your existing fmw to fme server

click on schedules

add new

type all the field like

name

fmw name

start run date

time

interval etc...

 

thats it . very easy

fme server will take care your job

Just to add it is better for the BAT file to run a workbench which is just a Creator and workspaceRunner and if fails then Emailer.

 

 

Therefore you can catch the Main workbench's errors otherwise if it failed then the windows scheduler will say its competed with no error.

 

 

Badge
You have to configure the writer to prevent this. Which writer do you use?

 

 

 

The purpose is calling an API and have recorded all the data that it is generating. There may be another way to automatically refresh the API instead running all the workflow
Userlevel 1
Badge +17
.csv/xlsx

 

Is not possible to set it in the same workflow?

 

Thanks

 

 

You can set the Overwrite Existing File to No

 

 

Badge

You can set the Overwrite Existing File to No

 

 

Great! It worked!

 

Many thanks!!
Badge

You can also schedule a workspace with the windows scheduler. You don't need Server for that. Just copy the first lines of the logging and paste them in to a .bat or .cmd file. After each new line you have to paste the ^ character to tell windows that the next line is a parameter of the first line.

So if I take this example the command file would look like:

D:\\FME\\fme-desktop-2018.0-b18284-win-x64\\fme.exe C:\\Users\\stalknechtw\\Desktop\\demo.fmw^

--SourceDataset_ESRISHAPE "D:\\OneDrive\\DemoData\\GWB2016\\Uitvoer_shape\\gem_2016.shp"^

--DestDataset_PDF2D "C:\\Temp\\result.pdf"

this command file can be scheduled in the windows scheduler.

I did this and it worked fine.

1st. Create a FME script, in my case, with FME 2022 workbench.

2nd. Run and break the tranalation.

3rd. Copy the lines between

"COMMAND-LINE TO RUN THIS WORKSPACE:" and "STARTING TRANSLATION".

4TH. Create/open a batch file and paste the copied line into it. Place place/copy/paste the character "^" at the end of each pasted lines and save the batch file.

6th. The batch file is ready to run. The running can be automated in the trigger tab in the TASK SCHEDULER app in windows microsoft.

 

Hello everyone,

I have an issue to execute my bat. files : I have a workspace without Reader. In that case, the bat. file just write "Emptying factory pipeline". I realised I don't have this issue when there's a Reader in my Workspace.

Is there someone who can help me with this ? :)

Userlevel 1
Badge +17

Hello everyone,

I have an issue to execute my bat. files : I have a workspace without Reader. In that case, the bat. file just write "Emptying factory pipeline". I realised I don't have this issue when there's a Reader in my Workspace.

Is there someone who can help me with this ? :)

Can you share the .bat file and / or workspace ?

imageimage

Userlevel 1
Badge +17

imageimage

Looks like your batch file isn't passing the parameters correctly.

Now each line wil be executed by the command interpreter.

Enter an 'accent circonflexe' ^ after each line of code except the last line.

This will instruct the paramaters to be executed by the command as it's one line.

example:

"C:\Program Files\FME 2022\fme.exe" "bladibladibla.fmw"^
--DestDataset_FILECOPY_3 "$(FME_MF_DIR_USERTYPED) bladibladibla"^
--FME_LAUNCH_VIEWER_APP "YES"

 

 

Reply