Useful methods and attributes
Useful TaskGroup attributes
self.wo_metadata
self.wo_metadata
Dict containing a merge of the workorder metadatas and parameters. If there are common keys, the parameter value will be the one kept. No write access is given on that object, only read access.
self.analysis_metadata
self.analysis_metadata
Dict containing the metadata provided at the analysis time. No write access is given on that object, only read access.
self.memory
self.memory
Dict containing whatever you want to store for following analysis. Be careful, there are not size limitations for now, but if you want to store something big, like an image, please talk about it with the product before doing so. You have a write access on that object.
self.state
self.state
Dict containing the state of the work-order, which are the values of the tasks in that work-order from previous analysis. No write access is given on that object, only read access.
In the __memory
key of a task-group is stored what was in the self.memory
during the previous analysis of that task-group.
Therefore, to pass information from a task group A to a task group B, you must first store the information in the self.memory
during the analysis of task group A, then get it back during the analysis of task group B through self.state["A"]["__memory"]
self.workspace
self.workspace
This is used to store whatever is needed to share between tasks during that analysis. This object won't be saved at the end of the analysis. You have a write access on that object.
You could, in an equivalent way, create and use attributes to the TaskGroup class, but it is better to separate things properly and use the self.workspace
self._tasks
self._tasks
This is where is stored the value of each executed task and associated regions during the analysis. It is the object that will be used at the end of the analysis to create the set of output task values. You have a write access on that object.
Useful TaskGroup methods
self.get_task(<task_name>)
self.get_task(<task_name>)
This is the preferred way to access the value of a task that was previously executed.