Crystal clear. ________________________________ From: Oleg Zhurakousky <[email protected]> Sent: Thursday, February 2, 2017 2:15:00 PM To: [email protected] Subject: Re: GenerateFlowFile.java
Alessio The onScheduled() is only called once when processor is started. Started means scheduled to execute, hence the name of the operation. When the process is scheduled its scheduler triggers the execution of the processor and the same scheduler controls how often the onTrigger is called. For example, with default TimeDrivenScheduler set to 1 sec, the onTrigger() operation will be invoked every sec. So to answer your question in short your use case should be implemented in onTrigger(). However onSchedule() is where you could/should obtain the reference to your service. Does that clarify? Cheers Oleg > On Feb 2, 2017, at 4:43 AM, Alessio Palma <[email protected]> > wrote: > > Hello all, > > I'm reading the GenerateFlowFile processor, which is started with no input > files. I need to write a processor very close to this one, which accept no > files, but when scheduled has to output into the queue the file returned from > a service it calls. > > I did not understand how the framework calls this kind of processor. > There are both onScheduled and onTrigger methods. > In which order are they called ? > Do I need both? > > AP
