Index: openacs-4/packages/cms/www/modules/workflow/task-start.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-start.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/task-start.tcl 20 Apr 2001 20:51:10 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/task-start.tcl 24 May 2001 23:57:17 -0000 1.2 @@ -6,22 +6,20 @@ request set_param return_url -datatype text -value "../workspace/index" set user_id [User::getID] -set db [template::get_db_handle] # make sure the task hasn't expired yet -template::query is_valid_task onevalue " +template::query get_status is_valid_task onevalue " select content_workflow.can_start( :task_id, :user_id ) from dual " # if the task is no longer valid, go to My Tasks page if { [string equal $is_valid_task f] } { - template::release_db_handle template::forward $return_url } # task info -template::query task_info onerow " +template::query get_task_info task_info onerow " select c.object_id, tr.transition_name, content_item.get_title(c.object_id) title, @@ -40,8 +38,6 @@ tk.case_id = c.case_id " -template::release_db_handle - set holding_user $task_info(holding_user) form create task_start -elements { @@ -117,21 +113,19 @@ set user_id [User::getID] set db [template::begin_db_transaction] + db_transaction { + # check that task has not expired, if it has display error msg + template::query get_status is_valid_task onevalue " + select content_workflow.can_start( :task_id, :user_id ) from dual" - # check that task has not expired, if it has display error msg - template::query is_valid_task onevalue " - select content_workflow.can_start( :task_id, :user_id ) from dual - " - - if { [string equal $is_valid_task f] } { - ns_ora dml $db "abort transaction" - template::release_db_handle - template::request::error invalid_task \ + if { [string equal $is_valid_task f] } { + db_dml abort "abort transaction" + template::request::error invalid_task \ "task-start.tcl - invalid task - $task_id" - return - } + return + } - template::query workflow_checkout dml " + db_exec_plsql workflow_checkout " begin content_workflow.checkout( task_id => :task_id, @@ -142,9 +136,7 @@ ); end; " - - template::end_db_transaction - template::release_db_handle + } template::forward $return_url -} \ No newline at end of file +}