pub struct CaseTrace {
pub case_id: Uuid,
pub variant_id: Option<String>,
pub business_process: BusinessProcess,
pub start_time: DateTime<Utc>,
pub end_time: Option<DateTime<Utc>>,
pub event_ids: Vec<Uuid>,
pub activity_sequence: Vec<String>,
pub primary_object_id: Uuid,
pub primary_object_type: String,
pub status: CaseStatus,
pub company_code: String,
pub is_anomaly: bool,
}Expand description
Case execution trace linking events to a process instance.
Fields§
§case_id: UuidUnique case ID
variant_id: Option<String>Variant ID (computed after case completion)
business_process: BusinessProcessBusiness process
start_time: DateTime<Utc>Case start time
end_time: Option<DateTime<Utc>>Case end time (if completed)
event_ids: Vec<Uuid>Event IDs in chronological order
activity_sequence: Vec<String>Activity sequence (for variant matching)
primary_object_id: UuidPrimary object ID (the main object being processed)
primary_object_type: StringPrimary object type
status: CaseStatusCase status
company_code: StringCompany code
is_anomaly: boolIs this case marked as anomalous
Implementations§
Source§impl CaseTrace
impl CaseTrace
Sourcepub fn new(
business_process: BusinessProcess,
primary_object_id: Uuid,
primary_object_type: &str,
company_code: &str,
) -> Self
pub fn new( business_process: BusinessProcess, primary_object_id: Uuid, primary_object_type: &str, company_code: &str, ) -> Self
Create a new case trace.
Sourcepub fn add_event(
&mut self,
event_id: Uuid,
activity_id: &str,
timestamp: DateTime<Utc>,
)
pub fn add_event( &mut self, event_id: Uuid, activity_id: &str, timestamp: DateTime<Utc>, )
Add an event to the trace.
Sourcepub fn complete_at(&mut self, end_time: DateTime<Utc>)
pub fn complete_at(&mut self, end_time: DateTime<Utc>)
Complete the case at a specific time.
Sourcepub fn duration_hours(&self) -> Option<f64>
pub fn duration_hours(&self) -> Option<f64>
Get the duration in hours (if completed).
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Check if the case is completed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CaseTrace
impl<'de> Deserialize<'de> for CaseTrace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CaseTrace
impl RefUnwindSafe for CaseTrace
impl Send for CaseTrace
impl Sync for CaseTrace
impl Unpin for CaseTrace
impl UnwindSafe for CaseTrace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more