<?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 Re: Output a FlowFile in a Process Group, triggered by another FlowFile in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204424#M65964</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/1651/menorah84.html" nodeid="1651" target="_blank"&gt;@J. D. Bacolod&lt;/A&gt;&lt;P&gt;The use case you describe is an exact fit for the "Wait" and "Notify" processors introduced in HDF 3.0/Apache NiFi 1.2.0.&lt;/P&gt;&lt;P&gt;Using these processor would work as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23402-screen-shot-2017-08-03-at-91426-am.png" style="width: 2308px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17208i99792A7C55D077EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23402-screen-shot-2017-08-03-at-91426-am.png" alt="23402-screen-shot-2017-08-03-at-91426-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The input (original FlowFile) is routed to both a Wait processor and your exiting flow.  The "Response" relationship from your InvokeHTTP processor would route to the corresponding Notify processor.&lt;/P&gt;&lt;P&gt;The Copy of the FlowFile that was routed to the Wait processor will continuously loop in the "wait" relationship until a release signal identifier for the FlowFile is written to a DistirbutedMapCache service by the Notify processor.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 05:03:37 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2019-08-18T05:03:37Z</dc:date>
    <item>
      <title>Output a FlowFile in a Process Group, triggered by another FlowFile</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204423#M65963</link>
      <description>&lt;P&gt;I am working on a workflow inside a Process Group. The flow inside the Process Group ends with an update on SalesForce API, but what this Process Group outputs is the original input. I will only send to the Output Port once I get a successful Response from the processor calling the SalesForce API.&lt;/P&gt;&lt;P&gt;What should I do within the Process Group to to have this result?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23397-nifi-canvass.png" style="width: 818px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17209iBCDC328463FD474C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23397-nifi-canvass.png" alt="23397-nifi-canvass.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:03:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204423#M65963</guid>
      <dc:creator>menorah84</dc:creator>
      <dc:date>2019-08-18T05:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Output a FlowFile in a Process Group, triggered by another FlowFile</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204424#M65964</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1651/menorah84.html" nodeid="1651" target="_blank"&gt;@J. D. Bacolod&lt;/A&gt;&lt;P&gt;The use case you describe is an exact fit for the "Wait" and "Notify" processors introduced in HDF 3.0/Apache NiFi 1.2.0.&lt;/P&gt;&lt;P&gt;Using these processor would work as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23402-screen-shot-2017-08-03-at-91426-am.png" style="width: 2308px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17208i99792A7C55D077EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23402-screen-shot-2017-08-03-at-91426-am.png" alt="23402-screen-shot-2017-08-03-at-91426-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The input (original FlowFile) is routed to both a Wait processor and your exiting flow.  The "Response" relationship from your InvokeHTTP processor would route to the corresponding Notify processor.&lt;/P&gt;&lt;P&gt;The Copy of the FlowFile that was routed to the Wait processor will continuously loop in the "wait" relationship until a release signal identifier for the FlowFile is written to a DistirbutedMapCache service by the Notify processor.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:03:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204424#M65964</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2019-08-18T05:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Output a FlowFile in a Process Group, triggered by another FlowFile</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204425#M65965</link>
      <description>&lt;P&gt;Thanks for your answer. We have NiFi below v1.2.0. Is there a workaround while we are not yet upgrading our cluster?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 09:09:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204425#M65965</guid>
      <dc:creator>menorah84</dc:creator>
      <dc:date>2017-08-04T09:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Output a FlowFile in a Process Group, triggered by another FlowFile</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204426#M65966</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1651/menorah84.html" nodeid="1651" target="_blank"&gt;@J. D. Bacolod&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Those processors were added for specific uses cases such as yours.&lt;/P&gt;&lt;P&gt;You can accomplish the same thing almost using the putDistributedMapCache and FetchDistributeMapCache processors along with an UpdateAttribute processor.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23426-screen-shot-2017-08-04-at-101513-am.png" style="width: 1079px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17204iAB75337BFAD78058/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23426-screen-shot-2017-08-04-at-101513-am.png" alt="23426-screen-shot-2017-08-04-at-101513-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I used the UpdateAttribute processor to set a unique value in a new attribute named "release-value".  In my case the value is assigned it was:&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The FetchDistributedMapCache processor then acts as the wait processor did looping FlowFile in the "not-found" relationship until the corresponding  value is found in the cache.&lt;/P&gt;&lt;P&gt;The "release-value" is written to the cache using the PutDistributedMapCache processor down the other path after the InvokeHTTP processor.  It will receive the "Response" relationship.&lt;/P&gt;&lt;P&gt;Keep in mind, the FetchDistributedMapCache processor does not have an "expire" relationship.  If a response if never received for some FlowFile or the cache expired/evicted the needed value, those FlowFiles will loop forever.  You can solve this two ways:&lt;/P&gt;&lt;P&gt;1. Set File Expiration on the connection containing the"not-found" relationship that will purge files that have not found a matching key value in the cache by the time the FlowFile's age has reached x value. With this option aged data is just lost.&lt;/P&gt;&lt;P&gt;2. Build a FlowFile expire loop which kicks these looping not-found FlowFiles out of loop after x amount of time so they can be handled by other processors.  This can be done using the "Advanced" UI of an UpdateAttribute processor and a RouteOnAttribute processor:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23433-screen-shot-2017-08-04-at-111003-am.png" style="width: 936px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17205iFC9DC7BD2B0B7400/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23433-screen-shot-2017-08-04-at-111003-am.png" alt="23433-screen-shot-2017-08-04-at-111003-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The UpdateAttribute sets a new attribute I called "initial-date" if and only if it has not already been set on the FlowFile. This can be done as follows using the "Advanced" UI of the UpdateAttribute processor :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23435-screen-shot-2017-08-04-at-111249-am.png" style="width: 635px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17206iE1FE7A62591A142B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23435-screen-shot-2017-08-04-at-111249-am.png" alt="23435-screen-shot-2017-08-04-at-111249-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The RouteOnAttribute Processor then compares the current date plus x milliseconds to that attribute's value to see if file has been looping for more the x amount of time. (Using 6 minutes (360000 ms) as an example, my RouteOnAttribute would have a property/routing rule like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23434-screen-shot-2017-08-04-at-111132-am.png" style="width: 473px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17207iEE3ADA6CB23B5419/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23434-screen-shot-2017-08-04-at-111132-am.png" alt="23434-screen-shot-2017-08-04-at-111132-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FlowFiles that have been looping for 360000 milliseconds or more will then get routed to "expired" relationship where you can choose what you want to do with them.&lt;/P&gt;&lt;P&gt;As you can see the processors wrap the above flow up in only two processors versus 5 processors you would need in older versions to get same functionality.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:03:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Output-a-FlowFile-in-a-Process-Group-triggered-by-another/m-p/204426#M65966</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2019-08-18T05:03:29Z</dc:date>
    </item>
  </channel>
</rss>

