cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC to JMS Mapping - Different Header and Detail Values

baskar_ramasamy
Participant
0 Kudos

Hi,

I am facing an issue on creating a scenario JDBC to JMS.

Scenario:

There are Header and Detail line items in rows that needs to be fetched from JDBC adapter.

Same Source Header Rows to be mapped to Target Header and details should be created under Details (It would be multiple line items)

Facing issue with Below:

While Header Rows is different ,Different Headers should be created and the corresponding Detail line items also should be created under the respective header.

Thanks,

Baskar

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Baskar,

Correct me if i am wrong

For example:

Record 1

LINENUMBER A

ITEMID X

Record 2

LINENUMBER A

ITEMID Y

Record 3

LINENUMBER B

ITEMID Z

You should have:

Shipment (header)

(Corresponding with LINENUMBER A)

ShipmentLines

ITEMID X

ITEMID Y

Shipment (header)

(Corresponding with LINENUMBER B)

ShipmentLines

ITEMID Z

If i am not wrong in my supposition you can sort by LINENUMBER and to use splitByValue (value changed) to get the header lines.

Regards.

baskar_ramasamy
Participant
0 Kudos

HI,

You are right

But Receiving as below

LINENUMBER  A

              ITEMID X          

              ITEMID Y          

              ITEMID Z          

LINENUMBER  B

This is Expected Output

LINENUMBER  A 

              ITEMID X          

              ITEMID Y          

LINENUMBER  B

              ITEMID Z          



baskar_ramasamy
Participant
0 Kudos

I am not facing issues with Header,

I am not getting the Details for Header (LINENUMBER B) , Instead it is generating in (LINENUMBER A)

I want to split the Detail node (ShipmentLine) for the respective header (LINENUMBER B).

Regards,

Baskar

former_member312864
Active Participant
0 Kudos

Hi,

You want to group ITEMID based on your LINENUMBER . In that case use formatByExample node function. You need to adjust the context for ITEMID based on LINENUMBER.

formatByValue

Input 1

ITEMID

input 2

LINENUMBER --> removeContext -->splitByValue[value change]

Map the output of formatByExample to ITEMID

Kind Regards,

Sarojkanta Parida

former_member182412
Active Contributor
0 Kudos

Hi Baskar,

The source field for target field ShipmentNumber say SHIPMENT then

SHIPMENT->removeContexts->SpliByValue(ValueChange)->ShipmentLine

Regards,

Praveen.

former_member312864
Active Participant
0 Kudos

Hello Baskar,

For Header

row -->removeContext --> Shipment

for Detail

direct mapping from source to target will work

Kind Regards,

Sarojkanta Parida