Tasks and Workflow

Currently tasks have state to test state changes, this will later be moved to packages (I believe Francisco is working on this).
Currently not yet implementing uuids. (Will address once Dustin's changes are merged)


Workflow now represented in DB.
Ex.
 id | task_id |    state    | next_state  
----+---------+-------------+-------------
  1 |       2  | Open        | In Progress
  2 |       2  | In Progress | Closed
  3 |       2   | Closed      | Open

Defaults to first stage of workflow if current status is not defined in the workflow.


For the time being when more than one outcome is possible we randomly select the outcome.
You will see in the console all the possible outcomes and what has been selected.
Ex. A -> (B, C)
From state A will randomly choose between state B or C when you update the task (Later you will update package)
This will change so the user can choose next state from the available states (B,C)


To play around with the current utilities
1) Create a user at /formtest
2) Create a task at /tasks
     owner: Refers to owner ID (Use 1 to refer to the user you created at step 1)
     task: Refers to the name of the task you want to create
     Default workflow is Open -> In Progress -> Closed
3) Change state of a task
    owner: Refers to the task ID
    task: Refers to the task Name
    When you hit update task you should see the state change from Open -> In Progress
4) Change the workflow
     Set your stages with the combo boxes
     Ensure all stages are unique
     Ensure your task is in one of the stages you defined in the workflow
     Hit update status
     Test state changes as in step 3