【问题标题】:Mule ESB DataMapper: Aggregation of field conditional to field typeMule ESB DataMapper:以字段类型为条件的字段聚合
【发布时间】:2015-03-15 07:35:47
【问题描述】:

Mule ESB DataMapper:根据字段类型聚合字段

我有以下结构:

结构 A:

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

结构 B:

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

如果我想要所有领域的总和,但只有 对于带有“BBB”的结构。

我可以在 Mule ESB 中执行此操作吗?如果可以,我将如何执行?

谢谢

【问题讨论】:

    标签: dictionary mule esb


    【解决方案1】:

    使用规则,如您之前的问题中所述,但使用以下 xpath:sum(//price[../type='BBB'])

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-21
      • 2020-05-05
      • 1970-01-01
      • 1970-01-01
      • 2022-12-02
      相关资源
      最近更新 更多