Can anyone recommend a .Net open source alternative to Windows Workflow? [closed]

放肆的年华 提交于 2019-11-28 17:54:50

问题


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.


Update:

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.


回答1:


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

Sample references:

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


来源:https://stackoverflow.com/questions/932924/can-anyone-recommend-a-net-open-source-alternative-to-windows-workflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!