Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My job is feed data (content ´)from a NIFI stream, but at times the stream feeds invalid data.
So before the message can be processed through the tExtract, I would like tJava to filter the content, and only allow messages that have a specific XML tag to proceed to downward components.
Is there a possible way I can do this without using the tFilter which is used after the tExtract?
Here is my section of the job with tjava at the start. I wish to be able to tell tJava that any message that does not contain <DG1> should not be read /dropped and the next one be read. How can I proceed with this, without sending null values to tExtract.
I would like to just have the code that I can put inside the tjava that says, if the content of context.NifiMsg contains <DG1> process, else Read next message (if there is any)
Thank you.
It appears that you are reading the file from a hardcoded location and converting it into a String content variable in the tJava. If this is the case, a simple way of doing this would be to simply perform a Java String.contains() search in a RunIf link which replaces your OnSubJobOK following the tJava_2.
Something like this ....
context.InNifiMsg!=null&&context.InNifiMsg.contains("<DG1>")
It appears that you are reading the file from a hardcoded location and converting it into a String content variable in the tJava. If this is the case, a simple way of doing this would be to simply perform a Java String.contains() search in a RunIf link which replaces your OnSubJobOK following the tJava_2.
Something like this ....
context.InNifiMsg!=null&&context.InNifiMsg.contains("<DG1>")
Thanks so much. this saved me a lot.