2011-07-29 11 views
6

私はWF4で非常に奇妙な問題に遭遇しました.Switchアクティビティを使用して文字列変数の値を何らかの形で決定すると、WFはスイッチの引数を文字列として扱います。変数の名前。その結果、私は間違った結果を得る。 REPROへのステップ:Workflow Foundationの問題の文字列の切り替え

 
- create new WF 
- add Sequence 
- add Switch of String to the Sequence 
- add a new string variable named, for instance, [testText] and set its default value to "test" 
- set argument of the switch to testText 
- create a case in the switch for "test" string and show msgbox on it 
- create another case, let it be default case which shows another msgbox with "default" text 
- run
そして、突然、ここでは「デフォルト」のテキストではなく、あなたが引用符なし テストの値を使用する必要がtestTextケース

答えて

11

のための1つのメッセージボックスを取得します。ケースには、式ではなくリテラル値が含まれます。はい、私はこれも混乱していると思います。

+0

うわー、うまくいきます。誰が思うかもしれない! –

+0

式を含むケースで 'Switch 'や 'FlowSwitch 'を使う方法はないと思いますか? –

関連する問題