Odin, So by using GetFile you have pulled the file from the file system 'into NiFi'. So if you then want to execute the Java process 'against' that file you need the process to be listening for the data via 'stdin' or you need to write that file out to a temp storage location and then execute from there.
GetFile: Pulled the file from the filesystem into nifi. ExecuteStreamProcess: Will start a command and can send things to stdin and listen to stdout. If the command you are running in ExecuteStreamProcess is looking for a file to operate on then you can use PutFile to write one out. Or you can change that program to listen for stdin as the input source. Thanks Joe On Mon, Sep 28, 2015 at 11:52 AM, Odin Guillermo Caudillo Gallegos <[email protected]> wrote: > Ok, now java is giving me the following exception when i read the file, > either with Scanner or BufferedReader: > file.txt (No such file or directory) > > 2015-09-28 10:30 GMT-05:00 Rick Braddy <[email protected]>: >> >> Ignore STDIN = true (you don’t have anything flowing into stdin, as I >> understand it) >> >> >> >> From: Odin Guillermo Caudillo Gallegos [mailto:[email protected]] >> Sent: Monday, September 28, 2015 10:06 AM >> >> >> To: [email protected] >> Subject: Re: Run process after getting a file >> >> >> >> Ok, so i'm using the following configuration on the >> ExecutingStreamProcess: >> >> command args = -jar;myJar.jar;${filename};/outputfolder >> >> command path = java >> >> Ignore STDIN = false >> >> It gives me a :Failed to write flow file to stdin due to >> java.io.IOException: Broken pipe: java.io.IOException: Broken pipe >> >> >> >> I'm using GetFile->ExecutingStreamProcess do i miss something? i run the >> jar from a terminal and works fine. >> >> Thanks >> >> >> >> 2015-09-25 19:01 GMT-05:00 Joe Witt <[email protected]>: >> >> command path = java >> command args = -jar;${filename} >> >> That might do the trick. >> >> Thanks >> Joe >> >> >> On Fri, Sep 25, 2015 at 7:59 PM, Rick Braddy <[email protected]> wrote: >> > Expression language in ExecuteStreamProcess could be your friend here to >> > use >> > the filename attribute to set the process arguments. >> > >> > >> > On Sep 25, 2015, at 6:12 PM, Odin Guillermo Caudillo Gallegos >> > <[email protected]> wrote: >> > >> > Great it works, now, is it possible to get like a .txt from the GetFile >> > flow >> > and use it to execute a java -jar <file from flow> as an input value? >> > >> > 2015-09-25 17:56 GMT-05:00 Odin Guillermo Caudillo Gallegos >> > <[email protected]>: >> >> >> >> Ok i'll give it a try >> >> >> >> 2015-09-25 17:40 GMT-05:00 Rick Braddy <[email protected]>: >> >>> >> >>> I think I misread your inquiry. ExecuteProcess is scheduled only by >> >>> Timer or Cron schedule today; however, ExecuteStreamCommand support >> >>> the >> >>> "Event" trigger method, which may meet your needs. >> >>> >> >>> Rick >> >>> >> >>> -----Original Message----- >> >>> From: Rick Braddy [mailto:[email protected]] >> >>> Sent: Friday, September 25, 2015 5:32 PM >> >>> To: [email protected] >> >>> Subject: Re: Run process after getting a file >> >>> >> >>> Not today. GetFile must start a flow. >> >>> >> >>> There are discussions underway on a proposal to introduce some new >> >>> file >> >>> processors that are event triggered and dynamically configured >> >>> (incoming >> >>> FlowFile contains path to file) >> >>> >> >>> Rick >> >>> >> >>> > On Sep 25, 2015, at 5:28 PM, Odin Guillermo Caudillo Gallegos >> >>> > <[email protected]> wrote: >> >>> > >> >>> > Hi, is it possible to run the ExecuteProcess after using GetFile? >> >>> > The >> >>> > idea is to not use the scheduling feature but trigger it with >> >>> > GetFile. >> >>> > >> >>> > Thanks >> >> >> >> >> > >> >> > >
