Developing Apama Applications > Developing Adapters > Standard Apama Adapters > Apama File adapter > LineWritten event
LineWritten event
After the File adapter writes a line to a file, the adapter sends a LineWritten event. The event definition is as follows:
event LineWritten
{
/* The name of the transport being used within the File adapter */
string transportName;
 
/* Request ID this event is in response to. */
integer requestId;
 
/* The sessionId the FileLine was sent for */
integer sessionId;
}
This is useful when you want your application to send FileLine events in a batch to control flow. If you need to do flow control, you would typically set all the requestIds to positive values and emit the next FileLine events only after receiving the LineWritten notification for the previous FileLine event you sent. If you do not need to do flow control, you could set requestId=-1 for all but the last FileLine event, but set it to a positive value for the very last FileLine event so you get a single LineWritten notification when everything has been written.
The file remains open for the lifetime of the adapter unless you emit a CloseFile event. See Opening files for reading for the CloseFile event definition.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.