工作流还是不工作流? [英] To Workflow or Not to Workflow?

查看:47
本文介绍了工作流还是不工作流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我负责一个开发人员团队,他们将开始开发轻量级保险索赔系统.该系统涉及大量手动任务和业务工作流,我们正在考虑使用 Windows Workflow (.NET 4.0).

I am responsible for a team of developers who will are about to start development of a light weight insurance claims system. The system involves a lot of manual tasks and business workflows and we are looking at using Windows Workflow (.NET 4.0).

业务域示例如下:保单持有人致电联络中心提出索赔.这个事件"会触发两个子任务,这些子任务是手动并行执行的,可能需要很长时间才能完成;

An example of the business domain is as follows: A policy holder calls the contact centre to lodge a claim. This "event" fires two sub tasks which are manually actioned in parallel and may take a lengthy time to complete;

  1. 检查客户是否存在欺诈行为 – 一种手动流程,运营商通过该流程致电各家信贷公司,以检查和评估欺诈客户的可能性.从这里子任务可以输入多个子状态(检查正在进行、失败的参考检查、通过的参考检查等)
  2. 将物品发送到维修中心 – 将投保人提出索赔的物品发送到维修中心进行维修的手动流程.从这里子任务可以输入多个子状态(等待修复、进行中、已修复、已发布等).只有当每个子任务的状态达到预定义状态(基于业务规则)时,才能进行索赔.

从表面上看,Workflow 确实是最好的技术选择;但是我在使用 WF 4.0 时确实有一些顾虑.

On the surface it seems that Workflow is indeed the best technology choice; however I do have a few concerns in using WF 4.0.

  1. 技能组合——从开发人员的平均技能组合来看,我发现了解或了解工作流程的开发人员并不多.
  2. 可维护性 - 社区内对 WF 4.0 项目的支持似乎很少,再加上缺乏技能组合,引发了对可维护性的担忧.
  3. 入门门槛——我觉得 Windows Workflow 的学习曲线很陡峭,而且并不总是那么容易上手.
  4. 新产品 - 由于工作流已针对 .NET 4.0 完全重写,我认为该产品是第一代产品,可能没有必要的稳定性.
  5. 声誉 - 以前版本的 Workflow 不受欢迎,被认为难以开发并导致业务吸收不佳.

所以我的问题是我们应该在这种情况下使用 Windows Workflow (WF) 4.0 还是有替代技术(例如,简单状态机等)或者甚至更好的工作流引擎?

So my question is should we use Windows Workflow (WF) 4.0 for this situation or is there an alternative technology (e.g., Simple State Machine, etc) or even a better workflow engine to use?

推荐答案

我已经完成了几个 WF4 项目,所以让我们看看是否可以在其他答案中添加任何有用的信息.

I have done several WF4 projects so lets see if I can add any useful info to the other answers.

从您的业务问题描述来看,WF4 是一个很好的匹配,所以没有问题.

From the description of your business problem it sounds like WF4 is a good match, so no problems there.

关于您的担忧,您是对的.基本上,WF4 是一个新产品,缺少一些重要的功能并且有一些粗糙的边缘.有一个学习曲线,你必须以不同的方式做一些事情.重点是长时间运行和序列化,这是普通开发人员不习惯的事情,需要一些思考才能正确,因为我经常听到人们在序列化实体框架数据上下文时遇到问题.

Regarding your concerns you are right. Basically WF4 is a new product and is lacking some important features and has some rough edges. There is a learning curve, you do have to do some things differently. The main point is long running and serialization, which is something the average developer is not used to and requires some thought to get right as I hear far too often that people have problems serializing an entities framework data context.

大多数情况下,使用 IIS/WAS 中托管的工作流服务是执行这些长时间运行的工作流类型的最佳途径.这使得解决版本控制问题也不难,只需让第一条消息返回工作流版本并将其作为每个后续消息的一部分.接下来将 WCF 路由器置于两者之间,根据版本将消息路由到正确的端点.基本原则是永远不要改变现有的工作流程,始终创建一个新的工作流程.

Most of the time using workflow services hosted in IIS/WAS is the best route when doing these long running type of workflows. That makes solving the versioning problem not to hard either, just have the first message return the workflow version and make that a part of each subsequent message. Next put the WCF router in between that routes the message to the correct endpoint based on the version. The basic is never to change an existing workflow, always create a new one.

那么我对你有什么建议?不要在未知的、未经证实的技术上押下大赌注.使用 WF4 做一个小的、非关键的应用程序.这样,如果它有效,您可以对其进行扩展,但如果它失败,您可以将其撕掉并用更传统的 .NET 代码替换它.这样您就可以获得 WF4 的真实体验,而不必根据二手信息做出决定,并在此过程中学习一种新的强大技术.如果可能的话,参加 WF4 课程,因为这将为您节省大量时间来加快速度(无耻的自插 此处).

So what is my advise to you? Don't take a big gamble on a unknown, and for you unproven, piece of technology. Do a small, non critical, piece of the application using WF4. That way if it works you can expand on it but if it fails you can rip it out and replace it with more traditional .NET code. That way you get real experience with WF4 instead of having to base a decision on second hand information and you learn a new and powerful technology in the process. If possible take a course on WF4 as that will save you a lot of time in getting up to speed (shameless self plug here).

关于简单状态机.我没有使用过它,但我的印象是它用于短期运行,在内存中,状态机.WF4 的主要优势之一是长期运行方面.

About the Simple State Machine. I have not used it but I was under the impression it was for short running, in memory, state machines. One of the main benefits of WF4 is the long running aspects.

这篇关于工作流还是不工作流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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