0

値が同じであるにも関わらず、選択コンポーネント内の整数であるインバウンドプロパティとペイロードの比較を試みている非常に単純なフローがあり、選択コンポーネントはデフォルトセクションにルーティングします。

私はこの仕事をするためにいくつかの助けを得たいと思います

前もって感謝します

<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" 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
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
    <flow name="flow_testFlow1" doc:name="flow_testFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
        <set-payload value="#[12]" doc:name="Set Payload"/>
        <set-property propertyName="trial" value="#[12]" doc:name="Property"/>
        <choice doc:name="Choice">
            <when expression="#[payload == message.inboundProperties['trial']]">
                <logger level="INFO" doc:name="Logger" message="Success"/>
            </when>
            <otherwise>
                <logger level="INFO" doc:name="Logger" message="error"/>
            </otherwise>
        </choice>
    </flow>
</mule>
4

1 に答える 1

3

set-propertyアウトバウンド スコープでプロパティを設定します。インバウンド スコープは読み取り専用です (インバウンド エンドポイントによって作成されます)。

したがって、選択ルート式を次のように修正する必要があります。

<when expression="#[payload == message.outboundProperties['trial']]">

そして、それは機能します。

于 2014-08-21T15:46:01.423 に答える