Answered by:
strange problem in flowswitch's expression activity

Question
-
I create a flowchart activity dynamically and assign a code acivitity created by myself to the expression property .
then bind a variable to a inoutargument to this activity.
but when I debug that ,it seems the activity can't retreive the value from context correctly. the return value is 0.
when I put this activity inside a flowstep in the same position, it seems everything is ok.
FlowSwitch<int> sw = new FlowSwitch<int>();
EvalActivity eval=new EvalActivity();
eval.InputResult = InOutArgument<int>.FromVariable(timeoutVar);can anybody help me resolve this problem? thanks a lot.
Thursday, March 25, 2010 6:06 AM
Answers
-
not very clear about your repro steps.
maybe this can help you.
for flowchart, the constructure is there are flowstep, flowswitch, and flowdecision parallelly under flowchart, and all the activities except flowswitch and flowdecision are wrapped by flowstep.
so if you want to add an activity to flowchart, you need to wrap it with flowstep.
and I'm not sure how you write your variable binding code when you can't retrieve the value from context.
maybe following code can help you.
can you have a try on following code?
FlowSwitch<int> sw = new FlowSwitch<int>();
EvalActivity eval=new EvalActivity();VisualBasicValue<int> value = new VisualBasicValue<int>();
value.ExpressionText = timeoutVar.Name;
eval.InputResult = new InOutArgument<int>(value);- Edited by Ye Yu - MSFT Thursday, March 25, 2010 6:44 AM
- Proposed as answer by Ye Yu - MSFT Thursday, March 25, 2010 6:45 AM
- Marked as answer by Scott Mason - MSFT Monday, March 29, 2010 9:39 PM
Thursday, March 25, 2010 6:33 AM
All replies
-
not very clear about your repro steps.
maybe this can help you.
for flowchart, the constructure is there are flowstep, flowswitch, and flowdecision parallelly under flowchart, and all the activities except flowswitch and flowdecision are wrapped by flowstep.
so if you want to add an activity to flowchart, you need to wrap it with flowstep.
and I'm not sure how you write your variable binding code when you can't retrieve the value from context.
maybe following code can help you.
can you have a try on following code?
FlowSwitch<int> sw = new FlowSwitch<int>();
EvalActivity eval=new EvalActivity();VisualBasicValue<int> value = new VisualBasicValue<int>();
value.ExpressionText = timeoutVar.Name;
eval.InputResult = new InOutArgument<int>(value);- Edited by Ye Yu - MSFT Thursday, March 25, 2010 6:44 AM
- Proposed as answer by Ye Yu - MSFT Thursday, March 25, 2010 6:45 AM
- Marked as answer by Scott Mason - MSFT Monday, March 29, 2010 9:39 PM
Thursday, March 25, 2010 6:33 AM -
it works. thanks for your help.
Thursday, March 25, 2010 6:44 AM -
so the binding code works for you?Thursday, March 25, 2010 6:46 AM