Search code examples
workflow-foundation-4workflow-foundation

How to reuse parts of Windows Workflows?


I have 2 different WF workflows, which both use an identical piece of logic.

Currently that part is copypasted from one workflow to another.

How can I use a part of a workflow in two different workflows without duplicating it?

Basically, I want to have one "library" workflow, which is used by the 2 "real" workflows.


Solution

    • Just add a new "Activity Library" project to your solution.
    • Create an activity in the library that contains the common part.
    • Add a reference to the Activity Library project.
    • Build all in release.
    • Drop the common activity into your workflows.