Sample Integration Flows and Mappings

Message Mappings and Value Mappings

Message Mapping Flatten Pricefx Company Parameter - Sample

This message mapping shows how a Pricefx Company Parameters Upsert Request can be converted to a list of xml element for building bulk data load request

Message Mapping Pricefx Company Parameter Upsert Request - Sample

This message mapping shows how a Pricefx Company Parameters Upsert Request can be built.

Value Mapping SAP S4HANA Connection

This value mapping shows how configuration for SAP S/4HANA connection of different environment is stored for dynamic property retrieval

Value Mapping Pricefx Connection

This value mapping shows how configuration for Pricefx connection of different environment is stored for dynamic property retrieval

Process Quote Events from Pricefx

This integration flow is a template for processing Pricefx quote events and performing appropriate actions. You can have different actions for different Quote Types.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Transaction handling

  3. XPaths to locate the quote ID and Quote Type

  4. Main receiver – The integration flow which processes the quote event.

  5. Pricefx connection properties

Listen to Pricefx Rabbit MQ Events - Using Condition Record Events

This integration flow is a template for listening to Pricefx events and performing appropriate actions. You should modify this flow based on the events you will listen to.

You need to have one integration flow for each Pricefx partition.

This sample contains example of below integrations:

  1. Reload Customer Hierarchy

  2. Payout Records

  3. Reload Product Hierarchy

  4. Condition Record

  5. Polling

  6. Quote

See Listen to Pricefx RabbitMQ Events for a configuration example.

Aggregate Messages from SAP S/4HANA and Write to Pricefx

This integration flow waits for multiple messages from the previous process and aggregates them together for another flow to process. This can reduce the number of calls to downstream applications. The aggregated message contains a list of IDs from a series of events.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Main receiver – The integration flow which processes the aggregated events.

  3. Error receiver – The error handling integration flow.

  4. Transaction handling

  5. Aggregator properties – Defines how the product events should be aggregated.

  6. Message header properties

Get Latest Updated Data by Polling at Intervals

This integration flow runs periodically at the configured timer interval to synchronize data between SAP S/4HANA and Pricefx. It provides an example to synchronize billing documents. You need to modify this process if you synchronize different data types.

You need to have one integration flow for each Pricefx partition.

Configuration

  1. Scheduler properties

  2. Environment properties

  3. Message header properties

  4. Main receiver – The integration flow which processes the billing documents

  5. Update token receiver - The integration flow which updates token

  6. Update Schedule receiver - The integration flow which updates polling schedule

  7. Error receiver – The error handling integration flow.

Get Latest Updated Entities from SAP S/4HANA and Write to Pricefx

This integration flow is a template for retrieving updated entities from SAP S/4HANA by OData in pages and for writing to Pricefx.

You need to have one copy of this flow per each Pricefx entity.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Main receiver – The integration flow which writes updates to Pricefx

  3. Error receiver – The integration flow which writes error to error handler

  4. Log receiver - The integration flow which writes error to log

  5. AIR and SAP connection properties receiver – The integration flow which retrieves and SAP connection properties and AIR from Pricefx.

  6. Transaction handling

  7. Message header properties

  8. OData connection properties

Consume requests from JMS and invoke another process

This integration flow shows a sample on how JMS consumer should be configured. You can copy and modify it when you need to build a JMS consumer for retry purposes.

Configuration

  1. JMS incoming queue and properties

  2. Error receiver – The integration flow which writes error to error handler

  3. Main receiver – The integration flow which processes the message.

  4. Transaction handling

Publish requests to JMS

This integration flow shows a sample on how JMS publisher should be configured. You can copy and modify it when you need to build a JMS publisher for retry purposes.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Error receiver – The integration flow which writes error to error handler

Multicast product response to all product entities in Pricefx - Updated Example

This integration flow is a template for multicasting product response to common product extensions. It also shows how headers for invoking “Write Records to Pricefx Tables” are configured.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Error receiver – The integration flow which writes error to error handler

  3. PFX receiver - The integration flow which writes records to Pricefx

  4. Mappings and headers for all the product extensions

  5. Transaction handling

  6. Message header properties

Write Records to Pricefx Company Parameter - Sample

This integration flow shows how headers for invoking “Write Records to Pricefx Tables” are configured when writing records to Pricefx Company Parameter

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Error receiver – The integration flow which writes error to error handler

  3. PFX receiver - The integration flow which writes records to Pricefx

  4. Mappings and headers for the company parameter

  5. Transaction handling

  6. Message header properties

Refresh Pricefx JWT Token

This integration flow shows how JWT token can be used in authentication.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Error receiver – The integration flow which writes error to error handler

  3. Pricefx integration adapter connection properties

  4. Transaction handling

Refresh Pricefx JWT Token and Test Connection

This integration flow shows how JWT token can be used in authentication. It invokes test connection operation to test if the connection is successful.

Configuration

  1. Sender – The process direct incoming path of this integration flow.

  2. Error receiver – The integration flow which writes error to error handler

  3. Pricefx integration adapter connection properties

  4. Refresh token receiver - The integration flow which refreshes JWT token

  5. Transaction handling

  6. Message header properties

Refresh Pricefx OAuth Token

This integration flow gets or refreshes the access token and stores the tokens in the global variables for Pricefx connections in your environment. You will need to duplicate this integration flow for each Pricefx partition. This is run periodically at the configured interval.

  1. Get the stored tokens from global variables.

  2. Check if the token creation or token refresh is required.

  3. Get the tokens via Pricefx Integration Adapter.

    refresh pfx token.jpg


    Sample JSON response from the get token operation:

    {
        "access-token": "03D43F56-xxxx-xxxx-xxxx-xxxxxxxxxxx",
        "refresh-token": "CE1F7DE5-xxxx-xxxx-xxxx-xxxxxxxxxxx",
        "token-type": "Bearer",
        "expires-in": 3600
    }
    

     

  4. Extract the token from the JSON response message by a Groovy script and write to global variables.

    import com.sap.gateway.ip.core.customdev.util.Message;
    import groovy.json.*
    def Message processData(Message message) {
    
        //Body
        def body = message.getBody(String.class);
    
        def jsonSlurper = new JsonSlurper()
        def json = jsonSlurper.parseText(body)
    
        message.setProperty("access-token", json.attribute13)
        message.setProperty("refresh-token", json.attribute14)
    
        return message
    }
    
    

     

For details see Pricefx SAP Integration Adapter - Authentication.

Configuration

  1. Pricefx connection properties

  2. Sender – The process direct incoming path of this integration flow.

  3. Transaction handling

  4. Refresh intervals

This integration flow gets the cookie and CSRF token from SAP S/4HANA fetch token operation and stores them in global variables for all token protected SAP OData connections in your environment. The fetch token operation can be any OData GET operation with x-csrf-token=”Fetch” header.

refresh hana token.jpg

Configuration

  1. OData connection properties

  2. Variable name of the S/4Hana access token and cookie token