How to make IDataformat

Hi guys,

Here is my problem.We are currently using webmethods4.6.I am getting flatfile.Which i am converting to IData object using CSV template.
after converting to Idata structre i am getting recordList like
Item.Item record list contains(elements) dataId,Quantity,schedule
Here is my structure.

Item[0]
–dataId — 101
–Quantity— 50
–Schedule— 75
Item[1]
– dataId— 101
—Quantity–65
—Schedule --80
Item[2]
— dataId --101
—Quanntity–70
—Schedule --85
Item[3]
— dataId–102
----Quantity–90
----Schedule–65
Item[4]
— dataId–102
----Quantity–65
----Schedule–75

Now i have to convert output as

ItemOut[0]
— dataId–101
Qty[0]
— Quantity–50
Qty[1]
— Quantity–65
Qty[2]
— Quantity–70
schd[0]
----Schedule–75
schd[1]
----Schedule–80
schd[2]
----Schedule–85
Item[1]
dataId–102
Qty[0]
— Quantity–90
Qty[1]
— Quantity–65
schd[1]
----Schedule–65
schd[2]
----Schedule–75

I can able to do in webMethods flow operations.But it is perforamance
problem.How can i do it in Java??

thanks,
wmUser

Use your queryDocument build-in service, you should be able to get it easily using XQL

Hi Terry,

   Could u explain how  to do it using QueryDocument service. 

Thanks,
Vasu

if you want to get all Quantity with dataId = 1 then

//Item[dataId=‘1’]/Quantity

this will return an list of Quantity which u can map under one of the ItemOut, same goes the schedule.

Please check your documentation on XQL.

cheers

by the way, do register, people here tend to help those who register an account.

Hi Terry,

 Thanks.Still i didn't got your solution.What about Item/dataId=102.Some records dataID is 101,some 102,some 103 like that way.I want to grab data Id 101,102,103 etc.. has Qty recordLists,Schedules recordlist. 

Thanks
vasu

  1. queryDocument for all //dataId
  2. Loop the dataId
    2.1 queryDocument for all
    2.1.1 //Item[dataId=’%dataId%’]/Quantity,
    map the output recordlist to your new structure
    //Item[dataId=’%dataId%’]/Schedule
    map the output recordlist to your new structure

Please check your documentation for queryDocument syntax

Terry,

     I din't understand your approach.Pl help me. 

thnaks,
Vasu