August 10, 2014 at 9:33 am
I need help on Database design for workflow application.
I have several workflow steps. Each record needs to pass through these steps. But conditionally, the record can move to any one of the workflow step. For example the record can move from step1 --> step2 or from step1 --> step4 based on record type (which is some logic to be executed to determine the record type).
I can have a table WF(master table) which has all the steps.
WF table
stepid, stepname, IsConditional
I will have another table to maintain what are the possible steps that a record can go to. So if IsConditional is 1, I will have 2 enteries in wf2approve table corresponditon to that stepid.
WF2Approve
stepid, nextstepid
How can I determine what will be next step id dynamically when IsConditional is 1.
Is it possible to maintain such information.
Any other solution which provides more flexibility (like I should be able to add more next steps or remove existing next steps for the conditional workflow step)
August 10, 2014 at 10:39 am
I would add a Conditions table with the columns Condition, Step, NextStep.
In that table I'd store all the options for a specific Condition.
For example, Condition "A" can go from Step 1 to either Step 2 or Step 4, but not step 3 and from Step 2 either to Step 4 or back to step 1.
Then The rwos would look like
Condition Step NextStep
A 1 2
A 1 4
A 2 4
A 2 1
Then you'll need to assign the condition that applies to a specific workflow.
As long as you're not trying to built a "decision tree" based on those data, it should work that way. A decision tree would end in an infinitive loop due to 1->2 and 2->1 ....
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply