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: 4.1.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
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 /// The Orvanta app `form_key` resolved to at deploy time (#1274, #705 phase 4), via a `bpmn_form_binding` row somebody wrote. Absent is the ordinary case and is not a failure: the task falls back to `form_fields`, exactly as every `formKey` task did before the binding table existed, and the deploy said so with a warning naming the element and the key. Rendered exactly like `form_ref`, which wins when a task somehow carries both -- `orvanta:formRef` is what this model's author wrote, a binding is a workspace-wide rule about a foreign key. Reported, not dereferenced: whether the app exists and whether the caller may open it is decided by the app routes.
75 #[serde(rename = "resolved_form_ref", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
76 pub resolved_form_ref: Option<Option<String>>,
77 /// `orvanta:formRef` (#718) -- the path of an app in this workspace rendered as the task's form, in place of `form_fields`. Reported, not dereferenced: whether the app exists and whether the caller may run it is decided by the app routes.
78 #[serde(rename = "form_ref", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
79 pub form_ref: Option<Option<String>>,
80 #[serde(rename = "form_fields", skip_serializing_if = "Option::is_none")]
81 pub form_fields: Option<Vec<models::BpmnUserTaskFormField>>,
82 /// the model set `flowable:formFieldValidation=\"false\"`, so the server will not validate the payload
83 #[serde(rename = "form_validation_disabled", skip_serializing_if = "Option::is_none")]
84 pub form_validation_disabled: Option<bool>,
85}
86
87impl PendingUserTask {
88 /// 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.
89 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 {
90 PendingUserTask {
91 instance_id,
92 workspace_id,
93 element_id,
94 token_id,
95 name: None,
96 bpmn_flow_path: None,
97 bpmn_version: None,
98 instance_created_at,
99 instance_created_by,
100 parked_at: None,
101 assignee: None,
102 owner: None,
103 candidate_users: None,
104 candidate_groups: None,
105 assignment_unresolved: None,
106 unresolved_assignments: None,
107 identity_resolved_at: None,
108 claimed_by: None,
109 claimed_at: None,
110 due_date: None,
111 priority: None,
112 form_key: None,
113 resolved_form_ref: None,
114 form_ref: None,
115 form_fields: None,
116 form_validation_disabled: None,
117 }
118 }
119}
120