如何将参数传递给 WorkflowServiceHost 中托管的 DynamicActivity?
如何将参数传递给使用 WorkflowServiceHost 托管的 DynamicActivity(使用 ActivityXamlServices 加载)?我知道我可以将参数传递给工作流中的初始接收活动,但我想在加载工作流时使用特定值来初始化工作流。我已经考虑了工作流定义中的 InArgument 和变量,但这些在加载 DynamicActivity(工作流)时不可见。谢谢。
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 initial 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 WorkflowServiceHost,当工作流开始运行时,您不必像使用 WorkflowApplication 或 WorkflowInvoker 那样将参数传递到工作流中。相反,正如您所指出的,它们是 Receive 活动的参数。也就是说,没有什么可以阻止您定义变量并将其值初始化为您自己类型之一的某些静态字段或函数。
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.