StanfordHCI/foundry — pull request #124 by jaypatelh (2014-12-01 06:22:51+00:00)
Title: Dependency chain v2

Smarter, and in action now!

2 additions:
1. Used the API to enforce the restriction that a task cannot be started until every task before it has been completed.
2. getDependencyMaps recomputes the hash maps if-and-only-if there was a change in the interactions array (i.e. new interaction(s) drawn, interaction(s) removed etc.)

To test addition 1:
Create a simple workflow with some tasks and handoffs. Start the team. Try to start a task before the ones before it have completed, and observe that it won't let you do so.

To test addition 2 (requires browser console):
Create a simple workflow with 3 tasks and handoffs from 1->2 and 2->3. Their ids will automatically be 1, 2, and 3. Run dependencyAPI.getEventsBefore(3, true) on the console. You should see a message that says 'Interactions changed from to ...'. That means the hashmaps were recomputed. Now, run the same command again and you shouldn't see the message because there has not been a change in the interactions since you last ran the command. Then, draw a new task 4 and add a handoff from 3 to 4. Re-run the earlier command again, and now you should see the message again because there has been a change in the interactions array.