Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data base design for workflow


Data base design for workflow

Author
Message
venki.funky
venki.funky
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
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)
LutzM
LutzM
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 7001 Visits: 13559
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search