Index: openacs-4/packages/simulation/tcl/sim-case-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/sim-case-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/simulation/tcl/sim-case-procs.tcl 19 Jan 2004 17:45:27 -0000 1.6 +++ openacs-4/packages/simulation/tcl/sim-case-procs.tcl 30 Nov 2004 21:09:02 -0000 1.7 @@ -167,3 +167,23 @@ } return 1 } + +ad_proc -public simulation::case::complete_p { + {-case_id:required} +} { + Checks if the case has been completed. + + @param case_id The ID of the case + + @return 1 if the case has been completed, 0 otherwise + + @author Jarkko Laine (jarkko@jlaine.net) +} { + set num_enabled_actions [db_string select_num_enabled_actions { + select count(*) + from workflow_case_enabled_actions + where case_id = :case_id + }] + + return [expr $num_enabled_actions == 0] +} \ No newline at end of file