Index: openacs-4/packages/xowf/tcl/xowf-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-procs.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/xowf/tcl/xowf-procs.tcl 7 Sep 2017 18:39:53 -0000 1.13 +++ openacs-4/packages/xowf/tcl/xowf-procs.tcl 27 Oct 2017 13:54:21 -0000 1.14 @@ -540,11 +540,15 @@ } # -debug - Context proc require {obj} { + Context proc require {{-new:switch false} obj} { #:log "START-require" # set ctx $obj-wfctx #:log "... ctx <$ctx> exists [:isobject $ctx]" + + if {$new && [llength [info commands $ctx]] == 1} { + $ctx destroy + } if {[llength [info commands $ctx]] == 0} { set wfContextClass [$obj wf_property workflow_context_class [self]] @@ -1100,14 +1104,6 @@ return ${:_wf_context} } - WorkflowPage instproc initialize_loaded_object {} { - if {${:state} eq ""} { - set :state "initial" - } - :log "===== WorkflowPage INIT_LOADED_OBJECT <${:state}>" - next - } - WorkflowPage ad_instproc is_wf {} { Check, if the current page is a workflow page (page, defining a workflow) } { @@ -1741,7 +1737,7 @@ # set the state to a well defined starting point if {${:state} eq ""} {set :state initial} - set ctx [::xowf::Context require [self]] + set ctx [::xowf::Context require -new [self]] :activate -verbose false $ctx initialize # Ignore the returned next_state, since the initial state is