Topic
  • 2 replies
  • Latest Post - ‏2013-06-14T14:54:23Z by NiladriChakraborty
NiladriChakraborty
NiladriChakraborty
11 Posts

Pinned topic Seek help on service result transformation

‏2013-06-14T07:08:31Z |

Hi,

I am using 'transform map' builder to transform output of an operation result to another schema structure. Both the structure are pretty simple and flat. But when I transformed them for each attribute it's generating one line, not generating a row for all the child attributes of Employee. PFA attached artifacts to see the issue. Keep Provider.model in model folder and EmployeeProvider.java in Java Resources folder, run Provider.model and execute getTransformedEmployees operation. I am eager to know if I am making any mistake.

I have one more question which is, is this transform map builder suitable for schema structure change like mapping parent attributes of source schema to child attributed of target schema?

Attachments

  • kevintap
    kevintap
    748 Posts

    Re: Seek help on service result transformation

    ‏2013-06-14T14:37:25Z  

    I have updated your Provider.model and re-attached it here.  The reason that the mapping is behaving like you describe is because no mapping is defined for the parent node (Employee -> Row).  In the absence of a specific mapping, the Transform Map builder will create a new element in the output structure for each node that it encounters.  (This behavior facilitates allowing other data transformations to be defined.)  So, you basically just need to provide a mapping which says to create one new Row element for each Employee element.

     

    And yes, the Transform Map builder can map between parent and child nodes in the two schemas.  It can be configured to insert new nodes into the schema or flatten the schema.

    Attachments

  • NiladriChakraborty
    NiladriChakraborty
    11 Posts

    Re: Seek help on service result transformation

    ‏2013-06-14T14:54:23Z  
    • kevintap
    • ‏2013-06-14T14:37:25Z

    I have updated your Provider.model and re-attached it here.  The reason that the mapping is behaving like you describe is because no mapping is defined for the parent node (Employee -> Row).  In the absence of a specific mapping, the Transform Map builder will create a new element in the output structure for each node that it encounters.  (This behavior facilitates allowing other data transformations to be defined.)  So, you basically just need to provide a mapping which says to create one new Row element for each Employee element.

     

    And yes, the Transform Map builder can map between parent and child nodes in the two schemas.  It can be configured to insert new nodes into the schema or flatten the schema.

    Thank you Kevin. It worked. I actually didn't think about the parent mapping. Thank you for quick response.