Skip to main content

orvanta_api/models/
pending_user_task.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/// PendingUserTask : One `<userTask>` parked awaiting a human, with the process context needed to act on it (#1104). Every field is read off the persisted process status, the compiled user-task model, or the `human_task_claim` ledger added by #1123. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PendingUserTask {
17    /// the process instance -- the `id` path segment of the completion operation
18    #[serde(rename = "instance_id")]
19    pub instance_id: uuid::Uuid,
20    #[serde(rename = "workspace_id")]
21    pub workspace_id: String,
22    /// the `<userTask>` element id -- the `user_task_id` path segment of the completion operation
23    #[serde(rename = "element_id")]
24    pub element_id: String,
25    /// The parked token -- the park itself, and what a claim is taken on (#1123). A multi-instance or parallel-branch task parks several tokens at one element, each with its own resolved identity and its own claim, so `(instance_id, element_id)` does not identify one of them. Pass this as `token_id` to the claim and release operations when an element holds more than one park. 
26    #[serde(rename = "token_id")]
27    pub token_id: uuid::Uuid,
28    /// `<userTask name=\"...\">`, the label an author wrote for a human
29    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub name: Option<Option<String>>,
31    #[serde(rename = "bpmn_flow_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub bpmn_flow_path: Option<Option<String>>,
33    #[serde(rename = "bpmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub bpmn_version: Option<Option<i64>>,
35    #[serde(rename = "instance_created_at")]
36    pub instance_created_at: String,
37    #[serde(rename = "instance_created_by")]
38    pub instance_created_by: String,
39    /// When the token arrived at this element, from the engine's own bounded history. Null for a park older than the retained history. 
40    #[serde(rename = "parked_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub parked_at: Option<Option<String>>,
42    /// `flowable:assignee` / `<humanPerformer>` -- the name the engine resolved at park time when the assignment was written as an expression, the declared literal otherwise (#1123). 
43    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub assignee: Option<Option<String>>,
45    /// `flowable:owner`, same rule as `assignee`
46    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub owner: Option<Option<String>>,
48    #[serde(rename = "candidate_users", skip_serializing_if = "Option::is_none")]
49    pub candidate_users: Option<Vec<String>>,
50    #[serde(rename = "candidate_groups", skip_serializing_if = "Option::is_none")]
51    pub candidate_groups: Option<Vec<String>>,
52    /// The task declares an assignment that could **not** be turned into a name -- an expression the engine's park-time resolution refused, or a task whose token parked before #1123 shipped. The task is still listed (hiding it would make it unreachable, which is the defect #1104 is about) but a client must not present it as unassigned.  An expression the engine *did* resolve is not flagged: the identity fields above carry the answer. 
53    #[serde(rename = "assignment_unresolved", skip_serializing_if = "Option::is_none")]
54    pub assignment_unresolved: Option<bool>,
55    /// Each refused expression with the reason it could not be read, so a client can say *why* rather than only *that*. Empty when there is nothing to refuse, and for a token parked before #1123 shipped (which carries no resolution record at all). 
56    #[serde(rename = "unresolved_assignments", skip_serializing_if = "Option::is_none")]
57    pub unresolved_assignments: Option<Vec<models::BpmnUnresolvedAssignment>>,
58    /// When the engine decided this task's identity. Present exactly when a park-time resolution record exists; absent means the identity was read from the static model, which for a literal assignment is the same answer arrived at a different way. 
59    #[serde(rename = "identity_resolved_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
60    pub identity_resolved_at: Option<Option<String>>,
61    /// Who has taken responsibility for this park (#1123). Absent means unclaimed, which is the ordinary state -- claiming is optional and an unclaimed task is completable by anyone in its audience. A claimed task is still listed for everyone in its audience, so they can see it is taken; only its holder and admins may complete it. 
62    #[serde(rename = "claimed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63    pub claimed_by: Option<Option<String>>,
64    #[serde(rename = "claimed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
65    pub claimed_at: Option<Option<String>>,
66    /// presentational only -- nothing schedules on it
67    #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68    pub due_date: Option<Option<String>>,
69    #[serde(rename = "priority", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
70    pub priority: Option<Option<String>>,
71    /// `flowable:formKey` -- the key exactly as the model wrote it, always reported so a client can name the external form whether or not it resolved. Before 6.0.0 a resolved key (via a `bpmn_form_binding` row) or `orvanta:formRef` could each name an Orvanta app to render in place of `form_fields`, surfaced as `resolved_form_ref` / `form_ref`. Apps were removed (#1720) and both fields with them (#1759): a key now only ever falls back to `form_fields`. 
72    #[serde(rename = "form_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
73    pub form_key: Option<Option<String>>,
74    #[serde(rename = "form_fields", skip_serializing_if = "Option::is_none")]
75    pub form_fields: Option<Vec<models::BpmnUserTaskFormField>>,
76    /// the model set `flowable:formFieldValidation=\"false\"`, so the server will not validate the payload
77    #[serde(rename = "form_validation_disabled", skip_serializing_if = "Option::is_none")]
78    pub form_validation_disabled: Option<bool>,
79}
80
81impl PendingUserTask {
82    /// One `<userTask>` parked awaiting a human, with the process context needed to act on it (#1104). Every field is read off the persisted process status, the compiled user-task model, or the `human_task_claim` ledger added by #1123. 
83    pub fn new(instance_id: uuid::Uuid, workspace_id: String, element_id: String, token_id: uuid::Uuid, instance_created_at: String, instance_created_by: String) -> PendingUserTask {
84        PendingUserTask {
85            instance_id,
86            workspace_id,
87            element_id,
88            token_id,
89            name: None,
90            bpmn_flow_path: None,
91            bpmn_version: None,
92            instance_created_at,
93            instance_created_by,
94            parked_at: None,
95            assignee: None,
96            owner: None,
97            candidate_users: None,
98            candidate_groups: None,
99            assignment_unresolved: None,
100            unresolved_assignments: None,
101            identity_resolved_at: None,
102            claimed_by: None,
103            claimed_at: None,
104            due_date: None,
105            priority: None,
106            form_key: None,
107            form_fields: None,
108            form_validation_disabled: None,
109        }
110    }
111}
112