cloacina-python::workflow_context
Rust
Structs
Section titled “Structs”class WorkflowContext
Section titled “class WorkflowContext”Binding
Python API:
cloaca.WorkflowContext
WorkflowContext provides namespace management for Python workflows
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
tenant_id |
String |
|
package_name |
String |
|
workflow_id |
String |
Methods
Section titled “Methods”fn new(tenant_id: &str, package_name: &str, workflow_id: &str) -> SelfPython 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(), } }tenant_id
Section titled “tenant_id”fn tenant_id(&self) -> &strPython API:
cloaca.WorkflowContext.tenant_id
Get tenant ID
Source
pub fn tenant_id(&self) -> &str { &self.tenant_id }package_name
Section titled “package_name”fn package_name(&self) -> &strPython API:
cloaca.WorkflowContext.package_name
Get package name
Source
pub fn package_name(&self) -> &str { &self.package_name }workflow_id
Section titled “workflow_id”fn workflow_id(&self) -> &strPython API:
cloaca.WorkflowContext.workflow_id
Get workflow ID
Source
pub fn workflow_id(&self) -> &str { &self.workflow_id }task_namespace
Section titled “task_namespace”fn task_namespace(&self, task_id: &str) -> PyTaskNamespacePython 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, )) }resolve_dependency
Section titled “resolve_dependency”fn resolve_dependency(&self, task_name: &str) -> PyTaskNamespacePython 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) }workflow_namespace
Section titled “workflow_namespace”fn workflow_namespace(&self) -> PyTaskNamespacePython 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, "", )) }contains_namespace
Section titled “contains_namespace”fn contains_namespace(&self, namespace: &PyTaskNamespace) -> boolPython 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 }__str__
Section titled “__str__”fn __str__(&self) -> StringPython API:
cloaca.WorkflowContext.__str__
String representation
Source
pub fn __str__(&self) -> String { format!( "{}::{}::{}", self.tenant_id, self.package_name, self.workflow_id ) }__repr__
Section titled “__repr__”fn __repr__(&self) -> StringPython API:
cloaca.WorkflowContext.__repr__
String representation
Source
pub fn __repr__(&self) -> String { format!( "WorkflowContext('{}', '{}', '{}')", self.tenant_id, self.package_name, self.workflow_id ) }__eq__
Section titled “__eq__”fn __eq__(&self, other: &PyWorkflowContext) -> boolPython 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 }default
Section titled “default”pub
fn default() -> SelfGet 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
Section titled “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) }