<?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 Generate processors dynamically from JSON Object length in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195840#M73795</link>
    <description>&lt;P&gt;Hi, I just started with NiFi. I've been looking for two days without success the answer to my problem. There it goes:&lt;/P&gt;&lt;P&gt;I have a EvaluateJsonPath that returns into an JSON NiFi Attribute some objects id in that way : [0, 1, 2, 3, 4, 5, 6, ...]. I would wish to create a processor (InvokeHttp) for each id dynamically. After that, each created processor should take the id from the JSON to generate the url.&lt;/P&gt;&lt;P&gt;How do i face it?? Thank you so much.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2018 22:45:37 GMT</pubDate>
    <dc:creator>victor_trivi</dc:creator>
    <dc:date>2018-01-23T22:45:37Z</dc:date>
    <item>
      <title>Generate processors dynamically from JSON Object length</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195840#M73795</link>
      <description>&lt;P&gt;Hi, I just started with NiFi. I've been looking for two days without success the answer to my problem. There it goes:&lt;/P&gt;&lt;P&gt;I have a EvaluateJsonPath that returns into an JSON NiFi Attribute some objects id in that way : [0, 1, 2, 3, 4, 5, 6, ...]. I would wish to create a processor (InvokeHttp) for each id dynamically. After that, each created processor should take the id from the JSON to generate the url.&lt;/P&gt;&lt;P&gt;How do i face it?? Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 22:45:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195840#M73795</guid>
      <dc:creator>victor_trivi</dc:creator>
      <dc:date>2018-01-23T22:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate processors dynamically from JSON Object length</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195841#M73796</link>
      <description>&lt;P&gt;What you will want to do is split your original JSON into a flow file per id, and then send them all to a single InvokeHttp processor and reference a variable in URL of InvokeHttp. Here is a high-level of how it might work...&lt;/P&gt;&lt;P&gt;Lets say starting JSON is:&lt;/P&gt;&lt;PRE&gt;{ "ids" : [ "1", "2", "3" ] }&lt;/PRE&gt;&lt;P&gt;First use SplitJson processor with a Json Path of $.ids, this will produce 3 flow files where the content of each is 1, 2, and 3 respectively.&lt;/P&gt;&lt;P&gt;Second, use ExtractText processor.. add a user defined property with the name "my.id" and the value of (.*)&lt;/P&gt;&lt;P&gt;That will extract the content of each flow file into an attribute called my.id.&lt;/P&gt;&lt;P&gt;Finally, in InvokeHttp set the Remote URL to &lt;A href="http://yourhost/path/${my.id}" target="_blank"&gt;http://yourhost/path/${my.id}&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When InvokeHttp processors a flow file, it will evaluate Remote URL against the incoming flow file attributes, and replace ${my.id} with the value of that attribute on the particular flow file, which in this case will be 1, 2, or 3.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 01:45:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195841#M73796</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2018-01-24T01:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Generate processors dynamically from JSON Object length</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195842#M73797</link>
      <description>&lt;P&gt;Thank you so much, &lt;A rel="user" href="https://community.cloudera.com/users/363/bbende.html" nodeid="363"&gt;@Bryan Bende&lt;/A&gt;. Your approach absolutely works!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:56:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Generate-processors-dynamically-from-JSON-Object-length/m-p/195842#M73797</guid>
      <dc:creator>victor_trivi</dc:creator>
      <dc:date>2018-01-24T16:56:10Z</dc:date>
    </item>
  </channel>
</rss>

