William,

You should be able to perform this using the Wait/Notify pattern. But I think a 
simpler (and likely better performing) alternative would be
to avoid splitting out into two directions at all and instead use a linear flow:

ListFile -> AttributesToJson -> ReplaceText -> InvokeHttp -> FetchFile -> 
UpdateAttribute (to rename file) -> PutFile

Because the first direction does not appear to need the contents of the file, 
since it is using attributes to create the JSON payload,
there's no need to fetch the contents of the file until after you've already 
made the web request and retrieved the client id. Once you
have that, you can fetch the contents and then use PutFile.

Thanks
-Mark


On Mar 27, 2019, at 2:25 PM, William Gosse 
<william.go...@aifoundry.com<mailto:william.go...@aifoundry.com>> wrote:

I’ve been trying to solve this problem in Nifi for the past couple of days and 
haven’t been able to find the secret sauce yet.

I goes something like this:
List/Fetch a file
Extract an client name from part of the filename using an UpdateAttribute

At this I send the flow in two different directions:
Direction 1 does this:
                Take the original flow and create a new JSON content out of it 
using an AttributesToJson and ReplaceText
                Post my new JSON content to a web service using an InvokeHttp 
to create a new client with the client name
                Extract a client new client id from the web service response.

Direction 2 does this
                Wait for the new client id return from the webservice  response 
(this is the part I’m not getting)
                Use client id to rename original file
                Put file to specified folder.

I’ll admit I could be doing this all wrong but what I’m having trouble with is 
bringing together my original flowfile with the result of my web service call.

I thought I could use a mergecontent somehow or a notify/wait but neither 
approach seems to work.

Any help will be greatly appreciated.

Reply via email to