覆盖工作流程中的活动?
我有一个复杂的向客户发送营销电子邮件的工作流程。有大约二十个活动决定谁会收到哪种类型的电子邮件。
我 95% 的活动都是在二进制活动库中定义的。我在视觉工作室中组装了我的主要活动。
对于某些类型的客户,我希望(例如)步骤 25a 中的活动的行为与我构建它时定义的不同。我们可以从数据库中托管的 xaml 加载活动。
一种选择是为这些客户克隆整个工作流程,但这会导致大量代码重复。
是否可以覆盖运行时用于定位和编组活动的任何内容,以便如果我的客户是左撇子,则工作流中的一项活动将被替换,而不是我在 IDE 中定义的活动?
我正在考虑如何重写 mvc 中的 ViewEngine 来动态加载 ipad 视图或其他内容。加载活动有类似的东西吗?
I have a complicated workflow for sending marketing emails to customers. There's something like twenty activities that decide who gets what kind of email.
95% of my activities are defined in a binary activity library. I assembled my main activity in visual studio.
For certain types of customer I want to have the activity in (say) step 25a behave differently than what I defined when I built it. We could load the activity from xaml hosted in a database.
One option is to clone the entire workflow for those customers, but that is a lot of code duplication.
Is it possible to override whatever the runtime uses to locate and marshal activities so that if my customer is left handed, one activity in the workflow is substituted instead of what I defined in the IDE?
I'm thinking of how you can override the ViewEngine in mvc to dynamically load ipad views or whatever. Is there something similar for loading activities?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果工作流本身已编译到程序集中,则无法替换该活动。不过,您可以使用以下几个选项:
You can't replace the activity in the workflow itself if it is compiled into the assembly. There are several options you can use though:
好消息...我已经在 Microsoft.Activities 中构建了您所需要的内容。有关详细信息,请参阅 WF4 如何以 XAML 形式调用子工作流,就在昨天,我添加了对跟踪子工作流的支持,请参阅使用 InvokeWorkflow 跟踪子工作流
Good news... I have built exactly what you need for this in Microsoft.Activities. For details see WF4 How To Invoke a Child Workflow as XAML and just yesterday I added support for tracking child workflows see Tracking Child Workflow with InvokeWorkflow