/*
* Orvanta API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.2.0
* Contact: contact@orvanta.cloud
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// 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). The remaining properties are the rule's own, and which are present depends on `rule`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnMappingBlocker {
#[serde(rename = "rule")]
pub rule: Rule,
#[serde(rename = "rule_number")]
pub rule_number: i32,
/// the rendered sentence, safe to show an operator as-is
#[serde(rename = "message")]
pub message: String,
#[serde(rename = "element_id", skip_serializing_if = "Option::is_none")]
pub element_id: Option<String>,
#[serde(rename = "flow_id", skip_serializing_if = "Option::is_none")]
pub flow_id: Option<String>,
#[serde(rename = "message_name", skip_serializing_if = "Option::is_none")]
pub message_name: Option<String>,
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "from", skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(rename = "to", skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(rename = "target", skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
#[serde(rename = "target_flow", skip_serializing_if = "Option::is_none")]
pub target_flow: Option<String>,
#[serde(rename = "from_kind", skip_serializing_if = "Option::is_none")]
pub from_kind: Option<String>,
#[serde(rename = "to_kind", skip_serializing_if = "Option::is_none")]
pub to_kind: Option<String>,
#[serde(rename = "from_message", skip_serializing_if = "Option::is_none")]
pub from_message: Option<String>,
#[serde(rename = "to_message", skip_serializing_if = "Option::is_none")]
pub to_message: Option<String>,
#[serde(rename = "expected_scope", skip_serializing_if = "Option::is_none")]
pub expected_scope: Option<String>,
#[serde(rename = "actual_scope", skip_serializing_if = "Option::is_none")]
pub actual_scope: Option<String>,
#[serde(rename = "mapped_source", skip_serializing_if = "Option::is_none")]
pub mapped_source: Option<String>,
#[serde(rename = "mapped_target", skip_serializing_if = "Option::is_none")]
pub mapped_target: Option<String>,
#[serde(rename = "sources", skip_serializing_if = "Option::is_none")]
pub sources: Option<Vec<String>>,
#[serde(rename = "targets", skip_serializing_if = "Option::is_none")]
pub targets: Option<Vec<String>>,
#[serde(rename = "candidates", skip_serializing_if = "Option::is_none")]
pub candidates: Option<Vec<String>>,
#[serde(rename = "missing", skip_serializing_if = "Option::is_none")]
pub missing: Option<Vec<String>>,
#[serde(rename = "unexpected", skip_serializing_if = "Option::is_none")]
pub unexpected: Option<Vec<String>>,
}
impl 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). The remaining properties are the rule's own, and which are present depends on `rule`.
pub fn new(rule: Rule, rule_number: i32, message: String) -> BpmnMappingBlocker {
BpmnMappingBlocker {
rule,
rule_number,
message,
element_id: None,
flow_id: None,
message_name: None,
kind: None,
from: None,
to: None,
target: None,
target_flow: None,
from_kind: None,
to_kind: None,
from_message: None,
to_message: None,
expected_scope: None,
actual_scope: None,
mapped_source: None,
mapped_target: None,
sources: None,
targets: None,
candidates: None,
missing: None,
unexpected: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Rule {
#[serde(rename = "unknown_source")]
UnknownSource,
#[serde(rename = "unknown_target")]
UnknownTarget,
#[serde(rename = "duplicate_source")]
DuplicateSource,
#[serde(rename = "activity_deleted")]
ActivityDeleted,
#[serde(rename = "mapped_kind_changed")]
MappedKindChanged,
#[serde(rename = "mapped_message_binding_changed")]
MappedMessageBindingChanged,
#[serde(rename = "message_name_removed")]
MessageNameRemoved,
#[serde(rename = "activities_merged")]
ActivitiesMerged,
#[serde(rename = "sequence_flows_merged")]
SequenceFlowsMerged,
#[serde(rename = "mapped_scope_incoherent")]
MappedScopeIncoherent,
#[serde(rename = "sequence_flow_unmapped")]
SequenceFlowUnmapped,
#[serde(rename = "sequence_flow_ambiguous")]
SequenceFlowAmbiguous,
#[serde(rename = "mapped_incoming_flows_changed")]
MappedIncomingFlowsChanged,
#[serde(rename = "boundary_events_changed")]
BoundaryEventsChanged,
}
impl Default for Rule {
fn default() -> Rule {
Self::UnknownSource
}
}