Expand description
Read a markup file and return a robust Process struct
All information in the markup file is stored in the Process struct, including information for every step of the Process and the metadata about the Process document’s place in the organizations document library.
Structs and Enums are public, but associated fields are private. “Get” and “Set”/“Add” functions exist throughout the implementations such that downstream users can query (or modify) data. Note: changes to process information should occur at the source markup file for it to be re-read, as to retain the truth in the author’s source file.
Structs§
- Action
- Each Action struct is a single operation to perform, with an expected result, and an optional Two-Party Verification flag
- Process
- Top-level struct containing all information read from the markup file
- Requirement
- Each Requirement struct represents a formal “shall” statement whose evidence of verification is produced in a Step of a Process
- Resource
- Resoures are named things that are needed to perform a Step - without them the Step can’t be performed
- Section
- Each Section struct contains all Steps within that document section
- Step
- Each Step struct contains all Actions, Images, Commands, Resources, Verifications, and Warnings contained in that step
- Table
- A flexible table of arbitrary number of rows and columns, with a caption to describe the table within the process
Enums§
- SubStep
- Each row within a step contributes to a SubStep. Some SubStep types (e.g. ActionSequence) contain information from multiple consecutive rows, whereas others (all others?) contain information from a single markup file row.
- Verification
Method - Verification methods include one-of-a-kind systems as well as high-volume production (e.g. Sampling)
Functions§
- extract_
embedded_ 🔒csv - When “CSV Start” line is encountered, this function reads this first line all the way through the “CSV End” line that terminates that CSV block.
- extract_
external_ 🔒csv - When a single “CSV File” line is encountered, this function reads the informational parts, parsed with the pipe character, particularly the external file to reference and read in.
- extract_
next_ 🔒action_ sequence - When an “Action” line is encountered within a Step, we want to group it with all consecutive Action lines that follow
- extract_
next_ 🔒section - Examine the remainder of lines in a file, and return the next Section A Section is composed of a series of steps, so this is but one layer in that hierarchy
- extract_
next_ 🔒step - When a “Step” line is encountered within a Section, this function performs an analogous extraction to “extract_next_section” but adapted for SubStep mining.
- parse_
action_ 🔒line - For a single Action line, extract the information and return an Action struct
- parse_
image_ 🔒line - For an “Image” line, parse the two output pieces of information and return as an Image type SubStep
- parse_
resource_ 🔒line - Simply pass the entire string into the one struct field TODO: make this nontrivial The existence of this function is really in case the struct gets more complicated than one field
- parse_
verification_ 🔒line - Verification lines have three expected pieces of information; this parsing function needs to be robust to all cases
- read_
ebml - Read and interpret an entire Easy Button Markup Language (EBML) file, and return a “Process” struct.
- trim_
whitespace_ 🔒make_ uppercase - Robustify string (slice) matching by trimming out all of the whitespace
- which_
method 🔒 - Interpret a user string into an enum variant