Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-14397

Data mapper conditional expressions don't work when you use a source collection field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • fuse-7.x-GA
    • fuse-7.6-GA, fuse-7.5-GA
    • Atlas Map
    • None
    • % %
    • Hide

      If the source data is defined like this json instance:

      {
      "id": "some text",
      "category": "Virtual",
      "orderRelationship": [

      { "id": "yup", "@referredType": "ProductTest" }

      ,

      { "id": "12345", "@referredType": "ProductOrder" }

      ]
      }

      We are looking to map the "Id" field to a target field (no-collection) only if @referredType field contains  "ProductOrder" string. I used the data mapper conditional expressions for this and added this expression: 

      IF (@referredType  == 'ProductOrder' ,  id ,null) 

      This worked in the test preview but NO when the integration has been deployed. There isn't any error log and no failure, simply seems the   @referredType  == 'ProductOrder' doesnt' evaluate the condition. I tested to replace the @refferedType field (collection) by another field like category (no-collection) and it worked. 

       

      Show
      If the source data is defined like this json instance: { "id": "some text", "category": "Virtual", "orderRelationship": [ { "id": "yup", "@referredType": "ProductTest" } , { "id": "12345", "@referredType": "ProductOrder" } ] } We are looking to map the "Id" field to a target field (no-collection) only if @referredType field contains  "ProductOrder" string. I used the data mapper conditional expressions for this and added this expression:  IF (@referredType  == 'ProductOrder' ,  id ,null)  This worked in the test preview but NO when the integration has been deployed. There isn't any error log and no failure, simply seems the   @referredType  == 'ProductOrder' doesnt' evaluate the condition. I tested to replace the @refferedType field (collection) by another field like category (no-collection) and it worked.   

          • This issue was found on Fuse Online 7.6 ***

      First, It is accepted that data mapper maps the mapped field’s value that is in the last element in the source collection to the target field.

      The objective is perform a map between an source field only if another source field contains an specific value. All source fields are inside a collection.

      After setting the condition expression and deploying the Integration seems that never executes the IF condition in the Condition Expression. There aren't any errors in the log.

       

              Unassigned Unassigned
              sgutierr@redhat.com Sergio Gutierrez Romero
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: