<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to manipulate text in NiFi processor IDE? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154235#M20637</link>
    <description>&lt;P&gt;I am trying to develop a custom processor to manipulate flowfile contents via Java.  However, I am not sure how constructors are used for the flowfile contents.  As a simplified example, how can I create a custom processor that replaces the letter A with the letter Z in a flowfile content?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 00:38:42 GMT</pubDate>
    <dc:creator>ltsimps1</dc:creator>
    <dc:date>2016-02-24T00:38:42Z</dc:date>
    <item>
      <title>How to manipulate text in NiFi processor IDE?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154235#M20637</link>
      <description>&lt;P&gt;I am trying to develop a custom processor to manipulate flowfile contents via Java.  However, I am not sure how constructors are used for the flowfile contents.  As a simplified example, how can I create a custom processor that replaces the letter A with the letter Z in a flowfile content?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 00:38:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154235#M20637</guid>
      <dc:creator>ltsimps1</dc:creator>
      <dc:date>2016-02-24T00:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to manipulate text in NiFi processor IDE?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154236#M20638</link>
      <description>&lt;P&gt;For replacing contents of an incoming flowfile, the write(FlowFile, StreamCallback) method of ProcessSession is probably your best bet. There is a corresponding &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html#enrich-modify-content"&gt;section of the NiFi Developer's Guide&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;There is an example of this in the ReplaceText processor code under the &lt;A target="_blank" href="https://github.com/apache/nifi/blob/nifi-0.5.0/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceText.java#L319"&gt;AlwaysReplace strategy&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;As an alternative to creating a full-fledged custom processor, as of NiFi 0.5.0 there are the InvokeScriptedProcessor and ExecuteScript processors. You can use InvokeScriptedProcessor to use a scripting language like Groovy to provide a Processor implementation, which avoids the need for building and deploying your own NARs.  If you don't need a full processor and are just looking to manipulate the flowfile content, you could use the ExecuteScript processor, which allows easy access to incoming flowfiles and such.&lt;/P&gt;&lt;P&gt;I've written a blog post on using ExecuteScript (with Groovy) to replace flowfile contents: &lt;A href="http://funnifi.blogspot.com/2016/02/executescript-processor-replacing-flow.html" target="_blank"&gt;http://funnifi.blogspot.com/2016/02/executescript-processor-replacing-flow.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 01:07:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154236#M20638</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-02-24T01:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to manipulate text in NiFi processor IDE?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154237#M20639</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/641/mburgess.html" nodeid="641"&gt;@mburgess&lt;/A&gt;&lt;P&gt;I am using nifi-0.4.0.  This version does not have the ExecuteScript processor.  How can I install this processor and configure the processor to run a Java program? &lt;/P&gt;&lt;P&gt;-KS&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 03:54:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-manipulate-text-in-NiFi-processor-IDE/m-p/154237#M20639</guid>
      <dc:creator>ltsimps1</dc:creator>
      <dc:date>2016-03-01T03:54:06Z</dc:date>
    </item>
  </channel>
</rss>

