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?


You need tables to manage:

<ol> <li>Groups, Users and user membership within the groups</li> <li>The definition of a workflow, its associated steps and the assignment of those steps to either groups or users.</li> <li>Instances of a workflow, its associated steps and the assignment of those steps to either groups or users.</li> </ol>

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.

<img src="https://i.stack.imgur.com/2SmPG.png" alt="Conceptual Model">


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.


  • Foreign key constraint error when adding through migrating
  • Excluding some combinations from left join in MySQL
  • Space between buttons and window
  • Devise: Is it possible to NOT send a confirmation email in specific cases ?
  • Catch an pre-defined int exception
  • PHP MYSQL event listener
  • Confused about STS and WIF
  • App store approval process for Hybrid Apps
  • How to set specific release date in new iTunesConnect interface after approval?
  • How to find out the solid color used for the Windows Wallpaper?
  • How to break up an array into strings MVC?
  • PayPal REST API cross reference transaction with payment
  • Why can't I request promo codes for my iOS app?
  • Change Image() object dimensions (width and height)
  • How to check the permission whether a friend allow me to post on his wall or not using php sdk
  • Draw a bitmap from a control taller than the screen
  • Drawing a polygon over the entire map
  • Ruby and class variables in inherit class
  • Insertion large number of Entities into SQL Server 2012 [duplicate]
  • R sqldf renaming a field in a select statement
  • Available space left on drive - WinAPI - Windows CE
  • Most efficient way to move table rows from one table to another
  • Which open source license has no forking [closed]
  • SAXReader not re-ecape characters
  • Using a canvas object in a thread to do simple animations - Java
  • How can I set a binding to a Combox in a UserControl?
  • Ionic 2 storage is not cleaning up on uninstall - Only for signed APK
  • preg_replace Double Spaces to tab (\\t) at the beginning of a line
  • Breeze - Deleted Items nav properties bug
  • How to delay loading a property with linq to sql external mapping?
  • javaw.exe and eclipse startup problems
  • Updated Ionic CLI but shows previous version (Windows)
  • Matrix multiplication with MKL
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • What are the advantages and disadvantages of reading an entire file into a single String as opposed
  • need help with bizarre java.net.HttpURLConnection behavior
  • Busy indicator not showing up in wpf window [duplicate]
  • Converting MP3 duration time
  • Conditional In-Line CSS for IE and Others?