I have a Switch activity that has an expression of
escalateEngine.CheckRules()
Where escalateEngine is an instance of a class that is passed to the workflow as an argument and CheckRules() is a method designed to work out if a problem that the workflow has encountered should be retried or aborted (usually the error is “ftp server not available”).
The CheckRules() method returns an int that is used by the Switch activity to reroute workflow execution.
What I don’t see how to do is how I can get CheckRules() to change the value of a Variable in the workflow. It’s not an activity so does not have access to CodeActivityContext. At least I don’t think it does.
Can anyone offer advice?
I realize I could use InvokeMethod to output the value and then run that value into the Switch but I was hoping for something neater
You are right in that you can’t change workflow variables outside of the workflow.