Skip to content

workflow

Classes

WorkflowMatcher

Bases: KiaraModel

An object describing requirements values should satisfy in order to be included in a query result.

Source code in kiara/interfaces/python_api/models/workflow.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class WorkflowMatcher(KiaraModel):
    """An object describing requirements values should satisfy in order to be included in a query result."""

    @classmethod
    def create_matcher(self, **match_options: Any):

        m = WorkflowMatcher(**match_options)
        return m

    has_alias: bool = Field(
        description="Workflow must have at least one alias.", default=False
    )

    def is_match(self, workflow_id: uuid.UUID, kiara: "Kiara") -> bool:

        if self.has_alias:
            aliases = kiara.workflow_registry.get_aliases(workflow_id=workflow_id)
            if not aliases:
                return False

        return True

Attributes

has_alias: bool = Field(description='Workflow must have at least one alias.', default=False) class-attribute

Functions

create_matcher(**match_options: Any) classmethod
Source code in kiara/interfaces/python_api/models/workflow.py
15
16
17
18
19
@classmethod
def create_matcher(self, **match_options: Any):

    m = WorkflowMatcher(**match_options)
    return m
is_match(workflow_id: uuid.UUID, kiara: Kiara) -> bool
Source code in kiara/interfaces/python_api/models/workflow.py
25
26
27
28
29
30
31
32
def is_match(self, workflow_id: uuid.UUID, kiara: "Kiara") -> bool:

    if self.has_alias:
        aliases = kiara.workflow_registry.get_aliases(workflow_id=workflow_id)
        if not aliases:
            return False

    return True