您推荐哪种工作流引擎?

发布于 2024-07-21 21:20:32 字数 1539 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往日 2024-07-28 21:20:32

如果您可以使用状态机,那么我会推荐一个名为 Nicholas Blumhardt 开发的 StateLess 的开源项目 (Autofaq创建者)。 他的方法避免了运行时引擎持有长时间运行的工作流的问题,因为状态是由简单的变量(例如字符串或整数)定义的。

这是一个示例状态机:

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

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

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

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

// ...

phoneCall.Fire(Trigger.CallDialled);
Assert.AreEqual(State.Ringing, phoneCall.State);

您的状态可以是一个整数,它允许您从数据库向其提供当前状态。 这可以在状态机的构造函数上进行设置,如下所示:

var stateMachine = new StateMachine<State, Trigger>(
    () => myState.Value,
    s => myState.Value = s);

与运行 Windows 工作流所需的多个项目相比,您只需在一个程序集中即可实现这一点。 维护成本极低,没有“设计师”为您生成代码,等等。同样,它很简单,而且存在着美丽。

If you can use a state machine, then I'd recommend an open source project called StateLess by Nicholas Blumhardt (Autofaq creator). His approach avoids the issue of long running workflows being held by a runtime engine, as the state is defined by a simple variable such as a string or int.

Here is a sample state machine:

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

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

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

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

// ...

phoneCall.Fire(Trigger.CallDialled);
Assert.AreEqual(State.Ringing, phoneCall.State);

Your state can be an integer which will allow you to feed it the current state from a database. This can be set on the constructor of the state machine as follows:

var stateMachine = new StateMachine<State, Trigger>(
    () => myState.Value,
    s => myState.Value = s);

You can implement this in just one assembly, compared to the multiple projects you need to run Windows Workflow. Maintenance is extremely low, there is no "designer" that generates code for your, etc. Again, it is simple, and there lies the beauty.

北方的巷 2024-07-28 21:20:32

我过去部署过 K2 和 WF 系统。 K2很强,但是很花钱。 WF虽然处于劣势,但进步很快。 两者都与 .NET 堆栈(特别是 MOSS)集成得很好,并且都具有非常好的工具集成。 一旦您了解了工作流程模型,两者的开发都相对容易。

您可以从许多不同的 MS 合作伙伴那里获得这两种解决方案的支持,尽管我猜测 WF 更容易获得解决方案支持(即更多的合作伙伴比 K2 拥有更多了解 WF 的顾问)。

不幸的是,我对 Oracle 产品或您提到的开源替代品没有任何经验,因此我无法对这些产品发表评论。

如果您不知所措,我建议您查看WF 虚拟实验室(页面底部)。 他们会让你掌握技术、掌握术语、经历一些场景。 一旦你掌握了这一点,理解 WF 如何适应你想要做的事情应该会容易得多。 另外,我可以推荐Essential Windows Workflow——非常好的书。 这是 PDC 的 WF 4.0 的精彩介绍。

I've deployed both K2 and WF systems in the past. K2 is quite strong, but spendy. WF is an underdog, but improving quickly. Both integrate with the .NET stack (MOSS specifically) quite well and both have very good tool integration. Both are relatively easy to develop for once you understand the workflow model.

You can get solutions support from many different MS partners for both, although my guess is WF is a bit easier to get solutions support for (i.e. more partners have more consultants who know WF than K2).

Unfortunately, I don't have any experience with the Oracle product or the open source alternatives you mentioned, so I can't comment on those.

If you are overwhelmed, I recommend you take a look at the WF Virtual Labs (bottom of the page). They will let you get your hands on the technology, get the lingo down, go through a few scenarios. Once you have that, understanding how WF can fit into what you trying to do should be substantially easier. Also, I can recommend Essential Windows Workflow -- very good book. Here's a good intro on WF 4.0 from PDC.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文