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

 <instance of xowf::test_item::Answer_manager[i]> get_answer_attributes \
    [ -state state ] [ -extra_attributes extra_attributes ] wf

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

Extracts wf instances as answers (e.g., extracting their answer-specific attributes)

Switches:
-state
(optional)
retrieve only instances in this state
-extra_attributes
(optional)
return these attributes additionally as key/value pairs per tuple
Parameters:
wf - the workflow
Returns:
a list of dicts

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

Testcases:
create_test_items
Source code:
set results {}
set items [:get_wf_instances $wf]
foreach i [$items children] {
  if {$state ne "" && [$i state] ne $state} {
    continue
  }

  set answerAttributes [:FL answer_attributes [$i instance_attributes]]
  foreach extra $extra_attributes {
    lappend answerAttributes $extra [$i property $extra]
  }
  #ns_log notice "get_answer_attributes $i: <$answerAttributes> ALL [$i instance_attributes]"
  lappend results [list item $i answerAttributes $answerAttributes state [$i state]]
}
return $results
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: