WF 扩展活动行为(或类似模板活动)
我想创建具有以下结构的 WF 活动(让我们称之为模板活动):几个预定义的活动(包括 if 等条件)+ 一个或多个占位符活动(例如序列活动可以是占位符)。这意味着,当我将此活动拖到设计器中的工作流程时,我将无法删除预定义的活动。我将能够向占位符添加任何活动,以定义特定于具体工作流程的自定义行为。
问题是我无法创建模板活动的设计器以这种方式运行。当将模板活动拖到设计器中的工作流程时,我无法将任何活动(在任何位置)添加到模板活动中。
有谁知道我如何实现这个模板活动行为?
I want to create WF activity (let's call it Template Activity) with the following structure: several predefined activities (including conditions like if and so on) + one or more placeholder activities (for example sequence activities could be place holders). That mean, when I drag this activity to the workflow in designer, I will not be able to remove the predefined activities. And I will be able to add any activities to the placeholders to define custom behavior specific for the concrete workflow.
The issue is that I could not create the designer of the Template Activity to behave this way. I could not add any activities (in any place) to the Template Activity when it is dragged to the workflow in designer.
Does anybody know how I could achieve this Template Activity behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 WF3 您实际上无法做到这一点。您可以创建自定义复合活动并在使用它们时向其中添加新活动,但它们不能包含预定义活动和“模板孔”。
像 IfElseAcitivity 这样的活动似乎执行此操作的方式是在将活动拖到设计图面上时添加默认的 2 个分支。这是通过将自定义 ActivityToolboxItem 添加到您的活动类来完成的。
Using WF3 you can't really do that. You can create custom composite activities and add new acitivities to them on when using them but they cannot already contain predefined activities and "template holes".
The way activities like the IfElseAcitivity appears to do this is by adding the default 2 branches at the time you drag the activity onto the design surface. This is done by adding a custom ActivityToolboxItem to your activity class.