Question

Workspace running Systemcaller won't complete

  • 27 April 2018
  • 1 reply
  • 9 views

Hi

For different reasons I am trying to use FME Server to run a batchfile scheduled.

The batchfile's task is to run a specified Powershell-script that converts a spreadsheet to PDF using MS Excel.(Yes, if FME would have had a proper plain PDF-writer I would have used this.). Both powershell-script at batchfile are working flawlessly when used manually.

I've created a workspace with a systemcaller to run the batch-file. When I start this workspace, it runs the batchfile and it does what it is supposed to do, and fme logs what is happening.

From the fme-log:

SystemCaller: Executing `C:\Scripts\RunPowershellScript.bat'
Z:\Some\network\address>>ECHO *********************************************************
Z:\Some\network\address>>ECHO ** run powershellscript to convert spreadsheet to pdf. ** 
** run powershellscript to convert spreadsheet to pdf. **
Z:\Some\network\address>>ECHO *********************************************************
Z:\Some\network\address>PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'C:\Scripts\ExportTo-ExcelPDF.ps1'" 
saving \\A\different\network\address\somewhere\kartoversikt.pd
f

done

After the last line "done", nothing more happens except the workspace continues to run infinately seemingly without doing anything more. If I pause the workspace it reports processes paused, so something is going on in the background.

Pauced process 5454.
Pauced process 2144.

I've tried adding an exitcode to the batchfile without success and end up having to stop the translation manually.

 

It may be there is an easy answer to this that I just don't see, or of course, there are other ways to solve this. I have not tried this on FMEServer yeat as I want it to run properly on Desktop first.

 

Any suggestions are welcome!

Thanks.


1 reply

Have you tried exiting powershell (exit) at the end of your script.

Reply