工作流程设计难题-所有包含状态机-或单个顺序 [英] Workflow Design Dilemma - All encompassing state machine - or individual sequentials

查看:79
本文介绍了工作流程设计难题-所有包含状态机-或单个顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是WF的初学者,但是我读过一本书,做了很多谷歌搜索.我想写一个库存管理服务.库存由状态为以下的单个项目组成:

Hello, I''m a beginner with WF, but I''ve read a book and done a lot of googling. I want to write an inventory management service. The inventory is made up of individual items which have a state:


  1. 备用
  2. 已安装
  3. 维修中



每个州的物品可能要花费数月的时间,并且有成千上万的物品.

问题是,是否要为所有不同状态创建状态机工作流?还是创建用于在状态之间转换的工作流?

如果我理解正确,那么如果我创建一个状态机工作流,那么将始终为每个项目运行一个工作流.这意味着数千个不断运行的工作流.另外,我需要能够显示每个项目状态的快照,这意味着我必须以某种方式查询所有工作流以获取它们当前所处的状态,否则在每次状态转换后都将持久化到数据库中. />
但是,从逻辑上讲,状态机工作流程听起来像是正确的事情,因此是我的难题.

如果可以的话请帮帮我

谢谢!



Items may spend months in each state, and there are thousands of items.

The question is, do I create a state machine workflow for all the different states? Or do I create workflows for transitioning between states?

If I understand correctly, if I create a single state machine workflow, then there will always be a workflow running for every item. This means thousands of ever-running workflows. Also, I need to be able to display a snapshot of the status of each item, so that means I have to somehow query all the workflows for the state they are currently in, or otherwise persist to a database after each state transition.

However, a state-machine workflow logically sounds like the right thing to do, hence my dilemma.

Please help me if you can

Thanks!

推荐答案

嗨.

如果猜到了,这个问题比特定于技术的问题更为笼统.

问题是您的项目状态是否为顺序状态.
如果您的回答是是",那么最有可能采用顺序工作流模型就足够了.当然也可以使用课程状态机.

关于
Hi.

If guess the question is more general than technology specific.

The question is if your item states are sequential.
If your answer is YES then most probably sequential workflow model will be enough for you. Else use of course state machine.

And about
写道:​​

数千个不断运行的工作流

thousands of ever-running workflows


我不确定我说对了吗.
如果您的项目/工作流可以长时间保持某种状态,那么我相信这是停放您的工作流并保存状态的一个很好的理由.


I''m not sure I got you right..
If your items/workflow can remain in some state pretty long time, then I''m sure it''s a good reason to park you workflow and save your state.


这篇关于工作流程设计难题-所有包含状态机-或单个顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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