我们使用Apache / WSO2 BPS实现了一个BPEL流程(它涵盖了整个订单流程,因此我们有长期运行的流程)。
我们从六个供应商那里得到一些产品的价格,响应格式已经统一,每个响应包含5-10个产品。以下是一些样本答复:
来自Vendor1:的响应
<Products Vendor="1stVendor">
<Product>
<Brand>Sony</Brand>
<Model>M5<Model>
<Price>800.00<Price>
<Product>
<Product>
<Brand>Dell</Brand>
<Model>B6<Model>
<Price>900.00<Price>
<Product>
来自Vendor2:的响应
<Products Vendor="2ndVendor">
<Product>
<Brand>Sony</Brand>
<Model>M5<Model>
<Price>720.00<Price>
<Product>
<Product>
<Brand>Dell</Brand>
<Model>B6<Model>
<Price>950.00<Price>
<Product>
<Product>
<Brand>IBM</Brand>
<Model>H9<Model>
<Price>940.00<Price>
<Product>
现在我们需要比较每种产品的价格,为每种产品找到最便宜的价格,并返回最佳的选项作为最终的反应。对于上面的例子,应该如下所示:
最终回应:
<Products>
<Product CheapestVendor="2ndVendor">
<Brand>Sony</Brand>
<Model>M5<Model>
<Price>720.00<Price>
<Product>
<Product CheapestVendor="1stVendor">
<Brand>Dell</Brand>
<Model>B6<Model>
<Price>900.00<Price>
<Product>
<Product CheapestVendor="2ndVendor">
<Brand>IBM</Brand>
<Model>H9<Model>
<Price>940.00<Price>
<Product>
关于上述细节:
1-实现这一目标的最佳和最快方法是什么?
使用像Drools或WSO2 BRS这样的规则引擎来比较这些价格有意义吗?如果是,我们是否应该将所有响应合并到一个消息中并传递给BRS,或者消息必须单独发送。
谢谢。
发布于 2013-10-29 04:28:57
在这里,http://wso2.com/library/articles/2011/05/integrate-business-rules-bpel/解释了类似的情况
谢谢
蒂里尼
https://stackoverflow.com/questions/13889776
复制相似问题