WF4: User Activity with Child Activity

How do I create a custom activity for Workflow Foundation 4 that hosts a child activity (or more)?

The idea is to create something similar to a TryCatch action, where you can specify an activity that is included in the try part and the other in the final part. However, I need my own business logic.

+6
workflow-foundation-4
source share
2 answers

Derive from NativeActivity. Use public properties to keep your children. how

public Activity Body { get; set; } 

override NativeActivityExecute (). Call NativeActivityContext.ScheduleActivity (this.Body). Use the overload that accepts completion handlers - if you want some kind of sequential execution, that is because the scheduled actions are only executed after Execute () returns.

These are the basics.

+6
source share

The article, β€œCreating Custom Flow Control Operations in WF 4,” available at http://msdn.microsoft.com/en-us/magazine/gg535667.aspx , explains how to create your own custom flow control actions (such as Sequence ) using WF4.

+2
source share

All Articles