Create Quote in Salesforce
This section shows how to create a quote in Salesforce via IntegrationManager (IM).
Process Diagram
Step by Step
Prepare the recommended project file structure or download the template files (im-example-salesforce).
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
Â
Create a route context in camel-context.xml and the XML file in resources/routes.
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>
Â
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
Â
Process the ITEM_APPROVED_Q event and collect data from Pricefx.
Define a processor to be able to fetch all data fields from an approved Pricefx quote.
Fetching approved quote
Â
 Collect data from Pricefx.
Process event
Â
Build a body for creating a new Salesforce quote.
Body request
Â
Marshal the body object by "gson" and call Salesforce API to create a quote.
Create SFDC quote
IntegrationManager version 5.8.0