Source: factory.workflow/ObjWorkflowSimul.py
Extends the base Workflow class to provide a comprehensive simulation environment
for testing, performance analysis, and validation of workflows.
Includes table tracking capabilities from ObjSimulation.
| Method | Signature | Description |
|---|---|---|
| debug | debug(*args, **kwargs) -> None |
Optimized debug logging - only evaluates arguments if DO_DEBUG is True. |
| info | info(*args, **kwargs) -> None |
Optimized info logging - always executes but captured for potential filtering. |
| get_template | get_template(template_name: str) -> str |
Load template from resource.templates first. |
| benchmark_start_simulation | benchmark_start_simulation() -> None |
Mark the start of a simulation run for benchmarking. |
| benchmark_end_simulation | benchmark_end_simulation(guid_count: int) -> JsonDict |
Mark the end of a simulation run and report performance metrics. |
| benchmark_json_serialization | benchmark_json_serialization(data: Any, indent: bool = False) -> str |
Benchmark JSON serialization performance. |
| get_benchmark_metrics | get_benchmark_metrics() -> JsonDict |
Return current benchmark metrics. |
| reset_benchmark_metrics | reset_benchmark_metrics() -> None |
Reset all benchmark counters. |
| get_presim_data | get_presim_data(workflow_name: str, package: str, simulation_size: int) -> dict |
Executes the PreSimSql for the workflow and returns a lookup dict |
| get_simulation_guids | get_simulation_guids(workflow_name: str, simulation_size: int) -> StringList |
Fetches the GUIDs to be used as inputs for the simulation run. |
| get_json_from_payload | get_json_from_payload(payload: str) -> dict[str, str] |
Parses a simple, non-standard string-based payload into a dictionary. |
| call_test_api | call_test_api(endpoint: str, payload: JsonDict) -> str |
Executes a simulated API call to a specified endpoint. |
| get_primary_keys | get_primary_keys(table: str) -> StringList |
Retrieves the primary key column(s) for a given database table. |
| preserve_input | preserve_input(workflow_name: str, simulation_guid: str, guid: str) -> None |
Saves the initial state of data before it is modified by a simulation. |
| parse_transit | parse_transit(transit: str) -> str |
Parses a transition string to extract the workflow node name. |
| get_node_description | get_node_description(workflow_code: str, node: str) -> str |
Retrieves the human-readable description for a workflow node. |
| simulation_summary | simulation_summary(guid: str) -> str |
Analyzes and summarizes the results of a simulation run into a Mermaid flowchart. |
| run_simulation_mode | run_simulation_mode(workflow_name: str, simulation_size: int, version = '1.0', mode = 'direct', endpoint = '', node_filter = None, seed_event_guid: str = '', seed_from_prev: bool = False, simul_guid: str = '', report_webhook: str = '') |
Orchestrates and executes a multi-threaded workflow simulation. |
| display_simulation_tracking_summary | display_simulation_tracking_summary(simulation_guid: str) -> None |
Display a summary of tables tracked during the simulation. |
| closure | closure(workflow_code: str) -> None |
Delegate closure analysis to WorkflowEdit. |
| save_workflow | save_workflow(workflow_code: str) -> str |
Save workflow definition to a YAML file via WorkflowEdit. |
| load_workflow | load_workflow(filename: str) -> None |
Load a workflow definition from a YAML file into the database. |
| trace_guid | trace_guid(workflow_name: str, guid: str) -> None |
Run a single GUID through the workflow in simulation mode and |
| run_simulation | run_simulation(workflow_name: str, simulation_size: int, version: str = '1.0', report_webhook: str = '') -> None |
Convenience method to run a simulation in 'direct' mode. |
| run_simulation_api | run_simulation_api(workflow_name: str, simulation_size: int, version: str = '1.0') -> None |
Convenience method to run a simulation in 'api' mode. |
Runs a workflow simulation in 'direct' mode.
Runs a workflow simulation in 'api' mode.
Generates and displays a summary of a simulation run.
Runs a workflow simulation interactively using a Rich-based UI.
Runs a workflow simulation with a live Rich TUI dashboard.
Sends a test notification to verify ObjNotify is working.
Generates a pyplot image of the credit limit distribution.
Save a workflow definition to a YAML file.
Load a workflow definition from a YAML file into the database.
Run a single GUID through the workflow in simulation mode and