/*
* Orvanta API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.0
* Contact: contact@orvanta.cloud
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BpmnMigrationPlan : A validated, fully-resolved rewrite: every identifier substitution needed to move an instance's persisted state from the source version's vocabulary to the target's. Only entries that actually change are present, so an empty plan with equal process ids is exactly an identity migration. A plan is necessary and **not sufficient**. Three things stand outside it: `ActivityState.external_worker` and `RetryState.max_attempts` are dispatch-time snapshots, frozen by decision; `history[]` records what actually executed under the ids it executed under, immutable by decision; and the eight `uuid_v5` derived key formats that embed element and flow ids are **not yet handled** -- every key of `elements` is an element whose derived child-job ids change, which the engine-side applier must re-key.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnMigrationPlan {
/// the root `Scope.element_id` before the rewrite -- the root scope's element id *is* the `<process id>`, and is the only site carrying it, which is why a process-id rename is unambiguous under a document and is resolved rather than refused
#[serde(rename = "from_process_id")]
pub from_process_id: String,
#[serde(rename = "to_process_id")]
pub to_process_id: String,
/// old element id -> new element id, changed entries only
#[serde(rename = "elements", skip_serializing_if = "Option::is_none")]
pub elements: Option<std::collections::HashMap<String, String>>,
/// old sequence-flow id -> new sequence-flow id, changed entries only. Derived by matching mapped endpoints, never declared.
#[serde(rename = "sequence_flows", skip_serializing_if = "Option::is_none")]
pub sequence_flows: Option<std::collections::HashMap<String, String>>,
}
impl BpmnMigrationPlan {
/// A validated, fully-resolved rewrite: every identifier substitution needed to move an instance's persisted state from the source version's vocabulary to the target's. Only entries that actually change are present, so an empty plan with equal process ids is exactly an identity migration. A plan is necessary and **not sufficient**. Three things stand outside it: `ActivityState.external_worker` and `RetryState.max_attempts` are dispatch-time snapshots, frozen by decision; `history[]` records what actually executed under the ids it executed under, immutable by decision; and the eight `uuid_v5` derived key formats that embed element and flow ids are **not yet handled** -- every key of `elements` is an element whose derived child-job ids change, which the engine-side applier must re-key.
pub fn new(from_process_id: String, to_process_id: String) -> BpmnMigrationPlan {
BpmnMigrationPlan {
from_process_id,
to_process_id,
elements: None,
sequence_flows: None,
}
}
}