Question

Running a workspace from a bat file automatically with 1 click?

  • 11 October 2023
  • 4 replies
  • 14 views

Badge
@echo off
start "" "C:\Program Files\ArcGIS\Data Interoperability for ArcGIS Pro\fmeworkbench.exe" "%~dp0ReadGdbFromFolder_AA.fmw" --run

Hi all, currently this bat file when clicked opens FME Workbench and the workspace dynamically based on where the bat file is located in and that's great, but is there a way I can also make workbench run my workspace once it loads up the workspace itself?


4 replies

Badge +13

It's possible to run the workspace from the batch file. Check the documentation here: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/Workbench/Running_a_Batch_Translation.htm

Badge

It's possible to run the workspace from the batch file. Check the documentation here: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/Workbench/Running_a_Batch_Translation.htm

I don't think that's what I'm looking for?

 

imagenewBat.bat is the current bat file I have. When I double click on it it opens FME workbench and the workspace:

imageBut I would still need to press Run on the top left to actually make it run, which is what I can't figure out how to do in my bat file.

Userlevel 3
Badge +19

Perhaps you can write some Python, you could do a call to os.system

Something like: os.system workspace.fmw --arg_one --arg_two ...

 

Add this python to the startup script

start up scriptsAn article that may help Startup Python Scripts in FME (safe.com)

Badge

Perhaps you can write some Python, you could do a call to os.system

Something like: os.system workspace.fmw --arg_one --arg_two ...

 

Add this python to the startup script

start up scriptsAn article that may help Startup Python Scripts in FME (safe.com)

Sorry I don't really understand how to adapt your code to my use case.

 

The problem I'm facing now is:

  1. I am designing my workspace with potential users who might not have python installed on their device in mind.
  2. If they do, I'm assuming that they might not know programming of any sort, let alone python.
  3. I'm looking at the guide by safe.com and I'm not sure how exactly I can set my paths since they hard code theirs.
  4. My workspace is intended to be used dynamically, as in users can copy paste my workspace file and DWG template file into the location of their Esri Project containing the GDB file to be converted and then run it from that specific project location.
  5. As far as I can tell, Workbench seems to be able to dynamically set it's dataset by selected $(FME_MF_DIR) in the Dataset field, I'm not sure how this would work with python?

image 

And I'm not sure what I should be passing as arguments as per your code and what safe.com recommends?

Reply