Convenience APIs are IronPython queries that provide simple access to task-stored input and output data. The available convenience APIs are:
-
GetInputDataByType
Returns a
List<object>
containing upstream data for a given type. For example:upstreamData = container.GetInputDataByType(InputType="MeshingMesh") meshFileRef = None upstreamDataCount = upstreamData.Count if upstreamDataCount > 0: meshFileRef = upstreamData[0]
-
GetOutputData
Returns a
Dictionary<string, List<DataReference>>
holding the task's output types. For example:outputRefs = container.GetOutputData() meshOutputSet = outputRefs["SimulationGeneratedMesh"] meshOutput = meshOutputSet[0] meshOutput.TransferFile = meshFileRef
-
GetCustomEntity
Obtains the custom data entity from a container based on the entity's name and type. If the name and type are not specified, the default ACT object is returned. This object contains the properties defined by the workflow task from the elements
<propertygroup>
and<property>
.entity = ACT.GetCustomEntity(container)
-
GetCustomEntityPropertyValue
This query returns the value of a property defined on a custom data entity.
inputValue = ACT.GetCustomEntityPropertyValue(entity, "Input")
Users can also directly access properties off of a task object.
-
SetCustomEntityPropertyValue
This command handles the setting of a custom entity's property value.
ACT.SetCustomEntityPropertyValue(entity, "Output", outputValue)
Users can also directly set properties off of a task object.
-
GetTaskByName
This command accesses the data model to facilitate task searches. A usage example appears in the figure at the end of this section.
ExtAPI.DataModel.GetTaskByName(taskName)
-
GetTaskGroupByName
This command accesses the data model to facilitate task group searches. A usage example appears in the figure at the end of this section.
ExtAPI.DataModel.GetTaskGroupByName(taskGroupName)
The following figure shows convenience queries for tasks and task groups.