Module Streamlines.Properties.Workflow

exception Bad_property of string

Bad_property string exception

type t = {
properties : Properties.t;
workflow_name : string;
mutable json : Json.json;
mutable rebuild_json : bool;
mutable verbosity : t_verbosity;
}

t structure

Structure for a workflow, with its name (for selecting its properties from the JSON files, and for displaying when it starts and stops), JSON files, and evaluated properties. The rebuild property is set to force the properties to be reevaluated before they are next used - this is therefore set when JSON files are added to the workflow, as this requires such a reevaluation.

The properties themselves are kept in the json element.

val create : Properties.t ‑> string ‑> t

create properties workflow_name

Create a workflow with a given name and Properties.t

val add_json : t ‑> Yojson.Basic.json ‑> unit

add_json t json

Internal function, used to extract the properties from the workflow_name member of the JSON, replacing only those properties specified by that JSON.

val rebuild : t ‑> unit

rebuild t

Rebuild the json element by extracting the contents of the workflow from the JSON files in properties - but only do the rebuild if marked to do so.

val str_of : t ‑> ?⁠default:string ‑> string ‑> string

str_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

A string representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val bool_of : t ‑> ?⁠override:bool ‑> ?⁠default:bool ‑> string ‑> bool

bool_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

A boolean representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val float_of : t ‑> ?⁠default:float ‑> string ‑> float

float_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

A float representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val int_of : t ‑> ?⁠default:int ‑> string ‑> int

int_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

An integer representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val int32_of : t ‑> ?⁠default:int32 ‑> string ‑> int32

int32_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

An Int32 representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val str_list_of : ?⁠default:string list ‑> t ‑> string ‑> string list

str_list_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

A string list representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val int_list_of : ?⁠default:int list ‑> t ‑> string ‑> int list

int_list_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

An int list representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val float_list_of : ?⁠default:float list ‑> t ‑> string ‑> float list

float_list_of t ?default member_name

Extract member_name from the json for the workflow if present; if not, use default. If this fails, then raise Bad_property.

A float list representation of the extracted property is returned. If that does not make sense, then, again, Bad_property is raised.

val get_verbosity : t ‑> t_verbosity

get_verbosity t

Get the verbosity

val set_verbosity : t ‑> t_verbosity ‑> unit

set_verbosity t verbosity

Upgrade verbosity based on 'verbose', 'noisy' and 'debug' properties and set it

val str : t ‑> string

str t

Generate a pretty string of the contents of the workflow json, for debug usually.

val pretty_print : t ‑> unit

pretty_print t

Pretty print the workflow json to stdout.

val pv_noisy : t ‑> (unit ‑> unit) ‑> unit

pv_noisy t f

Execute f () if verbosity is at least noisy

val pv_debug : t ‑> (unit ‑> unit) ‑> unit

pv_debug t

Execute f () if verbosity is at least debug

val pv_info : t ‑> (unit ‑> unit) ‑> unit

pv_info t

Execute f () if verbosity is at least info

val pv_verbose : t ‑> (unit ‑> unit) ‑> unit

pv_verbose t

Execute f () if verbosity is at least verbose

val workflow_start : ?⁠subflow:string ‑> t ‑> unit

workflow_start t

Mark start of a workflow, or possibly a subflow of a workflow.

val workflow_end : t ‑> unit

workflow_end t

Mark end of a workflow (or most recent subflow)