【问题标题】:Data Transformation in Mule ESBMule ESB 中的数据转换
【发布时间】:2015-07-16 17:37:52
【问题描述】:

我的 Mule 流程查询数据库并插入 Salesforce 中查询的数据。 DB 中的一列具有值“C”、“P”和“U”,这需要插入到 Salesforce 中具有值“公司”、“人员”、“未知”的选项列表中,其中 C 应映射到公司和 P 到 Person 等。任何有关如何执行此操作的指示都会有很大帮助。谢谢!

【问题讨论】:

    标签: mule datamapper


    【解决方案1】:

    您可以创建自定义 MEL 函数并在您的流程中使用它,在 expression-transformer 中:

    <configuration>
      <expression-language>
        <global-functions>
          def translateType(t) { 
            typeMap = ['C' : 'Company', 'P' : 'Person', 'U' : 'Unknown'];
            typeMap[t];
          }
        </global-functions>
      </expression-language>
    </configuration>
    

    有了这个,你可以在你的流程中使用translateType

    参考:MEL Global Configuration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 2014-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多