Skip to main content

ActivityType

Struct ActivityType 

Source
pub struct ActivityType {
    pub activity_id: String,
    pub name: String,
    pub business_process: BusinessProcess,
    pub involved_object_types: Vec<String>,
    pub state_transitions: Vec<ActivityStateTransition>,
    pub allowed_resource_types: Vec<String>,
    pub typical_duration_minutes: Option<f64>,
    pub duration_std_dev: Option<f64>,
    pub is_automated: bool,
    pub creates_object: bool,
    pub completes_object: bool,
}
Expand description

Definition of a business activity in OCPM.

Fields§

§activity_id: String

Unique activity type ID

§name: String

Human-readable name (e.g., “Create Order”, “Post Invoice”)

§business_process: BusinessProcess

Business process this activity belongs to

§involved_object_types: Vec<String>

Object types this activity operates on

§state_transitions: Vec<ActivityStateTransition>

Lifecycle transitions this activity triggers

§allowed_resource_types: Vec<String>

Resource types that can perform this activity

§typical_duration_minutes: Option<f64>

Typical duration in minutes (for simulation)

§duration_std_dev: Option<f64>

Standard deviation of duration

§is_automated: bool

Is this a manual or automated activity

§creates_object: bool

Does this activity create a new object

§completes_object: bool

Does this activity complete/terminate an object

Implementations§

Source§

impl ActivityType

Source

pub fn new( activity_id: &str, name: &str, business_process: BusinessProcess, ) -> Self

Create a new activity type.

Source

pub fn with_object_types(self, types: Vec<&str>) -> Self

Add involved object types.

Source

pub fn with_transitions(self, transitions: Vec<ActivityStateTransition>) -> Self

Add state transitions.

Source

pub fn with_duration(self, minutes: f64, std_dev: f64) -> Self

Set typical duration.

Source

pub fn automated(self) -> Self

Mark as automated.

Source

pub fn creates(self) -> Self

Mark as creating an object.

Source

pub fn completes(self) -> Self

Mark as completing an object.

Source

pub fn create_po() -> Self

Create Purchase Order activity.

Source

pub fn approve_po() -> Self

Approve Purchase Order activity.

Source

pub fn release_po() -> Self

Release Purchase Order activity.

Source

pub fn create_gr() -> Self

Create Goods Receipt activity.

Source

pub fn post_gr() -> Self

Post Goods Receipt activity.

Source

pub fn receive_invoice() -> Self

Receive Invoice activity.

Source

pub fn verify_invoice() -> Self

Verify Invoice (three-way match) activity.

Source

pub fn post_invoice() -> Self

Post Invoice activity.

Source

pub fn execute_payment() -> Self

Execute Payment activity.

Source

pub fn create_so() -> Self

Create Sales Order activity.

Source

pub fn check_credit() -> Self

Check Credit activity.

Source

pub fn release_so() -> Self

Release Sales Order activity.

Source

pub fn create_delivery() -> Self

Create Delivery activity.

Source

pub fn pick() -> Self

Pick activity.

Source

pub fn pack() -> Self

Pack activity.

Source

pub fn ship() -> Self

Ship activity.

Source

pub fn create_customer_invoice() -> Self

Create Customer Invoice activity.

Source

pub fn post_customer_invoice() -> Self

Post Customer Invoice activity.

Source

pub fn receive_payment() -> Self

Receive Payment activity.

Source

pub fn p2p_activities() -> Vec<Self>

Get all standard P2P activities.

Source

pub fn o2c_activities() -> Vec<Self>

Get all standard O2C activities.

Trait Implementations§

Source§

impl Clone for ActivityType

Source§

fn clone(&self) -> ActivityType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActivityType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ActivityType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ActivityType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,