IAsyncWorkflowInstance#
- class IAsyncWorkflowInstance#
Bases: abc.ABC
Represents an instantiated workflow instance.
Overview#
Get the state of the workflow instance. |
|
Set a workflow’s input datapins and run it. |
|
Set a workflow’s input datapins and start running the workflow. |
|
Get the root element of the workflow instance. |
|
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:
- inputs
Mapping
[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_names
AbstractSet
[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_names
AbstractSet
[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.
- inputs
- 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:
- inputs
Mapping
[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_names
AbstractSet
[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.
- inputs
- 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_name
str
Name of the element to retrieve in dotted notation. For example,
'Root.Component.Thing'
.
- element_name