Skip to main content link. Accesskey S
  • Help
  • IBM Logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • All Forums
  • ANNOUNCEMENT: Wiki changed to read-only. READ MORE...
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Search
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Click to view profileIBM contributorKevin Tapperson
Contribution Summary:
  • Articles authored: 13
  • Articles edited: 13
  • 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 JMX-based 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 IBM contributorKevin Tapperson on December 23, 2009 | Version 1
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:

  1. <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.
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (4)
collapsed Versions (4)
Version Comparison     
VersionDateChanged by              Summary of changes
4Jan 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
This version (1)Dec 23, 2009, 3:30:07 PMRob Flynn  IBM contributor
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 LinkThe Social Lounge
  • 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