.. _api-workflows: Workflows ========= These examples show the command facade at the application boundary. The detailed command pages provide the complete argument surface. The MAT example uses installed public headers. The PUQ and ``DIPParse`` examples use headers under the matching source checkout's ``src/snt/api``. In addition to linking ``snt-api``, add that checkout's ``src`` directory to the consuming target's include path, for example: .. code-block:: cmake target_include_directories(application PRIVATE /path/to/snt3/src) See :doc:`getting-started` for a complete installed-package CMake recipe. Convert a PUQ quantity ---------------------- Use a PUQ command when the caller wants a formatted result rather than a typed quantity: .. code-block:: cpp #include #include snt::api::PUQConvert convert("US_mi", "km"); std::string distance = convert.execute(); See :doc:`PUQ commands ` for evaluation, inspection, listing, and unit system options. Evaluate a MAT mixture ---------------------- MAT commands return typed records while preserving the configure-then-execute lifecycle: .. code-block:: cpp #include snt::api::MATMaterial material("0.965 0.035 "); material.argument_normalization("mass_fraction"); material.argument_mass_density(snt::puq::Quantity(1.02, "g/cm3")); material.argument_volume(snt::puq::Quantity(1.0, "L")); const auto result = material.execute(); See :doc:`MAT commands ` for element, substance, and material result records and build requirements. Parse and query DIPL -------------------- Register inputs and requests on ``DIPParse``, then execute once: .. code-block:: cpp #include #include snt::api::DIPParse parse; parse.argument_add("file", {"config.dip"}); parse.argument_request("build.python"); parse.argument_value("bool"); std::string value = parse.execute(); See :doc:`DIP commands ` for persistence, snapshot comparison, semantic JSON, generation, and reports.