Skip to main content

orvanta_api/models/
bpmn_mapping_blocker.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: 3.2.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnMappingBlocker : One reason a mapping document does not hold for a version pair (#925). `rule` is the discriminant; `rule_number` groups it (1 document well-formedness; 2 no silent drop -- an unmapped, deleted element would drop a token; 3 stable meaning -- kind, message binding and correlation names; 4 injectivity -- no N:1 merge, because a join's `arrived` is a set and would absorb the duplicate; 5 scope coherence; 6 edge images -- each source flow needs a unique counterpart between its mapped endpoints; 7 join coherence -- the only *silent* failure, since `JoinState.expected` is derived once and never refreshed; 8 boundary coherence -- the interruption surface of a running activity must not change under it; 9 vacated identifier reuse -- renaming an id away while the target still defines it points the instance's future `uuid_v5` derivations back onto keys it has already burned, which hangs the activity behind a 365-day park with no incident). The remaining properties are the rule's own, and which are present depends on `rule`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnMappingBlocker {
17    #[serde(rename = "rule")]
18    pub rule: Rule,
19    #[serde(rename = "rule_number")]
20    pub rule_number: i32,
21    /// the rendered sentence, safe to show an operator as-is
22    #[serde(rename = "message")]
23    pub message: String,
24    #[serde(rename = "element_id", skip_serializing_if = "Option::is_none")]
25    pub element_id: Option<String>,
26    #[serde(rename = "flow_id", skip_serializing_if = "Option::is_none")]
27    pub flow_id: Option<String>,
28    #[serde(rename = "message_name", skip_serializing_if = "Option::is_none")]
29    pub message_name: Option<String>,
30    /// rule 9 only -- the source id the mapping vacates while the target still defines it
31    #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")]
32    pub identifier: Option<String>,
33    /// rule 9 only -- the image the mapping gives `identifier`
34    #[serde(rename = "renamed_to", skip_serializing_if = "Option::is_none")]
35    pub renamed_to: Option<String>,
36    /// for rule 2 the element's BPMN kind; for rule 9 the namespace the identifier belongs to (`element` or `sequence_flow`)
37    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
38    pub kind: Option<String>,
39    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
40    pub from: Option<String>,
41    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
42    pub to: Option<String>,
43    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
44    pub target: Option<String>,
45    #[serde(rename = "target_flow", skip_serializing_if = "Option::is_none")]
46    pub target_flow: Option<String>,
47    #[serde(rename = "from_kind", skip_serializing_if = "Option::is_none")]
48    pub from_kind: Option<String>,
49    #[serde(rename = "to_kind", skip_serializing_if = "Option::is_none")]
50    pub to_kind: Option<String>,
51    #[serde(rename = "from_message", skip_serializing_if = "Option::is_none")]
52    pub from_message: Option<String>,
53    #[serde(rename = "to_message", skip_serializing_if = "Option::is_none")]
54    pub to_message: Option<String>,
55    #[serde(rename = "expected_scope", skip_serializing_if = "Option::is_none")]
56    pub expected_scope: Option<String>,
57    #[serde(rename = "actual_scope", skip_serializing_if = "Option::is_none")]
58    pub actual_scope: Option<String>,
59    #[serde(rename = "mapped_source", skip_serializing_if = "Option::is_none")]
60    pub mapped_source: Option<String>,
61    #[serde(rename = "mapped_target", skip_serializing_if = "Option::is_none")]
62    pub mapped_target: Option<String>,
63    #[serde(rename = "sources", skip_serializing_if = "Option::is_none")]
64    pub sources: Option<Vec<String>>,
65    #[serde(rename = "targets", skip_serializing_if = "Option::is_none")]
66    pub targets: Option<Vec<String>>,
67    #[serde(rename = "candidates", skip_serializing_if = "Option::is_none")]
68    pub candidates: Option<Vec<String>>,
69    #[serde(rename = "missing", skip_serializing_if = "Option::is_none")]
70    pub missing: Option<Vec<String>>,
71    #[serde(rename = "unexpected", skip_serializing_if = "Option::is_none")]
72    pub unexpected: Option<Vec<String>>,
73}
74
75impl BpmnMappingBlocker {
76    /// One reason a mapping document does not hold for a version pair (#925). `rule` is the discriminant; `rule_number` groups it (1 document well-formedness; 2 no silent drop -- an unmapped, deleted element would drop a token; 3 stable meaning -- kind, message binding and correlation names; 4 injectivity -- no N:1 merge, because a join's `arrived` is a set and would absorb the duplicate; 5 scope coherence; 6 edge images -- each source flow needs a unique counterpart between its mapped endpoints; 7 join coherence -- the only *silent* failure, since `JoinState.expected` is derived once and never refreshed; 8 boundary coherence -- the interruption surface of a running activity must not change under it; 9 vacated identifier reuse -- renaming an id away while the target still defines it points the instance's future `uuid_v5` derivations back onto keys it has already burned, which hangs the activity behind a 365-day park with no incident). The remaining properties are the rule's own, and which are present depends on `rule`.
77    pub fn new(rule: Rule, rule_number: i32, message: String) -> BpmnMappingBlocker {
78        BpmnMappingBlocker {
79            rule,
80            rule_number,
81            message,
82            element_id: None,
83            flow_id: None,
84            message_name: None,
85            identifier: None,
86            renamed_to: None,
87            kind: None,
88            from: None,
89            to: None,
90            target: None,
91            target_flow: None,
92            from_kind: None,
93            to_kind: None,
94            from_message: None,
95            to_message: None,
96            expected_scope: None,
97            actual_scope: None,
98            mapped_source: None,
99            mapped_target: None,
100            sources: None,
101            targets: None,
102            candidates: None,
103            missing: None,
104            unexpected: None,
105        }
106    }
107}
108/// 
109#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
110pub enum Rule {
111    #[serde(rename = "unknown_source")]
112    UnknownSource,
113    #[serde(rename = "unknown_target")]
114    UnknownTarget,
115    #[serde(rename = "duplicate_source")]
116    DuplicateSource,
117    #[serde(rename = "activity_deleted")]
118    ActivityDeleted,
119    #[serde(rename = "mapped_kind_changed")]
120    MappedKindChanged,
121    #[serde(rename = "mapped_message_binding_changed")]
122    MappedMessageBindingChanged,
123    #[serde(rename = "message_name_removed")]
124    MessageNameRemoved,
125    #[serde(rename = "activities_merged")]
126    ActivitiesMerged,
127    #[serde(rename = "sequence_flows_merged")]
128    SequenceFlowsMerged,
129    #[serde(rename = "mapped_scope_incoherent")]
130    MappedScopeIncoherent,
131    #[serde(rename = "sequence_flow_unmapped")]
132    SequenceFlowUnmapped,
133    #[serde(rename = "sequence_flow_ambiguous")]
134    SequenceFlowAmbiguous,
135    #[serde(rename = "mapped_incoming_flows_changed")]
136    MappedIncomingFlowsChanged,
137    #[serde(rename = "boundary_events_changed")]
138    BoundaryEventsChanged,
139    #[serde(rename = "vacated_identifier_reused")]
140    VacatedIdentifierReused,
141}
142
143impl Default for Rule {
144    fn default() -> Rule {
145        Self::UnknownSource
146    }
147}
148