Fetch Data from General Data Source

This code fetches data from Product Extension with the name Cars where attribute2 is bigger than 100. For a big dataset use batchedMode. You can fetch data from multiple data sources (P, PX, C, CX, etc.).

XML
<filter id="pxCarsFilter">
    <and>
        <criterion fieldName="name" operator="equals" value="Cars"/>
        <criterion fieldName="attribute2" operator="greaterThan" value="100"/>
    </and>
</filter>

.....

<route>
    <from uri="timer://fetchData?repeatCount=1"/>
    <to uri="pfx-api:fetch?filter=pxCarsFilter&amp;objectType=PX"/>
</route>

The same example but with a SQL-like query:

XML
<route>
  <from uri="timer://fetchDataByQuery?repeatCount=1"/>
  <to uri="pfx-api:fetch?sql=select sku,name,attribute2 where name='Cars' and attribute2>100 order by sku&amp;objectType=PX"/>
  <log message="${body}"/>
</route>