Skip to main content
Cloacina Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Workflow Context

cloacina::python::workflow_context Rust

Structs

cloacina::python::workflow_context::WorkflowContext

Binding

Python API: cloaca.python.workflow_context.WorkflowContext

WorkflowContext provides namespace management for Python workflows

Fields

Name Type Description
tenant_id String
package_name String
workflow_id String

Methods

new
fn new (tenant_id : & str , package_name : & str , workflow_id : & str) -> Self

Python API: cloaca.python.workflow_context.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(),
        }
    }
tenant_id
fn tenant_id (& self) -> & str

Python API: cloaca.python.workflow_context.WorkflowContext.tenant_id

Get tenant ID

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

Python API: cloaca.python.workflow_context.WorkflowContext.package_name

Get package name

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

Python API: cloaca.python.workflow_context.WorkflowContext.workflow_id

Get workflow ID

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

Python API: cloaca.python.workflow_context.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(crate::TaskNamespace::new(
            &self.tenant_id,
            &self.package_name,
            &self.workflow_id,
            task_id,
        ))
    }
resolve_dependency
fn resolve_dependency (& self , task_name : & str) -> PyTaskNamespace

Python API: cloaca.python.workflow_context.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)
    }
workflow_namespace
fn workflow_namespace (& self) -> PyTaskNamespace

Python API: cloaca.python.workflow_context.WorkflowContext.workflow_namespace

Get the workflow namespace (without task_id)

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

Python API: cloaca.python.workflow_context.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
    }
__str__
fn __str__ (& self) -> String

Python API: cloaca.python.workflow_context.WorkflowContext.str

String representation

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

Python API: cloaca.python.workflow_context.WorkflowContext.repr

String representation

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

Python API: cloaca.python.workflow_context.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
    }
default 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(),
        }
    }
as_components 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)
    }