pub struct Workflow { /* private fields */ }
Implementations§
source§impl Workflow
impl Workflow
sourcepub fn new<S: BnStrCompatible>(name: S) -> Ref<Self>
pub fn new<S: BnStrCompatible>(name: S) -> Ref<Self>
Create a new unregistered Workflow with no activities.
To get a copy of an existing registered Workflow use Workflow::clone_to.
sourcepub fn clone_to_with_root<S: BnStrCompatible, A: BnStrCompatible>(
&self,
name: S,
root_activity: A,
) -> Ref<Workflow>
pub fn clone_to_with_root<S: BnStrCompatible, A: BnStrCompatible>( &self, name: S, root_activity: A, ) -> Ref<Workflow>
pub fn instance<S: BnStrCompatible>(name: S) -> Ref<Workflow>
pub fn name(&self) -> BnString
sourcepub fn register(&self) -> Result<(), ()>
pub fn register(&self) -> Result<(), ()>
Register this Workflow, making it immutable and available for use.
sourcepub fn register_with_config<S: BnStrCompatible>(
&self,
config: S,
) -> Result<(), ()>
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
sourcepub fn register_activity_with_subactivities<I>(
&self,
activity: &Activity,
subactivities: I,
) -> Result<Ref<Activity>, ()>
pub fn register_activity_with_subactivities<I>( &self, activity: &Activity, subactivities: I, ) -> Result<Ref<Activity>, ()>
sourcepub fn contains<A: BnStrCompatible>(&self, activity: A) -> bool
pub fn contains<A: BnStrCompatible>(&self, activity: A) -> bool
Determine if an Activity exists in this Workflow.
sourcepub fn configuration(&self) -> BnString
pub fn configuration(&self) -> BnString
Retrieve the configuration as an adjacency list in JSON for the Workflow.
sourcepub fn configuration_with_activity<A: BnStrCompatible>(
&self,
activity: A,
) -> BnString
pub fn configuration_with_activity<A: BnStrCompatible>( &self, activity: A, ) -> BnString
Retrieve the configuration as an adjacency list in JSON for the
Workflow, just for the given activity
.
activity
- return the configuration for the activity
sourcepub fn registered(&self) -> bool
pub fn registered(&self) -> bool
pub fn size(&self) -> usize
sourcepub fn activity<A: BnStrCompatible>(&self, name: A) -> Option<Ref<Activity>>
pub fn activity<A: BnStrCompatible>(&self, name: A) -> Option<Ref<Activity>>
Retrieve the Activity object for the specified name
.
sourcepub fn activity_roots<A: BnStrCompatible>(&self, activity: A) -> Array<BnString>
pub fn activity_roots<A: BnStrCompatible>(&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 theactivity
sourcepub fn subactivities<A: BnStrCompatible>(
&self,
activity: A,
immediate: bool,
) -> Array<BnString>
pub fn subactivities<A: BnStrCompatible>( &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 theactivity
(includesactivity
)immediate
- whether to include only direct children ofactivity
or all descendants
sourcepub fn assign_subactivities<A, I>(&self, activity: A, activities: I) -> bool
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 childrenactivities
- the list of Activities to assign
sourcepub fn insert<A, I>(&self, activity: A, activities: I) -> bool
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 insertactivities
beforeactivities
- the list of Activities to insert
sourcepub fn insert_after<A, I>(&self, activity: A, activities: I) -> bool
pub fn insert_after<A, I>(&self, activity: A, activities: I) -> bool
Insert the list of activities
after the specified activity
and at the same level.
activity
- the Activity node for which to insertactivities
afteractivities
- the list of Activities to insert
sourcepub fn remove<A: BnStrCompatible>(&self, activity: A) -> bool
pub fn remove<A: BnStrCompatible>(&self, activity: A) -> bool
Remove the specified activity
sourcepub fn replace<A: BnStrCompatible, N: BnStrCompatible>(
&self,
activity: A,
new_activity: N,
) -> bool
pub fn replace<A: BnStrCompatible, N: BnStrCompatible>( &self, activity: A, new_activity: N, ) -> bool
Replace the specified activity
.
activity
- the Activity to replacenew_activity
- the replacement Activity
sourcepub fn graph<A: BnStrCompatible>(
&self,
activity: A,
sequential: Option<bool>,
) -> Option<Ref<FlowGraph>>
pub fn graph<A: BnStrCompatible>( &self, activity: A, sequential: Option<bool>, ) -> Option<Ref<FlowGraph>>
Generate a FlowGraph object for the current Workflow and optionally show it in the UI.
activity
- if specified, generate the Flowgraph usingactivity
as the rootsequential
- whether to generate a Composite or Sequential style graph
sourcepub fn show_metrics(&self)
pub fn show_metrics(&self)
Not yet implemented.
sourcepub fn show_topology(&self)
pub fn show_topology(&self)
Show the Workflow topology in the UI.
sourcepub fn show_trace(&self)
pub fn show_trace(&self)
Not yet implemented.