Merging multiple outpus into one

One Star

Merging multiple outpus into one

Hi,
Am saving information in the db using different SPs and I would like to merge the results to produce one response to the tRestResponse.
please find attached and image of what am trying to do.
Any help will be much appreciated.
Regards,
Allen

Re: Merging multiple outpus into one

Hi
Try and write all of your stored procedure results into their own tHashOutput.
Then use tHashInputs for each of the outputs used and join them with a tUnite
for example:
input -> tmap -> stored proc -> hash output
| -> stored proc -> hash output
| -> stored proc -> hash output
| -> stored proc -> hash output
| -> stored proc -> hash output
|
on subjob ok
|
|
hash input ->
hash input ->
hash input -> tunite -> tmap -> your rest response
hash input ->
hash input ->

Regards,
Brandon
Moderator

Re: Merging multiple outpus into one

Hi,
From your job design, there is a circle in the workflow, which cannot be achieved in talend. Please see the reference Can I create a Job with multiple paths from a single source to the same target?.
You can take a try @Brandon's solution to re-design your workflow.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Merging multiple outpus into one

Hello,
I have following table: Key#1 | Column#1 | Column#2 | Key#2
There are 2 different APIs, to get Column#1 & Column#2.
The problem that each API return JSON string with following fields: Key#1, Value, Key#2 
It doesn't matter which API sent, to get field Column#1 or field Column#2 - it always use the same name (Value) for both.

How I have structure the flow?
I have following:
tHTTPRequest_1 (for API#1) - To send API#1 request
tExtractJSONFields_1 (in schema Value will assign to Column#1)
tHTTPRequest_2 (for API#2) - To send API#1 request
tExtractJSONFields_2 (in schema Value will assign to Column#2)
Problem that I cannot connect tExtractJSONFields_1 and tExtractJSONFields_2 to tMap (one to one - yes, but not many to one)
Moderator

Re: Merging multiple outpus into one

Hi MindGeek,
Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.