How to pass parameter to DynamicActivity hosted in WorkflowServiceHost?
How can I pass in parameter to a DynamicActivity (loaded using ActivityXamlServices) that is hosted using WorkflowServiceHost? I know I can pass in parameter to the initia开发者_C百科l Receive activity in the workflow but I want to initialize the workflow with a specific value when it is loaded. I have considered both InArgument and variable in workflow definition but these are not visible upon loading the DynamicActivity (workflow). Thanks.
With a WorkflowServiceHost you don't pass arguments into workflows when they start running as you do with the WorkflowApplication or WorkflowInvoker. Instead, as you pointed out, they are parameters of the Receive activity. That said there is nothing preventing you from defining variables and initializing their value to some static field or function of one of your own types.
精彩评论