Igor Martins
Igor Martins

Reputation: 2047

Workflow - Database Design

I am making an application in cakephp and would like your help in what would be the best way to create my database and my relationship between the models .

Would be a " workflow " .

Would it work as follows:

1 - This application will have several groups and these groups , several users .

2 - Each request would have its flow , multiple requests can have the same flow .

3 - The " admin " can create multiple workflows , with up to 5 steps between groups and individuals . example :

First aprover | second apover | third aprover
 user              group           user

4 - When the administrator chooses a group , not a specific user , someone would be drawn from this group .

5 - The approvals follow the order , ie , the next can only approve if the previous one has already approved .

I think that's basically it. Really it ta giving me so much trouble . I'm having trouble thinking of anything.

What is the tables that i have to create and they relationship?

Upvotes: 1

Views: 6979

Answers (3)

00pol00
00pol00

Reputation: 1

(define a workflow name) Workflowdef=document generation

(This table define the workflow steps only) Stepdef=(1=review; 2=review; 3=generate)

(Create a workflow instance of "document generation") Workflowinstance=refrenece(document generation)

(Define de users for steps of workflow) Stepinstance= (1=user1;2=user2;3=user3)

(Missing table, define de current step TableRoute=(stepToken=step1,startdate=today,endDate=null)

When you complete the step , search for step+1, if no more steps end process

Hope this help something

Upvotes: 0

AKKAweb
AKKAweb

Reputation: 3807

I think it is normal when building any application to go thru these issues. Making sense of Database relations and what makes sense can be tricky. What I usually do is build the basics and go from there. I usually use http://www.cakeapp.com to give me a headstart when building a CakePHP application. It allows you to build your tables and connect them to each other thru belongsTo, hasMany and hasAndBelongsToMany. After you are done, you can download your SQL file and upload it to your DB.

Just a note: Do not download the entire application as the version of Cake is outdated. Just download the SQL file. Also, constantly save your changes.

Upvotes: 0

Declan_K
Declan_K

Reputation: 6826

You need tables to manage:

  1. Groups, Users and user membership within the groups
  2. The definition of a workflow, its associated steps and the assignment of those steps to either groups or users.
  3. Instances of a workflow, its associated steps and the assignment of those steps to either groups or users.

Note: the assigment to groups/users is populated on the step instance upon creation. This allows for the definition to be updated without overwriting the assignments on existing workflow instances.

The following shows the tables need to track what I have outlined above. This is by no means a complete model, but should be enough to get you pointed in the right direction.

Conceptual Model

Upvotes: 5

Related Questions