pub struct OcpmEventGenerator { /* private fields */ }Expand description
Main OCPM event generator.
Implementations§
Source§impl OcpmEventGenerator
impl OcpmEventGenerator
Sourcepub fn with_config(seed: u64, config: OcpmGeneratorConfig) -> Self
pub fn with_config(seed: u64, config: OcpmGeneratorConfig) -> Self
Create with custom configuration.
Sourcepub fn new_case_id(&mut self) -> Uuid
pub fn new_case_id(&mut self) -> Uuid
Generate a new case ID.
Sourcepub fn select_variant_type(&mut self) -> VariantType
pub fn select_variant_type(&mut self) -> VariantType
Select a process variant type based on configuration.
Sourcepub fn calculate_event_time(
&mut self,
base_time: DateTime<Utc>,
activity: &ActivityType,
) -> DateTime<Utc>
pub fn calculate_event_time( &mut self, base_time: DateTime<Utc>, activity: &ActivityType, ) -> DateTime<Utc>
Calculate event timestamp with variability.
Sourcepub fn create_event(
&mut self,
activity: &ActivityType,
timestamp: DateTime<Utc>,
resource_id: &str,
company_code: &str,
case_id: Uuid,
) -> OcpmEvent
pub fn create_event( &mut self, activity: &ActivityType, timestamp: DateTime<Utc>, resource_id: &str, company_code: &str, case_id: Uuid, ) -> OcpmEvent
Create an event from an activity type.
Sourcepub fn create_object(
&self,
object_type: &ObjectType,
external_id: &str,
company_code: &str,
created_at: DateTime<Utc>,
) -> ObjectInstance
pub fn create_object( &self, object_type: &ObjectType, external_id: &str, company_code: &str, created_at: DateTime<Utc>, ) -> ObjectInstance
Create an object instance for a document.
Sourcepub fn create_object_ref(
&self,
object: &ObjectInstance,
qualifier: ObjectQualifier,
) -> EventObjectRef
pub fn create_object_ref( &self, object: &ObjectInstance, qualifier: ObjectQualifier, ) -> EventObjectRef
Create object reference for an event.
Sourcepub fn add_event_attribute(
event: &mut OcpmEvent,
key: &str,
value: ObjectAttributeValue,
)
pub fn add_event_attribute( event: &mut OcpmEvent, key: &str, value: ObjectAttributeValue, )
Add an attribute to an event.
Sourcepub fn create_case_trace(
&self,
_case_id: Uuid,
events: &[OcpmEvent],
business_process: BusinessProcess,
primary_object_id: Uuid,
primary_object_type: &str,
company_code: &str,
) -> CaseTrace
pub fn create_case_trace( &self, _case_id: Uuid, events: &[OcpmEvent], business_process: BusinessProcess, primary_object_id: Uuid, primary_object_type: &str, company_code: &str, ) -> CaseTrace
Generate a complete case trace from events.
Sourcepub fn select_resource(
&mut self,
activity: &ActivityType,
available_users: &[String],
) -> String
pub fn select_resource( &mut self, activity: &ActivityType, available_users: &[String], ) -> String
Select a resource for an activity.
Sourcepub fn p2p_activities(&self) -> &[ActivityType]
pub fn p2p_activities(&self) -> &[ActivityType]
Get P2P activities.
Sourcepub fn o2c_activities(&self) -> &[ActivityType]
pub fn o2c_activities(&self) -> &[ActivityType]
Get O2C activities.
Sourcepub fn generate_inter_activity_delay(
&mut self,
min_minutes: i64,
max_minutes: i64,
) -> Duration
pub fn generate_inter_activity_delay( &mut self, min_minutes: i64, max_minutes: i64, ) -> Duration
Generate random delay between activities (in minutes).
Sourcepub fn should_skip_activity(&mut self, skip_probability: f64) -> bool
pub fn should_skip_activity(&mut self, skip_probability: f64) -> bool
Check if an activity should be skipped (for exception paths).
Sourcepub fn random_bool(&mut self, probability: f64) -> bool
pub fn random_bool(&mut self, probability: f64) -> bool
Generate a random boolean with given probability.
Source§impl OcpmEventGenerator
impl OcpmEventGenerator
Sourcepub fn generate_o2c_case(
&mut self,
documents: &O2cDocuments,
start_time: DateTime<Utc>,
available_users: &[String],
) -> CaseGenerationResult
pub fn generate_o2c_case( &mut self, documents: &O2cDocuments, start_time: DateTime<Utc>, available_users: &[String], ) -> CaseGenerationResult
Generate complete O2C process events.
Source§impl OcpmEventGenerator
impl OcpmEventGenerator
Sourcepub fn generate_p2p_case(
&mut self,
documents: &P2pDocuments,
start_time: DateTime<Utc>,
available_users: &[String],
) -> CaseGenerationResult
pub fn generate_p2p_case( &mut self, documents: &P2pDocuments, start_time: DateTime<Utc>, available_users: &[String], ) -> CaseGenerationResult
Generate complete P2P process events.
Auto Trait Implementations§
impl Freeze for OcpmEventGenerator
impl RefUnwindSafe for OcpmEventGenerator
impl Send for OcpmEventGenerator
impl Sync for OcpmEventGenerator
impl Unpin for OcpmEventGenerator
impl UnwindSafe for OcpmEventGenerator
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