Skip to content

cloacina-python::workflow_context

Rust

Binding

Python API: cloaca.WorkflowContext

WorkflowContext provides namespace management for Python workflows

Name Type Description
tenant_id String
package_name String
workflow_id String
fn new(tenant_id: &str, package_name: &str, workflow_id: &str) -> Self

Python API: cloaca.WorkflowContext.new

Create a new WorkflowContext

Source
pub fn new(tenant_id: &str, package_name: &str, workflow_id: &str) -> Self {
Self {
tenant_id: tenant_id.to_string(),
package_name: package_name.to_string(),
workflow_id: workflow_id.to_string(),
}
}
fn tenant_id(&self) -> &str

Python API: cloaca.WorkflowContext.tenant_id

Get tenant ID

Source
pub fn tenant_id(&self) -> &str {
&self.tenant_id
}
fn package_name(&self) -> &str

Python API: cloaca.WorkflowContext.package_name

Get package name

Source
pub fn package_name(&self) -> &str {
&self.package_name
}
fn workflow_id(&self) -> &str

Python API: cloaca.WorkflowContext.workflow_id

Get workflow ID

Source
pub fn workflow_id(&self) -> &str {
&self.workflow_id
}
fn task_namespace(&self, task_id: &str) -> PyTaskNamespace

Python API: cloaca.WorkflowContext.task_namespace

Generate a TaskNamespace for a task within this workflow context

Source
pub fn task_namespace(&self, task_id: &str) -> PyTaskNamespace {
PyTaskNamespace::from_rust(cloacina::TaskNamespace::new(
&self.tenant_id,
&self.package_name,
&self.workflow_id,
task_id,
))
}
fn resolve_dependency(&self, task_name: &str) -> PyTaskNamespace

Python API: cloaca.WorkflowContext.resolve_dependency

Resolve a dependency task name to a full TaskNamespace within this context

Source
pub fn resolve_dependency(&self, task_name: &str) -> PyTaskNamespace {
self.task_namespace(task_name)
}
fn workflow_namespace(&self) -> PyTaskNamespace

Python API: cloaca.WorkflowContext.workflow_namespace

Get the workflow namespace (without task_id)

Source
pub fn workflow_namespace(&self) -> PyTaskNamespace {
PyTaskNamespace::from_rust(cloacina::TaskNamespace::new(
&self.tenant_id,
&self.package_name,
&self.workflow_id,
"",
))
}
fn contains_namespace(&self, namespace: &PyTaskNamespace) -> bool

Python API: cloaca.WorkflowContext.contains_namespace

Check if a namespace belongs to this workflow context

Source
pub fn contains_namespace(&self, namespace: &PyTaskNamespace) -> bool {
namespace.tenant_id() == self.tenant_id
&& namespace.package_name() == self.package_name
&& namespace.workflow_id() == self.workflow_id
}
fn __str__(&self) -> String

Python API: cloaca.WorkflowContext.__str__

String representation

Source
pub fn __str__(&self) -> String {
format!(
"{}::{}::{}",
self.tenant_id, self.package_name, self.workflow_id
)
}
fn __repr__(&self) -> String

Python API: cloaca.WorkflowContext.__repr__

String representation

Source
pub fn __repr__(&self) -> String {
format!(
"WorkflowContext('{}', '{}', '{}')",
self.tenant_id, self.package_name, self.workflow_id
)
}
fn __eq__(&self, other: &PyWorkflowContext) -> bool

Python API: cloaca.WorkflowContext.__eq__

Equality comparison

Source
pub fn __eq__(&self, other: &PyWorkflowContext) -> bool {
self.tenant_id == other.tenant_id
&& self.package_name == other.package_name
&& self.workflow_id == other.workflow_id
}

pub

fn default() -> Self

Get the default workflow context (for backward compatibility)

Source
pub fn default() -> Self {
Self {
tenant_id: "public".to_string(),
package_name: "embedded".to_string(),
workflow_id: "default".to_string(),
}
}

pub

fn as_components(&self) -> (&str, &str, &str)

Convert to namespace components

Source
pub fn as_components(&self) -> (&str, &str, &str) {
(&self.tenant_id, &self.package_name, &self.workflow_id)
}