【问题标题】:Mule ESB DataMapper: Aggregation of field 1 multiplied by field 2Mule ESB DataMapper:字段 1 乘以字段 2 的聚合
【发布时间】:2015-01-16 20:39:44
【问题描述】:

我有以下结构:

结构 A:

<itemlist>
  <item>
    <id>123</id>
    <price>1</price>
    <quantity>1</quantity>
  </item>
  <item>
    <id>124</id>
    <price>2</price>
    <quantity>1</quantity>
  </item>
  <item>
    <id>125</id>
    <price>3</price>
    <quantity>1</quantity>
  </item>
<itemlist>

结构 B:

<totals>
  <total>
    <totalPrice>3</totalPrice>
  </total>
</totals>

如果我想要所有相乘的字段的总和 通过将结构 A 中的字段放入结构 B 的 totalprice 字段中,这在 DataMapper 中是否可行。

如果可以,你会怎么做?

谢谢

【问题讨论】:

    标签: dictionary mule esb


    【解决方案1】:

    是的,在 datamapper 中找到字段 1 的映射,然后转到脚本视图。在那里您会找到一个数据映射器 MEL 脚本。找到output.total = input.field1并添加*input.field2

    【讨论】:

      猜你喜欢
      • 2015-03-15
      • 1970-01-01
      • 1970-01-01
      • 2021-04-19
      • 1970-01-01
      • 1970-01-01
      • 2012-08-23
      • 2010-12-20
      相关资源
      最近更新 更多