App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  map policy

    Posted 7 days ago

    Dears , 

         appreciate your support i have this field in xml need to get the output of map policy same as below : 

                    <ns3:accountIdSet xmlns:ns3="http://www.banqueaudi.com/ebo/psa.cmn.Identifiers">
                        <ns3:accountId format="Local" domiciliation="Local">123456789</ns3:accountId>
                   </ns3:accountIdSet> 
    but i get the result as below always :
                 <ns3:accountIdSet>
                        <ns3:accountId domiciliation="Local" format="Local" /> 
                 </ns3:accountIdSet>
    this is the map policy mapping 
                  actions:
                 
                    - create: accountIdSet.accountId
                      foreach: accountIdSet
                      from: accountIdSet
                      actions:
                        - set: '@format'
                          from: accountId.format
                        - set: '@domiciliation'
                          from: accountId.domiciliation
    the xml definition is :
                accountIdSet:
                  type: array
                  items:
                    type: object
                    xml:
                      namespace: http://www.banqueaudi.com/ebo/psa.cmn.Identifiers
                      prefix: ns3
                      wrapped: true
                    properties:
                      accountId:
                        type: object
                        xml:
                          wrapped: true
                        minItems: 1
                        properties:
                          domiciliation:
                            xml:
                              namespace: ''
                              attribute: true
                            description: >-
                              A hint that this account id is a local, domestic, or
                              international institution account id
                            type: string
                            enum:
                              - Local
                              - Domestic
                              - International
                          format:
                            xml:
                              namespace: ''
                              attribute: true
                            description: An indication of the format of this accountId
                            type: string
                            enum:
                              - Local
                              - GL
                              - IBAN
                              - Other
                              - Unknown
                              - Display
                              - OldAccount
                              - OldIBAN
                              - FCUBSAccount

    appreciate your support to solve this issue ...
    i tried to make the accountId as array but didn't work also 


    ------------------------------
    Ahmed Elaimy
    ------------------------------


  • 2.  RE: map policy

    Posted 7 days ago

    It looks like you're using a map policy in IBM API Connect, not IBM App Connect Enterprise (ACE). You might get more relevant support by posting this in the API Connect community instead of the ACE community.

    From your description, it sounds like you're expecting the output to include a value inside the <accountId> element (123456789), but it's showing up as empty with only the attributes. If that's the case, it's likely because the text content of the element is not being explicitly set in your map policy. Can you try this?

               - create: accountIdSet.accountId
                  foreach: accountIdSet
                  from: accountIdSet
                  value: accountId
                  actions:
                    - set: '@format'
                      from: accountId.format
                    - set: '@domiciliation'
                      from: accountId.domiciliation

    Would you be able to share your assambly yaml? This way I can try and recreate your issue to see what is going wrong.


    ------------------------------
    Francis Cocx
    Integration Engineer
    Rijkevorsel
    ------------------------------