Skip to main content

OcpmEventGenerator

Struct OcpmEventGenerator 

Source
pub struct OcpmEventGenerator { /* private fields */ }
Expand description

Main OCPM event generator.

Implementations§

Source§

impl OcpmEventGenerator

Source

pub fn new(seed: u64) -> Self

Create a new OCPM event generator with a seed.

Source

pub fn with_config(seed: u64, config: OcpmGeneratorConfig) -> Self

Create with custom configuration.

Source

pub fn new_case_id(&mut self) -> Uuid

Generate a new case ID.

Source

pub fn select_variant_type(&mut self) -> VariantType

Select a process variant type based on configuration.

Source

pub fn calculate_event_time( &mut self, base_time: DateTime<Utc>, activity: &ActivityType, ) -> DateTime<Utc>

Calculate event timestamp with variability.

Source

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.

Source

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.

Source

pub fn create_object_ref( &self, object: &ObjectInstance, qualifier: ObjectQualifier, ) -> EventObjectRef

Create object reference for an event.

Source

pub fn add_event_attribute( event: &mut OcpmEvent, key: &str, value: ObjectAttributeValue, )

Add an attribute to an event.

Source

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.

Source

pub fn select_resource( &mut self, activity: &ActivityType, available_users: &[String], ) -> String

Select a resource for an activity.

Source

pub fn p2p_activities(&self) -> &[ActivityType]

Get P2P activities.

Source

pub fn o2c_activities(&self) -> &[ActivityType]

Get O2C activities.

Source

pub fn generate_inter_activity_delay( &mut self, min_minutes: i64, max_minutes: i64, ) -> Duration

Generate random delay between activities (in minutes).

Source

pub fn should_skip_activity(&mut self, skip_probability: f64) -> bool

Check if an activity should be skipped (for exception paths).

Source

pub fn random_bool(&mut self, probability: f64) -> bool

Generate a random boolean with given probability.

Source§

impl OcpmEventGenerator

Source

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

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V