Re: Configurable Workflows
I'd be a little cautious about this statement:-
"Based on the present state of an order, it could be pushed into the next state or cancelled"
In my experience there may well be several possible "next states". Or it could loop back to a previous state. Workflows are generally directed graphs rather than linear functions. That said, if you can keep yours purely linear you'll make your life much easier so pitch for that if you can.
Quote:
How do I manage this?
Achieve what?
Are you asking how to lay it out in the file? If so I'd recommend a format that has some hierarchical structure e.g. xml because you're going to need to store an indefinite number of actions for each state transtion (as well as an indefinite number of condtions, outcomes and destination states if you find you need to implemet a directed graph). In fact I'd probably go further and store it in a DB if it was me but I'm probably biased by the fact that dbs are my strong point.
Are you asking how to take that configuraton and run the apropriate method, in which case you want to bone up on reflection.
Or are you asking something else I haven't thought of.