Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
- run
And suddenly here we get a message box with "default" text, not the one for the testText case
like image 734
javros Avatar asked Jul 29 '11 13:07

javros


1 Answers

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.

like image 185
Maurice Avatar answered Oct 17 '22 16:10

Maurice