Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]Transform looping

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Transform looping
 Login/Join
 
Member
posted
Hi,

I need to create a transform that has an input like this:
<Order>
  <OrderHeader>
    <Customer>1234</Customer>
  </OrderHeader>

  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
  <OrderDetail>

  <OrderWeight>
    <Line>10</Line>
    <Weight>324.45</Weight>
    <WeightUOM>KG</WeightUOM>
  </OrderWeight>

  <OrderWeight>
    <Line>20</Line>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  </OrderWeight>
  
</Order>


The problem is that I need in my output to merge the OrderDetail and OrderWeight to get something like this:
<Order>
  <OrderHeader>
    <Customer>1234</Customer>
  </OrderHeader>

  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
     <Weight>324.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>
 
</Order>


By creating Groups with filters, I managed to get the good values, but the problem is that only the last OrderDetail has the value assigned. I get something like this:
  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
    <Weight/>
    <WeightUOM/>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>


Does anybody has an idea what could be wrong? Is it possible to loop through element that are outside the current loop?

This message has been edited. Last edited by: Charles Maheu,


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Report This Post
Expert
posted Hide Post
I'd use nested loops in WebFOCUS DM... Where are you doing THIS?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
iWay Transformer.

Nested loop gives me the result described in my original post.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Report This Post
Member
posted Hide Post
Which version of iway transformer are you using - Just ran your input on ism 6.1.7 and got you required output. Let me know if you need the GXP.


iSM 6.1.6
iDM 7.7.4
Windows 2008 R2
 
Posts: 2 | Registered: December 21, 2012Report This Post
Member
posted Hide Post
I'm using 6.1.4 and yes i'd like to see that gxp if possible.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Report This Post
Member
posted Hide Post
Ok I got it working.

I'm not sure if it's the better way, but it worked.

What I did is that concatenate my line number with the value using seperator before the main loop.

Then in the loop using the line number I can get the substring of my value.

Like I said it's not clean, but it worked.

Thanks for your help.

Paul_Maitland: If you could still provide me your GXP, i'd like to see your solution.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]Transform looping

Copyright © 1996-2020 Information Builders