我正在修改这个问题,以便更清晰。我正在尝试将Salesforce联系人数据导入CSV文件。
我的Config XML如下:
<sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
</sfdc:config>
<file:connector name="File" writeToDirectory="C:\Users\anataraj\Desktop\Mulesoft Fileconversion\Files" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<file:connector name="File1" writeToDirectory="C:\Users\anataraj\Desktop\Mulesoft Fileconversion\Files" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<file:connector name="File2" writeToDirectory="C:\Users\anataraj\Desktop\Mulesoft Fileconversion" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<data-mapper:config name="XML_To_CSV" transformationGraphPath="xml_to_csv.grf" doc:name="XML_To_CSV"/>
<flow name="testapp2Flow1" doc:name="testapp2Flow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<sfdc:query config-ref="Salesforce1" query="SELECT FirstName,LastName from Contact limit 5" doc:name="Salesforce"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
<data-mapper:transform config-ref="XML_To_CSV" doc:name="XML To CSV"/>
<file:outbound-endpoint path="C:\Users\anataraj\Desktop\Mulesoft Fileconversion" connector-ref="File2" responseTimeout="10000" doc:name="File"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
输出进入我的档案&amp;记录器的格式为:
"[FirstName, Kyle]",""
"[Id]",""
"[LastName, Swenson]",""
"[type, Contact]",""
我需要的是格式:
凯尔,Swenson的
安东尼,巴克
Rich,Gilbertson
AM我在映射方式上做错了。请指教。谢谢!
答案 0 :(得分:1)
你也可以使用以下配置集的转换消息。
%output application / csv separator =“;”,header = false