Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Web Experience Factory 8 Documentation WebSphere Portlet Factory 7 Documentation WebSphere Portlet Factory 7.0.1 Documentation Custom Search Scope...
Search
Community Articles > FAQs > How do I use the Transform builder?
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Kevin Tapperson
Contribution Summary:
  • Articles authored: 13
  • Articles edited: 9
  • Comments Posted: 3

Recent articles by this author

WebSphere Dashboard Framework Tutorials Feature Sets

This article contains the WebSphere Dashboard Framework Tutorials Feature Sets.

Managing SSL certificates used for publishing in the WEF Designer

This article describes how to manage SSL certificates used for publishing by the WEF Designer.

Diagnosing JMX publishing problems with WebSphere Portlet Factory

This article provides information on diagnosing problems with the JMXbased publish configurations in WebSphere Portlet Factory

How do I use the Transform builder?

Here is an example of using the Transform builder to map from one schema to another.
Let's assume a source schema like this:
{code:} Smith John
222 Main ...

How do I retrieve generated values from a SQL insert or update operation?

SQL provides the ability to retrieve the entire table of modified data following an insert/update/delete operation. For insert and update operations, you can use a syntax like this: {code:} SELECT * FROM NEW TABLE (INSERT INTO SCHEMA.TABLE_NAME (UNIQUEID, NAME, DESCRIPTION) VALUES ((SELECT ...

Community articleHow do I use the Transform builder?

Added by Kevin Tapperson | Edited by IBM contributor Rob Flynn on January 15, 2010 | Version 4
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: FAQ, builder faq
Here is an example of using the Transform builder to map from one schema to another.


Let's assume a source schema like this:

<person_list>
  <person>
    <name>
      <last_name>Smith</last_name>
      <first_name>John</first_name>
    </name>
    <address>
      <street>222 Main St.</street>
      <city>Indianapolis</city>
      <state>IN</state>
      <zip>46022</zip>
    </address>
    <junk>My name is John Smith.</junk>    
  </person>  
</person_list>



And a target schema like this:

<person_list>
  <person>
    <last_name>string</last_name>
    <first_name>string</first_name>
    <street>string</street>
    <city>string</city>
    <state>string</state>
    <zip>string</zip>
    <description>string</description>
  </person>
</person_list>



Since the source schema has multiple container nodes in it, you must apply multiple Transform builders to achieve the desired effect. I've used 3 Transform builders here each applied in sequence using an Action List.


The first Transform builder points to person_list/person/name in the source and copies this to person_list/person in the target. The important point here is that there are 3 levels in the source schema and 2 levels in the target schema. So, in the Parent Node mapping section, you must map the top level nodes to each other, then skip the intermediate level nodes in the source schema, and finally map the lowest level nodes to each other.





The second Transform builder points to person_list/person/address in the source and copies this to person_list/person in the target. This one is even trickier. Again, there is a difference in number of levels in the source and target schema. So, the same Parent Node mappings must be used here. In this case, however, on the lowest Parent Node mapping (address->person), you need to match nodes based on Child Node Text. The Source To Match input needs to navigate from person_list/person/address to person_list/person/name/last_name, so I've manually typed the XPath ../name/last_name here to achieve this. (This cannot be done through the picker.) The Target To Match input needs to navigate from person_list/person to person_list/person/last_name. The picker was used to choose this XPath (person/last_name). This will instruct the transform to match nodes based on the last_name field, which should already be copied from source to target using the first Transform builder described above. (This would not be an appropriate primary key to use if you have multiple people in the list with the same last name. You should consider augmenting the schema with an additional field that can be used as a unique key for the Transformation.)





The third Transform builder points to person_list/person in the source and copies this to person_list/person in the target. This builder has an equal number of parent nodes in both schemas, so the default Parent Node mapping is ok. However, we still need to make sure that the person node is matched appropriately.& nbsp; So, for the person node in the Parent Node mappings, we choose Source To Match as person/name/last_name and Target To Match as person/last_name. These are the relative XPaths from the person node to the last_name node in each of the source and target schemas respectively. (These can both be picked with the picker.)





The attached model demonstrates this usage of the Transform builder. TransformTest.model

As an alternative option. The model also demonstrates the use of the Advanced input in the Data Column Modifier builder. The Data Column Modifier builder provides an option to "Flatten Groups Within", which if enabled, will produce output very similar to the three Transform builders described.

  • Edit
  • More Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
application/octet-stream 23 KB TransformTest.model 3/12/09 3:31 PM
expanded Versions (4)
collapsed Versions (4)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (4)Jan 15, 2010 5:09:00 PMRob Flynn  IBM contributor
3Dec 23, 2009 3:45:09 PMRob Flynn  IBM contributor
2Dec 23, 2009 3:38:48 PMRob Flynn  IBM contributor
1Dec 23, 2009 3:30:07 PMRob Flynn  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • BlogsIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use