Skip to Content
avatar image
Former Member

want to skip or overwrite if the value occurs morethan one time

Hi Experts !


Here is my issue.


In below mentioned line item I want skip or over write lineitems which are occuring morethan once. In below example MF <Line item information Party> is occure two times i want only one to be present per line item other line items should be skipped (Highlighted is to be skipped- originally available in INPUT payload).So, I need only one MF values in the payload.


<LineItemInformationParty>-

<PartyRoleCode>MF</PartyRoleCode>-

<LineItemInformationPartyReferences>

<PartyAdditionalID>ACOPIAN</PartyAdditionalID>

</LineItemInformationPartyReferences>

</LineItemInformationParty>-

<LineItemInformationParty>

<PartyRoleCode>MF</PartyRoleCode>-

<LineItemInformationPartyReferences>

<PartyAdditionalID>ACOPIAN</PartyAdditionalID>

</LineItemInformationPartyReferences>

</LineItemInformationParty>

Current mapping (Screenshot attached) logic for <Party Additional ID> - If QUALF =004 then Ktext value should be mapped to <Party Additional ID>

Current mapping (Screenshot attached) logic for <LineItemInformationPartyReferences> - if QUALF = 004 then create <LineItemInformationPartyReferences>

Current mapping (Screenshot attached) logic for <Party Role code> - Constant = MF

Current mapping (Screenshot attached) logic for <LineItemInformationParty>- if Qualf=004 then create <LineItemInformationParty>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 05, 2013 at 09:27 AM

    Hi Team,

    Thanks for all of your effort taken.

    The above issue solves 😊. Kindly see attached screenshots.

    Missed Screenshot explanation :-

    <PartyRoleCode> mapped to Constant=MF

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 04, 2013 at 08:04 AM

    Hello Tamil,

    You can use below logic to eliminate duplicates

    <PartyRoleCode> ==> removeContext ==> sort (asc/desc) ==> SplitByValue (Value Change) ==> collapseContext ==> SplitByValue (Each Value) ==> TargetField.

    this way we get only one Target field for multiple PartyRoleCode with same values.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 03, 2013 at 05:03 PM

    Hi Tamil,

    can you provide the input xml? you need to find out the duplicate node in input, at the moment we have only one check qualf = 004.

    Regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Tamil,

      Please try with below map

      for LineItemInformationParty, the context of QUALF is E1EDP01

      for PartyRoleCode (please correct the input field as it is for example), the context of input fields is E1EDP01

      for LineItemInformationPartyReferences), the context of input fields is E1EDP01

      for PartyAdditionalID (please correct the input field as it is for example), the context of input fields is E1EDP01

      Hope this help.

      Harish

      mapping 1.PNG (12.1 kB)
      mapping 2.PNG (14.8 kB)
      mapping 3.PNG (14.0 kB)
      mapping 4.PNG (14.6 kB)
  • Dec 04, 2013 at 03:48 AM


    Hi ,

    You may also use Collapse Context function to remove duplicates.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 04, 2013 at 08:25 AM

    Hi Tamil,

    You can use the standard function CopyValue with the position 1 and you need to take into account the context for a right target xml. Check how it works in this link:

    Standard Functions in PI 7.0 - Process Integration - SCN Wiki

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 04, 2013 at 08:45 AM

    Hi

    Create target segment <LineItemInformationParty> based on the unique values of KText in your input.

    You can use node function sort or collapse context for that.

    Then map PartyRoleCode with constant.

    Map PartyAdditionalID with first value of Ktext. You can use function CopyValue for that.

    If you can provide us the input xml , we can give u the exact mapping.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 04, 2013 at 05:08 PM

    Hi Selvan,

    Use the Function  "CopyValue" and use the index as 0 to skip the second occurrence.

    <LineItemInformationParty>  ==>[CopyValue[0]] ==> <LineItemInformationParty>


    It will skip all the other occurrence except the first one.

    Add comment
    10|10000 characters needed characters exceeded