Я выполняю несколько операций Salesforce в сервисе wso2 EI. Для каждой операции я сделал salesforce.init
, которая отлично работает, но я хочу поддерживать одно соединение Salesforce, которое можно использовать для нескольких операций везде, где я хочу.
Может кто-нибудь предложить мне, как выполнить эту задачу?
У меня есть следующие документы для справки:
1) https://docs.wso2.com/display/ESBCONNECTORS/Configuring+Salesforce+Operations
2) https://docs.wso2.com/display/ESBCONNECTORS/Working+with+Queries
<sequence name="FeedsProcess_Query-Sequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="LoggerText" value="=====Fetch Query Process Sequence======"/>
</log>
<!-- =============Fetch Vehicle ID======================= -->
<property description="SingleQuote" name="SingleQuote" scope="default" type="STRING" value="'"/>
<property description="QueryToFetchVehicleData" expression="fn:concat(get-property('Sales_FetchVehicleQuery'),' WHERE Name =',get-property('SingleQuote'),get-property('VIN__c'),get-property('SingleQuote'))" name="VehicleQuery" scope="default" type="STRING"/>
<log level="custom">
<property expression="$ctx:VehicleQuery" name="VehicleQuery"/>
</log>
<!-- =======================SalesForce Process======================= -->
<sequence description="Load_SFConfig_CarSalestoSF" key="QRSag_ASGSalesforceInitializer_dev6"/>
<!-- <sequence description="Load_SFConfig_CarSalestoSF" key="QRSag_ASGSalesforceInitializer_devMerge"/> -->
<salesforcerest.init>
<accessToken>{$ctx:accessToken}</accessToken>
<apiVersion>{$ctx:apiVersion}</apiVersion>
<hostName>{$ctx:hostName}</hostName>
<refreshToken>{$ctx:refreshToken}</refreshToken>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<clientId>{$ctx:clientId}</clientId>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<registryPath>{$ctx:registryPath}</registryPath>
<intervalTime>{$ctx:intervalTime}</intervalTime>
</salesforcerest.init>
<salesforcerest.query>
<queryString>{$ctx:VehicleQuery}</queryString>
</salesforcerest.query>
<property expression="json-eval($.)" name="VehicleQueryDetails" scope="default" type="STRING"/>
<property expression="//records/Id/text()" name="VehicleQueryId" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('VehicleQueryDetails')" name="====VehicleQueryResponse==="/>
</log>
<!-- =============Fetch VehicleOwnership Contact Name======================= -->
<property description="QueryToFetchVOData" expression="fn:concat(get-property('Sales_FetchVOQuery'),' WHERE VIN__c =',get-property('SingleQuote'),get-property('VehicleQueryId'),get-property('SingleQuote'),' AND ERA_customer_ID__c=',get-property('SingleQuote'),get-property('FormattedCustomerId'),get-property('SingleQuote'))" name="VOQuery" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('VOQuery')" name="====VOQueryQuery==="/>
</log>
<sequence description="Load_SFConfig_CarSalestoSF" key="QRSag_ASGSalesforceInitializer_dev6"/>
<!-- <sequence description="Load_SFConfig_CarSalestoSF" key="QRSag_ASGSalesforceInitializer_devMerge"/> -->
<salesforcerest.init>
<accessToken>{$ctx:accessToken}</accessToken>
<apiVersion>{$ctx:apiVersion}</apiVersion>
<hostName>{$ctx:hostName}</hostName>
<refreshToken>{$ctx:refreshToken}</refreshToken>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<clientId>{$ctx:clientId}</clientId>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<registryPath>{$ctx:registryPath}</registryPath>
<intervalTime>{$ctx:intervalTime}</intervalTime>
</salesforcerest.init>
<salesforcerest.query>
<queryString>{$ctx:VOQuery}</queryString>
</salesforcerest.query>
<property expression="json-eval($.)" name="VOQueryDetails" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('VOQueryDetails')" name="====VOQueryResponse==="/>
</log>
<property expression="//records/ContactName__c/text()" name="VOContactName__c" scope="default" type="STRING"/>
</sequence>```
Best way to perform multiple salesforce operation by making single connection.