Switch of string in Workflow Foundation issue
I've encountered a very weird problem with WF4: when I use Switch activity and make the decision on the value of a string variable somehow WF开发者_开发百科 treats argument to the Switch as a string, not the name of the variable. And consequently I get incorrect results. Steps to repro:
- 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 - runAnd suddenly here we get a message box with "default" text, not the one for the testText case
You need to use the value of test without the quotes. The cases contain a literal value, not an expression. And yes I find this confusing as well.
精彩评论