Workflow Design Dilemma - State Machine, yes or no

前端 未结 9 1874
清歌不尽
清歌不尽 2020-12-03 05:38

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 whic

9条回答
  •  再見小時候
    2020-12-03 05:56

    As discussed in the comments to the original post I have some issues with using WF for this particular problem at all.

    The sentence "Items may spend months in each state, and there are thousands of items" is the trigger for this: I believe that workflows (modeled with WF) should be shorter lived. While there is no hard rule as to how long a WF instance can or should live, several months or maybe even years triggers kind of an "out-of-bounds" exception with me, especially when this would be a very common state of affairs for thousands of items :-)

    The reasons for using WF in your comments are sound, but don't address this particular point. So I would advise you to use shorter lived, specialized WF models for the things that happen between inventory item states, but don't capture the item state itself in a WF state. Long lived, seldom changed states are more suited to a database engine, where people expect them to be and where they are easily reported upon.

提交回复
热议问题