Custom component that can communicate with built in writers

I have a custom component that is sending http requests, parsing the response, and eventually creating a List of records. What I cant seem to figure out is what I need to do to be able to output that java object (or something derived from it) to another component that is connected downstream. I cant find any good docs on this, so any pointers in that regard would also be greatly appreciated.

Hi Aaron,

You can use following:
* documentation regarding component integration into Engine - http://doc.cloveretl.com/documentation/ … index.html
* files on SourceForge - http://sourceforge.net/projects/clovere … -3.4.0-M2/
** javadoc
** source codes of OpenSource Engine, including components (so you can check code of similar component to one you plan to write, for example SimpleCopy is easy)
** examples, see JavaExamples

Hi

One thing about SimpleCopy is that it is already reading in objects of type DataRecord . So it reads in using a CloverBuffer and then writes to the output port using the same object. There is no construction of records. Im trying to go from a java.util.collection class to a DataRecord. Once I have that I should be able to write those to the output port. So… how do you populate a DataRecord? Im guessing the fields in the data record are created when you use the DataRecordFactory and pass it metadata from either an input or output port. Great. But there is no setFieldValue(Object val) or something like that in order to populate a datarecord. There are getters, but no setters. Please, if there is something simple that I am missing let me know.

Hi,

On DataRecord created by DataRecordFactory you can via DataRecord.getField(int index | String name) obtain DataField which represents one field of record. Then on such DataField you can call DataField.setValue(Object).

DataField is abstract class which is implemented by classes like StringDataField, LongDataField, … which implements setValue(Object) method in proper way.

I hope this helps. Please take a look into JavaDoc.

Deal. Because thats not what I did in order to get to this point. Everyone uses org.jetel.data.DataRecord. Talk about ubiquitous!!! If only I would have read the java doc BEFORE I asked direct, specific questions about this process. Thank you!!!