Skip to content

capturegraph.procedures.nodes.automatic.operators.procedure #

Procedure operator procedures perform meta-operations on other procedures and their states. These procedures enable conditional logic, state checking, and procedure composition within workflows.

ProcedureCompleted #

Bases: Procedure[PBool]

Checks if a procedure has been completed successfully.

Returns true if the specified procedure has been executed and completed, false otherwise. Useful for creating conditional logic based on the completion status of other procedures in the workflow.

Attributes:

Name Type Description
procedure Procedure[PType]

The procedure to check for completion status

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/procedure.py
@make_procedure
class ProcedureCompleted(Procedure[PBool]):
    """
    Checks if a procedure has been completed successfully.

    Returns true if the specified procedure has been executed and completed,
    false otherwise. Useful for creating conditional logic based on the
    completion status of other procedures in the workflow.

    Attributes:
        procedure (Procedure[PType]): The procedure to check for completion status
    """

    procedure: Procedure[PType]

ProceduresEqual #

Bases: Procedure[PBool]

Compares two procedures to check if their results are equal.

Evaluates both procedures and returns true if their results are equivalent, false otherwise. Useful for validation and conditional logic based on procedure outputs.

Attributes:

Name Type Description
left Procedure[PType]

The first procedure to compare

right Procedure[PType]

The second procedure to compare

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/procedure.py
@make_procedure
class ProceduresEqual(Procedure[PBool]):
    """
    Compares two procedures to check if their results are equal.

    Evaluates both procedures and returns true if their results are
    equivalent, false otherwise. Useful for validation and conditional
    logic based on procedure outputs.

    Attributes:
        left (Procedure[PType]): The first procedure to compare
        right (Procedure[PType]): The second procedure to compare
    """

    left: Procedure[PType]
    right: Procedure[PType]

ProcedureOr #

Bases: Procedure[T]

Returns the result of the first procedure, or the second if the first fails.

Provides fallback logic by attempting to execute the left procedure first, and if it fails or returns null, executes the right procedure instead. Both procedures must return the same type T.

Attributes:

Name Type Description
left Procedure[PType]

The primary procedure to attempt first

right Procedure[PType]

The fallback procedure to use if left fails

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/procedure.py
@make_procedure
@forward_types(PType, "left", "right")
class ProcedureOr[T: PType](Procedure[T]):
    """
    Returns the result of the first procedure, or the second if the first fails.

    Provides fallback logic by attempting to execute the left procedure first,
    and if it fails or returns null, executes the right procedure instead.
    Both procedures must return the same type T.

    Attributes:
        left (Procedure[PType]): The primary procedure to attempt first
        right (Procedure[PType]): The fallback procedure to use if left fails
    """

    left: Procedure[T]
    right: Procedure[T]