on 10-12-2023 2:28 PM
Hello SAP Experts,
I am currently facing the problem that some I-Flows take too long to run through.
The reason is the content modifier which is used after the filter to append the root element to the XML.
Because the filtered document is very large, the content modifier takes a long time to append the root element to the XML.
Is there a more efficient way to append the root element to very large XML documents which would speed up the I-Flow?
Here is an example of how an XML looks like after the filter:
<RawData>
<UUID>27f0dfb6-03ff-4a9f-a53b-7259cb56b9ca</UUID>
<Timestamp>2023-10-11 11:00:04.538</Timestamp>
<UnitOfMeasure>kWh</UnitOfMeasure>
<Value>132888.8</Value>
</RawData>
<RawData>
<UUID>27f0dfb6-03ff-4a9f-a53b-7259cb56b9ca</UUID>
<Timestamp>2023-10-11 11:00:41.543</Timestamp>
<UnitOfMeasure>kWh</UnitOfMeasure>
<Value>132888.9</Value>
</RawData>
<RawData>
<UUID>27f0dfb6-03ff-4a9f-a53b-7259cb56b9ca</UUID>
...
...
...
Best Regards
Chris
Hi Chris
Interesting question! You are touching on the topic of streaming. This is covered in a couple of places in the iflow design guidelines. This page provides an overview of streaming support.
The Filter step does not support streaming. You might alternatively consider doing the filtering in an XSLT stylesheet. XSLT does support streaming, meaning that the input is processed without the whole payload being loaded into memory.
This would also eliminate the need for the slow Content Modifier, since the root element would not be removed.
XSLT streaming is not super straightforward, though. In my answer to this question I discuss some of the restrictions. That question is also about filtering, by the way, so you might find some inspiration there.
If you decide to try this approach, I'd be very interested in hearing how it works out.
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try the same thing in groovy or jscript and checked the difference?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.