workflow::test::assert_case_state (public)
workflow::test::assert_case_state -workflow_id workflow_id \ -case_id case_id [ -user_id user_id ] \ -expect_current_state expect_current_state \ -expect_enabled_actions expect_enabled_actions \ [ -expect_user_actions expect_user_actions ]
Defined in packages/workflow/tcl/test/workflow-test-procs.tcl
Make assertions about what the current state should be and what actions are enabled etc.
- Switches:
- -workflow_id (required)
- -case_id (required)
- -user_id (optional)
- -expect_current_state (required)
- -expect_enabled_actions (required)
- -expect_user_actions (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set actual_states [list] foreach elm [workflow::case::fsm::get_state_info -all -case_id $case_id] { foreach { parent_action_id state_id } $elm {} lappend actual_states [workflow::state::fsm::get_element -state_id $state_id -element short_name] } if { ![aa_true "Current states should be: $expect_current_state" [util_sets_equal_p $expect_current_state $actual_states]] } { aa_log "States are: $actual_states" } set enabled_actions [workflow::test::action_short_names [workflow::case::get_enabled_actions -case_id $case_id]] if { ![aa_true "Enabled actions should be: $expect_enabled_actions" [util_sets_equal_p $enabled_actions $expect_enabled_actions]] } { aa_log "Enabled actions are: $enabled_actions" } if { [info exists expect_user_actions] } { if { $user_id eq "" } { set user_id [workflow::test::admin_owner_id] } set user_actions [workflow::test::action_short_names [workflow::case::get_available_actions -case_id $case_id -user_id $user_id]] if { ![aa_true "Available user actions for user $user_id should be: $expect_user_actions" [util_sets_equal_p $user_actions $expect_user_actions]] } { aa_log "Available user actions are: $user_actions" } }XQL Not present: Generic, PostgreSQL, Oracle