Forum Discussion
omatzura
17 years agoSuper Contributor
Hi,
hmm.. if you want to add all rows in your datasource to one request you could do as follows:
1) DataSource
2) Groovy script that aggregates and builds xml
3) DataSourceLoop back to (2) for each row in (1)
4) Request that uses aggregated xml
The key here obviously being the script in (2), something like
In your request you could then have the following xml:
makes sense?
regards!
/Ole
eviware.com
hmm.. if you want to add all rows in your datasource to one request you could do as follows:
1) DataSource
2) Groovy script that aggregates and builds xml
3) DataSourceLoop back to (2) for each row in (1)
4) Request that uses aggregated xml
The key here obviously being the script in (2), something like
// get existing..
def xml = context.xml
if( xml == null )
xml = ""
// aggregate row
xml += "<CustomerOrderItem><Id>"
xml += context.expand( "${DataSource#id}" )
xml += "</Id><Name>"
xml += context.expand( "${DataSource#name}" )
xml += "</Name></CustomerOrderItem>"
// save
context.xml = xml
In your request you could then have the following xml:
<CustomerOrder>
${xml}
</CustomerOrder>
makes sense?
regards!
/Ole
eviware.com