ProcessTemplateBuilder

Builder for process templates, resource slots, and step templates.

Usage

Source

ProcessTemplateBuilder(
    name,
    version,
    *,
    backend,
    namespace_context,
    command_context,
    process_template_id=None,
    on_existing="warn"
)

Context-manager exit commits clean work and rolls back exceptions. Existing templates load by UUID; on_existing controls identity reuse, while draft validation reports invalid slots, steps, or parameters before submission.

Methods

Name Description
add_resource_slot() Add typed input/output resource slot after validating direction.
add_step() Open builder for a named process step.
get_model() Return a pydantic model for the process template, optionally reloading
set_model() Replace working template after verifying UUID identity.

add_resource_slot()

Add typed input/output resource slot after validating direction.

Usage

Source

add_resource_slot(
    name, resource_type, direction, create_resource_type=False, required=True
)

add_step()

Open builder for a named process step.

Usage

Source

add_step(name)

get_model()

Return a pydantic model for the process template, optionally reloading

Usage

Source

get_model(*, update=False)

from the backend first. Critical fields are locked against mutation.


set_model()

Replace working template after verifying UUID identity.

Usage

Source

set_model(model)