_xowf__create_new_workflow_page (private)

 _xowf__create_new_workflow_page

Defined in packages/xowf/tcl/test/xowf-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) _xowf__create_new_workflow_page _xowf__create_new_workflow_page _xowf__create_new_workflow_page->aa_equals _xowf__create_new_workflow_page->aa_false _xowf__create_new_workflow_page->aa_log _xowf__create_new_workflow_page->aa_log_result _xowf__create_new_workflow_page->aa_run_with_teardown

Testcases:
No testcase defined.
Source code:
        
            upvar 2 _aa_exports _aa_exports
            foreach init_class xowf_require_test_instance {
                if {[llength $init_class] == 2} {
                    lassign $init_class init_class init_package_key
                } else {
                    set init_package_key xowf
                }
                foreach v $_aa_exports([list $init_package_key $init_class]) {
                    upvar 2 $v $v
                }
                foreach logpair $::aa_init_class_logs([list $init_package_key $init_class]) {
                    aa_log_result [lindex $logpair 0] [lindex $logpair 1]
                }
            }
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
            aa_run_with_teardown -rollback -test_code {
                set instance $_xowf_test_instance_name
                set testfolder .testfolder

                set n [site_node::get_from_url -url $instance]
                set package_id [dict get $n object_id]

                ::xowf::Package initialize -package_id $package_id
                set parent_id [$package_id folder_id]

                set item_ref_info [$package_id item_ref  -use_site_wide_pages true  -default_lang en  -parent_id $parent_id  en:Workflow.form]
                set page_template [dict get $item_ref_info item_id]

                set name testWF
                set title testWFTitle
                set wf [::xowf::Package create_new_workflow_page  -package_id $package_id  -parent_id $parent_id  -name $name  -title $title  -instance_attributes {
                                a b
                                c d
                            }]

                aa_equals "$wf: name is correct" $name [$wf name]
                aa_equals "$wf: title is correct" $title [$wf title]
                aa_equals "$wf: property 'a' is correct" b [$wf property a]
                aa_equals "$wf: property 'c' is correct" d [$wf property c]

                aa_false "$wf: package_id is not set on the fresh object" [$wf exists package_id]

                $wf set package_id $package_id
                $wf save_new

                set item_id [$wf item_id]
                set found_p [::xo::dc 0or1row check_wf {
                    select instance_attributes from
                    xowiki_form_instance_item_index i,
                    cr_revisions r,
                    xowiki_page_instance pi
                    where i.item_id = :item_id
                    and r.item_id = i.item_id
                    and r.revision_id = pi.page_instance_id
                    and i.package_id = :package_id
                    and i.page_template = :page_template
                    and i.name like '%' || name
                    and r.title = :title
                }]
                aa_true "Workflow was created in the database" $found_p
                if {$found_p} {
                    aa_equals "Properties have been stored correctly"  [dict create {*}$instance_attributes] [dict create a b c d]
                }
            }
        }} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "create_new_workflow_page (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: