简体   繁体   English

如何在 wso2 ESB 中对多个参数使用过滤器

[英]How to use filter for more than one parameter in wso2 ESB

I know to check for a parameter, we have to do something like this我知道要检查一个参数,我们必须做这样的事情

use boolean xpath function to verify if your property exist:使用布尔 xpath 函数来验证您的属性是否存在:

<filter xpath="boolean(get-property('ModifiedOn'))">
   <then> 
      ...
   </then>
   <else>
      ...
   </else>
</filter>

can you please tell me how can i check if more than one parameter is there.你能告诉我如何检查是否有多个参数吗? I mean we need to check 3 parameters.我的意思是我们需要检查 3 个参数。 how can we do this?我们应该怎么做?

Specify all of your criteria that must be true and evaluate as a boolean:指定所有必须为真的条件并评估为布尔值:

<filter xpath="boolean(boolean(get-property('ModifiedOn') and 
                       boolean(get-property('prop2')) and 
                       boolean(get-property('prop3'))">
   <then> 
      ...
   </then>
   <else>
      ...
   </else>
</filter>

As a solution you can set the parameters as below:作为解决方案,您可以设置如下参数:

<filter xpath="fn:number(get-property('SIMPLE_SER_AMT')) > fn:number(get-property('SECURE_SER_AMT'))">

For more information you can refer Sample 156: Service Integration with specifying the receiving sequence available on [1]有关更多信息,您可以参考[1]上可用的示例 156:服务集成以及指定接收顺序

Hope this information will help you.希望这些信息对您有所帮助。

For my case none of the listed solutions worked.就我而言,列出的解决方案均无效。 I am using WSO2 version: 6.5 I was able to make multiple conditions as follows:我使用的是 WSO2 版本:6.5 我能够按如下方式设置多个条件:

<filter regex="true" source="boolean(get-property('VALUE1')) and boolean(get-property('VALUE2')) and boolean(get-property('VALUE3'))">
<then> ...

This expression will make sure that value 1 and 2 and 3 are filled before running the code in the 'then' clause.此表达式将确保在运行“then”子句中的代码之前填充值 1、2 和 3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM