【问题标题】:Is this aggregation possible in the Mule ESB DataMapper在 Mule ESB DataMapper 中是否可以进行这种聚合
【发布时间】:2015-01-16 03:49:15
【问题描述】:

Mule ESB DataMapper 中是否可以进行这种聚合

我有以下结构:

结构 A:

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

结构 B:

<total>
  <totalPrice>6</totalPrice>
</total>

如果我想要所有字段的总和 在结构 A 中放入总价中 结构 B,在 DataMapper 中是可能的。

如果可以,你会怎么做?

谢谢

【问题讨论】:

    标签: dictionary mule esb


    【解决方案1】:

    您显示的源 XML 无效,您只能拥有一个根元素才能拥有有效的 XML。所以我猜你有一个&lt;items&gt; 根元素。

    您可以说,从价格生成总计,然后使用 sum(//price) 创建一个 xpath 规则,然后将其映射到总计。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-15
      • 2015-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-12
      • 2015-11-30
      相关资源
      最近更新 更多