## Make sure, the context object for workflow '$obj exists. The# flag "-new" can be used to make sure, a new and fresh context is# available.##:log "START-require"#set ctx $obj-wfctx
if {$new && [nsf::is object $ctx]} {
$ctx destroy
}
if {![nsf::is object $ctx]} {
set wfContextClass [$obj wf_property workflow_context_class [self]]
regsub -all \r\n [$obj wf_property workflow_definition] \n workflow_definition
$wfContextClass create $ctx -object $obj -destroy_on_cleanup -workflow_definition $workflow_definition$ctx initialize_context $obj
}
#:log "END-require ctx <$ctx>"return$ctx