AnsweredAssumed Answered

Process Route Ignores Returned Documents

Question asked by on May 18, 2018
Latest reply on May 21, 2018 by leif_jacobsen

I have a process I use for HttpResponse handling.  It checks for http response code 200, it checks the response Content-Type header (via dynamic document property), then, based on the content type, will route to one of several Return Documents (labeled as "xml", "json" etc).   


I designed it so that documents will always return to two Return Documents paths.  I have a second Return Documents shape, called "Default," in case I don't want to route according to content-type.  If I don't care about content-type, then I'll map the process route's return path to the second path, "Default Return Documents" path. 


The idea is to have one HttpResponse Handler which can follow an HttpClient request.  Depending on what Content-Type I'm expecting to receive, I can use a process route shape to send documents down a path for json, or xml, or plain text, or one or the other, because the endpoint can return multiple content types and I need to know what type I've received and handle it differently.


The problem is, the process route executes, both ReturnDocument shapes get loaded, but then the process route ignores the documents, and sends zero documents down the success path.  The Notify shape following it receives zero documents.


Here is the handler.  Documents are returned through the application/json route, and through the default route.  The process log (further down) shows where both these shapes are receiving one document.


Here is a process which uses an Http Client connector, and follows with the response handler route.  The document gets routed to the HttpResponse Handler correctly.


This is the process router.  I use process route shapes to de-couple process calls, most especially on common sub processes.  I came up with a convention of using "Default" as the route key.



Here are the entries from the process log.  You can see where both decision shapes are loaded, but then promptly ignorned when returning to the parent process.



Then it throws a BAD_PRACTICE warning where the email shape is being called without a document, which, is to be expected since the process route ignored the returned document.