Skip to main content

orvanta_api/models/
process_history_entry.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 6.3.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProcessHistoryEntry : One per-element transition record, in chronological (push) order. **Populated by the engine since #421**, correcting the text that stood here until #1613 (\"Not currently populated by the engine -- always an empty array today\"). That sentence was true of the Phase 5 Task 3 contract and stopped being true when the engine gained a persisted transition log; it outlived the change, and the run overlay was built to infer edge state from element state on the strength of it. Bounded at 2000 records (`worker_bpmn::MAX_HISTORY`), oldest dropped first, so a long-running or heavily looping instance carries the most recent window rather than its whole run.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProcessHistoryEntry {
17    #[serde(rename = "element_id")]
18    pub element_id: String,
19    #[serde(rename = "transition")]
20    pub transition: String,
21    /// The incoming sequence flow the token arrived at this element by (#1613). Not keyed to the transition kind (#1627): the engine snapshots the token's arrival flow once per visit and stamps it on whichever record that visit produces -- `entered`, `completed` or `failed` alike. Absent only where there is no arrival flow to name: a token freshly created at a start event, a multi-instance body token, and the records written on the async job-resume path. This is what makes per-edge run state a fact rather than an inference. From element state alone a traversal is only derivable as \"source completed AND target now active\", which cannot express a parallel join mid-execution (the branch that already delivered reads idle) or a re-traversed loop-back (indistinguishable from a single pass). The engine records an `entered` on a converging gateway for every arrival, satisfying or not, so each delivered branch is named here by its own flow id; and a loop-back is two `entered` records with the same `via_flow` and different `at`.
22    #[serde(rename = "via_flow", skip_serializing_if = "Option::is_none")]
23    pub via_flow: Option<String>,
24    /// why this transition is not what it looks like. Set only by a `noop` delegate binding today (#923): the activity reports `completed` without having run anything, and this carries the binding's mandatory reason.
25    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
26    pub note: Option<String>,
27    #[serde(rename = "at")]
28    pub at: String,
29}
30
31impl ProcessHistoryEntry {
32    /// One per-element transition record, in chronological (push) order. **Populated by the engine since #421**, correcting the text that stood here until #1613 (\"Not currently populated by the engine -- always an empty array today\"). That sentence was true of the Phase 5 Task 3 contract and stopped being true when the engine gained a persisted transition log; it outlived the change, and the run overlay was built to infer edge state from element state on the strength of it. Bounded at 2000 records (`worker_bpmn::MAX_HISTORY`), oldest dropped first, so a long-running or heavily looping instance carries the most recent window rather than its whole run.
33    pub fn new(element_id: String, transition: String, at: String) -> ProcessHistoryEntry {
34        ProcessHistoryEntry {
35            element_id,
36            transition,
37            via_flow: None,
38            note: None,
39            at,
40        }
41    }
42}
43