You can try using java service doInvoke or something sort of to get the entire pipeline output response signature from service B to A instead of having processing rule based invoke:
But I have to Us TN, to identify the EDI document. As the XML can contain different type of EDI’s.
So once submitted to TN, TN will identify the Processing service, and will identify the processing service. I just need to bring the response of processing service back to Service A(Submitter)
In that case create TN handler service and it will receive EDIdata and explicitly do invokes service B using Java based Invoke method and extract the pipeline output to A…so just make sure the Invoke returns the pipeline values as expected.
As long as the processing rule is synchronous, whatever is placed in the pipeline by Service B will be available to Service A after the call to wm.tn:receive returns. You don’t need to call Service B directly and you definitely do not need to use Java.
It’s been a number of years but I have indeed done this in the past. In Developer you won’t see the vars. At run-time, they should be there. Have you done a save pipeline to see?
My suggestion is also uses TN only but only difference is instead of calling service B directly it calls generic handler handler service (say processInbound) that does the actual do Invokes svc B,C etc…based on the transaction X12/type/version from your table.
Same issue will be here to, as the handler service (say processInbound) will bring the response back from service B, C, D… in pipeline, but how to bring that response back to service A…
My Scenerio is
Client submits edi in XML → ServiceA → submits EDI to TN → Processing rule invokes Service B,C, D to get response back from backend system.
how do I get the response back to Service A , so I can send it back to Client? on a sync call.
Even though its a synchronous call how would you get response back like similar to http and setResponse calls:
TN isn’t request/reply for processing data we sent internally in your example service A (submitted EDI to TN and not exactly received from externally via http to receive/handler service) and you sent synchronous response back:
But it may be that for EDI this isn’t possible/advisable (my earlier work with returning pipeline vars wasn’t for EDI). The splitting of the envelopes may kick off threads. You may be stuck. If threads are used and you cannot control them via the rules, then you won’t be able to pass a synchronous response back.
Not sure if this will fit your scenario, but we have a similar requirement in which B2B Service A processes an EDI document in TN, publishing a canonical, which is subscribed and processed by a service on the EAI server (Service B). At the conclusion of Service B, a canonical called TNDocumentStatus is published. B2B server subscribes to TNDocumentStatus and updates the User Status in the related TN EDI document with the status value from Service B.
If you are not using pub/sub, perhaps you could create a custom flat file or XML document type in TN (called something like TN Document Status that contains the Response from Service B and values necessary to identify the original EDI document in TN) and Service B could generate TN documents of that type. The processing rule for that document type could invoke a service that updates the User Status (or custom doc attributes) for the related EDI document.