Renders the decision-switch sim dashboard (HTML page) and the sim
overview email, both reading from bloom_sim_{decision_name} plus
the AI / reconcile narrative blocks in data_decision_sim_analysis.
DecisionSwitchSim — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Param1 — DecisionName whose simulation output table to display.Param2 — pass email (or mail) to return the email-mode HTMLParam3 — reserved for future filtering.render_email(decision_name) -> (html, inline_images) is the underlying
method. It returns the rendered HTML alongside a list of CID-attachment
paths (Technocore agent logo + the active package logo) so the caller
can pass them to WebMail.send_report(inline_images=...). Render(_, "email")
discards the inline-images list to keep its str return type;
ObjDecisionSwitch.cli_email calls render_email directly so the logos
actually attach.
The email body is assembled by the SIMULATION_OVERVIEW template in
def_email_template (Jinja2 engine). Section variables passed to the
template: kpi_html, config_section, anomalies, distribution_section,
outcomes, rules_section, summary_block, reconcile_block,
raci_section, plus header metadata (decision_name, version,
three_words). If the template is missing or fails to render the code
falls back to the legacy direct concatenation.
Expected_Outcome.Outcome value,ObjReportDecisionRules.render_email_fragment(..., max_rows=50) sorender_fragment path.summary, outcomes,anomalies, and reconcile blocks pulled fromdata_decision_sim_analysis viaObjReportDecisionAnalysis.render_email_block.The email shell (email_doc HTML in the YAML) renders a 2-column
header (title + subtitle on the left; package logo and current date
top-right) and a 2-column footer signature (Technocore logo on the
left; "Axion Agent for <Package>" / "TechnoCore Automate" /
"Cape Town | technocore.co.za" on the right). Both logos are CID
inline images and require the inline_images list returned by
render_email.
RpcCsv(data)Returns the entire output table as CSV. Required keys: decision_name.
Returns {status, filename, csv, row_count}.
The table name is derived as bloom_sim_{decision_name} and the
decision name is validated against ^[A-Za-z0-9_]+$ before being
interpolated into SQL. If the table does not exist (no simulation has
been run yet) the report renders an empty-state with the CLI command
to run the simulation. Styling is provided by ObjCss.get_component_css()
via the shared .ax-* class set; report-specific styles live in the
companion YAML under html.extra_css.