pub struct Workflow { /* private fields */ }

Implementations§

source§

impl Workflow

source

pub fn new<S: BnStrCompatible>(name: S) -> Self

Create a new unregistered Workflow with no activities.

To get a copy of an existing registered Workflow use Workflow::new_from_copy.

source

pub fn new_from_copy<S: BnStrCompatible + Clone>(name: S) -> Workflow

Make a new unregistered Workflow, copying all activities and the execution strategy.

source

pub fn new_from_copy_with_root<S: BnStrCompatible + Clone, A: IntoActivityName>( name: S, root_activity: A ) -> Workflow

Make a new unregistered Workflow, copying all activities, within root_activity, and the execution strategy.

  • name - the name for the new Workflow
  • root_activity - perform the clone operation with this activity as the root
source

pub fn instance<S: BnStrCompatible>(name: S) -> Workflow

source

pub fn list() -> Array<Workflow>

List of all registered Workflow’s

source

pub fn name(&self) -> BnString

source

pub fn register(&self) -> Result<(), ()>

Register this Workflow, making it immutable and available for use.

source

pub fn register_with_config<S: BnStrCompatible>( &self, config: S ) -> Result<(), ()>

Register this Workflow, making it immutable and available for use.

  • configuration - a JSON representation of the workflow configuration
source

pub fn register_activity(&self, activity: &Activity) -> Result<Activity, ()>

Register an Activity with this Workflow.

source

pub fn register_activity_with_subactivities<I>( &self, activity: &Activity, subactivities: I ) -> Result<Activity, ()>

Register an Activity with this Workflow.

  • activity - the Activity to register
  • subactivities - the list of Activities to assign
source

pub fn contains<A: IntoActivityName>(&self, activity: A) -> bool

Determine if an Activity exists in this Workflow.

source

pub fn configuration<A: IntoActivityName>(&self, activity: A) -> BnString

Retrieve the configuration as an adjacency list in JSON for the Workflow, or if specified just for the given activity.

activity - if specified, return the configuration for the activity

source

pub fn registered(&self) -> bool

Whether this Workflow is registered or not. A Workflow becomes immutable once registered.

source

pub fn size(&self) -> usize

source

pub fn activity<A: BnStrCompatible>(&self, name: A) -> Option<Activity>

Retrieve the Activity object for the specified name.

source

pub fn activity_roots<A: IntoActivityName>( &self, activity: A ) -> Array<BnString>

Retrieve the list of activity roots for the Workflow, or if specified just for the given activity.

  • activity - if specified, return the roots for the activity
source

pub fn subactivities<A: IntoActivityName>( &self, activity: A, immediate: bool ) -> Array<BnString>

Retrieve the list of all activities, or optionally a filtered list.

  • activity - if specified, return the direct children and optionally the descendants of the activity (includes activity)
  • immediate - whether to include only direct children of activity or all descendants
source

pub fn assign_subactivities<A, I>(&self, activity: A, activities: I) -> bool

Assign the list of activities as the new set of children for the specified activity.

  • activity - the Activity node to assign children
  • activities - the list of Activities to assign
source

pub fn clear(&self) -> bool

Remove all Activity nodes from this Workflow.

source

pub fn insert<A, I>(&self, activity: A, activities: I) -> bool

Insert the list of activities before the specified activity and at the same level.

  • activity - the Activity node for which to insert activities before
  • activities - the list of Activities to insert
source

pub fn remove<A: IntoActivityName>(&self, activity: A) -> bool

Remove the specified activity

source

pub fn replace<A: IntoActivityName, N: IntoActivityName>( &self, activity: A, new_activity: N ) -> bool

Replace the specified activity.

  • activity - the Activity to replace
  • new_activity - the replacement Activity
source

pub fn graph<A: IntoActivityName>( &self, activity: A, sequential: Option<bool> ) -> Option<FlowGraph>

Generate a FlowGraph object for the current Workflow and optionally show it in the UI.

  • activity - if specified, generate the Flowgraph using activity as the root
  • sequential - whether to generate a Composite or Sequential style graph
source

pub fn show_metrics(&self)

Not yet implemented.

source

pub fn show_topology(&self)

Show the Workflow topology in the UI.

source

pub fn show_trace(&self)

Not yet implemented.

Trait Implementations§

source§

impl CoreArrayProvider for Workflow

§

type Raw = *mut BNWorkflow

§

type Context = ()

§

type Wrapped<'a> = Guard<'a, Workflow>

source§

impl ToOwned for Workflow

§

type Owned = Ref<Workflow>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

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

§

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>,

§

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.