Index: openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-tasks.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 23 Jan 2004 15:52:58 -0000 1.36 +++ openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 26 Jan 2004 12:34:46 -0000 1.37 @@ -83,18 +83,18 @@ link_url_col {[ad_decode $display_mode edit view_url ""]} } -lappend elements assigned_name { - label "
Assignee" - link_url_col assigned_role_edit_url -} - lappend elements trigger_type { label "
Type" display_eval {[string totitle $trigger_type] [ad_decode $num_subactions "" "" "($num_subactions subtasks)"]} link_url_col add_child_action_url link_html { title "Edit subtasks" } } +lappend elements assigned_name { + label "
Assignee" + link_url_col assigned_role_edit_url +} + lappend elements delete { sub_class narrow hide_p {[ad_decode $display_mode edit 0 1]} Index: openacs-4/contrib/packages/simulation/tcl/sim-action-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/sim-action-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/simulation/tcl/sim-action-procs.tcl 23 Jan 2004 14:31:36 -0000 1.5 +++ openacs-4/contrib/packages/simulation/tcl/sim-action-procs.tcl 26 Jan 2004 12:34:46 -0000 1.6 @@ -287,7 +287,9 @@ } ad_proc -public simulation::action::get_ids { + {-all:boolean} {-workflow_id:required} + {-parent_action_id {}} } { Get the action_id's of all the actions in the workflow. @@ -297,7 +299,7 @@ @author Lars Pind (lars@collaboraid.biz) } { - return [workflow::action::fsm::get_ids -workflow_id $workflow_id] + return [workflow::action::fsm::get_ids -all=$all_p -workflow_id $workflow_id -parent_action_id $parent_action_id] } ad_proc -public simulation::action::get_element { Index: openacs-4/contrib/packages/simulation/tcl/sim-role-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/sim-role-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/packages/simulation/tcl/sim-role-procs.tcl 23 Jan 2004 14:31:36 -0000 1.7 +++ openacs-4/contrib/packages/simulation/tcl/sim-role-procs.tcl 26 Jan 2004 12:34:47 -0000 1.8 @@ -211,7 +211,9 @@ } ad_proc -private simulation::role::get_ids { + {-all:boolean} {-workflow_id:required} + {-parent_action_id {}} } { Get the IDs of all the roles in the right order. @@ -221,7 +223,7 @@ @author Lars Pind (lars@collaboraid.biz) } { - return [workflow::role::get_ids -workflow_id $workflow_id] + return [workflow::role::get_ids -all=$all_p -workflow_id $workflow_id -parent_action_id $parent_action_id] } ad_proc -private simulation::role::generate_spec { Index: openacs-4/contrib/packages/simulation/www/simbuild/state-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simbuild/Attic/state-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/simulation/www/simbuild/state-edit.tcl 23 Jan 2004 15:52:58 -0000 1.4 +++ openacs-4/contrib/packages/simulation/www/simbuild/state-edit.tcl 26 Jan 2004 12:34:47 -0000 1.5 @@ -106,6 +106,7 @@ # Check that pretty_name is unique set unique_p [workflow::state::fsm::pretty_name_unique_p \ -workflow_id $workflow_id \ + -parent_action_id $parent_action_id \ -state_id $state_id \ -pretty_name $pretty_name] Index: openacs-4/contrib/packages/simulation/www/simbuild/task-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simbuild/Attic/task-edit.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/contrib/packages/simulation/www/simbuild/task-edit.tcl 23 Jan 2004 15:52:58 -0000 1.32 +++ openacs-4/contrib/packages/simulation/www/simbuild/task-edit.tcl 26 Jan 2004 12:34:47 -0000 1.33 @@ -26,9 +26,11 @@ set package_key [ad_conn package_key] set package_id [ad_conn package_id] +set num_sub_actions 0 + if { ![ad_form_new_p -key action_id] } { simulation::action::get -action_id $action_id -array task_array - + set workflow_id $task_array(workflow_id) # Message tasks have a recipient; upload document tasks ("normal") have no recipient @@ -40,6 +42,14 @@ set trigger_type $task_array(trigger_type) set parent_action_id $task_array(parent_action_id) + + if { [lsearch -exact { workflow parallel dynamic } $trigger_type] != -1 } { + set num_sub_actions [db_string num_sub_actions { + select count(*) + from workflow_actions + where parent_action_id = :action_id + }] + } } workflow::get -workflow_id $workflow_id -array sim_template_array @@ -124,7 +134,8 @@ {help_text "What the task will appear like in the case log. Usually the past tense of the task name, e.g. 'Close' becomes 'Closed'."} } {trigger_type:text(radio) - {label "Trigger Type"} + {label {[ad_decode $num_sub_actions 0 "Trigger Type" "Trigger Type
(Cannot edit because
task has child tasks)"]}} + {mode {[ad_decode $num_sub_actions 0 "" "display"]}} {options { { "User task" user } { "Automatic timer" time } @@ -279,6 +290,7 @@ # Check that pretty_name is unique set unique_p [workflow::action::pretty_name_unique_p \ -workflow_id $workflow_id \ + -parent_action_id $parent_action_id \ -action_id $action_id \ -pretty_name $pretty_name] Index: openacs-4/packages/simulation/lib/sim-template-tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-tasks.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 23 Jan 2004 15:52:58 -0000 1.36 +++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 26 Jan 2004 12:34:46 -0000 1.37 @@ -83,18 +83,18 @@ link_url_col {[ad_decode $display_mode edit view_url ""]} } -lappend elements assigned_name { - label "
Assignee" - link_url_col assigned_role_edit_url -} - lappend elements trigger_type { label "
Type" display_eval {[string totitle $trigger_type] [ad_decode $num_subactions "" "" "($num_subactions subtasks)"]} link_url_col add_child_action_url link_html { title "Edit subtasks" } } +lappend elements assigned_name { + label "
Assignee" + link_url_col assigned_role_edit_url +} + lappend elements delete { sub_class narrow hide_p {[ad_decode $display_mode edit 0 1]} Index: openacs-4/packages/simulation/tcl/sim-action-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/sim-action-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/simulation/tcl/sim-action-procs.tcl 23 Jan 2004 14:31:36 -0000 1.5 +++ openacs-4/packages/simulation/tcl/sim-action-procs.tcl 26 Jan 2004 12:34:46 -0000 1.6 @@ -287,7 +287,9 @@ } ad_proc -public simulation::action::get_ids { + {-all:boolean} {-workflow_id:required} + {-parent_action_id {}} } { Get the action_id's of all the actions in the workflow. @@ -297,7 +299,7 @@ @author Lars Pind (lars@collaboraid.biz) } { - return [workflow::action::fsm::get_ids -workflow_id $workflow_id] + return [workflow::action::fsm::get_ids -all=$all_p -workflow_id $workflow_id -parent_action_id $parent_action_id] } ad_proc -public simulation::action::get_element { Index: openacs-4/packages/simulation/tcl/sim-role-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/sim-role-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/simulation/tcl/sim-role-procs.tcl 23 Jan 2004 14:31:36 -0000 1.7 +++ openacs-4/packages/simulation/tcl/sim-role-procs.tcl 26 Jan 2004 12:34:47 -0000 1.8 @@ -211,7 +211,9 @@ } ad_proc -private simulation::role::get_ids { + {-all:boolean} {-workflow_id:required} + {-parent_action_id {}} } { Get the IDs of all the roles in the right order. @@ -221,7 +223,7 @@ @author Lars Pind (lars@collaboraid.biz) } { - return [workflow::role::get_ids -workflow_id $workflow_id] + return [workflow::role::get_ids -all=$all_p -workflow_id $workflow_id -parent_action_id $parent_action_id] } ad_proc -private simulation::role::generate_spec { Index: openacs-4/packages/simulation/www/simbuild/state-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/state-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/simulation/www/simbuild/state-edit.tcl 23 Jan 2004 15:52:58 -0000 1.4 +++ openacs-4/packages/simulation/www/simbuild/state-edit.tcl 26 Jan 2004 12:34:47 -0000 1.5 @@ -106,6 +106,7 @@ # Check that pretty_name is unique set unique_p [workflow::state::fsm::pretty_name_unique_p \ -workflow_id $workflow_id \ + -parent_action_id $parent_action_id \ -state_id $state_id \ -pretty_name $pretty_name] Index: openacs-4/packages/simulation/www/simbuild/task-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-edit.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/simulation/www/simbuild/task-edit.tcl 23 Jan 2004 15:52:58 -0000 1.32 +++ openacs-4/packages/simulation/www/simbuild/task-edit.tcl 26 Jan 2004 12:34:47 -0000 1.33 @@ -26,9 +26,11 @@ set package_key [ad_conn package_key] set package_id [ad_conn package_id] +set num_sub_actions 0 + if { ![ad_form_new_p -key action_id] } { simulation::action::get -action_id $action_id -array task_array - + set workflow_id $task_array(workflow_id) # Message tasks have a recipient; upload document tasks ("normal") have no recipient @@ -40,6 +42,14 @@ set trigger_type $task_array(trigger_type) set parent_action_id $task_array(parent_action_id) + + if { [lsearch -exact { workflow parallel dynamic } $trigger_type] != -1 } { + set num_sub_actions [db_string num_sub_actions { + select count(*) + from workflow_actions + where parent_action_id = :action_id + }] + } } workflow::get -workflow_id $workflow_id -array sim_template_array @@ -124,7 +134,8 @@ {help_text "What the task will appear like in the case log. Usually the past tense of the task name, e.g. 'Close' becomes 'Closed'."} } {trigger_type:text(radio) - {label "Trigger Type"} + {label {[ad_decode $num_sub_actions 0 "Trigger Type" "Trigger Type
(Cannot edit because
task has child tasks)"]}} + {mode {[ad_decode $num_sub_actions 0 "" "display"]}} {options { { "User task" user } { "Automatic timer" time } @@ -279,6 +290,7 @@ # Check that pretty_name is unique set unique_p [workflow::action::pretty_name_unique_p \ -workflow_id $workflow_id \ + -parent_action_id $parent_action_id \ -action_id $action_id \ -pretty_name $pretty_name]