Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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. Spare
  2. Installed
  3. In-Repair


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!
Posted

1 solution

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
wrote:
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900