次の動作が発生する理由を誰でも説明できますか? 論理積を使用するときにオペランドの順序が重要なのはなぜですか? mule-ce 3.3.1 で実行されています。
出力は次のとおりです。
true
true
false
true
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<flow name="testFlow1" doc:name="testFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="20005" path="test" doc:name="HTTP"/>
<message-properties-transformer overwrite="true" scope="session" doc:name="Message Properties">
<add-message-property key="productNumber" value="1" />
</message-properties-transformer>
<logger level="INFO" message="#[(sessionVars['productNumber'] == '1' || sessionVars['productNumber'] == '2') and (sessionVars['quantity'] == null)]" doc:name="Logger"/>
<!-- true -->
<logger level="INFO" message="#[(sessionVars['quantity'] == null) and (sessionVars['productNumber'] == '1' || sessionVars['productNumber'] == '2')]" doc:name="Logger"/>
<!-- true -->
<message-properties-transformer overwrite="true" scope="session" doc:name="Message Properties">
<add-message-property key="productNumber" value="3" />
</message-properties-transformer>
<logger level="INFO" message="#[(sessionVars['productNumber'] == '1' || sessionVars['productNumber'] == '2') and (sessionVars['quantity'] == null)]" doc:name="Logger"/>
<!-- false -->
<logger level="INFO" message="#[(sessionVars['quantity'] == null) and (sessionVars['productNumber'] == '1' || sessionVars['productNumber'] == '2')]" doc:name="Logger"/>
<!-- true? it should not be true! -->
</flow>
</mule>