Create Quote in Salesforce

This section shows how to create a quote in Salesforce via IntegrationManager (IM).

Process Diagram

Step by Step

  1. Prepare the recommended project file structure or download the template files (im-example-salesforce).

  2. Fill in credentials in the configuration file to communicate with Salesforce API via the REST protocol.

    Salesforce configuration

    salesforce.username=your_salesforce_username salesforce.password=your_salesforce_password salesforce.clientId=your_salesforce_clientId salesforce.clientSecret=your_salesforce_clientSecret salesforce.url=your_salesforce_url

     

  3. Create a route context in camel-context.xml and the XML file in resources/routes.

    1. Define the salesforceService bean in the file salesForceRoutes.xml in src/main/resources/routes. 

      Salesforce Service Bean

      <bean id="salesforceServiceOAuth" class="net.pricefx.integration.services.salesforce.auth.SalesforceAuthenticationOAuth"> <property name="url" value="${salesforce.url}"/> <property name="clientId" value="${salesforce.clientId}"/> <property name="clientSecret" value="${salesforce.clientSecret}"/> <property name="password" value="${salesforce.password}"/> <property name="username" value="${salesforce.username}"/> </bean> <bean id="salesforceService" class="net.pricefx.integration.services.salesforce.SalesforceService"> <property name="authentication" ref="salesforceServiceOAuth"/> <property name="url" value="${salesforce.url}"/> <property name="version" value="v44.0"/> </bean> <bean id="camelSalesforceService" class="net.pricefx.integration.services.salesforce.ExchangeSalesforceService"> <property name="salesforceService" ref="salesforceService"/> </bean>

       

    2. Enable IM listening to events from Pricefx.

      Pull event configuration

      integration.events.enabled=true integration.events.scheduler-delay=60000 integration.events.delay=10000 integration.events.cache-folder=${data.directory}/events integration.events.event-to-route-mapping.ITEM_APPROVED_Q=direct:quoteApproved

       

    3. Process the ITEM_APPROVED_Q event and collect data from Pricefx.

      1. Define a processor to be able to fetch all data fields from an approved Pricefx quote.

        Fetching approved quote

         

      2.  Collect data from Pricefx.

        Process event

         

    4. Build a body for creating a new Salesforce quote.

      Body request

       

    5. Marshal the body object by "gson" and call Salesforce API to create a quote.

      Create SFDC quote



IntegrationManager version 5.8.0