谁能推荐Windows Workflow的.Net开源替代品? [英] Can anyone recommend a .Net open source alternative to Windows Workflow?

查看:113
本文介绍了谁能推荐Windows Workflow的.Net开源替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.Net堆栈中的Windows Workflow有哪些替代方案?而且,如果您使用了这些解决方案,那么您是通过Windows Workflow选择它们的,这是一个不错的选择.

What alternatives are there to Windows Workflow in the .Net stack? And if you have used these solutions, what made you select them over Windows Workflow and was it a good choice.

更新:

我继续选择无状态由尼古拉斯·布鲁姆哈特(Nicholas Blumhardt)创建.这是在域中建模状态的非常简单的方法.以下是Google提供的示例代码:

I went ahead and selected stateless created by Nicholas Blumhardt. This is a very simple approach to modeling states in a domain. Below is sample code provided at google:

var phoneCall = new StateMachine<State, Trigger>(State.OffHook);

phoneCall.Configure(State.OffHook)
    .Allow(Trigger.CallDialed, State.Ringing);

phoneCall.Configure(State.Ringing)
    .Allow(Trigger.HungUp, State.OffHook)
    .Allow(Trigger.CallConnected, State.Connected);

phoneCall.Configure(State.Connected)
    .OnEntry(t => StartCallTimer())
    .OnExit(t => StopCallTimer())
    .Allow(Trigger.LeftMessage, State.OffHook)
    .Allow(Trigger.HungUp, State.OffHook)
    .Allow(Trigger.PlacedOnHold, State.OnHold);

phoneCall.Configure(State.OnHold)
    .SubstateOf(State.Connected)
    .Allow(Trigger.TakenOffHold, State.Connected)
    .Allow(Trigger.HungUp, State.OffHook)
    .Allow(Trigger.PhoneHurledAgainstWall, State.PhoneDestroyed);

如您所见,状态机使用泛型对状态及其各自的触发器进行建模.换句话说,您可以使用枚举,整数,字符串等来满足您的需求.可以为状态机的每个状态配置条件触发器,这些条件触发器将根据特定条件触发.

As you can see, the state machine uses generics to model the states and their respective triggers. In other words, you can use enums, integers, string, etc to fit your needs. Each state of the state machine can be configured with conditional triggers that will fire based on specific criteria.

推荐答案

在某些情况下,Windows Workflow Foundation对我来说是过度杀伤.然后,实现您自己的工作流引擎变得更加容易和简单.

Windows Workflow Foundation feels like an overkill to me in some situations. Then, it is easier and simpler to implement your own workflow engine.

参考样本:

  • Simple State Machine project on CodePlex
  • Stateless on Google Code

这篇关于谁能推荐Windows Workflow的.Net开源替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆