可重用的子工作流程?

发布于 2024-11-02 07:06:12 字数 176 浏览 7 评论 0原文

我正在开发子工作流程的类库;我有一组用于创建子工作流程的活动。我想将这些子工作流程开发为可重用的工作流程,我可以将其用于创建实际的工作流程。我基本上正在实现现有工作流程的类库,其他人可以使用它来创建实际的业务工作流程。我想要的是,当用户创建一个子工作流程时,它应该自动添加到工作流程的类库中并进行编译,并且应该在运行时作为可重用组件提供。

I am in process of developing Class library of Sub workflows; I have set of Activities which I use for creating Sub workflow. I want to develop these sub workflows as reusable workflows which I can use in creating actual workflows. I am basically implementing Class Library of existing workflows which can be used by others to create actual business workflows. What I want is when user creates one Sub workflow it should be automatically should be added in Class library of workflows and compiled and should be available as reusable component at run time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿嘿嘿 2024-11-09 07:06:12

我相信我理解您的目标,但这并不像您想象的那么容易。

第一反应是向您的解决方案添加一个活动(添加 => 新项目 => 工作流程 => Actvity),并将其他活动拖到设计图面上。

这将创建可重用的工作流程,不幸的是,它们不会有任何与之关联的设计器。因此,当其他用户尝试从工具箱中拖动这些工作流程并在不同解决方案的工作流程中使用它们时,他们会得到如下内容:

designer failure

这并不完全有用。另一种方法是创建一个实现 IActivityTemplateFactory< 的自定义活动/a>.这种类型(我相信*)可以添加到工具箱中。将它们拖到设计图面上时,将调用 Create 方法。在此方法中,您可以构建所需的任何工作流程并将其返回。该活动树将添加到工作流中,以便其中的所有活动都可见。

*您可能还需要扩展 Activity 才能使其显示在工具箱中;我对此不太确定。将 Activity 视为实际上从未使用过的虚拟对象。

I believe I understand your goals, however it isn't as easy as you believe it should be.

The first instinct is to add an Activity to your solution (Add => New Item => Workflow => Actvity), and drag other Activities onto the design surface.

This will create reusable workflows, unfortunately they will not have any Designer associated with them. So, when another user attempts to drag these workflows from the toolbox and use them in a workflow in a different solution, they'll get something like this:

designer fail

That isn't exactly useful. An alternative is to create a custom Activity that implements IActivityTemplateFactory. This type (I believe*) can be added to the Toolbox. When they are dragged onto the design surface, the Create method is called. Within this method, you can construct whatever workflow you want and return it. This activity tree will be added to the workflow so that all activities within it are visible.

*You may also have to extend Activity in order for it to show in the Toolbox; I'm not sure about that. Think of the Activity being a dummy which actually is never used.

静谧 2024-11-09 07:06:12

这也可能很有用

http://blogs.msdn.com/b/mwinkle/archive/2009/12/24/swiss-cheese-and-wf4-or-an-introduction-to-activityaction.aspx

一种常见的场景
WF 3 客户的要求是
具有模板化或“灰色”的能力
盒子”或“有洞的活动”
他们(因此瑞士奶酪照片
多于)。在 WF4 中,我们在
这样我们就可以调用 ActivityAction

This may also be useful

http://blogs.msdn.com/b/mwinkle/archive/2009/12/24/swiss-cheese-and-wf4-or-an-introduction-to-activityaction.aspx

One common scenario that was often
requested by customers of WF 3 was the
ability to have templated or “grey
box” or “activities with holes” in
them (hence the Swiss cheese photo
above). In WF4 we’ve done this in a
way that way we call ActivityAction

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文