将参数绑定到 Windows Workflow 实例& 忽略未使用的
我在 Dictionary
中有一堆命名值参数,我想将它们传递到不同的工作流程中。 问题是每个工作流程只需要字典中属性的子集,并且我事先不知道哪个工作流程需要哪些属性。
问题是,当我使用要绑定的字典调用 WorkflowRuntime.CreateWorkflow 时,它失败并显示:
The activity '<workflow name>' has no public writable property named '<property name>'
我知道这意味着什么。 工作流中的属性未定义,因为此特定工作流不需要该特定属性(其他工作流可能)。
无论如何,是否可以将字典绑定到工作流属性,并忽略工作流中未定义的属性?
I have a bunch of named value parameters in a Dictionary<string, object>
, which I want to pass into different workflows. The catch is that each workflow will only need a subset of the properties in the dictionary, and I don't know beforehand which workflow needs which properties.
The problem is that when I call WorkflowRuntime.CreateWorkflow with the dictionary to bind with, it fails with:
The activity '<workflow name>' has no public writable property named '<property name>'
I know what this means. The property in the workflow is not defined because this particular workflow does not need that particular property (other workflows might).
Is there anyway to bind a dictionary to workflow properties, and IGNORE properties that are not defined on the workflow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不将字典传递到工作流程实例中? 然后,您的工作流程定义只需具有该字典的属性即可。
这样,您的工作流程只需从字典中获取感兴趣的字典项目。
Why don't you pass your dictionary into the workflow instances? Your workflow definitions then just have to have a property for that dictionary.
This way your workflows just get the dictionary items of interest from the dictionary.