python工作流引擎_Workflow Core是一款针对.NET标准的轻量级工作流引擎

Workflow Core

68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f786e62793670357634757230347537363f7376673d74727565

Workflow Core is a light weight embeddable workflow engine targeting .NET Standard. Think: long running processes with multiple tasks that need to track state. It supports pluggable persistence and concurrency providers to allow for multi-node clusters.

Announcements

New related project: Conductor

Conductor is a stand-alone workflow server as opposed to a library that uses Workflow Core internally. It exposes an API that allows you to store workflow definitions, track running workflows, manage events and define custom steps and scripts for usage in your workflows.

Documentation

Fluent API

Define your workflows with the fluent API.

public class MyWorkflow : IWorkflow

{

public void Build(IWorkflowBuilder builder)

{

builder

.StartWith()

.Then()

.Then();

}

}

JSON / YAML Workflow Definitions

Define your workflows in JSON or YAML, need to install WorkFlowCore.DSL

{

"Id": "HelloWorld",

"Version": 1,

"Steps": [

{

"Id": "Hello",

"StepType": "MyApp.HelloWorld, MyApp",

"NextStepId": "Bye"

},

{

"Id": "Bye",

"StepType": "MyApp.GoodbyeWorld, MyApp"

}

]

}

Id: HelloWorld

Version: 1

Steps:

- Id: Hello

StepType: MyApp.HelloWorld, MyApp

NextStepId: Bye

- Id: Bye

StepType: MyApp.GoodbyeWorld, MyApp

Sample use cases

New user workflow

public class MyData

{

public string Email { get; set; }

public string Password { get; set; }

public string UserId { get; set; }

}

public class MyWorkflow : IWorkflow

{

public void Build(IWorkflowBuilder builder)

{

builder

.StartWith()

.Input(step => step.Email, data => data.Email)

.Input(step => step.Password, data => data.Password)

.Output(data => data.UserId, step => step.UserId)

.Then()

.WaitFor("confirmation", data => data.UserId)

.Then()

.Input(step => step.UserId, data => data.UserId);

}

}

Saga Transactions

public class MyWorkflow : IWorkflow

{

public void Build(IWorkflowBuilder builder)

{

builder

.StartWith()

.Then()

.OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))

.Then()

.OnError(WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10));

}

}

builder

.StartWith()

.Saga(saga => saga

.StartWith()

.CompensateWith()

.Then()

.CompensateWith()

.Then()

.CompensateWith()

)

.OnError(Models.WorkflowErrorHandling.Retry, TimeSpan.FromMinutes(10))

.Then();

Persistence

Since workflows are typically long running processes, they will need to be persisted to storage between steps. There are several persistence providers available as separate Nuget packages.

MemoryPersistenceProvider (Default provider, for demo and testing purposes)

Search

A search index provider can be plugged in to Workflow Core, enabling you to index your workflows and search against the data and state of them. These are also available as separate Nuget packages.

Extensions

Samples

Contributors

Daniel Gerlag - Initial work

Jackie Ja

Aaron Scribner

Roberto Paterlini

Related Projects

Conductor (Stand-alone workflow server built on Workflow Core)

Ports

License

This project is licensed under the MIT License - see the LICENSE.md file for details

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值