简体   繁体   English

如何在wf 4.5中使用自动环绕序列设计器创建工作流程活动?

[英]How to create a workflow activity with auto-surround sequence designer in wf 4.5?

One of the new improvements of workflow foundation 4.5 is called "Auto Surround With Sequence" and basically is the ability of creating automatically a sequence once you drop an activity within a body that already has an activity within. 工作流基础4.5的一项新改进称为“带序列自动环绕”,基本上是一种功能,一旦将活动放到体内已有活动的情况下,即可自动创建序列。

http://blogs.msdn.com/b/mcsuksoldev/archive/2012/11/07/workflow-foundation-wf-4-5-designer-improvements.aspx http://blogs.msdn.com/b/mcsuksoldev/archive/2012/11/07/workflow-foundation-wf-4-5-designer-improvements.aspx

I have found how to enable this in a Re-hosting project and I can see regular wf 4.5 activities with this functionality enabled (IF-THEN-ELSE fe) but its not working with our custom activities so I presume I have to decorate the activity somehow but I do not know exactly how to do it. 我已经找到了如何在Re-hosting项目中启用此功能,并且可以看到启用了此功能的常规wf 4.5活动(IF-THEN-ELSE fe),但是它不适用于我们的自定义活动,因此我想我必须装饰该活动不知何故,但我不知道该怎么做。

It should be relative simple but all information I found is about re-hosting but not about the usage in custom activities. 它应该相对简单,但是我发现的所有信息都与重新托管有关,而不与自定义活动中的使用有关。

So, being new to Activity Designers, I was a little unclear on Bernhard's answer until I delved into the WorkflowItemPresenter implementation. 因此,对于Activity Designers还是陌生的,直到我深入研究WorkflowItemPresenter实现之前,我对Bernhard的答案还是不太清楚。 Basically, all you need to do (from an Activity designer point-of-view) is: 基本上,您需要做的(从Activity设计器的角度来看)是:

<sap:WorkflowItemPresenter Item="{Binding Path=ModelItem.MyNestedActivity, Mode=TwoWay}" 
                           AllowedItemType="sa:Activity" 
                           HintText="Add nested activity here" />

This will work straight away with the standard VS WF4 designer. 这将立即与标准VS WF4设计器一起使用。 I'm posting this as this SO thread is the best information I've come across anywhere, and I hope the above xaml helps anybody else with the same issue. 我发布此消息是因为该SO线程是我在任何地方遇到的最佳信息,并且希望以上xaml可以帮助遇到相同问题的其他任何人。

Regards, Julian 问候,朱利安

you need to set the DesignerConfigurationService AutoSurroundWithSequence property to true and in your and in your designer you also need to define the AllowedActivityType, because the WorkflowItemPresenter just provides that feature if that condition typeof(Activity).IsAssignableFrom(this.AllowedItemType)) is true as well. 您需要将DesignerConfigurationService AutoSurroundWithSequence属性设置为true,并且在您和您的设计器中还需要定义AllowedActivityType,因为WorkflowItemPresenter仅在条件typeof(Activity).IsAssignableFrom(this.AllowedItemType))为true时才提供该功能。好。

regards bernhard 问候伯恩哈德

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM