Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data base design for workflow Expand / Collapse
Author
Message
Posted Sunday, August 10, 2014 9:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, August 10, 2014 9:38 PM
Points: 2, Visits: 10
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)
Post #1601577
Posted Sunday, August 10, 2014 10:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:13 PM
Points: 6,842, Visits: 13,364
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 ....




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #1601584
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse