Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Notes and examples on usage of various Pricefx Camel components related to Integration Engineering.

Reference

IM Introduction

Integration Route Considerations

...

marshal().jaxb() .to("jms:queue:order");

Camel split EIP Component

See https://camel.apache.org/components/3.20.x/eips/split-eip.html

...

Code Block
<route>
    <from uri="direct:teststream"/>
    <split streaming="true">
        <tokenize token="|"/>
        <to uri="activemq:streamed-parts"/>
    </split>
</route>

pfx-api unmarshal EIP Component

See https://camel.apache.org/components/3.20.x/eips/unmarshal-eip.html

...

In the above example, the Camel body is split based on newline ( \n) characters and then rendered into the data structure that was originally placed into the message ( object, text, etc. )

pfx-api loaddata EIP Component

This is a Pricefx specific component which is used primarily to bulk load data into Pricefx tables. By bulk load we are referring to cases where the volume of data exceeds about 7500 rows.

Code Block
<loadMapper id="carsMapper" includeUnmappedProperties="false">
  <simple in="sku" out="13"/>
  <simple in="manufacturer" out="bmw"/>
</loadMapper>

<routes xmlns="http://camel.apache.org/schema/spring">
  <routes>
    <from uri="direct:create"/>
    <to uri="pfx-api:loaddata?mapper=carsMapper&objectType=PX&businessKeys=sku,name,attribute1&businessKeysMaxLengths=255,255"/>
    <log message="Done"/>
  </route>
</routes>

pfx-api integrate EIP Component

This is a Pricefx specific component which is used primarily to load relatively small amounts of data into Pricefx tables. Note that integrate is restricted to MasterData tables only.

Code Block
    <!-- Load Accounts from Salesforce to PriceFx -->
    <to uri="pfx-json:unmarshal"/>
    <setBody>
        <simple>${body[records]}</simple>
    </setBody>
    <log message="Loading data to PriceFx, body = ${body}"/>
    <to uri="pfx-api:integrate?objectType=C&amp;mapper={{sf.to.pfx.account.mapper}}"/>
    <log message="Data loaded, response = ${body}"/>

    <!-- Set integration timestamp in PriceFx config after finished load -->
     <setHeader name="lastIntegrationTimestamp">
        <!-- Salesforce keeps all dates in UTC zone -->
        <groovy>new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone('UTC'))</groovy>
    </setHeader>
    <toD uri="pfx-config:set?name=integrate.account.sf.to.pfx.timestamp&amp;value=${header.lastIntegrationTimestamp}"/>

pfx-api fetch EIP Component

See Code Samples

...

Code Block
            <route id="my-batch-route-filter">
                <from uri="direct:my-batch-route-filter"/>
                <to uri="pfx-api:fetch?objectType=DM&amp;dsUniqueName=DMDS.PriceRelationships&amp;batchedMode=true&amp;batchSize=450&amp;filter=myFilter"/>
                <log message="Body: ${body}"/>
                <split>
                    <simple>${body}</simple>
                    <to uri="pfx-api:fetchIterator"/>
                </split>
                <to uri="mock:done-filter"/>
            </route>

Camel multicast EIP Component

See https://camel.apache.org/components/3.20.x/eips/multicast-eip.html

...

Code Block
    <route>
            <from uri="direct:rodendpointA"/>
            <multicast>
                <to uri="direct:rodendpointB"/>
                <to uri="direct:rodendpointC"/>
                <to uri="direct:rodendpointD"/>
            </multicast>
    
        </route>

        <route>
            <from uri="direct:rodendpointB"/>
            .  
            .
            .
        </route>

        <route>
            <from uri="direct:rodendpointC"/>
            .  
            .
            .
        </route>

        <route>
            <from uri="direct:rodendpointD"/>
            .  
            .
            .
        </route>

Camel filter EIP Component

See https://camel.apache.org/components/3.20.x/eips/filter-eip.html

...

Code Block
   <split>
            <simple>${body}</simple>
            <to uri="pfx-api:fetch?filter=Filter_ProductPerf&amp;objectType=PX&amp;connection={{pfx:export-product-perf-to-csv-via-ftp.pfx-connection}}"/>

pfx-api loadmapper EIP Component

This Pricefx component option is used to map either the inbound object fields to corresponding fields on the Pricefx table or map Pricefx table fields to element names in the outbound file.

...

Note that when the mapper definition is coming form the Integration Route mappers folder created by a Template, the definitions and files in this folder will have been automatically created by Platform Manager.

Camel wiretap EIP Component

See https://camel.apache.org/components/3.20.x/eips/wireTap-eip.html

...

Code Block
            .
            .
            .
            <setHeader name="CamelFileName">
                <groovy>
                    return 'PricingImport_' + (new Date()).format("yy_MM_dd-HH_mm_ss") + '.csv'
                </groovy>
            </setHeader>

            <filter>
                <simple>${body.size} > 0</simple>
             
                <wireTap id="ple_wireTap1" uri="direct:updateDateSent" />
             
                <process id="ple_map" ref="mapPL2JDE" />
                <to id="ple_to1"
                    uri="pfx-csv:marshal?skipHeaderRecord=true&amp;escapeCharacter=~&amp;quoteMode=NONE&amp;header=Business Unit,2nd Item Number,ShiptoNumber,BLANK PLACE HOLDER,UnitPrice,UM,CurCod,EffectiveDate,ExpiredDate,PFXPriceListNumber,Agreement" />

                <to uri="{{plExport-toUri}}" />

                <log id="ple_log2" message="Price List Export ${header[CamelFileName]} has been saved." />
            </filter>

            <to id="ple_toUndo" uri="direct:uplExport" />

        </route>

        <route id="updateDateSentRoute">
            <from id="" uri="direct:updateDateSent" />
            <to uri="pfx-api:loaddata?mapper=pfxPLSentMap&amp;objectType=DMDS&amp;dsUniqueName=DMDS.ComponentPriceHistoricalData&amp;detectJoinFields=true&amp;direct2ds=true" />
        </route>

Camel aggregate EIP Component

See https://camel.apache.org/components/3.20.x/eips/aggregate-eip.html

...

Expected Result :

LasgnaisHeavenly

Camel processor interface

See https://camel.apache.org/manual/processor.html

...