How can I create a custom activity for Workflow Foundation 4 that host a child activity (or several)?
The idea is to create something similar to the TryCatch activity where you can specify an activity that goes in the try part and another in the finally part. However I need my own custom business logic.
Derive from NativeActivity. Use public properties to hold your children. Like
public Activity Body { get; set; }
override NativeActivityExecute(). Call NativeActivityContext.ScheduleActivity(this.Body). Use the overload that takes completion handlers - if you want some kind of sequential execution, that is, because scheduled activities are executed only after Execute() returns.
This is the basics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With