过滤器调解器在 WSO2 EI 6.6 中无法正常工作

Filter mediator not working Properly in WSO2 EI 6.6

我正在尝试通过使用条件为(Vin 号已成功更新)的过滤器调解器来处理输出序列中的响应,如果它满足则需要排除块,而不是块,而是执行 else 块,所以请告诉我在下面提到的代码中我弄错了什么。谢谢!

 <outSequence>
        <log level="custom">
            <property expression="json-eval($.)" name="===Response from COMS==="/>
        </log>
        <log level="custom">
            <property expression="json-eval($)" name="ComsResponse"/>
        </log>
        <property expression="json-eval($.ComsResponse)" name="Response" scope="default" type="STRING"/>
        <filter regex="Vin number Updated Successfully" source="$ctx:Response">
            <then>
                <payloadFactory description="Form Response Payload" media-type="json">
                    <format>{"StatusCode":"","Message":""}</format>
                    <args>
                        <arg value="200"/>
                        <arg value="Updated Sucessfully"/>
                    </args>
                </payloadFactory>
            </then>
            <else>
                <payloadFactory description="Form Response Payload" media-type="json">
                    <format>{"StatusCode":"","Message":""}</format>
                    <args>
                        <arg value="400"/>
                        <arg value="Unable to Created or Vin Number already exist"/>
                    </args>
                </payloadFactory>
            </else>
        </filter>
        <respond/>
        <property description="HTTPStatusCode" name="HTTP_SC" scope="axis2" type="STRING" value="200"/>
        <property description="HttpMessageType" name="messageType" scope="axis2" type="STRING" value="application/json"/>
    </outSequence>

属性 ComsResponse 可能是空的。

<property expression="json-eval($.ComsResponse)" name="Response" scope="default" type="STRING"/> 

json-eval 语句正在消息中查找 ComsResponse element/key。这不存在只是 $ 的结果。只是一个字符串。

所以目前过滤器正在针对空字符串测试正则表达式。尝试按如下方式设置响应 属性:

<property expression="json-eval($.)" name="Response" scope="default" type="STRING"/>

有关 json-eval 函数的更多详细信息,请查看 WSO2 documentation.