Galosys.Foundation.WorkflowCore 26.5.20.1

dotnet add package Galosys.Foundation.WorkflowCore --version 26.5.20.1
                    
NuGet\Install-Package Galosys.Foundation.WorkflowCore -Version 26.5.20.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Galosys.Foundation.WorkflowCore" Version="26.5.20.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Galosys.Foundation.WorkflowCore" Version="26.5.20.1" />
                    
Directory.Packages.props
<PackageReference Include="Galosys.Foundation.WorkflowCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Galosys.Foundation.WorkflowCore --version 26.5.20.1
                    
#r "nuget: Galosys.Foundation.WorkflowCore, 26.5.20.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Galosys.Foundation.WorkflowCore@26.5.20.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Galosys.Foundation.WorkflowCore&version=26.5.20.1
                    
Install as a Cake Addin
#tool nuget:?package=Galosys.Foundation.WorkflowCore&version=26.5.20.1
                    
Install as a Cake Tool

DI

成熟度: 🔴 实验性 — 依赖 preview 版本,API 可能变更

⚠️ 本模块依赖 preview/不稳定版本包,API 可能随时变更。

Galosys.Foundation.WorkflowCore

      services.AddWorkflowCore();

Definition

    {
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            //throw new Exception();
            Console.WriteLine($"Start");
            return ExecutionResult.Next();
        }
    }

    public class PlusStepBody : StepBody
    {
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            //throw new Exception();
            var input = context.Workflow.Data as PlusInput;
            input.Output = input.P1 + input.P2;
            return ExecutionResult.Next();
        }
    }

    internal class TestWorkflow : IWorkflow<WorkflowParameter>
    {
        public string Id => "test";

        public int Version => 1;

        public void Build(IWorkflowBuilder<WorkflowParameter> builder)
        {
            builder.StartWith<PlusStepBody>()
                .Then<PrintStepBody>()
                .Then(i => Console.WriteLine("over"));
        }
    }

    internal class EventHandlerWorkflow : IWorkflow
    {
        public string Id => "event-handler";

        public int Version => 1;

        public void Build(IWorkflowBuilder<object> builder)
        {
            builder
                .StartWith(context => ExecutionResult.Next())
                .WaitFor(Id, data => "plus")
                .Output((step, data) =>
                {
                    var input = step.EventData as PlusInput;
                    var d = (PlusInput)data;
                    d = input;
                    Tracer.Trace($"{input.P1}+{input.P2}", "eventhandler=>plus");
                })
                .Then<PlusStepBody>();
        }
    }

QucikStart

 using (var scope = _scopeFactory.CreateScope())
            {
                var sp = scope.ServiceProvider;
                var host = sp.GetRequiredService<IWorkflowHost>();
                //await host.StartWorkflow("test", new PlusInput { P1 = 1, P2 = 2 });
                await host.StartWorkflow("event-handler", new PlusInput { P1 = 1, P2 = 2 });
                await host.PublishEvent("event-handler", "plus", new PlusInput { P1 = 2, P2 = 3 });
            }
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.5.20.1 64 5/20/2026
26.5.19.1 75 5/19/2026
26.5.18.1 85 5/18/2026
26.5.15.1 84 5/15/2026
26.5.12.3 82 5/12/2026
26.5.12.2 86 5/12/2026
26.4.27.1-rc1 90 4/26/2026
26.4.25.1-rc1 89 4/25/2026
26.4.22.2-rc7 94 4/22/2026
26.4.22.2-rc6 83 4/22/2026
26.4.22.2-rc4 88 4/22/2026
26.4.22.2-rc3 83 4/22/2026
26.4.19.1-rc1 95 4/19/2026
26.4.12.8-rc1 90 4/12/2026
26.4.12.7-rc1 85 4/12/2026
26.4.12.5-rc1 88 4/12/2026
26.1.30.1-rc1 111 1/30/2026
26.1.29.1 113 1/29/2026
26.1.28.5 120 1/28/2026
26.1.28.4 117 1/28/2026
Loading failed