IAsyncWorkflowInstance#

class IAsyncWorkflowInstance#

Bases: abc.ABC

Represents an instantiated workflow instance.

Overview#

get_state

Get the state of the workflow instance.

run

Set a workflow’s input datapins and run it.

start_run

Set a workflow’s input datapins and start running the workflow.

get_root

Get the root element of the workflow instance.

get_element_by_name

Get an element of the workflow instance by name.

Import detail#

from ansys.engineeringworkflow.api.iasyncworkflow import IAsyncWorkflowInstance

Method detail#

abstract async IAsyncWorkflowInstance.get_state() ansys.engineeringworkflow.api.datatypes.WorkflowInstanceState#

Get the state of the workflow instance.

abstract async IAsyncWorkflowInstance.run(inputs: Mapping[str, ansys.tools.variableinterop.VariableState] = {}, reset: bool = False, validation_names: AbstractSet[str] = set(), collect_names: AbstractSet[str] = set()) Mapping[str, ansys.tools.variableinterop.VariableState]#

Set a workflow’s input datapins and run it.

Parameters:
inputsMapping[str, VariableState]

Map of datapin names to VariableState objects for all inputs to set before running the workflow.

resetbool, default: False

Whether to reset the workflow before running. If this parameter is set to True, all run components and data links become invalid so that the workflow runs from the beginning. However, it does not reset any input values that have been set to non-default values. Note that setting datapin values could also implicitly reset the states of some components.

validation_namesAbstractSet[str]

Names of the specific datapins or components that are required to be valid. Setting names may enable the workflow engine to shortcut evaluation of the workflow. If the set is non-empty, the workflow engine may choose which portions of the workflow are run to satisfy the given datapins with the minimum runtime.

collect_namesAbstractSet[str]

Names of the specific datapins or elements that are to cause the method to return these values after running. If an element is specified, all child datapins are recursively included.

Raises:
ValueOutOfRangeError

If one of the input values violates its datapin’s bounds or enumerated values.

abstract async IAsyncWorkflowInstance.start_run(inputs: Mapping[str, ansys.tools.variableinterop.VariableState], reset: bool, validation_names: AbstractSet[str]) str#

Set a workflow’s input datapins and start running the workflow.

Parameters:
inputsMapping[str, VariableState]

Map of datapin names to VariableState objects for all inputs to set before running the workflow.

resetbool

Whether to reset the workflow before running. If this parameter is set to True, all run components and data links become invalid so that the workflow runs from the beginning. However, it does not reset any input values that have been set to non-default values. Note that setting datapin values could also implicitly reset some the states of some components.

validation_namesAbstractSet[str]

Names of the specific datapins or components that are required to be valid. Setting names may enable the workflow engine to shortcut evaluation of the workflow. If the set is non-empty, the workflow engine may choose which portions of the workflow are run to satisfy the given datapins with the minimum runtime.

Raises:
ValueOutOfRangeError

If one of the input values violates its datapin’s bounds or enumerated values.

abstract async IAsyncWorkflowInstance.get_root() IAsyncControlStatement#

Get the root element of the workflow instance.

abstract async IAsyncWorkflowInstance.get_element_by_name(element_name: str) IAsyncElement#

Get an element of the workflow instance by name.

Parameters:
element_namestr

Name of the element to retrieve in dotted notation. For example, 'Root.Component.Thing'.