IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Filtering by current index

    Posted 05/14/13 03:30 AM

    Originally posted by: migsss


    I need to mix loops in two diferent input cards in an only output. The two source messages have this estructure:

    Clients:

    Clients
    -->Client
    ---->Name
    ---->idCard
    ...

    Addresses:

    Addresses
    -->Address
    ---->idCard
    ---->Street
    ...

    Output:

    Clients
    -->Client
    ---->Name
    ---->Addresses
    ------>Address
    -------->street
    ...

    I need to make a functional map that maps the clients and, for each of them, adds all the addresses whose idCard is the same as in the client. How can I make the filter in order to get, in each index of the loop "client" only the accurate adresses of the other card?

    Thanks...


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Filtering by current index

    Posted 05/14/13 07:45 AM

    Originally posted by: Laurent(Satisco)


    This can easily be done using two fmaps level:

        The first fmap is called for each client, and receives the whole addresses set.

       It then calls another fmap which receives all the addresses matching the current iDCard (EXTRACT is your friend ;-) )

     

    This may not be the best performance-wise, but it is the simplest way I think.

     

    A better way would be to make sure the addresses are sorted by IdCard, so that the type tree can be altered to use "control break" to manage a group of all addresses with the same IdCard, which should make the extraction much easier.


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Filtering by current index

    Posted 05/14/13 10:28 AM

    Originally posted by: migsss


    Thank you for the answer.

    Basicaly, I'm doing what you suggest. I have made a functional map that gets "client" and "address" as parameters. Then this maps calls another one using a Extract of adress whose idCard is equal to the same field in Client.

    The problem is that the first functional map is called for all the combinations of client and address even if they don't match, so every client is repeated in the output once per address. When the address don't match, it's node is empty in the output.

    I guess I need to extract the addresses in the root map so that the functional map is called the accurate times. I have tried to extract the addresses in the map call, like this:

    =F_Clients(Client:ClientCard, Extract(Address:AddressesCard, IdCard:Address:AdressesCard = IdCard:Client:ClientCard))

    but the result is something extrange.

    ¿How can I make such a filter for the call parameter?


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Filtering by current index

    Posted 05/14/13 12:06 PM

    Originally posted by: Laurent(Satisco)


    This is because you're pssing each address.

    You need to pass the all addresses "file" (whatever it is) and only in the fmap do the extract


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Filtering by current index

    Posted 05/15/13 04:21 AM

    Originally posted by: migsss


    Thank you! That worked perfectly.


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: Filtering by current index

    Posted 05/30/13 03:07 PM

    Originally posted by: RPotteti


    Hi - Can you give give the functional map rule that you used to achieve this?


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender