Hi,
I'm ingesting some XML with an overly complicated structure and I've build a 
custom java DOM parser to wrangle it into a saner form. (Is that frowned upon - 
should I just use the built-in processors to wrangle it?)

So my question is, I've parsed the XML into a simple POJO, how do I get that 
pojo into the next processor as a 'Record'.  My custom nifi processor's 
onTrigger looks like this:

MyParser parser = new MyParser();
MyPojo pojo = parser.parse(flowFileContents);

// TODO: convert pojo to record
Record myrecord = pojo.toRecord(); // how to do this?
session.transfer(myrecord, REL_SUCCESS)

I'm guessing I could convert the pojo to JSON, write that out to the next 
stage, and then use a JsonRecordReader to convert the JSON into a record.  
However, if I can go straight from pojo to record, that seems more efficient - 
just not sure how to go about it.  Thanks.

Reply via email to