Skip to main content

orvanta_api/models/
cmmn_case_instance.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.5.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CmmnCaseInstance : The pure engine's own state, embedded verbatim in `CmmnCaseStatus`. Owned by `orvanta-cmmn`, which depends on no I/O --- a change to this shape is a change in that crate.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CmmnCaseInstance {
17    /// The `<case id>` the deployed document declares.
18    #[serde(rename = "case_id")]
19    pub case_id: String,
20    #[serde(rename = "state")]
21    pub state: models::CmmnCaseState,
22    #[serde(rename = "instances")]
23    pub instances: Vec<models::CmmnPlanItemInstance>,
24    /// Case variables. Arbitrary JSON by definition.
25    #[serde(rename = "variables")]
26    pub variables: std::collections::HashMap<String, serde_json::Value>,
27    #[serde(rename = "history")]
28    pub history: Vec<models::CmmnTraceEvent>,
29    /// Case-level `completable`, feeding `${cmmn:isStageCompletable()}` at the case plan model.
30    #[serde(rename = "completable")]
31    pub completable: bool,
32    /// Criterion latches for the case plan model's own exit criteria, keyed by criterion id.
33    #[serde(rename = "satisfied_on_parts")]
34    pub satisfied_on_parts: std::collections::HashMap<String, Vec<String>>,
35    #[serde(rename = "satisfied_if_parts")]
36    pub satisfied_if_parts: Vec<String>,
37}
38
39impl CmmnCaseInstance {
40    /// The pure engine's own state, embedded verbatim in `CmmnCaseStatus`. Owned by `orvanta-cmmn`, which depends on no I/O --- a change to this shape is a change in that crate.
41    pub fn new(case_id: String, state: models::CmmnCaseState, instances: Vec<models::CmmnPlanItemInstance>, variables: std::collections::HashMap<String, serde_json::Value>, history: Vec<models::CmmnTraceEvent>, completable: bool, satisfied_on_parts: std::collections::HashMap<String, Vec<String>>, satisfied_if_parts: Vec<String>) -> CmmnCaseInstance {
42        CmmnCaseInstance {
43            case_id,
44            state,
45            instances,
46            variables,
47            history,
48            completable,
49            satisfied_on_parts,
50            satisfied_if_parts,
51        }
52    }
53}
54