Skip to Content
avatar image
Former Member

Complex Sync receiver JDBC scenario

Hi everyone,

Scenario - Web Service (async) -> PI -> JDBC (sync)

Request structure (not typing the standard format, but I am following that)-

<MT_req>

<Statement1> SELECT # 1

<access>

<filenumber/>

<segment1>

<field2>

.

.

</segment1>

<segment2>

<field2>

.

.

</segment2>

</Statement1>

<Statement2> SELECT # 2

<access>

<filenumber/>

<segment1>

<field2>

.

.

</segment1>

<segment2>

<field2>

.

.

</segment2>

</Statement2>

</MT_req>

Select # 1 will return FILENUMBER and SEGMENT1 (In this case, segment2 will be blank?). Select # 2 will return FILENUMBER and SEGMENT2 (In this case segment1 will be blank).

There can be multiple occurrences of segment 1 & 2. Not always segment 1 & 2 will share same FILENUMBER.

The target payload should look like -

<MT_resp>

<row>

<FILENUMBER> (if seg1 & 2 share the same FILENUMBER)

<segment1> fields with values </segment1>

<segment2> fields with values </segment2>

</row>

<row>

<FILENUMBER> (if seg1 & 2 don't share the same FILENUMBER)

<segment1> fields with values </segment1>

<segment2> fields with NO values </segment2>

</row>

</MT_resp>

Briefly it means that if FILENUMBER is same, then "merge" the 2 segments in the same message row.

Can this be handled in the message mapping? If yes, how? If no, then what can be done?

I hope I am able to explain it properly. Any help will be highly appreciated.

Thanks for your time and efforts.

Abhi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 12, 2010 at 11:00 PM

    Hi Abhi,

    What I understand from your requirement is -

    1. Select # 1 will return FILENUMBER and SEGMENT1 and Select #2 will return FILENUMBER and SEGMENT 2.

    2. SEG1 and SEG2 are in the same node (in DT), but in the response, either SEG1 will be populated or SEG2, but both won't be populated at the same time (as these are responses from 2 different SELECTs).

    3. There can be multiple "access" nodes for Statement 1 & 2.

    4. Once you get the response back, you have to merge them as per the same FILENUMBER.

    If my understanding is correct, then either you can use Java codes in Graphical map or use XSL Map. You will have to check for 1st FILENUMBER and scan the whole payload and create the message accordingly ... same for FILENUMBER 2 and so on.

    Else you can use BPM. Use 2 containers, get response back from Select 1 and hold it in Container 1 and similarly for Select 2 in Container 2. Then merge them.

    If you plan to use BPM, then you might have to check the volume of data that will be coming back as response.

    Hope this helps.

    Regards,

    Neetesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Neetesh and Abhishek.

      I will try to resolve this as per your advice. I am closing this thread for the time being, but in case it is not resolved, I will re-open it.

      Thanks everyone for your time and efforts.

      --Abhi

  • avatar image
    Former Member
    Jan 12, 2010 at 09:45 AM
    Scenario - Web Service (async) -> PI -> JDBC (sync)

    So does it mean that you do not want to send the response back to WS? In this case you have to implement a BPM to either discard the response from JDBC or to route the response to some other receiver.

    <row>
    <FILENUMBER> (if seg1 & 2 share the same FILENUMBER)
    <segment1> fields with values </segment1>
    <segment2> fields with values </segment2>
    </row>

    In the source will segment1 and segment2 are present as two different nodes (i.e. in the datatype itself)?

    If yes, then below logic should work for creating FileNumber in above case:

    Segment1 -->
              --> equalS --> if (Then --> Blank_Constant) --> row
    Segment2 -->

    to generate the other row node when segment1 and segment2 are not the same just put a Not function after equalS .... second row node needs to be duplicated (duplicate Subtree)

    Regards,

    Abhishek.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2010 at 04:34 PM

    Anyone? Please help ... Thanks.

    Add comment
    10|10000 characters needed characters exceeded