span8
span4
span8
span4
Hi all,
I've been playing around with the system caller,however,I've found that when I abort my FME process the process triggered using the System Caller keeps running.
Part of the problem is that I'm also using the TempPathnameCreator as the output for the called process,if I kill the FME process and the sub-process keeps running then the temp files also don't get deleted.
I have to manually kill and then delete the process
Does anyone know of a workaround for this?
Another thing / question,related to this one: my batch file or my executable are finished running,but the system caller is still running.So the process in Workspace is not continuing.Is this a related problem or a new question?@david_r @virtualcitymatt?
How are you starting the child process in the SystemCaller?If you can get hold of the process id (pid) you can make FME wait for process termination using e.g.a PythonCaller.
Here's an example that takes a list of process ids (pid_list{}) and wait until they've all terminated before the trigger feature is output:
import subprocessimport timeclassFeatureProcessor(object): def __init__(self): pass def input(self,feature): while True: process_ids = feature.getAttribute('pid_list{}') subprocess_lines = [line.split() for line in subprocess.check_output("tasklist").splitlines()] running_process_ids = [line[1] for line in subprocess_lines if len(line) > 1] is_running = any(running is True for running in [i in running_process_ids for i in process_ids]) if is_running: time.sleep(3) else: break self.pyoutput(feature) def close(self): pass
Thanks@david_r,
The process is a java program where the call is something like "java -jar '
So the process is java.exe - I could look for and kill the pid relating to a java.exe process if,and only if,there is a single java.exe running.This might be my only option as you say,unless you know of a way to get the ProcessID for something triggered by the SystemCaller with Python...?
Ideally it would be great if there was something I'm missing in the system caller to avoid the need,but perhaps that's wishful thinking :D
It may be easier to just skip the SystemCaller and start your java app using the subprocess.Popen() function in Python: it will return the pid for you to use later on,without having to guess based on the tasklist.
Emailer question1 Answer
Create an excel file before opening it2 Answers
Write features as they are read1 Answer
Workspace in cmd2 Answers
Dynamic reader parameters0 Answers
© 2019 亚搏在线Safe Software Inc |Legal