pub struct Workflow { /* private fields */ }
Implementations§
source§impl Workflow
impl Workflow
sourcepub fn new(name: &str) -> Ref<Self>
pub fn new(name: &str) -> Ref<Self>
Create a new unregistered Workflow with no activities.
To get a copy of an existing registered Workflow use Workflow::clone_to.
pub fn instance(name: &str) -> Ref<Workflow>
pub fn name(&self) -> String
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(&self, config: &str) -> Result<(), ()>
pub fn register_with_config(&self, config: &str) -> 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(&self, activity: &str) -> bool
pub fn contains(&self, activity: &str) -> bool
Determine if an Activity exists in this Workflow.
sourcepub fn configuration(&self) -> String
pub fn configuration(&self) -> String
Retrieve the configuration as an adjacency list in JSON for the Workflow.
sourcepub fn configuration_with_activity(&self, activity: &str) -> String
pub fn configuration_with_activity(&self, activity: &str) -> String
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(&self, name: &str) -> Option<Ref<Activity>>
pub fn activity(&self, name: &str) -> Option<Ref<Activity>>
Retrieve the Activity object for the specified name
.
sourcepub fn activity_roots(&self, activity: &str) -> Array<BnString>
pub fn activity_roots(&self, activity: &str) -> 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(&self, activity: &str, immediate: bool) -> Array<BnString>
pub fn subactivities(&self, activity: &str, 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<I>(&self, activity: &str, activities: I) -> bool
pub fn assign_subactivities<I>(&self, activity: &str, 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<I>(&self, activity: &str, activities: I) -> bool
pub fn insert<I>(&self, activity: &str, 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<I>(&self, activity: &str, activities: I) -> bool
pub fn insert_after<I>(&self, activity: &str, 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 replace(&self, activity: &str, new_activity: &str) -> bool
pub fn replace(&self, activity: &str, new_activity: &str) -> bool
Replace the specified activity
.
activity
- the Activity to replacenew_activity
- the replacement Activity
sourcepub fn graph(
&self,
activity: &str,
sequential: Option<bool>,
) -> Option<Ref<FlowGraph>>
pub fn graph( &self, activity: &str, 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.