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: 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/// 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 or the compiled user-task model -- there is no claim ledger and no `claimed_by`, because the engine records no such thing. 
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    /// `<userTask name=\"...\">`, the label an author wrote for a human
26    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub name: Option<Option<String>>,
28    #[serde(rename = "bpmn_flow_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub bpmn_flow_path: Option<Option<String>>,
30    #[serde(rename = "bpmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub bpmn_version: Option<Option<i64>>,
32    #[serde(rename = "instance_created_at")]
33    pub instance_created_at: String,
34    #[serde(rename = "instance_created_by")]
35    pub instance_created_by: String,
36    /// When the token arrived at this element, from the engine's own bounded history. Null for a park older than the retained history. 
37    #[serde(rename = "parked_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub parked_at: Option<Option<String>>,
39    /// `flowable:assignee` / `<humanPerformer>`, when written as a literal
40    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub assignee: Option<Option<String>>,
42    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub owner: Option<Option<String>>,
44    #[serde(rename = "candidate_users", skip_serializing_if = "Option::is_none")]
45    pub candidate_users: Option<Vec<String>>,
46    #[serde(rename = "candidate_groups", skip_serializing_if = "Option::is_none")]
47    pub candidate_groups: Option<Vec<String>>,
48    /// The task declares an assignment written as an expression, which this path cannot evaluate. 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. 
49    #[serde(rename = "assignment_unresolved", skip_serializing_if = "Option::is_none")]
50    pub assignment_unresolved: Option<bool>,
51    /// presentational only -- nothing schedules on it
52    #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub due_date: Option<Option<String>>,
54    #[serde(rename = "priority", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
55    pub priority: Option<Option<String>>,
56    /// `flowable:formKey`, reported but never resolved (#705 phase 4)
57    #[serde(rename = "form_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
58    pub form_key: Option<Option<String>>,
59    #[serde(rename = "form_fields", skip_serializing_if = "Option::is_none")]
60    pub form_fields: Option<Vec<models::BpmnUserTaskFormField>>,
61    /// the model set `flowable:formFieldValidation=\"false\"`, so the server will not validate the payload
62    #[serde(rename = "form_validation_disabled", skip_serializing_if = "Option::is_none")]
63    pub form_validation_disabled: Option<bool>,
64}
65
66impl PendingUserTask {
67    /// 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 or the compiled user-task model -- there is no claim ledger and no `claimed_by`, because the engine records no such thing. 
68    pub fn new(instance_id: uuid::Uuid, workspace_id: String, element_id: String, instance_created_at: String, instance_created_by: String) -> PendingUserTask {
69        PendingUserTask {
70            instance_id,
71            workspace_id,
72            element_id,
73            name: None,
74            bpmn_flow_path: None,
75            bpmn_version: None,
76            instance_created_at,
77            instance_created_by,
78            parked_at: None,
79            assignee: None,
80            owner: None,
81            candidate_users: None,
82            candidate_groups: None,
83            assignment_unresolved: None,
84            due_date: None,
85            priority: None,
86            form_key: None,
87            form_fields: None,
88            form_validation_disabled: None,
89        }
90    }
91}
92