Skip to content
forked from UiPath/CoreWF

WF runtime ported to work on .NET Core

License

Notifications You must be signed in to change notification settings

dmetzgar/corewf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status MyGet (dev)

CoreWF

A port of the Windows Workflow Foundation (WF) runtime to .NET Core. This project is still in the experimental phase. It is licensed under the MIT License.

This is not an official Microsoft release of WF on .NET Core. CoreWF is a derivative work of Microsoft's copyrighted Windows Workflow Foundation.

WF Overview

Workflows are multi-step processes composed of activities. Activities are single-purpose elements that can be composed of other activities. Workflows have only one root activity in the same way that an XML document has only one root element.

Developers can create workflows in code:

var helloWorldActivity = new Sequence()
{
    Activities =
    {
        new WriteLine
        {
            Text = "Hello World!"
        }
    }
};

The workflow can be run with the following code:

System.Activities.WorkflowInvoker.Invoke(helloWorldActivity);

The similarity of workflow/activity concepts to XML's document/element concepts means it's possible to write workflows in XML; specifically, an extension of XML called XAML. The "Hello World!" workflow from above can be written as:

<Activity 
 x:Class="WorkflowConsoleApplication1.HelloWorld"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Sequence>
    <WriteLine Text="Hello World!" />
  </Sequence>
</Activity>

The XAML workflow can be loaded in CoreWF through ActivityXamlServices:

var helloWorldActivity = ActivityXamlServices.Load(new StringReader(xamlString));
System.Activities.WorkflowInvoker.Invoke(helloWorldActivity);

WF in the .NET Framework includes a visual, drag-and-drop designer for workflows that produces XAML. The "Hello World!" workflow looks like this in the designer:

Hello World! workflow in WF designer

The designer experience is not part of CoreWF but the XAML produced by the designer can be run in CoreWF (with some limitations). The WF designer experience is available in Visual Studio 2019 by enabling the "Windows Workflow Foundation" individual component in the Visual Studio Installer.

Target Frameworks

CoreWF targets .NET Core 3.1 and .NET Standard 2.0. The .NET Core 3.1 target is meant for Windows runtimes as it uses the Microsoft.WindowsDesktop.App.WPF framework extension to access System.Xaml. To use CoreWF on non-Windows runtimes, use the .NET Standard 2.0 target. This is possible because CoreWF includes a copy of the System.Xaml code.

Usage

To add this library to your project, use the NuGet package.

Contributing

Check out the contributing guide for information on how to help CoreWF.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

About

WF runtime ported to work on .NET Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.0%
  • Other 1.0%