R – Entering Data in a Custom Activity at Design Time (WF 4.0)

workflow-foundationworkflow-foundation-4

I want to better understand the capabilities and limitations of what can be done with custom activities in WF 4.0 at design time. More specifically, what we can do in a custom activity such that we can allow the designer to interact in a customized way at the design time for specifying details/data about an activity.

For example, I would like to create an activity A, and when the workflow designer places that activity in a workflow in the designer (either Visual Studio designer or a re-hosted designer in a separate application), a .NET dialog can be shown that lets the user enter data (e.g. specify a file through Open File dialog) and validates input data i.e. runs some code whenever a particular text box is focused or data entered (event handlers).

Can this be done and stored in the workflow XAML file?

Please note that all this capability is required in a workflow designer when a workflow is actually being designed.

Thanks.

Best Answer

The WF4 designer is quite capable. You can add controls to the designer allowing the end user to interact with the design surface directly without using the property sheet. You can also add validation to activities to check if the data entered is acceptable or not. All of this is done at the activity level in C# or VB code, not at the workflow level. I am not sure about events when an activity is dropped but believe they are also supported (they where in Wf3 at least and I would expect that to be carried forward.

Related Topic