Mule ESB DataMapper:字段条件到字段类型的聚合 [英] Mule ESB DataMapper: Aggregation of field conditional to field type
本文介绍了Mule ESB DataMapper:字段条件到字段类型的聚合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Mule ESB DataMapper:字段条件到字段类型的聚合
Mule ESB DataMapper: Aggregation of field conditional to field type
我有以下结构:
Strcuture A:
Strcuture 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。
If I want a sumation of all the field, but only for structures with a of "BBB".
我可以在Mule ESB中执行此操作吗?如果是,我该怎么办?
Can I do this in Mule ESB, and if so how would I do it?
谢谢
Thanks
推荐答案
使用一条规则,就像上一个问题中所述,但使用以下xpath: sum(/ / price [../ type ='BBB'])
。
Use a rule, like described in a your previous question, but use the following xpath: sum(//price[../type='BBB'])
.
这篇关于Mule ESB DataMapper:字段条件到字段类型的聚合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文