Skip to main content

ViewOf

Type Alias ViewOf 

Source
pub type ViewOf<W> = WorkflowView<<W as WorkflowDefinition>::Phase, <W as WorkflowDefinition>::Obligation, <W as WorkflowDefinition>::Outcome>;
Expand description

Shorthand for the view type of a definition.

Aliased Type§

pub struct ViewOf<W> {
    pub case_ref: CaseRef,
    pub workflow_version: WorkflowVersion,
    pub phase: <W as WorkflowDefinition>::Phase,
    pub obligations: Vec<<W as WorkflowDefinition>::Obligation>,
    pub blocking_interaction: Option<InteractionRequirement>,
    pub notices: Vec<WorkflowNotice>,
    pub outcome: Option<<W as WorkflowDefinition>::Outcome>,
}

Fields§

§case_ref: CaseRef

The case and the revision it was projected at.

§workflow_version: WorkflowVersion

Version of the definition that produced the view.

§phase: <W as WorkflowDefinition>::Phase

Exactly one lifecycle phase (I3).

§obligations: Vec<<W as WorkflowDefinition>::Obligation>

Every currently open obligation, possibly parameterized (I4), in the order the workflow wants them asked for.

A set is the truth about what is open and is what an index wants; it cannot say which one is being asked. Told to pick “the most useful one” a writer picks, and a collection flow was asked for its bank account first and its beneficiary second — the last question of the flow — and then read all six out as a menu. So the list is ordered by declaration and the writer is told to ask for the first.

Ordering rather than a single “current” obligation, because some domains genuinely have several open at once — a proposal reviewed in one answer, three extras with no payer that one message can close two of — and a shape that forced exactly one would make those unsayable.

§blocking_interaction: Option<InteractionRequirement>

Zero or one blocking interaction requirement (I5, I6).

§notices: Vec<WorkflowNotice>

Informational, non-blocking elements.

§outcome: Option<<W as WorkflowDefinition>::Outcome>

Present only when the workflow is complete.