xowf::test_item::Answer_manager method state_periods (public)

 <instance of xowf::test_item::Answer_manager[i]> state_periods \
    -state state  revision_sets

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

Return for the provided revision_sets the time ranges the workflow was in the provided state.

Switches:
-state
(required)
Parameters:
revision_sets

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowf::test_item::Answer_manager instproc state_periods xowf::test_item::Answer_manager instproc state_periods test_create_test_items->xowf::test_item::Answer_manager instproc state_periods

Testcases:
create_test_items
Source code:
set periods ""
set from ""
set last_from ""
set until ""
foreach ps $revision_sets {
  set current_state [ns_set get $ps state]
  if {$state eq $current_state} {
    if {$until ne ""} {
      lappend periods [:pretty_period $last_from $until]
    }
    set from [ns_set get $ps creation_date]
    set until ""
  } elseif {$until eq "" && $current_state ne $state && $from ne ""} {
    set until [ns_set get $ps last_modified]
    set last_from $from
    set from ""
  }
}
if {$until ne ""} {
  lappend periods [:pretty_period $last_from $until]
} elseif {$from ne ""} {
  lappend periods [:pretty_period $from ""]
}
#ns_log  notice "state_periods $state <$from> <$last_from> <$until> <$periods>"
return $periods
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: