【问题标题】:Mulesoft : Could not find a transformer to transform "SimpleDataType{type=java.util.LinkedHashMapMulesoft:找不到转换器来转换“SimpleDataType{type=java.util.LinkedHashMap
【发布时间】:2018-11-27 05:41:52
【问题描述】:

我正在尝试从 Netsuite 获取数据并使用 Mulesoft Dataweave 元素以及 When-Otherwise 根据下面的 sn-p 将其保存在 salesforce 对象中,但给了我错误:

找不到将“SimpleDataType{type=java.util.LinkedHashMap, mimeType='/', encoding='null'}”转换为“CollectionDataType{type=java.util”的转换器.List, itemType=java.lang.Object, mimeType='/'}”。

不知道如何将 Map 转换为 List,因为我是 Mulesoft 的新手。 如果我不使用 When-Otherwise,它会给出:

如果来自 Netsuite 的值为 null,则“无法将 :null 强制转换为 :string 错误”。

   <dw:transform-message doc:name="Transform Message">
        <dw:set-payload><![CDATA[%dw 1.0
            %output application/java 
            ---
            {
                Some_Id__c: payload.customFieldList.customField[0].StringCustomFieldRef__custbody_reference_id as :string when payload.customFieldList.customField[0].StringCustomFieldRef__custbody_reference_id != null otherwise ""
            } 
            ]]></dw:set-payload>
   </dw:transform-message>

【问题讨论】:

    标签: mule


    【解决方案1】:

    如果您需要一个列表,请将其括在方括号中。另外,请尝试使用默认值:

    [
      {
        Some_Id__c: payload.customFieldList.customField[0].StringCustomFieldRef__custbody_reference_id as :string default ""
      }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-17
      • 1970-01-01
      • 2017-04-06
      • 2021-04-22
      • 1970-01-01
      • 2015-04-30
      相关资源
      最近更新 更多